Form S_154FA: Domino Demonstration A

LANSA

Form S_154FA: Domino Demonstration A
Name: S_154FA

Description: The following RDMLX form is a demonstration of interfacing LANSA applications with Domino databases.
;
* ;
* Disclaimer: The following material is supplied as example material only. ;
* ---------------- No warranty concerning this material or its use in any way;
* whatsoever is expressed or implied. ;
* ;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM FORMPOSITION(ScreenCenter) HEIGHT(477) LAYOUTMANAGER(#ATLM_1) LEFT(66) TOP(229) WIDTH(919);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1);
;
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(5) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(426) WIDTH(911);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Bottom) MANAGE(#STBR_1) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_PGBR) NAME(#PROGBAR) DISPLAYPOSITION(1) HEIGHT(18) LEFT(713) PARENT(#STBR_1) TABPOSITION(1) TOP(4) VISIBLE(False) WIDTH(179);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(4) HEIGHT(74) LAYOUTMANAGER(#FWLM_1) LEFT(6) PARENT(#COM_OWNER) TABPOSITION(5) TABSTOP(False) TOP(6) VISUALSTYLE(#VS_PANEL) WIDTH(899);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Top) MANAGE(#PANL_1) MARGINBOTTOM(6) MARGINLEFT(6) MARGINRIGHT(6) MARGINTOP(6) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_2) DISPLAYPOSITION(6) HEIGHT(330) LAYOUTMANAGER(#SPLM_1) LEFT(5) PARENT(#COM_OWNER) TABPOSITION(6) TABSTOP(False) TOP(91) WIDTH(901);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_3) ATTACHMENT(Center) MANAGE(#PANL_2) MARGINBOTTOM(5) MARGINLEFT(5) MARGINRIGHT(5) MARGINTOP(5) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_SPLM) NAME(#SPLM_1) ORIENTATION(Vertical);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_3) DISPLAYPOSITION(1) HEIGHT(330) LAYOUTMANAGER(#ATLM_2) LEFT(0) PARENT(#PANL_2) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(159);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_4) DISPLAYPOSITION(2) HEIGHT(330) LAYOUTMANAGER(#SPLM_2) LEFT(163) PARENT(#PANL_2) TABPOSITION(2) TABSTOP(False) TOP(0) WIDTH(738);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_1) MANAGE(#PANL_3) PARENT(#SPLM_1);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_2) MANAGE(#PANL_4) PARENT(#SPLM_1) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_SPLM) NAME(#SPLM_2) ORIENTATION(Vertical);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_5) DISPLAYPOSITION(1) HEIGHT(330) LAYOUTMANAGER(#ATLM_3) LEFT(0) PARENT(#PANL_4) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(283);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_6) DISPLAYPOSITION(2) HEIGHT(330) LAYOUTMANAGER(#ATLM_4) LEFT(287) PARENT(#PANL_4) TABPOSITION(2) TABSTOP(False) TOP(0) WIDTH(451);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_3) MANAGE(#PANL_5) PARENT(#SPLM_2);
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_4) MANAGE(#PANL_6) PARENT(#SPLM_2) WEIGHT(1);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_2);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_3);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_4);
DEFINE_COM CLASS(#PRIM_GRID) NAME(#DEP_GRID) COLUMNBUTTONHEIGHT(26) DISPLAYPOSITION(1) HEIGHT(330) LEFT(0) PARENT(#PANL_3) POPUPMENU(#PMNU_1) SELECTIONSTYLE(Multiple) SHOWSELECTION(True) TABPOSITION(1) TOP(0) WIDTH(159);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_4) ATTACHMENT(Center) MANAGE(#DEP_GRID) PARENT(#ATLM_2);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_5) ATTACHMENT(Left) PARENT(#ATLM_3);
DEFINE_COM CLASS(#PRIM_GRID) NAME(#SEC_GRID) COLUMNBUTTONHEIGHT(26) DISPLAYPOSITION(1) HEIGHT(330) LEFT(0) PARENT(#PANL_5) POPUPMENU(#PMNU_2) SELECTIONSTYLE(Multiple) SHOWSELECTION(True) TABPOSITION(1) TOP(0) WIDTH(283);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_6) ATTACHMENT(Center) MANAGE(#SEC_GRID) PARENT(#ATLM_3);
DEFINE_COM CLASS(#PRIM_GRID) NAME(#EMP_GRID) COLUMNBUTTONHEIGHT(26) DISPLAYPOSITION(1) HEIGHT(330) LEFT(0) PARENT(#PANL_6) POPUPMENU(#PMNU_3) SELECTIONSTYLE(Multiple) SHOWSELECTION(True) TABPOSITION(1) TOP(0) WIDTH(451);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_7) ATTACHMENT(Center) MANAGE(#EMP_GRID) PARENT(#ATLM_4);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_1) CAPTION('Dept') CAPTIONTYPE(Caption) DISPLAYPOSITION(1) PARENT(#DEP_GRID) READONLY(False) SOURCE(#DEPTMENT) WIDTH(20);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_2) CAPTION('Description') CAPTIONTYPE(Caption) DISPLAYPOSITION(2) PARENT(#DEP_GRID) READONLY(False) SOURCE(#DEPTDESC) WIDTH(30) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_3) CAPTION('Dept') CAPTIONTYPE(Caption) DISPLAYPOSITION(1) PARENT(#SEC_GRID) READONLY(False) SOURCE(#DEPTMENT) WIDTH(15);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_4) CAPTION('Section') CAPTIONTYPE(Caption) DISPLAYPOSITION(2) PARENT(#SEC_GRID) READONLY(False) SOURCE(#SECTION) WIDTH(15);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_5) CAPTION('Description') CAPTIONTYPE(Caption) DISPLAYPOSITION(3) PARENT(#SEC_GRID) READONLY(False) SOURCE(#SECDESC) WIDTH(50);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_6) CAPTION('Phone') CAPTIONTYPE(Caption) DISPLAYPOSITION(4) PARENT(#SEC_GRID) READONLY(False) SOURCE(#SECPHBUS) WIDTH(20) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_7) CAPTION('Number') CAPTIONTYPE(Caption) DISPLAYPOSITION(1) PARENT(#EMP_GRID) READONLY(False) SOURCE(#EMPNO) WIDTH(10);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_8) CAPTION('First Name') CAPTIONTYPE(Caption) DISPLAYPOSITION(2) PARENT(#EMP_GRID) READONLY(False) SOURCE(#GIVENAME) WIDTH(22);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_9) CAPTION('Last Name') CAPTIONTYPE(Caption) DISPLAYPOSITION(3) PARENT(#EMP_GRID) READONLY(False) SOURCE(#SURNAME) WIDTH(22);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_10) CAPTION('Dept') CAPTIONTYPE(Caption) DISPLAYPOSITION(4) PARENT(#EMP_GRID) READONLY(False) SOURCE(#DEPTMENT) WIDTH(10);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_11) CAPTION('Section') CAPTIONTYPE(Caption) DISPLAYPOSITION(5) PARENT(#EMP_GRID) READONLY(False) SOURCE(#SECTION) WIDTH(10);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_12) CAPTION('Salary') CAPTIONTYPE(Caption) DISPLAYPOSITION(6) PARENT(#EMP_GRID) READONLY(False) SOURCE(#SALARY) WIDTH(20) WIDTHTYPE(Remainder);
DEFINE_COM CLASS(#PRIM_GDCL) NAME(#GDCL_13) CAPTION('Zip') CAPTIONTYPE(Caption) DISPLAYPOSITION(7) PARENT(#EMP_GRID) READONLY(False) SOURCE(#POSTCODE) WIDTH(10);
;
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) FLOWOPERATION(Center) FLOWOPERATIONVER(Decrease) MARGINBOTTOM(6) MARGINLEFT(6) MARGINTOP(6) SPACING(6) SPACINGITEMS(6);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_OPEN) CAPTION('Open Domino DataBases') DISPLAYPOSITION(1) HINT('Open the required Domino databases') LEFT(6) PARENT(#PANL_1) TABPOSITION(1) TOP(7) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#BTN_OPEN) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_CLOSE) CAPTION('Close Domino Databases') DISPLAYPOSITION(2) HINT('Close the Domino databases') LEFT(172) PARENT(#PANL_1) TABPOSITION(2) TOP(7) VISIBLE(False) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#BTN_CLOSE) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_TODOM) CAPTION('Send Grids to Domino') DISPLAYPOSITION(3) HINT('Transfer contents of the grids above into the Domino databases') LEFT(338) PARENT(#PANL_1) TABPOSITION(3) TOP(7) VISIBLE(False) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_3) MANAGE(#BTN_TODOM) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_FRDOM) CAPTION('Load Grids from Domino ') DISPLAYPOSITION(4) HINT('Transfer contents of the Domino databases into the grids above') LEFT(504) PARENT(#PANL_1) TABPOSITION(4) TOP(7) VISIBLE(False) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_4) MANAGE(#BTN_FRDOM) PARENT(#FWLM_1);
;
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_1);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#DLT_DEP) CAPTION('Delete') DISPLAYPOSITION(1) PARENT(#PMNU_1);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_2);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#DLT_SEC) CAPTION('Delete') DISPLAYPOSITION(1) PARENT(#PMNU_2);
DEFINE_COM CLASS(#PRIM_PMNU) NAME(#PMNU_3);
DEFINE_COM CLASS(#PRIM_MITM) NAME(#DLT_EMP) CAPTION('Delete') DISPLAYPOSITION(1) PARENT(#PMNU_3);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_CLEAR) CAPTION('Clear all Grids') DISPLAYPOSITION(5) HINT('Clears all entries from all displayed grids') LEFT(670) PARENT(#PANL_1) TABPOSITION(5) TOP(7) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_5) MANAGE(#BTN_CLEAR) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_LOAD) CAPTION('Load Grids from DBMS') DISPLAYPOSITION(6) LEFT(6) PARENT(#PANL_1) TABPOSITION(6) TOP(38) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_6) MANAGE(#BTN_LOAD) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_CONNECT) CAPTION('Connect to Remote DBMS') DISPLAYPOSITION(7) LEFT(172) PARENT(#PANL_1) TABPOSITION(7) TOP(38) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_7) MANAGE(#BTN_CONNECT) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#BTN_DISCON) CAPTION('Disconnect from Remote DBMS') DISPLAYPOSITION(8) LEFT(338) PARENT(#PANL_1) TABPOSITION(8) TOP(38) VISIBLE(False) VISUALSTYLEOFPARENT(False) WIDTH(160);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_8) MANAGE(#BTN_DISCON) PARENT(#FWLM_1);
;
DEFINE_COM CLASS(#S_154RDW) NAME(#DOM_EMP) DISPLAYPOSITION(3) PARENT(#COM_OWNER) TABPOSITION(3);
DEFINE_COM CLASS(#S_154RDW) NAME(#DOM_DEP) DISPLAYPOSITION(2) PARENT(#COM_OWNER) TABPOSITION(2);
DEFINE_COM CLASS(#S_154RDW) NAME(#DOM_SEC) PARENT(#COM_OWNER);
;
DEFINE_COM CLASS(#VL_SAM003) NAME(#RMTDBMS);
;
Define #RowHandle RefFld(#Std_Num);
Def_Cond *RowFound '#RowHandle > 0' ;
;
* =========================================================================================== ;
;
* Handle form initialization;
;
EVTROUTINE handling(#com_owner.Initialize);
;
* Define the Domino equivalent of PSLMST;
;
Invoke #DOM_EMP.DefineItem SymName(Empno) DomName(EMPLOYEE_NUMBER) TYPE(Text) KeyNumber(1);
Invoke #DOM_EMP.DefineItem SymName(Surname) DomName(EMPLOYEE_SURNAME) TYPE(Text);
Invoke #DOM_EMP.DefineItem SymName(GiveName) DomName(EMPLOYEE_GIVEN_NAME) TYPE(Text);
Invoke #DOM_EMP.DefineItem SymName(Section) DomName(EMPLOYEE_SECTION) TYPE(Text);
Invoke #DOM_EMP.DefineItem SymName(Deptment) DomName(EMPLOYEE_DEPARTMENT) TYPE(Text);
Invoke #DOM_EMP.DefineItem SymName(Salary) DomName(EMPLOYEE_SALARY) TYPE(Number) Decimals(2);
Invoke #DOM_EMP.DefineItem SymName(Postcode) DomName(EMPLOYEE_ZIP_CODE) TYPE(Number) Decimals(0);
* ;
* Define the Domino equivalent of DEPTAB;
* ;
Invoke #DOM_DEP.DefineItem SymName(Deptment) DomName(DEPARTMENT_NAME) TYPE(Text) KeyNumber(1);
Invoke #DOM_DEP.DefineItem SymName(DeptDesc) DomName(DEPARTMENT_DESCRIPTION) TYPE(Text);
* ;
* Define the Domino equivalent of SECTAB;
* ;
Invoke #DOM_SEC.DefineItem SymName(Deptment) DomName(DEPARTMENT_NAME) TYPE(Text) KeyNumber(1);
Invoke #DOM_SEC.DefineItem SymName(Section) DomName(DEPARTMENT_SECTION) TYPE(Text) KeyNumber(2);
Invoke #DOM_SEC.DefineItem SymName(SecDesc) DomName(SECTION_DESCRIPTION) TYPE(Text) ;
Invoke #DOM_SEC.DefineItem SymName(SecPhBus) DomName(SECTION_PHONE_NUMBER) TYPE(Text) ;
;
* Finished ... ready for work;
;
Message 'Ready';
;
ENDROUTINE ;
* =========================================================================================== ;
;
* Handle load of grids from DBMS;
;
EvtRoutine Handling(#BTN_Load.Click);
;
Set #ProgBar Value(0) MaximumValue(3) Visible(True);
;
* Clear all grids;
;
Invoke #Com_Owner.ClearAllGrids;
;
* Load the 3 grids from the data base ;
;
Set #ProgBar Value(1);
Message 'Loading Departments' Type(*Status);
Select (#Deptment #DeptDesc) from_file(DepTab);
Add_Entry #Dep_Grid;
EndSelect ;
;
Set #ProgBar Value(2);
Message 'Loading Sections' Type(*Status);
Select (#Deptment #Section #SecDesc #SecPhBus) from_file(SecTab);
Add_Entry #Sec_Grid;
EndSelect ;
;
Set #ProgBar Value(3);
Message 'Loading Employees' Type(*Status);
Select (#EmpNo #Deptment #Section #SurName #GiveName #Salary #PostCode) from_file(PslMst);
Add_Entry #Emp_Grid;
EndSelect ;
;
* Finished;
;
Set #ProgBar Visible(False);
Message 'Load of grids from DBMS tables completed' ;
;
EndRoutine ;
* =========================================================================================== ;
;
* Handle a Domino error;
;
EvtRoutine Handling(#DOM_EMP.DominoErrorDetected #DOM_DEP.DominoErrorDetected #DOM_SEC.DominoErrorDetected);
USE BUILTIN(MESSAGE_BOX_SHOW) WITH_ARGS(OK OK WARNING *COMPONENT 'A domino related error was signalled');
EndRoutine ;
;
* =========================================================================================== ;
;
* Handle form closing;
;
EvtRoutine Handling(#Com_Owner.Closing);
Invoke #RmtDBMS.uDisConnect;
Invoke #DOM_SEC.Close;
Invoke #DOM_DEP.Close;
Invoke #DOM_EMP.Close;
Endroutine ;
;
* =========================================================================================== ;
;
* Handle use of the Open Domino Button ;
;
EVTROUTINE HANDLING(#BTN_OPEN.Click);
Invoke #DOM_EMP.Open WithName(PSLMST_DEMO);
Invoke #DOM_DEP.Open WithName(DEPTAB_DEMO);
Invoke #DOM_SEC.Open WithName(SECTAB_DEMO);
Set #BTN_Open Visible(False);
Set (#BTN_Close #BTN_FrDom #BTN_ToDom) Visible(True);
Message 'Open completed';
ENDROUTINE ;
;
* =========================================================================================== ;
;
* Handle use of the Close Domino Button ;
;
EVTROUTINE HANDLING(#BTN_CLOSE.Click);
Invoke #DOM_SEC.Close;
Invoke #DOM_DEP.Close;
Invoke #DOM_EMP.Close;
Set #BTN_Open Visible(True);
Set (#BTN_Close #BTN_FrDom #BTN_ToDom) Visible(False);
Message 'Close completed';
ENDROUTINE ;
;
* =========================================================================================== ;
;
* Handle use of the Delete menu buttons ;
;
EVTROUTINE HANDLING(#DLT_DEP.Click);
SelectList #Dep_Grid;
If '#Dep_Grid.CurrentItem.Selected = True';
Change #RowHandle #Dep_Grid.CurrentItem.Entry;
Dlt_Entry #RowHandle #Dep_Grid;
Endif ;
EndSelect ;
EndRoutine ;
;
EVTROUTINE HANDLING(#DLT_SEC.Click);
SelectList #Sec_Grid;
If '#Sec_Grid.CurrentItem.Selected = True';
Change #RowHandle #Sec_Grid.CurrentItem.Entry;
Dlt_Entry #RowHandle #Sec_Grid;
Endif ;
EndSelect ;
EndRoutine ;
;
EVTROUTINE HANDLING(#DLT_EMP.Click);
SelectList #Emp_Grid;
If '#Emp_Grid.CurrentItem.Selected = True';
Change #RowHandle #Emp_Grid.CurrentItem.Entry;
Dlt_Entry #RowHandle #Emp_Grid;
Endif ;
EndSelect ;
EndRoutine ;
;
* =========================================================================================== ;
;
* Handle use of the To Domino Button ;
;
EVTROUTINE HANDLING(#BTN_TODOM.Click);
;
Set #ProgBar Value(0) MaximumValue(6) Visible(True);
;
* Delete the current contents of all 3 domino databases;
;
Set #ProgBar Value(1);
Message 'Deleting Departments from Domino' Type(*Status);
Invoke #Dom_DEP.Select RetHandle(#RowHandle) ;
DoWhile *RowFound;
Invoke #Dom_DEP.Delete WithHandle(#RowHandle) ;
Invoke #Dom_DEP.SelectNext RetHandle(#RowHandle) ;
EndWhile ;
;
Set #ProgBar Value(2);
Message 'Deleting Sections from Domino' Type(*Status);
Invoke #Dom_SEC.Select RetHandle(#RowHandle) ;
DoWhile *RowFound;
Invoke #Dom_SEC.Delete WithHandle(#RowHandle) ;
Invoke #Dom_SEC.SelectNext RetHandle(#RowHandle) ;
EndWhile ;
;
Set #ProgBar Value(3);
Message 'Deleting Employees from Domino' Type(*Status);
Invoke #Dom_EMP.Select RetHandle(#RowHandle) ;
DoWhile *RowFound;
Invoke #Dom_EMP.Delete WithHandle(#RowHandle) ;
Invoke #Dom_EMP.SelectNext RetHandle(#RowHandle) ;
EndWhile ;
;
* Now insert the contents of the 3 grids;
;
Set #ProgBar Value(4);
Message 'Inserting Employees into Domino' Type(*Status);
SelectList #Emp_Grid;
Invoke #Dom_EMP.SetItem SymName(Empno) AlphaVal(#EmpNo);
Invoke #Dom_EMP.SetItem SymName(Surname) AlphaVal(#SurName);
Invoke #Dom_EMP.SetItem SymName(GiveName) AlphaVal(#GiveName);
Invoke #Dom_EMP.SetItem SymName(Section) AlphaVal(#Section);
Invoke #Dom_EMP.SetItem SymName(Deptment) AlphaVal(#Deptment);
Invoke #Dom_EMP.SetItem SymName(Salary) NumericVal(#Salary);
Invoke #Dom_EMP.SetItem SymName(Postcode) NumericVal(#PostCode);
Invoke #Dom_EMP.Insert;
Leave '#Dom_EMP.ErrorDetected = True';
EndSelect ;
;
Set #ProgBar Value(5);
Message 'Inserting Sections into Domino' Type(*Status);
SelectList #Sec_Grid;
Invoke #Dom_SEC.SetItem SymName(Deptment) AlphaVal(#Deptment);
Invoke #Dom_SEC.SetItem SymName(Section) AlphaVal(#Section);
Invoke #Dom_SEC.SetItem SymName(SecDesc) AlphaVal(#SecDesc);
Invoke #Dom_SEC.SetItem SymName(SecPhBus) AlphaVal(#SecPhBus);
Invoke #Dom_SEC.Insert;
Leave '#Dom_SEC.ErrorDetected = True';
EndSelect ;
;
Set #ProgBar Value(6);
Message 'Inserting Departments into Domino' Type(*Status);
SelectList #Dep_Grid;
Invoke #Dom_DEP.SetItem SymName(Deptment) AlphaVal(#Deptment);
Invoke #Dom_DEP.SetItem SymName(DeptDesc) AlphaVal(#DeptDesc);
Invoke #Dom_DEP.Insert ;
Leave '#Dom_DEP.ErrorDetected = True';
EndSelect ;
;
* Finished ... ready for more work;
;
Set #ProgBar Visible(False);
Message 'Transfer to Domino completed';
;
EndRoutine ;
;
* =========================================================================================== ;
;
* Handle use of the From Domino Button ;
;
EVTROUTINE HANDLING(#BTN_FRDOM.Click);
;
Set #ProgBar Value(0) MaximumValue(4) Visible(True);
;
* Blow away the grid contents;
;
Set #ProgBar Value(1);
Message 'Clearing grids' Type(*Status);
Invoke #Com_Owner.ClearAllGrids;
;
* Now (re)load the grids ;
;
Set #ProgBar Value(2);
Message 'Loading Employess from Domino' Type(*Status);
Invoke #Dom_EMP.Select RetHandle(#RowHandle) ;
DoWhile *RowFound;
Invoke #Dom_EMP.GetItem SymName(Empno) AlphaVal(#EmpNo);
Invoke #Dom_EMP.GetItem SymName(Surname) AlphaVal(#SurName);
Invoke #Dom_EMP.GetItem SymName(GiveName) AlphaVal(#GiveName);
Invoke #Dom_EMP.GetItem SymName(Section) AlphaVal(#Section);
Invoke #Dom_EMP.GetItem SymName(Deptment) AlphaVal(#Deptment);
Invoke #Dom_EMP.GetItem SymName(Salary) NumericVal(#Salary);
Invoke #Dom_EMP.GetItem SymName(Postcode) NumericVal(#PostCode);
Add_Entry #Emp_Grid ;
Invoke #Dom_EMP.SelectNext RetHandle(#RowHandle) ;
EndWhile ;
;
Set #ProgBar Value(3);
Message 'Loading Sections from Domino' Type(*Status);
Invoke #Dom_SEC.Select RetHandle(#RowHandle) ;
DoWhile *RowFound;
Invoke #Dom_SEC.GetItem SymName(Deptment) AlphaVal(#Deptment);
Invoke #Dom_SEC.GetItem SymName(Section) AlphaVal(#Section);
Invoke #Dom_SEC.GetItem SymName(SecDesc) AlphaVal(#SecDesc);
Invoke #Dom_SEC.GetItem SymName(SecPhBus) AlphaVal(#SecPhBus);
Add_Entry #Sec_Grid ;
Invoke #Dom_SEC.SelectNext RetHandle(#RowHandle) ;
EndWhile ;
;
Set #ProgBar Value(4);
Message 'Loading Departments from Domino' Type(*Status);
Invoke #Dom_DEP.Select RetHandle(#RowHandle) ;
DoWhile *RowFound;
Invoke #Dom_DEP.GetItem SymName(Deptment) AlphaVal(#Deptment);
Invoke #Dom_DEP.GetItem SymName(DeptDesc) AlphaVal(#DeptDesc);
Add_Entry #Dep_Grid ;
Invoke #Dom_DEP.SelectNext RetHandle(#RowHandle) ;
EndWhile ;
;
* Finished ... ready for more work;
;
Set #ProgBar Visible(False);
Message 'Transfer from Domino completed';
;
EndRoutine ;
;
* =========================================================================================== ;
;
* Handle a clear grids request ;
;
EVTROUTINE HANDLING(#BTN_CLEAR.Click);
Invoke #Com_Owner.ClearAllGrids;
Message 'Grids cleared';
ENDROUTINE ;
;
* =========================================================================================== ;
;
* Clear all Grids;
;
MthRoutine ClearAllGrids;
Clr_List #Emp_Grid ;
Clr_List #Sec_Grid ;
Clr_List #Dep_Grid ;
EndRoutine ;
;
* =========================================================================================== ;
;
* Handle connection to remote DBMS ;
;
EvtRoutine Handling(#RMTDBMS.uConnectionCreated);
Set #BTN_Connect Visible(False);
Set #BTN_DisCon Visible(True);
Invoke #Com_Owner.ClearAllGrids;
EndRoutine ;
;
* =========================================================================================== ;
;
* Handle disconnection from remote DBMS ;
;
EvtRoutine Handling(#RMTDBMS.uConnectionDestroyed);
Invoke #Com_Owner.ClearAllGrids;
Set #BTN_DisCon Visible(False);
Set #BTN_Connect Visible(True);
EndRoutine ;
;
* =========================================================================================== ;
;
* Handle request to connect to remote DBMS ;
;
EVTROUTINE HANDLING(#BTN_Connect.Click);
Invoke #RmtDBMS.uConnectModal;
ENDROUTINE ;
;
* =========================================================================================== ;
;
* Handle request to disconnect from remote DBMS ;
;
EVTROUTINE HANDLING(#BTN_DisCon.Click);
Invoke #RmtDBMS.uDisConnect;
ENDROUTINE ;
;
END_COM ;