Procedure

TfrmOrders.PositionTopOrder

Module

fOrders

Last Modified

7/15/2014 3:26:42 PM

Comments

View menu events -------------------------------------------------------------------------

Visibility

Private

Owner

TfrmOrders

Declaration

procedure PositionTopOrder(DGroup: Integer);

Calls Hierarchy


TfrmOrders.PositionTopOrder
 └SeqOfDGroup
   └LoadDGroupMap

Called-By Hierarchy


            TfrmOrders.PositionTopOrder
               TfrmOrders.NotifyOrder┤ 
               TfrmFrame.UMNewOrder┘ │ 
             TfrmOrders.lstWriteClick┤ 
TfrmOrders.PlaceOrderForDefaultDialog┘ 
   TfrmOrders.DisplayDefaultDlgList┤   
        TfrmOrders.ResetOrderPage┘ │   
TfrmOrders.btnDelayedOrderClick┘   │   
                  DisplayEvntDialog┤   
              SetDelayEventForMed┘ │   
       TfrmMeds.mnuActCopyClick┘   │   
                  DisplayEvntDialog┤   
                   SetViewForCopy┘ │   
     TfrmOrders.mnuActCopyClick┘   │   
                  DisplayEvntDialog┘   
                 ExecuteChangeEvt┘     
  TfrmOrders.mnuActChgEvntClick┘       

Calls

Name Declaration Comments
SeqOfDGroup function SeqOfDGroup(IEN: Integer): Integer; -

Called-By

Name Declaration Comments
TfrmOrders.lstWriteClick procedure lstWriteClick(Sender: TObject); -
TfrmOrders.NotifyOrder procedure NotifyOrder(OrderAction: Integer; AnOrder: TOrder); override; -
TfrmOrders.PlaceOrderForDefaultDialog function PlaceOrderForDefaultDialog(ADlgInfo: string; IsDefaultDialog: boolean; AEvent: TOrderDelayEvent): boolean; -


Source

670   procedure TfrmOrders.PositionTopOrder(DGroup: Integer);
671   const
672     SORT_FWD     = 0;
673     SORT_REV     = 1;
674     SORT_GRP_FWD = 2;
675     SORT_GRP_REV = 3;
676   var
677     i, Seq: Integer;
678     AnOrder: TOrder;
679   begin
680     with lstOrders do
681     begin
682       case (Ord(FCurrentView.ByService) * 2) + Ord(FCurrentView.InvChrono) of
683       SORT_FWD: TopIndex := Items.Count - 1;
684       SORT_REV: TopIndex := 0;
685       SORT_GRP_FWD: begin
686                       Seq := SeqOfDGroup(DGroup);
687                       for i := Items.Count - 1 downto 0 do
688                       begin
689                         AnOrder := TOrder(Items.Objects[i]);
690                         if AnOrder.DGroupSeq <= Seq then break;
691                       end;
692                       TopIndex := i;
693                     end;
694       SORT_GRP_REV: begin
695                       Seq := SeqOfDGroup(DGroup);
696                       for i := 0 to Items.Count - 1 do
697                       begin
698                         AnOrder := TOrder(Items.Objects[i]);
699                         if AnOrder.DGroupSeq >= Seq then break;
700                       end;
701                       TopIndex := i;
702                     end;
703       end; {case}
704     end; {with}
705   end;