Produced by Araxis Merge on 10/18/2017 11:37:29 AM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | OSCIF_CPRS v32 Phase 2 Build 2OR3.0405_August_2017.zip\OR_30_405V36_SRC.zip\XE8\Broker\Source | SelDiv.pas | Wed Oct 11 20:08:07 2017 UTC |
| 2 | OSCIF_CPRS v32 Phase 2 Build 2OR3.0405_August_2017.zip\OR_30_405V36_SRC.zip\XE8\Broker\Source | SelDiv.pas | Tue Oct 17 19:58:08 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 512 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | { ******** ********** ********** ********** ********** ********** **** | |
| 2 | Pa ckage: XWB - Kernel RPCBroker | |
| 3 | Da te Created : Sept 18, 1997 (Ver sion 1.1) | |
| 4 | Si te Name: O akland, OI Field Off ice, Dept of Veteran Affairs | |
| 5 | De velopers: PII, PII, PII | |
| 6 | De scription: Contains TRPCBroker and relat ed compone nts. | |
| 7 | Unit: Se lDiv handl es Divisio n selectio n for mult idivision users. | |
| 8 | Cu rrent Rele ase: Versi on 1.1 Pat ch 65 | |
| 9 | ********** ********** ********** ********** ********** ********** *** } | |
| 10 | ||
| 11 | { ******** ********** ********** ********** ********** ** | |
| 12 | Changes in v1.1.65 (HGW 11/0 3/2016) XW B*1.1*65 | |
| 13 | 1. Refac tor form. Not all sc reen resol utions wer e displayi ng properl y. | |
| 14 | ||
| 15 | Changes in v1.1.60 (HGW 09/1 8/2013) XW B*1.1*60 | |
| 16 | 1. None. | |
| 17 | ||
| 18 | Changes in v1.1.13 (DCM 05/2 4/2000) XW B*1.1*13 | |
| 19 | 1. Silen t Login, a llows for silent log -in functi onality. | |
| 20 | ********** ********** ********** ********** ********** } | |
| 21 | ||
| 22 | {--------- ---------- ---------- ---------- ---------- ---------- ---------- --------- | |
| 23 | This will ONLY be in voked when user has more than one divisi on to sele ct from | |
| 24 | in NEW Per son file. If user o nly has on e division , that div ision will be used; | |
| 25 | else it wi ll default to whatev er is in t he Kernel Site Param eter file. | |
| 26 | ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------} | |
| 27 | ||
| 28 | unit SelDi v; | |
| 29 | ||
| 30 | interface | |
| 31 | ||
| 32 | uses | |
| 33 | {System} | |
| 34 | SysUtils , Classes, | |
| 35 | {WinApi} | |
| 36 | Windows, Messages, | |
| 37 | {VA} | |
| 38 | MFunStr, Trpcb, | |
| 39 | {Vcl} | |
| 40 | Graphics , Controls , Forms, D ialogs, St dCtrls, Bu ttons; | |
| 41 | ||
| 42 | type | |
| 43 | TSelDivF orm = clas s(TForm) | |
| 44 | btnOK: TBitBtn; | |
| 45 | btnCan cel: TBitB tn; | |
| 46 | btnHel p: TBitBtn ; | |
| 47 | DivLab el1: TLabe l; | |
| 48 | DivLis tBox: TLis tBox; | |
| 49 | proced ure btnOKC lick(Sende r: TObject ); | |
| 50 | proced ure btnCan celClick(S ender: TOb ject); | |
| 51 | proced ure btnHel pClick(Sen der: TObje ct); | |
| 52 | proced ure FormCr eate(Sende r: TObject ); | |
| 53 | private | |
| 54 | { Priv ate declar ations } | |
| 55 | public | |
| 56 | { Publ ic declara tions } | |
| 57 | proced ure Enter; | |
| 58 | end; | |
| 59 | ||
| 60 | function C hooseDiv(u serid : st ring; MDiv Broker: TR PCBroker): Boolean; | |
| 61 | function S etDiv(divi sion : str ing; MDivB roker: TRP CBroker): boolean; //p13 | |
| 62 | function M ultDiv(MDi vBroker: T RPCBroker) : boolean; | |
| 63 | function S electDivis ion(Divisi onArray: T Strings; M DivBroker: TRPCBroke r): Boolea n; | |
| 64 | ||
| 65 | var | |
| 66 | SelDivFo rm: TSelDi vForm; | |
| 67 | ||
| 68 | implementa tion | |
| 69 | ||
| 70 | var | |
| 71 | DivSel : string; | |
| 72 | CntDiv : integer; | |
| 73 | DivArray : TString s; //Holds Results f rom 'XUS D ivision Ge t' | |
| 74 | {$R *.DFM} | |
| 75 | ||
| 76 | {--------- ---------- ---------- -ChooseDiv ---------- ---------- ---------- ---} | |
| 77 | { This fu nction wil l retrieve the divis ions for a user. The user will | |
| 78 | then ch oose one d ivision fo r signon. 'USERID' p arameter i s for futu re use | |
| 79 | that wi ll bring b ack a list of divisi ons for a user based on their DUZ | |
| 80 | (or use rname to l ookup DUZ) , not base d on the D UZ as it e xists in t he | |
| 81 | symbol table. } | |
| 82 | ||
| 83 | function C hooseDiv(u serid : st ring; MDiv Broker: TR PCBroker): Boolean; | |
| 84 | var | |
| 85 | division : string; | |
| 86 | begin | |
| 87 | Result : = false; / / stays 'f alse' if u ser not se lect divis ion. | |
| 88 | with MDi vBroker do | |
| 89 | begin | |
| 90 | if use rid <> '' then // futu re use - - DUZ is pa ssed in. | |
| 91 | begin | |
| 92 | with Param[0] do | |
| 93 | begi n | |
| 94 | Va lue := use rid; | |
| 95 | PT ype := lit eral; | |
| 96 | end; | |
| 97 | end; | |
| 98 | Remote Procedure := 'XUS DI VISION GET '; | |
| 99 | Call; | |
| 100 | CntDiv := StrToI nt(MDivBro ker.Result s[0]); //c ount of di visions. | |
| 101 | end;{wit h} | |
| 102 | if CntDi v = 0 then Result := true; //u sing the K ernel defa ult divisi on. | |
| 103 | //if Cnt Div = 1 th en ? //if a user is assigned t o one divi sion, use it? | |
| 104 | //if Cnt Div > 1 th en //pop up form b elow | |
| 105 | if CntDi v > 0 then | |
| 106 | begin | |
| 107 | DivArr ay := TStr inglist.Cr eate; //Put Re sults in D ivArray | |
| 108 | DivArr ay.Assign( MDivBroker .Results); | |
| 109 | try | |
| 110 | SelD ivForm := TSelDivFor m.Create(A pplication ); //creat e division form. | |
| 111 | Show Applicatio nAndFocusO K(Applicat ion); | |
| 112 | SetF oregroundW indow(SelD ivForm.Han dle); | |
| 113 | SelD ivForm.Ent er; | |
| 114 | finall y; | |
| 115 | SelD ivForm.Fre e; | |
| 116 | end; | |
| 117 | end;{if/ begin} | |
| 118 | if DivSe l <> '' th en | |
| 119 | begin | |
| 120 | Result := True; //user sel ected a di vision. | |
| 121 | divisi on := Piec e((Piece(D ivSel,'(', 2)),')',1) ; | |
| 122 | if Set Div(divisi on,MDivBro ker) then MDivBroker .User.Divi sion := Di vision; | |
| 123 | end;{if/ begin} | |
| 124 | end;{proce dure} | |
| 125 | ||
| 126 | function S electDivis ion(Divisi onArray: T Strings; M DivBroker: TRPCBroke r): Boolea n; | |
| 127 | var | |
| 128 | division : string; | |
| 129 | begin | |
| 130 | Result : = false; | |
| 131 | with MDi vBroker do | |
| 132 | begin | |
| 133 | if Div isionArray .Count = 0 then | |
| 134 | begin | |
| 135 | Remo teProcedur e := 'XUS DIVISION G ET'; | |
| 136 | Call ; | |
| 137 | CntD iv := StrT oInt(Resul ts[0]); // count of d ivisions. | |
| 138 | Divi sionArray. Assign(Res ults); | |
| 139 | end; | |
| 140 | end;{wit h} | |
| 141 | if CntDi v = 0 then //using t he Kernel default di vision. | |
| 142 | begin | |
| 143 | Result := true; | |
| 144 | exit; | |
| 145 | end; | |
| 146 | if CntDi v > 0 then | |
| 147 | begin | |
| 148 | DivArr ay := TStr inglist.Cr eate; //Put Re sults in D ivArray | |
| 149 | DivArr ay.Assign( DivisionAr ray); | |
| 150 | try | |
| 151 | SelD ivForm := TSelDivFor m.Create(A pplication ); //creat e division form. | |
| 152 | Show Applicatio nAndFocusO K(Applicat ion); | |
| 153 | SetF oregroundW indow(SelD ivForm.Han dle); | |
| 154 | SelD ivForm.Ent er; | |
| 155 | finall y; | |
| 156 | SelD ivForm.Fre e; | |
| 157 | end; { try} | |
| 158 | end; {if /begin} | |
| 159 | if DivSe l <> '' th en | |
| 160 | begin | |
| 161 | Result := True; //user sel ected a di vision. | |
| 162 | divisi on := Piec e((Piece(D ivSel,'(', 2)),')',1) ; | |
| 163 | if Set Div(divisi on,MDivBro ker) then MDivBroker .User.Divi sion := Di vision; | |
| 164 | end{if d ivsel} | |
| 165 | else MDi vBroker.Lo gIn.ErrorT ext := 'In valid Divi sion'; | |
| 166 | end;{funct ion} | |
| 167 | ||
| 168 | function M ultDiv(MDi vBroker: T RPCBroker) : boolean; | |
| 169 | begin | |
| 170 | Result : = False; | |
| 171 | with MDi vBroker do | |
| 172 | begin | |
| 173 | Remote Procedure := 'XUS DI VISION GET '; | |
| 174 | Call; | |
| 175 | CntDiv := StrToI nt(Results [0]); //co unt of div isions. | |
| 176 | if Cnt Div > 0 th en with Lo gin do | |
| 177 | begin | |
| 178 | DivL ist.Assign (Results); //store th e division s | |
| 179 | Mult iDivision := True; | |
| 180 | Resu lt := True ; | |
| 181 | end; | |
| 182 | end; | |
| 183 | end; | |
| 184 | ||
| 185 | {--------- ---------- ---------S etDiv----- ---------- ---------- -------} | |
| 186 | { This fun ction will set DUZ(2 ) to the d ivision th e user sel ected. } | |
| 187 | ||
| 188 | function S etDiv(divi sion : str ing; MDivB roker: TRP CBroker): boolean; | |
| 189 | begin | |
| 190 | Result : = False; | |
| 191 | with MDi vBroker do | |
| 192 | begin | |
| 193 | Param[ 0].Value : = division ; | |
| 194 | Param[ 0].PType : = literal; | |
| 195 | Remote Procedure := 'XUS DI VISION SET '; | |
| 196 | Call; | |
| 197 | if Res ults[0] = '1' then R esult := T rue //1= D UZ(2) set successful ly to divi sion. | |
| 198 | else Login.Erro rText := ' Invalid Di vision'; | |
| 199 | end;{wit h} //0= DUZ( 2) NOT abl e to set t o division . | |
| 200 | end; | |
| 201 | ||
| 202 | procedure TSelDivFor m.Enter; | |
| 203 | begin | |
| 204 | try | |
| 205 | ShowMo dal; //inv oke divisi on form | |
| 206 | finally | |
| 207 | ||
| 208 | end; | |
| 209 | end; | |
| 210 | ||
| 211 | procedure TSelDivFor m.btnOKCli ck(Sender: TObject); | |
| 212 | begin | |
| 213 | if DivLi stBox.Item Index = -1 then // nothing se lected. | |
| 214 | ShowMe ssage('A D ivision wa s not sele cted!') | |
| 215 | else | |
| 216 | begin | |
| 217 | DivSel := DivLis tBox.Items [DivListB ox.ItemInd ex]; //div ision | |
| 218 | close; // sele cted. | |
| 219 | end; | |
| 220 | end; | |
| 221 | ||
| 222 | procedure TSelDivFor m.btnCance lClick(Sen der: TObje ct); | |
| 223 | begin | |
| 224 | close; | |
| 225 | end; | |
| 226 | ||
| 227 | procedure TSelDivFor m.btnHelpC lick(Sende r: TObject ); | |
| 228 | begin | |
| 229 | ShowMess age('Selec t a divisi on from th e list and click OK. '+ | |
| 230 | ' A division m ust be sel ected in o rder to co ntinue wit h your sig non.' + | |
| 231 | ' To abort pro cess click on Cancel but signo n will NOT be comple ted.') | |
| 232 | end; | |
| 233 | ||
| 234 | procedure TSelDivFor m.FormCrea te(Sender: TObject); | |
| 235 | var | |
| 236 | I : inte ger; | |
| 237 | X : stri ng; | |
| 238 | y,def: s tring; | |
| 239 | begin | |
| 240 | def := ' '; | |
| 241 | DivSel : = ''; //cl ear any ol d selectio n | |
| 242 | I := 1; | |
| 243 | while no t (I > Cnt Div) do | |
| 244 | begin | |
| 245 | X := D ivArray[I] ; | |
| 246 | y := ' (' + Piece (X,U,3) + ') ' + Pie ce(X,U,2); //p13 mov ed div# in front | |
| 247 | //of div name | |
| 248 | DivLis tBox.Items .Add(y); / / + ' ^' + Int ToStr(I)); | |
| 249 | if Pie ce(X,U,4) = '1' then def := y; | |
| 250 | I := I + 1; | |
| 251 | end; | |
| 252 | DivListB ox.Sorted := TRUE; | |
| 253 | if def < > '' then DivListBox .ItemIndex := DivLis tBox.Items .Indexof(d ef); / /use itemi ndex to hi ghlight th e default division | |
| 254 | end; | |
| 255 | ||
| 256 | end. | |
| 257 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.