Work with Employees Form with a Forms Collection

FUNCTION OPTIONS(*DIRECT);

BEGIN_COM BORDERICONS(Maximize+Minimize+SystemMenu) CAPTION('Work with Employees');

;

***************************************************;

DEFINE_COM CLASS(#PRIM_LTVW) NAME(#LTVW_1) DISPLAYPOSITION(1) HEIGHT(281) LEFT(16) PARENT(#COM_OWNER) TABPOSITION(1) TOP(8) WIDTH(465);

DEFINE_COM CLASS(#PRIM_MBAR) NAME(#MBAR_1) PARENT(#COM_OWNER);

DEFINE_COM CLASS(#PRIM_MITM) NAME(#MEMPLOYEE) CAPTION(Employee) DISPLAYPOSITION(1) PARENT(#MBAR_1);

DEFINE_COM CLASS(#PRIM_SMNU) NAME(#SMNU_1) PARENT(#MEMPLOYEE);

DEFINE_COM CLASS(#PRIM_MITM) NAME(#MNEW) CAPTION(New) DISPLAYPOSITION(1) PARENT(#SMNU_1);

DEFINE_COM CLASS(#PRIM_MITM) NAME(#MDETAILS) CAPTION(Details) DISPLAYPOSITION(2) PARENT(#SMNU_1);

DEFINE_COM CLASS(#PRIM_MITM) NAME(#MSEPARATOR) CAPTION(-) DISPLAYPOSITION(3) PARENT(#SMNU_1);

DEFINE_COM CLASS(#PRIM_MITM) NAME(#MEXIT) CAPTION(Exit) DISPLAYPOSITION(4) PARENT(#SMNU_1);

DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_1) DISPLAYPOSITION(1) PARENT(#LTVW_1) SOURCE(#EMPNO) WIDTH(20);

DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_2) DISPLAYPOSITION(2) PARENT(#LTVW_1) SOURCE(#GIVENAME) WIDTH(20);

DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_3) DISPLAYPOSITION(3) PARENT(#LTVW_1) SOURCE(#SURNAME) WIDTH(20);

DEFINE_COM CLASS(#PRIM_LVCL) NAME(#LVCL_4) DISPLAYPOSITION(4) PARENT(#LTVW_1) SOURCE(#PHONEHME) WIDTH(20);

GROUP_BY NAME(#ALLFLDS) FIELDS(#EMPNO #GIVENAME #SURNAME #PHONEHME);

DEFINE_COM CLASS(#FRMDETAIL) NAME(#FRMDETAIL) BORDERICONS(Maximize+Minimize+SystemMenu) CAPTION('Employee Details') HEIGHT(296) LEFT(326) TOP(172) WIDTH(494);

DEFINE_COM CLASS(#PRIM_KCOL) NAME(#DFORMS) COLLECTS(#FRMDETAIL) KEYEDBY(#EMPNO);

;

;

EVTROUTINE HANDLING(#COM_OWNER.Initialize);

execute getlist;

ENDROUTINE  ;

;

EVTROUTINE HANDLING(#MDetails.Click);

Set com(#dforms<#empno>) formowner(#com_owner)

invoke #dforms<#empno>.showform;

set com(#dforms<#empno>) employee(#empno);

invoke #dforms<#empno>.GetInfo;

ENDROUTINE  ;

;

EVTROUTINE HANDLING(#dforms<>.OKPressed);

execute getlist;

ENDROUTINE  ;

;

subroutine name(getlist);

clr_list #ltvw_1;

select fields(#allflds) from_file(pslmst) ;

add_entry to_list(#ltvw_1);

endselect  ;

endroutine  ;

;

EVTROUTINE HANDLING(#COM_OWNER.Closing);

invoke #dforms<>.CloseForm;

ENDROUTINE  ;

end_com  ;

;