Files
roadef/Clase/oasociere.vc2

916 lines
28 KiB
Plaintext
Raw Permalink Blame History

*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="oasociere.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS cus_odata_parteneri_gestiuni AS _cusodatabase OF "..\comun\clase\_cus_odata_base.vcx"
*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />
#INCLUDE "..\program files\microsoft visual foxpro 8\foxpro.h"
*<PropValue>
Name = "cus_odata_parteneri_gestiuni"
*</PropValue>
PROCEDURE make_sql
Lparameters toRec,tnId
lcActiune = Alltrim(This.cActiune)
If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
Return .F.
Endif
If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
Return .F.
Endif
lcId = Iif(InList(lcActiune, 'UPDATE', 'DELETE'), Alltrim(Str(tnId)), 'NULL')
If InList(lcActiune, 'INSERT', 'UPDATE')
lcId_part = Iif(Nvl(toRec.id_part,0) = 0, 'NULL',Alltrim(Str(toRec.id_part)))
lcId_gestiune = Iif(Nvl(toRec.id_gestiune,0) = 0, 'NULL',Alltrim(Str(toRec.id_gestiune)))
lcCont = Iif(IsNull(toRec.cont), '',Alltrim(toRec.cont))
EndIf
Do Case
Case InList(lcActiune, "INSERT", 'UPDATE')
lcSql = [begin pack_def.asociere_part_gest(]+lcId+[,]+lcId_part+[,]+lcId_gestiune+[,'] + lcCont + [',] + ALLTRIM(Str(gnIdUtil))+[,]+ALLTRIM(STR(pnTip_asociere))+[); end;]
Case lcActiune = "DELETE"
lcSql = [begin pack_def.sterge_asociere_part_gest(]+lcId+[); end;]
Endcase
This.csql = lcSql
ENDPROC
ENDDEFINE
DEFINE CLASS cus_odata_parteneri_sectii AS _cusodatabase OF "..\comun\clase\_cus_odata_base.vcx"
*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />
#INCLUDE "..\program files\microsoft visual foxpro 8\foxpro.h"
*<PropValue>
Name = "cus_odata_parteneri_sectii"
*</PropValue>
PROCEDURE make_sql
Lparameters toRec,tnId
lcActiune = Alltrim(This.cActiune)
If Inlist(lcActiune, "UPDATE",'INSERT') And Type('toRec') != "O"
Return .F.
Endif
If Inlist(lcActiune, "UPDATE",'DELETE') And Type('tnId') != "N"
Return .F.
Endif
If Inlist(lcActiune, "UPDATE",'DELETE')
lcId = Alltrim(Str(tnId))
*!* lcnom = gcS + ".nom_valute"
*!* lcamp = "nom_valute.id_valuta"
*!* lclook = gcS + ".act"
*!* lclookid = "act.id_valuta"
Endif
If Inlist(lcActiune, "UPDATE",'INSERT')
lcId_part = Nvl(Alltrim(Str(toRec.id_part)),"")
lcId_sectie = Nvl(Alltrim(Str(toRec.id_sectie)),"")
Endif
Do Case
Case lcActiune = "INSERT"
lcSql = [begin pack_def.adauga_asociere_part_sect(]+lcId_part+[,]+lcId_sectie+[,]+ALLTRIM(Str(gnIdUtil))+[,]+ALLTRIM(STR(pnTip_asociere))+[); end;]
Case lcActiune = "UPDATE"
lcSql = [begin pack_def.modifica_asociere_part_sect(]+lcId+[,]+lcId_part+[,]+lcId_sectie+[,]+ALLTRIM(Str(gnIdUtil))+[); end;]
Case lcActiune = "DELETE"
lcSql = [begin pack_def.sterge_asociere_part_sect(]+lcId+[); end;]
Endcase
This.csql = lcSql
ENDPROC
ENDDEFINE
DEFINE CLASS frm_parteneri_gestiuni AS _frmbase OF "..\comun\clase\_frm_base.vcx"
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="grid_asociere" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.cPartener.Header1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.cPartener.Text1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.cGestiune.Header1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.cGestiune.Text1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.cCont.Header1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.cCont.Text1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
*<PropValue>
BorderStyle = 1
cgridsortlist = grid_asociere
DoCreate = .T.
Height = 391
Name = "frm_parteneri_gestiuni"
Width = 429
_shape1.Height = 29
_shape1.Left = 0
_shape1.Name = "_shape1"
_shape1.Top = 0
_shape1.Width = 444
_shape2.Height = 29
_shape2.Left = 247
_shape2.Name = "_shape2"
_shape2.Top = 0
_shape2.Width = 182
Lb_titlu_alb_b121.Caption = "Asociere entit<69><74>i - gestiuni"
Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
BUT_TERMIN1.Left = 399
BUT_TERMIN1.Name = "BUT_TERMIN1"
BUT_TERMIN1.Top = 1
Gridsort1.Left = 12
Gridsort1.Name = "Gridsort1"
Gridsort1.Top = 12
*</PropValue>
ADD OBJECT 'But_excel1' AS but_excel WITH ;
Left = 368, ;
Name = "But_excel1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_listare1' AS but_listare WITH ;
Left = 339, ;
Name = "But_listare1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
Left = 279, ;
Name = "But_modifica1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_nou1' AS but_nou WITH ;
Left = 249, ;
Name = "But_nou1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
Left = 309, ;
Name = "But_sterge1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'grid_asociere' AS _grdrow WITH ;
ColumnCount = 3, ;
DeleteMark = .F., ;
Height = 336, ;
Left = 12, ;
Name = "grid_asociere", ;
Panel = 1, ;
RecordSource = "crsAsociere", ;
Top = 41, ;
Width = 408, ;
Column1.ColumnOrder = 2, ;
Column1.ControlSource = "denumire", ;
Column1.Name = "cPartener", ;
Column1.Width = 155, ;
Column2.ColumnOrder = 3, ;
Column2.ControlSource = "nume_gestiune", ;
Column2.Name = "cGestiune", ;
Column2.Width = 165, ;
Column3.ColumnOrder = 1, ;
Column3.ControlSource = "cont", ;
Column3.Name = "cCont", ;
Column3.Width = 52
*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />
ADD OBJECT 'grid_asociere.cCont.Header1' AS header WITH ;
Alignment = 2, ;
Caption = "Cont", ;
Name = "Header1"
*< END OBJECT: BaseClass="header" />
ADD OBJECT 'grid_asociere.cCont.Text1' AS textbox WITH ;
BackColor = 255,255,255, ;
BorderStyle = 0, ;
ForeColor = 0,0,0, ;
Margin = 0, ;
Name = "Text1"
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'grid_asociere.cGestiune.Header1' AS header WITH ;
Alignment = 2, ;
Caption = "Gestiune", ;
Name = "Header1"
*< END OBJECT: BaseClass="header" />
ADD OBJECT 'grid_asociere.cGestiune.Text1' AS textbox WITH ;
BackColor = 255,255,255, ;
BorderStyle = 0, ;
ForeColor = 0,0,0, ;
Margin = 0, ;
Name = "Text1"
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'grid_asociere.cPartener.Header1' AS header WITH ;
Alignment = 2, ;
Caption = "Entitate", ;
Name = "Header1"
*< END OBJECT: BaseClass="header" />
ADD OBJECT 'grid_asociere.cPartener.Text1' AS textbox WITH ;
BackColor = 255,255,255, ;
BorderStyle = 0, ;
ForeColor = 0,0,0, ;
Margin = 0, ;
Name = "Text1"
*< END OBJECT: BaseClass="textbox" />
PROCEDURE actualizeaza_grid1
LPARAMETERS pcFiltru
LOCAL lcFiltru
lcFiltru=pcFiltru
IF EMPTY(lcFiltru)
lcFiltru=poAsociere.ca_baza1.cfiltru
ENDIF
save_grid_tag(thisform.grid_asociere)
poAsociere.ca_baza1.cfiltru=lcFiltru
poAsociere.ca_baza1.afisare()
restore_grid_tag(thisform.grid_asociere)
*!* IF RECCOUNT('v_sucursale')>0
*!* thisform._gnom_sucursale.SetFocus()
*!* ELSE
*!* thisform.lb_nom_sucursale.SetFocus()
*!* ENDIF
ENDPROC
PROCEDURE do_adauga
SELECT crsAsociere
SCATTER NAME loRec blank
DO Adauga_Modifica_Inregistrare WITH "parteneri_gestiuni",loRec,,"INSERT"
this.actualizeaza_grid1()
ENDPROC
PROCEDURE do_modifica
Select crsAsociere
Scatter Name loRec
Do Adauga_Modifica_Inregistrare With "parteneri_gestiuni",loRec,loRec.id_asociere,"UPDATE"
thisform.actualizeaza_grid1()
ENDPROC
PROCEDURE do_sterge
SELECT crsAsociere
SCATTER NAME lorec
llSucces = STERGE_INREGISTRARE("parteneri_gestiuni",loRec.id_asociere)
If llSucces
this.actualizeaza_grid1()
EndIf
this.grid_asociere.SetFocus()
ENDPROC
PROCEDURE inainte_de_do_excel
DO export_excel_grid WITH thisform.grid_asociere
ENDPROC
PROCEDURE inainte_de_do_listare
thisform.AlwaysOnTop = .F.
PRIVATE pcDataOra, pcTitlu
pcDataOra = get_ora(2)
pcTitlu = "Asociere entitati - gestiuni"
LOCAL lcTabel
lcTabel = this.grid_asociere.RecordSource
SELECT (lcTabel)
REPORT FORM rAsociere_part_gest.frx TO PRINTER PROMPT PREVIEW
thisform.AlwaysOnTop = .T.
ENDPROC
ENDDEFINE
DEFINE CLASS frm_parteneri_gestiuni_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx"
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="Ct_clb_partener" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Ct_clb_gestiune" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Clb_cont" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Cus_odata_parteneri_gestiuni1" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: do_cauta_gestiune
*m: do_cauta_partener
*p: nid
*p: orec
*</DefinedPropArrayMethod>
*<PropValue>
BorderStyle = 1
DoCreate = .T.
Height = 137
Name = "frm_parteneri_gestiuni_nou"
nid = .F.
orec = .F.
Width = 290
_shape1.Height = 29
_shape1.Left = 0
_shape1.Name = "_shape1"
_shape1.Top = 0
_shape1.Width = 684
_shape2.Height = 29
_shape2.Left = 533
_shape2.Name = "_shape2"
_shape2.Top = -1
_shape2.Width = 66
Lb_titlu_alb_b121.Caption = "Partener - gestiune"
Lb_titlu_alb_b121.Left = 6
Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
Lb_titlu_alb_b121.TabIndex = 5
BUT_TERMIN1.Left = 260
BUT_TERMIN1.Name = "BUT_TERMIN1"
BUT_TERMIN1.TabIndex = 3
BUT_TERMIN1.Top = 0
Gridsort1.Left = 156
Gridsort1.Name = "Gridsort1"
Gridsort1.Top = 0
*</PropValue>
ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
Left = 229, ;
Name = "BUT_RENUNT1", ;
TabIndex = 4, ;
Top = 0
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'Clb_cont' AS clb_tx_simplu WITH ;
Height = 29, ;
Left = 7, ;
Name = "Clb_cont", ;
TabIndex = 1, ;
Top = 42, ;
Width = 125, ;
Text_simplu1.ControlSource = "porec.cont", ;
Text_simplu1.Format = "!K", ;
Text_simplu1.Height = 23, ;
Text_simplu1.Left = 64, ;
Text_simplu1.Name = "Text_simplu1", ;
Text_simplu1.Top = 3, ;
Text_simplu1.Width = 57, ;
Lb_simplu1.Caption = "Cont", ;
Lb_simplu1.Name = "Lb_simplu1"
*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
ADD OBJECT 'Ct_clb_gestiune' AS ct_clb_cautare WITH ;
cconditie = empty(nvl(poRec.id_gestiune,0)), ;
cprocedura = thisform.do_cauta_gestiune, ;
cvar_afisata = poRec.nume_gestiune, ;
Height = 31, ;
Left = 6, ;
Name = "Ct_clb_gestiune", ;
TabIndex = 2, ;
Top = 97, ;
Width = 281, ;
IMG_CAUTARE.Left = 259, ;
IMG_CAUTARE.Name = "IMG_CAUTARE", ;
IMG_CAUTARE.Top = 5, ;
CLB_TX_CAUTARE.Height = 29, ;
CLB_TX_CAUTARE.LB_SIMPLU1.Caption = "Gestiune", ;
CLB_TX_CAUTARE.LB_SIMPLU1.Name = "LB_SIMPLU1", ;
CLB_TX_CAUTARE.Left = 1, ;
CLB_TX_CAUTARE.Name = "CLB_TX_CAUTARE", ;
CLB_TX_CAUTARE.TEXT_SIMPLU1.Left = 63, ;
CLB_TX_CAUTARE.TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
CLB_TX_CAUTARE.TEXT_SIMPLU1.Top = 3, ;
CLB_TX_CAUTARE.Top = 1, ;
CLB_TX_CAUTARE.Width = 252
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
ADD OBJECT 'Ct_clb_partener' AS ct_clb_cautare WITH ;
cconditie = empty(nvl(poRec.id_part,0)), ;
cprocedura = thisform.do_cauta_partener, ;
cvar_afisata = poRec.denumire, ;
Height = 31, ;
Left = 6, ;
Name = "Ct_clb_partener", ;
TabIndex = 1, ;
Top = 69, ;
Width = 281, ;
img_cautare.Left = 259, ;
img_cautare.Name = "img_cautare", ;
img_cautare.Top = 5, ;
clb_tx_cautare.Height = 29, ;
clb_tx_cautare.Lb_simplu1.Caption = "Partener", ;
clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
clb_tx_cautare.Left = 1, ;
clb_tx_cautare.Name = "clb_tx_cautare", ;
clb_tx_cautare.Text_simplu1.Left = 62, ;
clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
clb_tx_cautare.Text_simplu1.Top = 3, ;
clb_tx_cautare.Top = 1, ;
clb_tx_cautare.Width = 251
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
ADD OBJECT 'Cus_odata_parteneri_gestiuni1' AS cus_odata_parteneri_gestiuni WITH ;
Left = 180, ;
Name = "Cus_odata_parteneri_gestiuni1", ;
Top = 0
*< END OBJECT: ClassLib="oasociere.vcx" BaseClass="custom" />
PROCEDURE do_cauta_gestiune
Local loCauta
loCauta = caut_gestiune()
If !Empty(Nvl(loCauta.id_gestiune,0))
poRec.id_gestiune = loCauta.id_gestiune
poRec.nume_gestiune = Alltrim(loCauta.nume_gestiune)
Thisform.ct_clb_gestiune.Refresh()
Else
poRec.id_gestiune = Null
poRec.nume_gestiune = []
Endif
ENDPROC
PROCEDURE do_cauta_partener
Local loCauta
loCauta=caut_partener()
If !Empty(Nvl(loCauta.id_part,0))
poRec.id_part = loCauta.id_part
poRec.denumire = Alltrim(loCauta.denumire)
Thisform.ct_clb_partener.Refresh()
Else
poRec.id_part = Null
poRec.denumire = []
Endif
ENDPROC
PROCEDURE inainte_de_do_termin
Private pnExistaGestiune, pnExistaPartener
Local PLRETURN
Do Case
Case Empty(porec.id_part) Or Isnull(porec.id_part)
amessagebox('Nu ati completat partenerul!',0+48,"Atentie")
Thisform.ct_clb_partener.SetFocus()
PLRETURN=.F.
Case Empty(porec.id_gestiune) Or Isnull(porec.id_gestiune)
amessagebox('Nu ati completat gestiunea!',0+48,"Atentie")
Thisform.ct_clb_sectie.SetFocus()
PLRETURN=.F.
Otherwise
If Alltrim(Upper(This.cus_odata_parteneri_gestiuni1.cactiune))="INSERT" ;
Or (Alltrim(Upper(This.cus_odata_parteneri_gestiuni1.cactiune))="UPDATE")
pnExistaGestiune = 0
*!* pnExistaPartener = 0
*!* lcSql = [select Count(*) from asociere_parteneri_gestiuni where cont = '] + Alltrim(porec.Cont) + [' and id_part = ] + Alltrim(Str(porec.id_part))
*!* lnSucces = goExecutor.oSelect2Value(lcSql, @pnExistaPartener)
lcSql = [select Count(*) from asociere_parteneri_gestiuni where id_gestiune = ] + Alltrim(Str(porec.id_gestiune))
lnSucces = goExecutor.oSelect2Value(lcSql, @pnExistaGestiune)
If pnExistaGestiune <> 0
*!* If pnExistaGestiune <> 0
amessagebox('Mai exista aceasta gestiune inregistrata!',0+48,"Atentie")
Thisform.ct_clb_gestiune.SetFocus()
PLRETURN=.F.
*!* Else
*!* If pnExistaPartener <> 0
*!* amessagebox('Mai exista acest partener inregistrat!',0+48,"Atentie")
*!* Thisform.ct_clb_partener.SetFocus()
*!* PLRETURN=.F.
*!* Endif
*!* Endif
Else
PLRETURN=This.cus_odata_parteneri_gestiuni1.salvare(This.OREC,This.NID)
Endif
Endif
Endcase
Return PLRETURN
ENDPROC
PROCEDURE Init
LPARAMETERS toRec, tnId, tcActiune
DODEFAULT()
this.orec= toRec
this.nid = tnId
this.cus_odata_parteneri_gestiuni1.cactiune = tcActiune
ENDPROC
ENDDEFINE
DEFINE CLASS frm_parteneri_sectii AS _frmbase OF "..\comun\clase\_frm_base.vcx"
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="grid_asociere" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.Column1.Header1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.Column1.Text1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.Column2.Header1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="grid_asociere.Column2.Text1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
*<PropValue>
BorderStyle = 3
DoCreate = .T.
Height = 391
Name = "frm_parteneri_sectii"
Width = 400
_shape1.Height = 29
_shape1.Left = 0
_shape1.Name = "_shape1"
_shape1.Top = 0
_shape1.Width = 410
_shape2.Height = 29
_shape2.Left = 216
_shape2.Name = "_shape2"
_shape2.Top = 0
_shape2.Width = 182
Lb_titlu_alb_b121.Caption = "Asociere entit<69><74>i - sec<65>ii"
Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
BUT_TERMIN1.Left = 369
BUT_TERMIN1.Name = "BUT_TERMIN1"
BUT_TERMIN1.Top = 1
Gridsort1.Left = 12
Gridsort1.Name = "Gridsort1"
Gridsort1.Top = 12
*</PropValue>
ADD OBJECT 'But_excel1' AS but_excel WITH ;
Left = 338, ;
Name = "But_excel1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_listare1' AS but_listare WITH ;
Left = 309, ;
Name = "But_listare1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
Left = 249, ;
Name = "But_modifica1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_nou1' AS but_nou WITH ;
Left = 219, ;
Name = "But_nou1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
Left = 279, ;
Name = "But_sterge1", ;
Top = 1
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'grid_asociere' AS _grdrow WITH ;
ColumnCount = 2, ;
DeleteMark = .F., ;
Height = 336, ;
Left = 12, ;
Name = "grid_asociere", ;
Panel = 1, ;
RecordSource = "crsAsociere", ;
Top = 41, ;
Width = 375, ;
Column1.ColumnOrder = 1, ;
Column1.ControlSource = "denumire", ;
Column1.Name = "Column1", ;
Column1.Width = 155, ;
Column2.ColumnOrder = 2, ;
Column2.ControlSource = "sectie", ;
Column2.Name = "Column2", ;
Column2.Width = 182
*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />
ADD OBJECT 'grid_asociere.Column1.Header1' AS header WITH ;
Alignment = 2, ;
Caption = "Entitate", ;
Name = "Header1"
*< END OBJECT: BaseClass="header" />
ADD OBJECT 'grid_asociere.Column1.Text1' AS textbox WITH ;
BackColor = 255,255,255, ;
BorderStyle = 0, ;
ForeColor = 0,0,0, ;
Margin = 0, ;
Name = "Text1"
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'grid_asociere.Column2.Header1' AS header WITH ;
Alignment = 2, ;
Caption = "Sectie", ;
Name = "Header1"
*< END OBJECT: BaseClass="header" />
ADD OBJECT 'grid_asociere.Column2.Text1' AS textbox WITH ;
BackColor = 255,255,255, ;
BorderStyle = 0, ;
ForeColor = 0,0,0, ;
Margin = 0, ;
Name = "Text1"
*< END OBJECT: BaseClass="textbox" />
PROCEDURE actualizeaza_grid1
LPARAMETERS pcFiltru
LOCAL lcFiltru
lcFiltru=pcFiltru
IF EMPTY(lcFiltru)
lcFiltru=poAsociere.ca_baza1.cfiltru
ENDIF
save_grid_tag(thisform.grid_asociere)
poAsociere.ca_baza1.cfiltru=lcFiltru
poAsociere.ca_baza1.afisare()
restore_grid_tag(thisform.grid_asociere)
*!* IF RECCOUNT('v_sucursale')>0
*!* thisform._gnom_sucursale.SetFocus()
*!* ELSE
*!* thisform.lb_nom_sucursale.SetFocus()
*!* ENDIF
ENDPROC
PROCEDURE do_adauga
SELECT crsAsociere
SCATTER NAME loRec blank
DO Adauga_Modifica_Inregistrare WITH "parteneri_sectii",loRec,,"INSERT"
this.actualizeaza_grid1()
ENDPROC
PROCEDURE do_modifica
Select crsAsociere
Scatter Name loRec
Do Adauga_Modifica_Inregistrare With "parteneri_sectii",loRec,loRec.id_asociere,"UPDATE"
thisform.actualizeaza_grid1()
ENDPROC
PROCEDURE do_sterge
SELECT crsAsociere
SCATTER NAME lorec
Do STERGE_INREGISTRARE With "parteneri_sectii",loRec.id_asociere
this.actualizeaza_grid1()
ENDPROC
PROCEDURE inainte_de_do_excel
DO export_excel_grid WITH thisform.grid_asociere
ENDPROC
PROCEDURE inainte_de_do_listare
thisform.AlwaysOnTop = .F.
PRIVATE pcDataOra, pcTitlu
pcDataOra = get_ora(2)
pcTitlu = "Asociere entitati - sectii"
LOCAL lcTabel
lcTabel = this.grid_asociere.RecordSource
SELECT (lcTabel)
REPORT FORM rAsociere_part_sect.frx TO PRINTER PROMPT PREVIEW
thisform.AlwaysOnTop = .T.
ENDPROC
PROCEDURE Init
DoDefault()
Thisform.grid_asociere.colUMN1.DynamicBackColor = [IIF(part_inactiv = 1,RGB(128,128,128),RGB(255,255,255))]
Thisform.grid_asociere.coluMN2.DynamicBackColor = [IIF(sectie_inactiva = 1,RGB(128,128,128),RGB(255,255,255))]
ENDPROC
ENDDEFINE
DEFINE CLASS frm_parteneri_sectii_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx"
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="Cus_odata_parteneri_sectii1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Ct_clb_partener" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Ct_clb_sectie" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: do_cauta_partener
*m: do_cauta_sectie
*p: nid
*p: orec
*</DefinedPropArrayMethod>
*<PropValue>
DoCreate = .T.
Height = 98
Name = "frm_parteneri_sectii_nou"
nid = .F.
orec = .F.
Width = 598
_shape1.Height = 29
_shape1.Left = 0
_shape1.Name = "_shape1"
_shape1.Top = 0
_shape1.Width = 684
_shape2.Height = 29
_shape2.Left = 533
_shape2.Name = "_shape2"
_shape2.Top = -1
_shape2.Width = 66
Lb_titlu_alb_b121.Caption = "Partener - sec<65>ie"
Lb_titlu_alb_b121.Left = 6
Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
Lb_titlu_alb_b121.TabIndex = 5
BUT_TERMIN1.Left = 567
BUT_TERMIN1.Name = "BUT_TERMIN1"
BUT_TERMIN1.TabIndex = 3
BUT_TERMIN1.Top = 0
Gridsort1.Left = 228
Gridsort1.Name = "Gridsort1"
Gridsort1.Top = 5
*</PropValue>
ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
Left = 536, ;
Name = "BUT_RENUNT1", ;
TabIndex = 4, ;
Top = 0
*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />
ADD OBJECT 'Ct_clb_partener' AS ct_clb_cautare WITH ;
cconditie = ISNULL(poRec.id_part), ;
cprocedura = thisform.do_cauta_partener, ;
cvar_afisata = poRec.denumire, ;
Height = 31, ;
Left = 6, ;
Name = "Ct_clb_partener", ;
TabIndex = 1, ;
Top = 48, ;
Width = 280, ;
img_cautare.Left = 259, ;
img_cautare.Name = "img_cautare", ;
img_cautare.Top = 5, ;
clb_tx_cautare.Height = 29, ;
clb_tx_cautare.Lb_simplu1.Caption = "Partener", ;
clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
clb_tx_cautare.Left = 1, ;
clb_tx_cautare.Name = "clb_tx_cautare", ;
clb_tx_cautare.Text_simplu1.Left = 62, ;
clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
clb_tx_cautare.Text_simplu1.Top = 3, ;
clb_tx_cautare.Top = 1, ;
clb_tx_cautare.Width = 251
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
ADD OBJECT 'Ct_clb_sectie' AS ct_clb_cautare WITH ;
cconditie = ISNULL(poRec.id_sectie), ;
cprocedura = thisform.do_cauta_sectie, ;
cvar_afisata = poRec.sectie, ;
Height = 31, ;
Left = 312, ;
Name = "Ct_clb_sectie", ;
TabIndex = 2, ;
Top = 48, ;
Width = 281, ;
IMG_CAUTARE.Left = 259, ;
IMG_CAUTARE.Name = "IMG_CAUTARE", ;
IMG_CAUTARE.Top = 5, ;
CLB_TX_CAUTARE.Height = 29, ;
CLB_TX_CAUTARE.LB_SIMPLU1.Caption = "Sec<65>ie", ;
CLB_TX_CAUTARE.LB_SIMPLU1.Name = "LB_SIMPLU1", ;
CLB_TX_CAUTARE.Left = 1, ;
CLB_TX_CAUTARE.Name = "CLB_TX_CAUTARE", ;
CLB_TX_CAUTARE.TEXT_SIMPLU1.Left = 63, ;
CLB_TX_CAUTARE.TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
CLB_TX_CAUTARE.TEXT_SIMPLU1.Top = 3, ;
CLB_TX_CAUTARE.Top = 1, ;
CLB_TX_CAUTARE.Width = 252
*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />
ADD OBJECT 'Cus_odata_parteneri_sectii1' AS cus_odata_parteneri_sectii WITH ;
Left = 156, ;
Name = "Cus_odata_parteneri_sectii1", ;
Top = 12
*< END OBJECT: ClassLib="oasociere.vcx" BaseClass="custom" />
PROCEDURE do_cauta_partener
Local loCauta
loCauta=caut_partener()
If !Empty(Nvl(loCauta.id_part,0))
poRec.id_part = loCauta.id_part
poRec.denumire = Alltrim(loCauta.denumire)
Thisform.ct_clb_partener.Refresh()
Else
poRec.id_part = Null
poRec.denumire = []
Endif
ENDPROC
PROCEDURE do_cauta_sectie
Local loCauta
loCauta = caut_sectie()
If !Empty(Nvl(loCauta.id_sectie,0))
poRec.id_sectie = loCauta.id_sectie
poRec.sectie = Alltrim(loCauta.sectie)
Thisform.ct_clb_sectie.Refresh()
Else
poRec.id_sectie = Null
poRec.sectie = []
Endif
ENDPROC
PROCEDURE inainte_de_do_termin
Private pnExistaPartener, pnExistaSectie
Local PLRETURN
Do Case
Case Empty(porec.id_part) Or Isnull(porec.id_part)
amessagebox('Nu ati completat partenerul!',0+48,"Atentie")
Thisform.ct_clb_partener.SetFocus()
PLRETURN=.F.
Case Empty(porec.id_sectie) Or Isnull(porec.id_sectie)
amessagebox('Nu ati completat sectia!',0+48,"Atentie")
Thisform.ct_clb_sectie.SetFocus()
PLRETURN=.F.
Otherwise
If Alltrim(Upper(This.cus_odata_parteneri_sectii1.cactiune))="INSERT" ;
Or (Alltrim(Upper(This.cus_odata_parteneri_sectii1.cactiune))="UPDATE")
pnExistaPartener = 0
lcSql = [select Count(*) from asociere_parteneri_sectii where id_part=]+Alltrim(Str(porec.id_part))
lnSucces = goExecutor.oSelect2Value(lcSql, @pnExistaPartener)
pnExistaSectie = 0
lcSql = [select Count(*) from asociere_parteneri_sectii where id_sectie=]+Alltrim(Str(porec.id_sectie))
lnSucces = goExecutor.oSelect2Value(lcSql, @pnExistaPartener)
If pnTip_asociere = 1 && inchidere cu K
If pnExistaPartener > 0
amessagebox('Mai exista acest partener inregistrat!',0+48,"Atentie")
Thisform.ct_clb_partener.SetFocus()
PLRETURN=.F.
Else
If pnExistaSectie > 0
amessagebox('Mai exista aceasta sectie inregistrata!',0+48,"Atentie")
Thisform.ct_clb_sectie.SetFocus()
PLRETURN=.F.
Else
PLRETURN=This.cus_odata_parteneri_sectii1.salvare(This.OREC,This.NID)
Endif
Endif
Else
PLRETURN=This.cus_odata_parteneri_sectii1.salvare(This.OREC,This.NID)
Endif
Else
PLRETURN=This.cus_odata_parteneri_sectii1.salvare(This.OREC,This.NID)
Endif
Endcase
Return PLRETURN
ENDPROC
PROCEDURE Init
LPARAMETERS toRec, tnId, tcActiune
DODEFAULT()
this.orec= toRec
this.nid = tnId
this.cus_odata_parteneri_sectii1.cactiune = tcActiune
ENDPROC
PROCEDURE Ct_clb_sectie.IMG_CAUTARE.Click
thisform.do_cauta_sectie()
ENDPROC
ENDDEFINE