*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="onomenclatoare.vcx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS cb_nom_valute AS _cbbase OF "..\libs\_cb_base.vcx" 
 	*< CLASSDATA: Baseclass="combobox" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<DefinedPropArrayMethod>
		*m: initializare
	*</DefinedPropArrayMethod>

	*<PropValue>
		FontName = "Arial Narrow"
		Name = "cb_nom_valute"
		Width = 72
	*</PropValue>
	
	PROCEDURE Destroy
		If Used('crsnumeval')
			Use In crsnumeval
		Endif
	ENDPROC

	PROCEDURE Init
		this.initializare()
	ENDPROC

	PROCEDURE initializare
		=ccvalute()
		Select nume_val From v_nom_valute Into Array lanumeval Order By nume_val
		Use In v_nom_valute
		
		If Used('crsnumeval')
			Use In crsnumeval
		Endif
		
		Create Cursor crsnumeval (nume_val c(5))
		Select crsnumeval
		Append Blank
		Replace nume_val With '---'
		If Type('lanumeval')#'U'
			Append From Array lanumeval
			Release lanumeval
		Endif
		This.RowSourceType= 2
		This.RowSource="crsnumeval"
		This.Value='---'
		This.BoundTo=.T.
	ENDPROC

ENDDEFINE

DEFINE CLASS ct_coresp_delegati_part AS _container OF "_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="lb_explicatie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_parteneri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_parteneri.cAles.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_parteneri.cAles._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_parteneri.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_parteneri.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="tx_cautare" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_cauta
		*m: do_initializeaza_grid
		*m: do_modifica_lista_part
		*m: do_prelucreaza_coresp
		*m: initializeaza_date
		*m: modifica_vizibilitate
		*p: clista_id_part
		*p: clista_initiala		&& 1=2 daca gridul e readonly sau daca nu e vizibil; 2=2 daca gridul e vizibil
		*p: nid_delegat
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderWidth = 0
		clista_id_part = 
		clista_initiala = 
		Height = 443
		Name = "ct_coresp_delegati_part"
		nid_delegat = 0
		Width = 251
	*</PropValue>

	ADD OBJECT 'grd_parteneri' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 367, ;
		HighlightStyle = 2, ;
		Left = 11, ;
		Name = "grd_parteneri", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "crsrezultate", ;
		TabIndex = 2, ;
		Top = 65, ;
		Width = 228, ;
		Column1.ControlSource = "ales", ;
		Column1.Name = "cAles", ;
		Column1.Sparse = .F., ;
		Column1.Width = 28, ;
		Column2.ControlSource = "denumire", ;
		Column2.Name = "cDenumire", ;
		Column2.Width = 170
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grd_parteneri.cAles._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 14, ;
		Name = "_checkbox1", ;
		Top = 42
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grd_parteneri.cAles.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Ales", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grd_parteneri.cDenumire.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grd_parteneri.cDenumire.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'lb_explicatie' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Alegeți clienții pentru acest delegat", ;
		FontCharSet = 238, ;
		Height = 17, ;
		Left = 12, ;
		Name = "lb_explicatie", ;
		TabIndex = 3, ;
		Top = 5, ;
		Width = 192
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'tx_cautare' AS _textbox WITH ;
		Format = "K!", ;
		Height = 24, ;
		Left = 22, ;
		Name = "tx_cautare", ;
		TabIndex = 1, ;
		Top = 29, ;
		Width = 206
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE Destroy
		If Used('crsrezultate')
			Use In crsrezultate
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Lparameters tcValoare
		save_grid_tag(This.grd_parteneri)
		If Used('crsClientiTemp')
			Use In crsClientiTemp
		Endif
		If Used('crsClientiDelTemp')
			Use In crsClientiDelTemp
		Endif
		If Used('crsrezultate')
			Select ales,denumire,id_part From crsrezultate With (Buffering = .T.) Where ales = 1 Into Cursor crsClientiDelTemp
			Use In crsrezultate
		Else
			Create Cursor crsClientiDelTemp(ales N(1),denumire c(50),id_part N(10))
		Endif
		lcSql = [select b.id_part,b.denumire from ] + gcS + [.coresp_tip_cont a ] + ;
			[left join ] + gcS + [.vcoresp_tip_part b on a.id_tip_part = b.id_tip_part ] + ;
			[where a.cont = ?gcCont411 and b.inactiv = 0 and b.denumire like '] + Alltrim(Strtran(tcValoare,['],[''])) + [%']
		lnSucces = goExecutor.oExecute(lcSql,[crsClientiTemp])
		If lnSucces < 0
			amessagebox(goExecutor.oPrelucreazaEroare(),16,"Eroare")
		Endif
		Select ales,denumire,id_part From crsClientiDelTemp ;
			UNION ;
			Select 0 As ales,denumire,id_part From crsClientiTemp Where id_part Not In (Select id_part From crsClientiDelTemp) ;
			INTO Cursor crsrezultate Readwrite Order By ales Desc,denumire
		Use In crsClientiTemp
		restore_grid_tag(This.grd_parteneri)
		If Reccount('crsrezultate')>0
			This.grd_parteneri.SetFocus()
		Else
			amessagebox("Cautarea nu a intors rezultate!",0+48,"Info cautare")
			This.tx_cautare.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_initializeaza_grid
		Lparameters tcCorespDel
		save_grid_tag(This.grd_parteneri)
		Do Case
		Case !Empty(tcCorespDel)
		*!*	adaugare de delegat pentru un anumit partener
			lcSql = [select 1 as ales, a.id_part, a.denumire from ] + gcS + [.nom_parteneri a ] + ;
				[where a.id_part in (] + Alltrim(tcCorespDel) + [)]
			lnSucces = goExecutor.oExecute(lcSql,[crsrezultate])
			If lnSucces<0
				amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
			Endif
		Case Empty(tcCorespDel) And Used('crscoresppart')
		*!*	adaugare/modificare de delegat din fereastra speciala pentru delegati
			Select 1 As ales,id_part,denumire From crscoresppart Into Cursor crsrezultate Readwrite Order By denumire
		Otherwise
		*!*	adaugare/modificare de delegat din fereastra generala de entitati sau din fereastra pentru alte tipuri decat delegat
			lcSql = [select 1 as ales, a.id_part, b.denumire from ] + gcS + [.coresp_delegati_part a ] + ;
				[left join ] + gcS + [.nom_parteneri b on a.id_part = b.id_part ] + ;
				[where a.id_delegat = ] + Alltrim(Str(This.nid_delegat)) + [ and a.sters = 0 and ] + ;
				[b.sters = 0 and b.inactiv = 0 order by b.denumire]
			lnSucces = goExecutor.oExecute(lcSql,[crsrezultate])
			If lnSucces<0
				amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
			Endif
		Endcase
		restore_grid_tag(This.grd_parteneri)
	ENDPROC

	PROCEDURE do_modifica_lista_part
		Select crsrezultate
		lcIdPart = [<]+Alltrim(Str(id_part))+[>]
		If At(lcIdPart,This.clista_id_part,1)>0
			This.clista_id_part = Strtran(This.clista_id_part,lcIdPart,[])
		Else
			This.clista_id_part = This.clista_id_part + lcIdPart
		Endif
	ENDPROC

	PROCEDURE do_prelucreaza_coresp
	ENDPROC

	PROCEDURE initializeaza_date
		Lparameters tlExistent,tnIdPart,tnIdTipPart,tcCorespDel
		This.nid_delegat = tnIdPart
		Do Case
		Case Inlist(tnIdTipPart,gnIdTipDelegati,0) And tlExistent
		&&	este apelata din Entitati sau din Delegati
			Do Case
			Case tnIdPart <> 0
				This.do_initializeaza_grid()
			Case tnIdPart = 0 And !Empty(tcCorespDel)
				This.do_initializeaza_grid(tcCorespDel)
				This.clista_id_part = [<]+Strtran(tcCorespDel,[,],[><])+[>]
			Endcase
			Bindevent(This.grd_parteneri.cAles._checkbox1,"Click",This,"do_modifica_lista_part",1)
			This.clista_initiala = [2=2]
		Case tnIdTipPart <> gnIdTipDelegati And tlExistent
		&&	este apelata din alta fereastra,dar este si delegat
			This.RemoveObject('tx_cautare')
			This.lb_explicatie.Caption = [Partenerii pentru acest delegat:]
			This.grd_parteneri.SetAll("ReadOnly",.T.,"Column")
			This.do_initializeaza_grid()
			This.clista_initiala = []
		Otherwise
			This.clista_initiala = []
		Endcase
		
	ENDPROC

	PROCEDURE modifica_vizibilitate
		Lparameters tlVizibil
		This.Visible = tlVizibil
		
	ENDPROC

	PROCEDURE grd_parteneri.Init
		This.SetAll("DynamicBackColor","iif(ales = 1, RGB(157,206,255), RGB(255,255,255))","Column")
		
	ENDPROC

	PROCEDURE tx_cautare.KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		If Inlist(nKeyCode,9,13) And nShiftAltCtrl = 0 And !Empty(This.Value)
			Nodefault
			This.Parent.do_cauta(This.Value)
		Else
			DoDefault(nKeyCode,nShiftAltCtrl)
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS ct_localitate AS _container OF "_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Cb_tara" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_judet" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_localitate_af" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_localitate_af.img_atentie" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_judete
		*m: actualizeaza_localitati
		*m: actualizeaza_tari
		*m: initializeaza
		*m: modifica_judet
		*m: modifica_localitate
		*m: modifica_tara
		*p: ccrsjudete		&& Nume cursor Judete
		*p: ccrslocalitati		&& Nume cursor Localitati
		*p: ccrstari		&& Nume cursor Tari
		*p: cdate		&& Numele obiectului care are proprietatile : id_tara, tara, id_judet, judet, id_localitate, localitate
		*p: cprescurtaretara
		*p: odate		&& Obiectul care are proprietatile : id_tara, tara, id_judet, judet, id_localitate, localitate
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderWidth = 0
		ccrsjudete = crsJudete
		ccrslocalitati = crsLocalitati
		ccrstari = crsTari
		cdate = 
		cprescurtaretara = 
		Height = 85
		Name = "ct_localitate"
		odate = 
		Width = 314
		_memberdata = <VFPData>
			<memberdata name="ccrstari" display="cCrsTari"/>
			<memberdata name="ccrsjudete" display="cCrsJudete"/>
			<memberdata name="ccrslocalitati" display="cCrsLocalitati"/>
		</VFPData>
	*</PropValue>

	ADD OBJECT 'Cb_judet' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 0, ;
		Name = "Cb_judet", ;
		TabIndex = 2, ;
		Top = 28, ;
		Width = 314, ;
		ZOrderSet = 14, ;
		_cbbase1.Enabled = .F., ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 80, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 230, ;
		_lbbase1.Caption = "Județ", ;
		_lbbase1.Left = 4, ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_localitate_af' AS cb_tx_autofill WITH ;
		Left = 0, ;
		Name = "Cb_localitate_af", ;
		TabIndex = 3, ;
		Top = 56, ;
		Width = 314, ;
		_lbbase1.Caption = "Localitate", ;
		_lbbase1.Left = 4, ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.TabIndex = 2, ;
		_lbbase1.Top = 6, ;
		_cbautofill1.Enabled = .F., ;
		_cbautofill1.Left = 80, ;
		_cbautofill1.Name = "_cbautofill1", ;
		_cbautofill1.Style = 2, ;
		_cbautofill1.TabIndex = 1, ;
		_cbautofill1.Top = 3, ;
		_cbautofill1.Width = 230
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_localitate_af.img_atentie' AS _image WITH ;
		Height = 18, ;
		Left = 59, ;
		Name = "img_atentie", ;
		Picture = ..\grafice\exclam.ico, ;
		Stretch = 1, ;
		Top = 5, ;
		Visible = .F., ;
		Width = 18
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="image" />

	ADD OBJECT 'Cb_tara' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 0, ;
		Name = "Cb_tara", ;
		TabIndex = 1, ;
		Top = 0, ;
		Width = 314, ;
		ZOrderSet = 14, ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 80, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.TabIndex = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 230, ;
		_lbbase1.Caption = "Țară", ;
		_lbbase1.Left = 4, ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_judete
		Local lcSql, lcCursor
		With This.cb_judet
			With ._cbbase1
				.ControlSource = []
				.RowSourceType = 0
				.RowSource = []
				.DisplayValue = []
			Endwith
		
			If This.cprescurtaretara = [RO]
				.Visible = .T.
				lcSql = [select 1 as tip,null as id_judet, '<ALEGETI JUDETUL>' as judet, '' as indicativ from dual] + ;
					[ union all ] +;
					[select 2 as tip,id_judet, judet, indicativ from syn_vnom_judete where inactiv = 0 and id_tara = 1 order by tip,judet]
				lcCursor = IIF(!EMPTY(This.cCrsJudete), This.cCrsJudete, [crsjudete])
				If goExecutor.oExecuta(lcSql,lcCursor)
					Select (lcCursor)
					Locate For Nvl(id_judet,-1) = Nvl(This.oDate.id_judet,-1)
					If !Found()
						Go Top
					Endif
					This.oDate.id_judet = id_judet
					This.oDate.judet = Alltrim(judet)
					With ._cbbase1
						.Enabled = .T.
					Endwith
				Else
					This.oDate.id_judet = Null
					This.oDate.judet = []
					With ._cbbase1
						.Enabled = .F.
					Endwith
				Endif
		
				With ._cbbase1
					.ControlSource = This.cDate+[.judet]
					.RowSourceType = 2
					.RowSource = m.lcCursor + [.judet]
					.DisplayValue = This.oDate.judet
				Endwith
			Else
				.Visible = .F.
				This.oDate.id_judet = Null
				This.oDate.judet = []
			Endif
		Endwith
		This.actualizeaza_localitati()
	ENDPROC

	PROCEDURE actualizeaza_localitati
		Local lcSql, lcCursor, lcFiltru
		With This.cb_localitate_af._cbautofill1
			.ControlSource = []
			.RowSourceType = 0
			.RowSource = []
			.DisplayValue = []
		
			If This.cprescurtaretara = [RO]
				If Nvl(This.oDate.id_judet,0) = 0
					lcFiltru = [1=2]
				Else
					lcFiltru = [inactiv = 0 and id_judet = ] + Alltrim(Str(This.oDate.id_judet))
				Endif
				.Style = 2
			Else
				lcFiltru = [inactiv = 0 and id_tara = ] + Alltrim(Str(This.oDate.id_tara))
				.Style = 0
			Endif
			.Format = [!K]
			lcSql = [select 1 as tip,null as id_loc, '<ALEGETI LOCALITATEA>' as localitate,1 as nr_loc from dual] + ;
				[ union all ] +;
				[select 2 as tip,id_loc, localitate,nr_loc from syn_vnom_localitati where ] + lcFiltru + ;
				[ order by tip,localitate]
			lcCursor = IIF(!EMPTY(This.cCrsLocalitati), This.cCrsLocalitati, [crsLocalitati])
			If goExecutor.oExecuta(lcSql,lcCursor)
				Select (lcCursor)
				Locate For Nvl(id_loc,-1) = Nvl(This.oDate.id_loc,-1)	&&	am pus -1 pentru ca localitatile noi le am cu id = 0
				If !Found()
					Go Top
				Endif
				This.oDate.id_loc = id_loc
				This.oDate.localitate = Alltrim(localitate)
				If Reccount(lcCursor) = 1 AND This.cprescurtaretara = [RO] AND Nvl(This.oDate.id_judet,0) = 0
					.Enabled = .F.
				Else
					.Enabled = .T.
				ENDIF
				
			Else
				This.oDate.id_loc = Null
				This.oDate.localitate = []
				.Enabled = .F.
			Endif
		
			.ControlSource = This.cDate+[.localitate]
			.RowSourceType = 2
			.RowSource = m.lcCursor + [.localitate,nr_loc]
			.ColumnCount = 2
			.ColumnWidths = [250,0]
			.ColumnLines = .F.
			.cpk = [id_loc]
			.DisplayValue = This.oDate.localitate
		Endwith
	ENDPROC

	PROCEDURE actualizeaza_tari
		Local lcSql, lcCursor
		With This.cb_tara._cbbase1
			.ControlSource = []
			.RowSourceType = 0
			.RowSource = []
			.DisplayValue = []
			lcSql = [select id_tara, tara, prescurtare from syn_vnom_tari order by tara]
			lcCursor = IIF(!EMPTY(This.cCrsTari), This.cCrsTari, [crstari])
			If goExecutor.oExecuta(lcSql,lcCursor)
				Select (lcCursor)
				If Nvl(This.oDate.id_tara,0) = 0
					Locate For prescurtare = [RO]
				Else
					Locate For id_tara = This.oDate.id_tara
				Endif
				If !Found()
					Go Top
				Endif
				This.oDate.id_tara = id_tara
				This.oDate.tara = Alltrim(tara)
				This.cprescurtaretara = Alltrim(prescurtare)
			Endif
			.ControlSource = This.cDate+[.tara]
			.RowSourceType = 2
			.RowSource = lcCursor + [.tara]
			.DisplayValue = This.oDate.tara
		Endwith
		This.actualizeaza_judete()
	ENDPROC

	PROCEDURE Destroy
		lcCursorLocalitati = IIF(!EMPTY(This.cCrsLocalitati), This.cCrsLocalitati, [crsLocalitati])
		lcCursorJudete = IIF(!EMPTY(This.cCrsJudete), This.cCrsJudete, [crsJudete])
		lcCursorTari = IIF(!EMPTY(This.cCrsTari), This.cCrsTari, [crsTari])
		
		Use In (Select(lcCursorTari))
		Use In (Select(lcCursorJudete))
		Use In (Select(lcCursorLocalitati))
		
	ENDPROC

	PROCEDURE initializeaza
		Local lcObiect
		lcObiect = This.cdate
		This.odate = &lcObiect
		This.actualizeaza_tari()
	ENDPROC

	PROCEDURE modifica_judet
		LOCAL lcCursor
		lcCursor = IIF(!EMPTY(This.cCrsJudete), This.cCrsJudete, [crsjudete])
		
		This.oDate.id_judet = EVALUATE(m.lcCursor + [.id_judet])
		This.oDate.id_loc = Null
		This.oDate.localitate = []
		This.actualizeaza_localitati()
	ENDPROC

	PROCEDURE modifica_localitate
		Lparameters tnIdLoc
		
		This.oDate.id_loc = tnIdLoc
	ENDPROC

	PROCEDURE modifica_tara
		LOCAL lcCursor
		lcCursor = IIF(!EMPTY(This.cCrsTari), This.cCrsTari, [crstari])
		
		This.oDate.id_tara = EVALUATE(m.lcCursor + [.id_tara])
		This.cprescurtaretara = Alltrim(EVALUATE(m.lcCursor + [.prescurtare]))
		This.oDate.id_judet = Null
		This.oDate.judet = []
		This.actualizeaza_judete()
	ENDPROC

	PROCEDURE Cb_judet._cbbase1.InteractiveChange
		This.Parent.Parent.modifica_judet()
	ENDPROC

	PROCEDURE Cb_localitate_af._cbautofill1.InteractiveChange
		DoDefault()
		Local lnNrLoc, lcCursor
		lcCursor = Iif(!Empty(This.Parent.Parent.cCrsLocalitati), This.Parent.Parent.cCrsLocalitati, [crsLocalitati])
		lnNrLoc = Evaluate(lcCursor + '.nr_loc')
		If lnNrLoc > 1
			This.Parent.img_atentie.Visible = .T.
			This.Parent.img_atentie.ToolTipText = [ATENTIE! Exista ] + Alltrim(Str(lnNrLoc)) + [ localitati cu acest nume!]
		Else
			This.Parent.img_atentie.Visible = .F.
		Endif
	ENDPROC

	PROCEDURE Cb_localitate_af._cbautofill1.Valid
		DoDefault()
		This.Parent.Parent.modifica_localitate(This.npk)
		
	ENDPROC

	PROCEDURE Cb_tara._cbbase1.InteractiveChange
		This.Parent.Parent.modifica_tara()
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_categorii_entitati AS _cusodatabase OF "..\..\..\roacomenzi\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<DefinedPropArrayMethod>
		*p: csql1
		*p: csql2
	*</DefinedPropArrayMethod>

	*<PropValue>
		csql1 = 
		csql2 = 
		Name = "cus_odata_categorii_entitati"
	*</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))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcCategorie_Entitate = Nvl(Strtran(Alltrim(Upper(toRec.categorie_entitate)),['],['']),"")
			lcinactiv = Alltrim(Str(toRec.inactiv))
		Endif
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin ] + gcS + [.pack_def.adauga_categorie_entitate(']+lcCategorie_Entitate+[',]+lcinactiv+[,?gnIdUtil); end;]
		Case lcActiune = "UPDATE"
			lcSql = [begin ] + gcS + [.pack_def.modifica_categorie_entitate(]+lcId+[,']+lcCategorie_Entitate+[',]+lcinactiv+[,?gnIdUtil); end;]
		Case lcActiune = "DELETE"
			lcSql = [begin ] + gcS + [.pack_def.sterge_categorie_entitate(]+lcId+[,?gnIdUtil); end;]
		Endcase
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_clienti_201402 AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_clienti"
	*</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_parteneri"
			lcamp = "id_part"
			lclook = gcS + ".dev_masiniclienti"
			lclookid = "id_partener"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcNume = Nvl(Strtran(Alltrim(Upper(toRec.nume)),['],['']),"")
			lcCod_fiscal = Nvl(Strtran(Alltrim(Upper(toRec.cod_fiscal)),['],['']),"")
			lctelefon = Nvl(Strtran(Alltrim(Upper(toRec.telefon)),['],['']),"")
			lcadresa = Nvl(Strtran(Alltrim(Upper(toRec.adresa)),['],['']),"")
			lcbanca = Nvl(Strtran(Alltrim(Upper(toRec.banca)),['],['']),"")
			lccont_banca = Nvl(Strtran(Alltrim(Upper(toRec.cont_banca)),['],['']),"")
			lcreg_comert = Nvl(Strtran(Alltrim(Upper(toRec.reg_comert)),['],['']),"")
		*!*		lcJudet = Nvl(STRTRAN(Alltrim(Upper(toRec.judet)),['],['']),"")
		*!*		lcLocalitate = Nvl(STRTRAN(Alltrim(Upper(toRec.localitate)),['],['']),"")
			lcIdLoc = Nvl(Alltrim(Str(toRec.id_loc)),0)
		Endif
		
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin devpartinsproc('] + gcS + [','] + lcNume + [','] + lcCod_fiscal + [','] + lctelefon +[',']+ lcadresa + [','] +lcbanca + ;
				[',']+ lccont_banca + [','] + lcreg_comert + [',] + lcIdLoc + [); end;]
		
		*!*			lcSql = [INSERT INTO ] + gcS + [.nom_parteneri (nume,cod_fiscal,telefon,adresa,banca,cont_banca,reg_comert,id_loc) ] + ;
		*!*				[VALUES ('] + lcnume + [','] + lccod_fiscal + [','] + lctelefon +[',']+ lcAdresa + [','] +lcbanca + ;
		*!*				[',']+ lcCont_banca + [',']+ lcReg_comert+[',] + lcIdLoc + [)]
		Case lcActiune = "UPDATE"
			If pnNivelModificare=-1
				lcSql = [UPDATE ] + gcS + [.nom_parteneri SET nume = '] + lcNume;
					+[',cod_fiscal = '] + lcCod_fiscal + [',telefon = '] + lctelefon +;
					[',adresa = '] + lcadresa + [',banca = '] + lcbanca + [',cont_banca = '] + lccont_banca + [',reg_comert = ']+lcreg_comert+;
					[',id_loc = ] + lcIdLoc + [ where id_part = ] + lcId
			ELSE
				lcSql = [UPDATE ] + gcS + [.nom_parteneri SET telefon = '] + lctelefon + [' ]+;
					[ where id_part = ] + lcId
			Endif
		Case lcActiune = "DELETE"
		
		*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
			lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcId + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		This.csql = lcSql
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_cod AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_cod"
	*</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))
			lccod = gcS + ".cod"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcocod = Nvl(STRTRAN(Alltrim(Upper(toRec.cod)),['],['']),"")
			lcidpart = NVL(STRTRAN(ALLTRIM(UPPER(STR(toRec.id_part))),['],['']),"")
			
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.parteneri_coduri (cod,id_part,id_util) VALUES ('] + lcocod + [',] + lcidpart + [,?gnIdUtil)]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.parteneri_coduri SET cod= '] + lcocod + ['] + [ where id = ] + lcId
		
			Case lcActiune = "DELETE"
				lcSql = [begin coddelproc('] + lcid + [',?gnIdUtil); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_config_cont_ireg AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_config_cont_ireg"
	*</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 + ".config_cont_ireg"
			lcamp = "config_cont_ireg.cont"
		*!*		lclook = gcS + ".act"
		*!*		lclookid = "id_tip_part"
		ENDIF 
		
		
		IF INLIST(lcActiune, "UPDATE",'INSERT')
		    *lcId_tip_part=ALLTRIM(STR(torec.id_tip_part))   
			lcCont = NVL(STRTRAN(ALLTRIM(UPPER(toRec.Cont)),['],['']),"")
			lcExplicatie = NVL(STRTRAN(ALLTRIM(UPPER(toRec.Explicatie)),['],['']),"")
			lnFel_cont = ALLTRIM(STR(toRec.Fel_Cont))
			lnCu_inregistrari = ALLTRIM(STR(toRec.Cu_Inregistrari))
			lnDupa_venchelt = ALLTRIM(STR(toRec.Cu_venchelt))
			lnDupa_ProcTva = ALLTRIM(STR(toRec.Cu_proc_tva))
		ENDIF 
			
		**MESSAGEBOX("id loc:"+STR(lcId_loc))
		**MESSAGEBOX("id tip part:"+STR(lcId_tip_part))
		
		DO CASE
			CASE lcActiune = "INSERT"
				lcSql = [INSERT INTO ] + gcS + [.config_cont_ireg(Cont,Explicatie,Fel_cont,Cu_inregistrari,cu_venchelt,cu_proc_tva)]+;
				+[ VALUES (']+ lcCont + [',']+ lcExplicatie + [',] + lnFel_cont + [,] + lnCu_inregistrari + [,] + lnDupa_venchelt + [,] + lnDupa_procTva + [)]
		
			CASE lcActiune = "UPDATE"
				lcSql = [UPDATE ] + gcS + [.config_cont_ireg SET  Cont = '] + lcCont + [',Explicatie = '] + lcExplicatie + [',Fel_cont = ] + lnFel_cont + ;
				[,Cu_inregistrari = ] + lnCu_inregistrari + [,Cu_venChelt = ] + lnDupa_venchelt + [,Cu_proc_Tva = ] + lnDupa_ProcTva + ;
				[ where id_cont_ireg = ] + lcId
		
			CASE lcActiune = "DELETE"
		
				lcSql = [delete ] + gcS + [.config_cont_ireg where id_cont_ireg =]+lcid
		
		ENDCASE
		this.csql = lcSql 
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_contract AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_contract"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		Private poRec
		poRec = m.toRec
		
		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",'INSERT')
			poRec.id_tip_ctr = Nvl(poRec.id_tip_ctr, 0)
			poRec.inactiv = Nvl(poRec.inactiv, 0)
			poRec.id_tata = Iif(Empty(Nvl(poRec.id_tata,0)),Null, poRec.id_tata)
			poRec.id_valuta = Iif(Empty(Nvl(poRec.id_valuta,0)),Null,poRec.id_valuta)
			poRec.id_responsabil = Iif(Empty(Nvl(poRec.id_responsabil,0)), Null, poRec.id_responsabil)
		Endif
		
		Do Case
			Case Inlist(lcActiune, "INSERT", "UPDATE")
				TEXT TO lcSql NOSHOW
		begin
		  pack_def.adauga_modifica_contract(?@pnIdAMS,
			                                    ?poRec.id_part,
			                                    ?poRec.numar,
			                                    ?poRec.data,
			                                    ?poRec.data_inceput,
			                                    ?poRec.data_sfarsit,
			                                    ?poRec.Id_tip_ctr,
			                                    ?poRec.inactiv,
			                                    ?poRec.tip_istoric,
			                                    ?poRec.descriere,
			                                    ?poRec.id_tata,
			                                    ?poRec.Valftva,
			                                    ?poRec.proc_tva,
			                                    ?poRec.curs,
			                                    ?poRec.id_valuta,
			                                    ?poRec.tip_curs,
			                                    ?poRec.id_responsabil,
			                                    ?poRec.scadenta_incasare,
			                                    ?poRec.coef_penalitati,
			                                    ?poRec.coef_penalitati2,
			                                    ?poRec.zile_penalitati,
			                                    ?poRec.zile_penalitati2,
			                                    ?poRec.zile_gratie_penalitati,
			                                    ?gnIdUtil);
		end;
				ENDTEXT
		
		
			Case lcActiune = "DELETE"
				lcSql = [begin pack_def.sterge_contract(?pnId,?gnIdUtil); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_coresp_tipuri_conturi AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_coresp_tipuri_conturi"
	*</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 + ".coresp_tip_cont"
			lcamp = "coresp_tip_cont.id_coresp_tip_cont"
		*!*		lclook = gcS + ".act"
		*!*		lclookid = "id_tip_part"
		ENDIF 
		
		
		IF INLIST(lcActiune, "UPDATE",'INSERT')
		    lcId_tip_part=ALLTRIM(STR(torec.id_tip_part))   
			lcCont = NVL(STRTRAN(ALLTRIM(UPPER(toRec.Cont)),['],['']),"")
			*lcExplicatie = NVL(STRTRAN(ALLTRIM(UPPER(toRec.Explicatie)),['],['']),"")
			*lnFel_cont = ALLTRIM(STR(toRec.Fel_Cont))
			*lnCu_inregistrari = ALLTRIM(STR(toRec.Cu_Inregistrari))
		ENDIF 
			
		**MESSAGEBOX("id loc:"+STR(lcId_loc))
		**MESSAGEBOX("id tip part:"+STR(lcId_tip_part))
		
		DO CASE
			CASE lcActiune = "INSERT"
		*!*			lcSql = [INSERT INTO ] + gcS + [.coresp_tip_cont (Id_tip_part,Cont,Explicatie,Fel_cont,Cu_inregistrari)]+;
		*!*			+[ VALUES (] + lcId_tip_part+[,']+ lcCont + [',']+ lcExplicatie + [',] + lnFel_cont + [,] + lnCu_inregistrari + [)]
				lcSql = [INSERT INTO ] + gcS + [.coresp_tip_cont (Id_tip_part,Cont)]+;
				+[ VALUES (] + lcId_tip_part+[,']+ lcCont + [')]
		
			CASE lcActiune = "UPDATE"
				*lcSql = [UPDATE ] + gcS + [.coresp_tip_cont SET Id_tip_part = ] + lcId_tip_part +[,Cont = '] + lcCont + [',Explicatie = '] + lcExplicatie + [',Fel_cont = ] + lnFel_cont + [,Cu_inregistrari = ] + lnCu_inregistrari + [ where id_coresp_tip_cont = ] + lcId
				lcSql = [UPDATE ] + gcS + [.coresp_tip_cont SET Id_tip_part = ] + lcId_tip_part +[,Cont = '] + lcCont + [' where id_coresp_tip_cont = ] + lcId
		
			CASE lcActiune = "DELETE"
		
				lcSql = [delete ] + gcS + [.coresp_tip_cont where id_coresp_tip_cont=]+lcid
		
		ENDCASE
		this.csql = lcSql 
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_fdoc AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_fdoc"
	*</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_fdoc"
			lcamp = "nom_fdoc.id_fdoc"
			lclook = gcS + ".act"
			lclookid = "act.id_fdoc"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcfdoc = Nvl(STRTRAN(Alltrim(Upper(toRec.fel_document)),['],['']),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")
			lcTip = Nvl(STRTRAN(Alltrim(Upper(toRec.tip_doc)),['],['']),"")
			lcPaymentCode = ALLTRIM(NVL(toRec.PaymentCode,''))
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO nom_fdoc (fel_document, tip_doc, inactiv, paymentcode) VALUES ('] + lcfdoc + [','] + lcTip + [',] + lcinactiv + [,'] + m.lcPaymentCode + [')]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE nom_fdoc SET fel_document = '] + lcfdoc + [', tip_doc = '] + lcTip + [', inactiv =] + lcinactiv + [, paymentcode = '] + m.lcPaymentCode + [' where id_fdoc = ] + lcId
		
			Case lcActiune = "DELETE"
			
		*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
				lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_gestiuni AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_gestiuni"
	*</PropValue>
	
	PROCEDURE make_sql
		*!* 22.02.2010
		*!* marius.mutu
		*!* lcid_sucursala caracter in loc de numeric
		
		*!* 23.02.2010
		*!* marius.mutu
		*!* + lcid_sectie
		
		*!* 22.02.2010
		*!* marius.mutu
		*!* +lcacont_cheltuiala, lcacont_adaos
		
		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
		
		Local lcid_sectie, lcacont_cheltuiala, lcacont_adaos
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
			*!*	ROADEF	v 2.0.16
			*!*		lcnom = gcS + ".nom_gestiuni"
			*!*		lcamp = "nom_gestiuni.id_gestiune"
			*!*		lclook = gcS + ".act"
			*!*		lclookid1 = "act.id_gestin"
			*!*		lclookid2 = "act.id_gestout"
			*!*	ROADEF	v 2.0.16	^
		Endif
		
		If Inlist(lcActiune, "UPDATE",'DELETE')
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcsectie = Nvl(Strtran(Alltrim(Upper(toRec.nume_gestiune)),['],['']),"")
			lcgest = Nvl(Upper(Alltrim(toRec.cgest)),"")
			lcont = Nvl(Alltrim(toRec.Cont),"")
			lnr_pag = Nvl(Alltrim(Str(toRec.nr_pag)),"")
			lacont = Nvl(Alltrim(toRec.acont),"")
			****** modificare v 2.0.13
			*!*	lcid_sucursala = Nvl(ALLTRIM(STR(toRec.id_sucursala)),[NULL])
			****** modificare v 2.0.13^
			lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)),"")
			*!* 22.02.2010
			lcid_sucursala = Iif(Isnull(toRec.id_sucursala), "NULL", Alltrim(Str(toRec.id_sucursala)))
			lcid_responsabil = Iif(Isnull(toRec.id_responsabil), "NULL", Alltrim(Str(toRec.id_responsabil)))
			*!* 22.02.2010 ^
			*!* 23.02.2010
			lcid_sectie = Iif(Isnull(toRec.id_sectie), "NULL", Alltrim(Str(toRec.id_sectie)))
			*!* 23.02.2010 ^
			*!* 24.02.2010
			lcacont_cheltuiala = Alltrim(Nvl(toRec.acont_cheltuiala,""))
			lcacont_adaos = Alltrim(Nvl(toRec.acont_adaos,""))
			*!* 24.02.2010 ^
			lcid_lucrare = Iif(Isnull(toRec.id_lucrare), "NULL", Alltrim(Str(toRec.id_lucrare)))
			lcGestionar = Upper(Alltrim(NVL(toRec.gestionar, "")))
			lcReceptie1 = Upper(Alltrim(NVL(toRec.comisie_receptie1, "")))
			lcReceptie2 = Upper(Alltrim(NVL(toRec.comisie_receptie2, "")))
			lcReceptie3 = Upper(Alltrim(NVL(toRec.comisie_receptie3, "")))			
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql = [begin pack_def.adauga_gestiune('] + lcsectie + [','] + lcgest + [','] + lcont + [',] + lnr_pag + [,] + ;
					['] + lacont +  [',] + lcinactiv +[,]+lcid_sucursala+ [,] + lcid_responsabil + [,] + lcid_sectie + ;
					[,'] + lcacont_cheltuiala +  [','] + lcacont_adaos + [',] + lcid_lucrare + [,'] + lcGestionar + [','] + lcReceptie1 + [','] + lcReceptie2 + [','] + lcReceptie3 + ['); end;]
		
			Case lcActiune = "UPDATE"
				lcSql = [begin pack_def.modifica_gestiune(] + lcId + [,'] + lcsectie + [','] + lcgest + [','] + lcont + ['] + ;
					[,] + lnr_pag + [,'] + lacont + [',] + lcinactiv +[,]+lcid_sucursala + [,] + lcid_responsabil + [,] + lcid_sectie + ;
					[,'] + lcacont_cheltuiala +  [','] + lcacont_adaos + [',] + lcid_lucrare + [,'] + lcGestionar + [','] + lcReceptie1 + [','] + lcReceptie2 + [','] + lcReceptie3 + ['); end;]
			Otherwise
				*!*	ROADEF	v 2.0.16
				*!*		lcSql = [begin nomdelproc2('] + lcnom + [','] + lcamp + [',] + lcId + [,'] + lclook + [','] + lclookid1 + [','] + lclook + [','] + lclookid2 + ['); end;]
				lcSql = [begin pack_def.sterge_gestiune(] + lcId + [,?gnIdUtil); end;]
				*!*	ROADEF	v 2.0.16	^
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_judet AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_judet"
	*</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 = "syn_nom_judete"
		*!*		lcamp = "syn_nom_judete.id_judet"
		*!*		lclook = "syn_nom_localitati"
		*!*		lclookid = "nom_localitati.id_judet"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcjud = Nvl(STRTRAN(Alltrim(Upper(toRec.judet)),['],['']),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
			lcindicativ = Nvl(ALLTRIM(toRec.indicativ),"")		
			lcidtara = NVL(ALLTRIM(STR(toRec.id_tara)),"")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		*!*			lcSql = [INSERT INTO ] + gcS + [.nom_judete (judet,indicativ,inactiv) VALUES ('] + lcjud + [','] + lcindicativ + [', ] + lcinactiv + [)]
				lcSql = [begin syn_pack_def_co.adauga_judet(']+lcjud+[',']+lcindicativ+[',]+lcidtara+[,]+lcinactiv+[);end;]
			Case lcActiune = "UPDATE"
		*!*			lcSql = [UPDATE ] + gcS + [.nom_judete SET judet = '] + lcjud + [',indicativ = '] + lcindicativ + [',inactiv = ] + lcinactiv + [ where id_judet = ] + lcId
				lcSql = [begin syn_pack_def_co.modifica_judet(]+lcId+[,']+lcjud+[',']+lcindicativ+[',]+lcidtara+[,]+lcinactiv+[);end;]
			Case lcActiune = "DELETE"
		*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
		*!*			lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
				lcSql = [begin syn_pack_def_co.sterge_judet(]+lcid+[);end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_localitati AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_localitati"
	*</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_localitati"
		*!*		lcamp = "nom_localitati.id_loc"
		*!*		lclook = gcS + ".nom_parteneri"
		*!*		lclookid = "nom_parteneri.id_loc"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcloc = Nvl(STRTRAN(Alltrim(Upper(toRec.localitate_s)),['],['']),"")
			lcid_judet = Nvl(ALLTRIM(STR(toRec.id_judet)),"NULL")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"0")	
			lcSiruta = Nvl(ALLTRIM(STR(toRec.siruta)),"NULL")	
			lcIdTara = NVL(ALLTRIM(STR(toRec.id_tara)),"NULL")
			lcExplicatie = NVL(ALLTRIM(toRec.explicatie),"")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		*!*			lcSql = [INSERT INTO ] + gcS + [.nom_localitati (localitate,id_judet,siruta,inactiv) VALUES ('] + lcloc + [',] + lcid_judet + [,] + lcSiruta + [,] + lcinactiv + [)]
		 		lcSql = [begin syn_pack_def_co.adauga_localitate(']+lcLoc+[',']+lcExplicatie+[',]+lcIdTara+[,]+lcid_judet+[,]+lcSiruta+[,]+;
		 			lcInactiv+[); end;]
			Case lcActiune = "UPDATE"
		*!*			lcSql = [UPDATE ] + gcS + [.nom_localitati SET localitate = '] + lcloc +[',id_judet = ] + lcid_judet + [,siruta=] + lcSiruta + [,inactiv = ] + lcinactiv + [ where id_loc = ] + lcId
		 		lcSql = [begin syn_pack_def_co.modifica_localitate(]+lcId+[,']+lcLoc+[',']+lcExplicatie+[',]+lcIdTara+[,]+lcid_judet+[,]+;
		 			lcSiruta+[,]+lcInactiv+[); end;]
			Case lcActiune = "DELETE"
		*!*	*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
		*!*			lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		 		lcSql = [begin syn_pack_def_co.sterge_localitate(]+lcId+[); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_lucrari AS _cusodatabase OF "..\..\..\roagest\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_lucrari"
	*</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_lucrari"
			lcamp = "id_lucrare"
			lclook = gcS + ".act"
			lclookid = "id_lucrare"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcnrord = Nvl(STRTRAN(Alltrim(Upper(toRec.nrord)),['],['']),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
			IF EMPTY(toRec.id_tata) OR ISNULL(toRec.id_tata)
				lcParentId = "NULL"
			ELSE 	
				lcParentId = NVL(TRANSFORM(toRec.id_tata),"NULL")
			ENDIF 		
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql = [begin ] + gcS + [.pack_def.adauga_lucrare('] + lcnrord + [',] + lcParentId + [,] + lcinactiv +[); end;]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [begin ] + gcS + [.pack_def.modifica_lucrare(] + lcId + [,'] + lcnrord + [',] + lcParentId + [,] + lcinactiv + [); end;]
		
			Case lcActiune = "DELETE"
			
				lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_medii_transmisie AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_medii_transmisie"
	*</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 = "nom_medii_transmisie"
			lcamp = "nom_medii_transmisie.id_mediu"
			lclook = ""
			lclookid = ""
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcMediu_transmisie = Nvl(STRTRAN(Alltrim(Upper(toRec.mediu_transmisie)),['],['']),"")
			*lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")
		
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO nom_medii_transmisie (mediu_transmisie) VALUES ('] + lcMediu_transmisie + [')]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE nom_medii_transmisie SET mediu_transmisie = '] + lcMediu_transmisie + [' where id_mediu = ] + lcId
		
			Case lcActiune = "DELETE"
			
				lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_parteneri AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Height = 18
		Name = "cus_odata_parteneri"
		Width = 18
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec, tnId
		
		Local lcActiune, lcBanca, lcCod_fiscal, lcCod_fiscal2, lcCont_Banca, lcCorespDel, lcDenumire, lcId
		Local lcIdString, lcId_categ_ent, lcId_loc_inreg, lcId_util, lcMotiv_inactiv, lcNume, lcPrefix
		Local lcPrenume, lcReg_comert, lcSql, lcSufix, lcTip_persoana, lcamp, lcinactiv, lclook, lcnom
		LOCAL lcSwiftBanca, lcAdresaBanca, lcInstitutiePublica
		PRIVATE pnIdPart
		pnIdPart = IIF(!EMPTY(NVL(tnId,0)), m.tnId, 0)
		lcActiune = Alltrim(This.cActiune)
		lcId_util = Alltrim(Str(gnidutil))
		lcDenumire = ''
		lcNume = ''
		lcPrenume = ''
		lcCod_fiscal = ''
		lcCod_fiscal2 = ''
		lcReg_comert = ''
		lcId_loc_inreg = 'NULL'
		lcId_categ_ent = 'NULL'
		lcPrefix = ""
		lcSufix = ""
		lcTip_persoana = "0"
		lcBanca = ""
		lcCont_Banca = ""
		lcinactiv = "0"
		lcMotiv_inactiv = ""
		lcIdString = ""
		lcCorespDel = ""
		lcSwiftBanca = ""
		lcAdresaBanca = ""
		lcInstitutiePublica = "0"
		lcId = ALLTRIM(STR(m.pnIdPart))
		
		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_parteneri"
		*!*		lcamp = "id_part"
		*!*		lclook = "vact.id_partd;vact.id_partc"
		*!*	Endif
		
		If Inlist(lcActiune, "UPDATE", 'INSERT')
			lcDenumire = Nvl(Strtran(Alltrim(Upper(toRec.denumire)), ['], ['']), "")
			lcCod_fiscal = Nvl(Alltrim(Upper(toRec.cod_fiscal)), "")
			If Pemstatus(toRec, 'nume', 5)
				lcNume = Nvl(Strtran(Alltrim(Upper(toRec.Nume)), ['], ['']), "")
			Endif
			If Pemstatus(toRec, 'prenume', 5)
				lcPrenume = Nvl(Strtran(Alltrim(Upper(toRec.Prenume)), ['], ['']), "")
			Endif
			If Empty(m.lcNume)
				lcNume = m.lcDenumire
				lcPrenume = ''
			Endif
			If Pemstatus(toRec, 'cod_fiscal2', 5)
				lcCod_fiscal2 = Nvl(Alltrim(Upper(toRec.cod_fiscal2)), "")
			Endif
			If Pemstatus(toRec, 'reg_comert', 5)
				lcReg_comert = Nvl(Alltrim(Upper(toRec.reg_comert)), "")
			Endif
			If Pemstatus(toRec, 'id_loc_inreg', 5)
				lcId_loc_inreg = Iif(Nvl(toRec.id_loc_inreg, 0) = 0, 'NULL', Alltrim(Str(toRec.id_loc_inreg)))
			Endif
			If Pemstatus(toRec, 'id_categorie_entitate', 5)
				lcId_categ_ent = Iif(Nvl(toRec.id_categorie_entitate, 0) = 0, 'NULL', Alltrim(Str(toRec.id_categorie_entitate)))
			Endif
			If Pemstatus(toRec, 'prefix', 5)
				lcPrefix = Nvl(Alltrim(Upper(toRec.prefix)), "")
			Endif
			If Pemstatus(toRec, 'sufix', 5)
				lcSufix = Nvl(Alltrim(Upper(toRec.sufix)), "")
			Endif
			If Pemstatus(toRec, 'tip_persoana', 5)
				lcTip_persoana = Nvl(Alltrim(Str(toRec.tip_persoana)), "0")
			Endif
			If Pemstatus(toRec, 'banca', 5)
				lcBanca = Nvl(Alltrim(Upper(toRec.Banca)), "")
			Endif
			If Pemstatus(toRec, 'cont_banca', 5)
				lcCont_Banca = Nvl(Alltrim(Upper(toRec.Cont_Banca)), "")
			Endif
			If Pemstatus(toRec, 'inactiv', 5)
				lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)), "0")
			Endif
			If Pemstatus(toRec, 'motiv_inactiv', 5)
				lcMotiv_inactiv = Nvl(Alltrim(Upper(toRec.motiv_inactiv)), "")
			Endif
			If Pemstatus(toRec, 'tip_partener', 5)
				lcIdString = Nvl(Alltrim(Upper(Transform(toRec.tip_partener))), "")
				If(Right(lcIdString, 1) # ';')
					lcIdString = lcIdString + ";"
				Endif
			Endif
			If Pemstatus(toRec, 'ccorespdel', 5)
				lcCorespDel = Nvl(Alltrim(toRec.ccorespdel), "")
			Endif
			If Pemstatus(toRec, 'swift_banca', 5)
				lcSwiftBanca = Nvl(Alltrim(toRec.swift_banca), "")
			Endif
			If Pemstatus(toRec, 'adresa_banca', 5)
				lcAdresaBanca = Nvl(Alltrim(toRec.adresa_banca), "")
			Endif
			If Pemstatus(toRec, 'institutie_publica', 5)
				lcInstitutiePublica = Nvl(Alltrim(Str(toRec.institutie_publica)), "0")
			Endif
		
		Endif
		
		
		Do Case
			Case Inlist(lcActiune, "INSERT", "UPDATE")
				lcSql = [begin pack_def.adauga_modifica_partener(?@pnIdPart, '] + lcDenumire + [','] + lcNume + [','] + lcPrenume + [','] + lcCod_fiscal + [','] + lcCod_fiscal2 + [','] + ;
					lcReg_comert + [',] + lcId_loc_inreg + [,] + lcId_categ_ent + [,'] + lcPrefix + [','] + lcSufix + [',] + ;
					lcTip_persoana + [,'] + lcBanca + [','] + lcCont_Banca + [',] + lcinactiv + [,'] + lcMotiv_inactiv + [',] + ;
					lcId_util + [,'] + lcIdString + [','] + lcCorespDel + [','] + lcSwiftBanca + [','] + lcAdresaBanca + [',] + m.lcInstitutiePublica + [); end;]
			Case lcActiune = "DELETE"
				lcSql = [begin pack_def.sterge_partener(] + lcId + [,] + lcId_util + [); end;]
		Endcase
		This.csql = lcSql
		*STRTOFILE(lcsql,'c:\sql.txt')
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_parteneri_2 AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		lsilent = .F.
		Name = "cus_odata_parteneri_2"
	*</PropValue>
	
	PROCEDURE make_sql
		LPARAMETERS toRec,tnId
		
		lcActiune = ALLTRIM(THIS.cActiune)
		lcId_util = ALLTRIM(STR(gnidutil))
		
		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_parteneri"
			lcamp = "id_part"
			lclook = "vact.id_partd;vact.id_partc"
		ENDIF 
		
		IF INLIST(lcActiune, "UPDATE",'INSERT')
		    lcDenumire = NVL(STRTRAN(ALLTRIM(UPPER(toRec.denumire)),['],['']),"")
			lcNume = NVL(STRTRAN(ALLTRIM(UPPER(toRec.Nume)),['],['']),"")
			lcPrenume = NVL(STRTRAN(ALLTRIM(UPPER(toRec.Prenume)),['],['']),"")
			lcCod_fiscal = NVL(ALLTRIM(UPPER(toRec.cod_fiscal)),"")
			lcReg_comert = NVL(ALLTRIM(UPPER(toRec.reg_comert)),"")	
			lcId_loc_inreg = Nvl(ALLTRIM(STR(toRec.id_loc_inreg)),[NULL])
			IF lcId_loc_inreg = '0'
				lcId_loc_inreg = 'NULL'
			ENDIF 
			lcId_categ_ent = NVL(ALLTRIM(STR(toRec.id_categorie_entitate)),[NULL])
			IF lcId_categ_ent = '0'
				lcId_categ_ent = 'NULL'
			ENDIF 
			lcPrefix = NVL(ALLTRIM(UPPER(toRec.prefix)),"")
			lcSufix = NVL(ALLTRIM(UPPER(toRec.sufix)),"")
			*IF thisform.op
			lcTip_persoana = Nvl(ALLTRIM(STR(toRec.tip_persoana)),"0")
			
			lcBanca = NVL(ALLTRIM(UPPER(toRec.Banca)),"")	
			lcCont_Banca = NVL(ALLTRIM(UPPER(toRec.Cont_Banca)),"")	
			
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"0")
			lcMotiv_inactiv = NVL(ALLTRIM(UPPER(toRec.motiv_inactiv)),"")
			
			lcIdString = NVL(ALLTRIM(UPPER(toRec.tip_partener)),"")
			lcCorespDel = NVL(ALLTRIM(toRec.ccorespdel),"")
		ENDIF 
			
		
		DO CASE
			CASE lcActiune = "INSERT"
				lcSql = [begin pack_def.adauga_partener(']+lcDenumire+[',']+lcNume+[',']+lcPrenume+[',']+lcCod_fiscal+[',']+;
					lcReg_comert+[',]+lcId_loc_inreg+[,]+lcId_categ_ent +[,']+lcPrefix+[',']+lcSufix+[',]+;
					lcTip_persoana+[,']+lcBanca+[',']+lcCont_banca+[',]+lcInactiv+[,']+lcMotiv_inactiv+[',]+;
					lcId_util+[,']+lcIdString+[',']+lcCorespDel+[',?@pnIdPart); end;]
			
			CASE lcActiune = "UPDATE"
				lcSql = [begin pack_def.modifica_partener(]+lcId+[,']+lcDenumire+[',']+lcNume+[',']+lcPrenume+[',']+;
					lcCod_fiscal+[',']+lcReg_comert+[',]+lcId_loc_inreg+[,]+lcId_categ_ent +[,']+lcPrefix+[',']+;
					lcSufix+[',]+lcTip_persoana+[,']+lcBanca+[',']+lcCont_banca+[',]+lcInactiv+[,']+lcMotiv_inactiv+;
					[',]+lcId_util+[,']+lcIdString+[',']+lcCorespDel+['); end;]
			
			CASE lcActiune = "DELETE"
				lcSql = [begin pack_def.sterge_partener(] + lcId+ [,]+lcId_util + [); end;]
		ENDCASE
		this.csql = lcSql 
		*STRTOFILE(lcsql,'c:\sql.txt')
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_parteneri_adrese AS _cusodatabase OF "_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_adrese"
	*</PropValue>
	
	PROCEDURE make_sql
		LPARAMETERS toRec,tnId
		
		lcActiune = ALLTRIM(THIS.cActiune)
		lcId_util = ALLTRIM(STR(gnidutil))
		
		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))
		ENDIF
		
		IF INLIST(lcActiune, "UPDATE",'INSERT')
			lcDenumire_adresa = NVL(ALLTRIM(UPPER(toRec.denumire_adresa)),"")
			lcDA_apare = ALLTRIM(STR(toRec.da_apare))
			lcStrada = NVL(ALLTRIM(UPPER(toRec.strada)),"")
			lcNumar = NVL(ALLTRIM(UPPER(toRec.numar)),"")
		
			lcBloc = NVL(ALLTRIM(UPPER(toRec.BLOC)),"")
			lcScara = NVL(ALLTRIM(UPPER(toRec.scara)),"")
			lcApart = NVL(ALLTRIM(UPPER(toRec.apart)),"")
			lcEtaj = NVL(ALLTRIM(toRec.etaj),"")
			lcId_loc = NVL(ALLTRIM(STR(toRec.Id_loc)),"NULL")
			lcLocalitate = ALLTRIM(toRec.localitate)
			lcId_Judet = NVL(ALLTRIM(STR(toRec.Id_judet)),"NULL")
			lcCodpostal = NVL(ALLTRIM(STR(toRec.codpostal)),"NULL")
			lcId_tara =  NVL(ALLTRIM(STR(toRec.Id_tara)),"NULL")
			lcTelefon1 = NVL(ALLTRIM(UPPER(toRec.Telefon1)),"")
			lcTelefon2 = NVL(ALLTRIM(UPPER(toRec.Telefon2)),"")
			lcFax = NVL(ALLTRIM(UPPER(toRec.fax)),"")
			lcEmail = NVL(ALLTRIM(toRec.email),"")
			lcWeb = NVL(ALLTRIM(toRec.web),"")
			lcPrincipala = NVL(ALLTRIM(STR(toRec.principala)),"0")
			lcinactiv = NVL(ALLTRIM(STR(toRec.inactiv)),"0")
			lcIdPart = NVL(ALLTRIM(STR(toRec.id_part)),"")
			IF lcId_Judet = "0"
				lcId_Judet = 'NULL'
			ENDIF
			IF lcId_tara = "0"
				lcId_tara = 'NULL'
			ENDIF
			IF lcId_loc = "0"
				lcId_loc = 'NULL'
			ENDIF
		ENDIF
		
		DO CASE
			CASE lcActiune = "INSERT"
				lcSql = [begin pack_def.adauga_adresa_partener2(]+lcIdPart + [,']+ lcDenumire_adresa+[',] + lcDA_apare + [,] + ;
					[']+lcStrada+[',']+lcNumar + [','] +;
					lcBloc+[',']+lcScara+[',']+lcApart+[',']+lcEtaj+[',]+lcId_loc+[,']+lcLocalitate+[',]+lcId_Judet+[,]+lcCodpostal+[,]+lcId_tara+[,']+;
					lcTelefon1+[',']+lcTelefon2+[',']+lcFax+[',']+lcEmail+[',']+lcWeb+[',]+;
					lcPrincipala+[,]+lcinactiv+[,]+lcId_util+[,?@pnIdAdresa); end;]
		
			CASE lcActiune = "UPDATE"
				lcSql = [begin pack_def.modifica_adresa_partener2(]+lcId+[,']+lcDenumire_adresa+[',] + lcDA_apare + [,] + ;
					[']+lcStrada+[',']+lcNumar + [','] +;
					lcBloc+[',']+lcScara+[',']+lcApart+[',']+lcEtaj+[',]+lcId_loc+[,']+lcLocalitate+[',]+lcId_Judet+[,]+lcCodpostal+[,]+lcId_tara+[,']+;
					lcTelefon1+[',']+lcTelefon2+[',']+lcFax+[',']+lcEmail+[',']+lcWeb+[',]+;
					lcPrincipala+[,]+lcinactiv+[,]+lcId_util+[); end;]
		
			CASE lcActiune = "DELETE"
				lcSql = [begin pack_def.sterge_adresa_partener(]+lcId+[,]+lcId_util+[); end;]
		ENDCASE
		
		THIS.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_pers_contact AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_pers_contact"
	*</PropValue>
	
	PROCEDURE make_sql
		LPARAMETERS toRec,tnId
		
		lcActiune = ALLTRIM(THIS.cActiune)
		lcId_util = ALLTRIM(STR(gnidutil))
		
		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))
		ENDIF 
		
		IF INLIST(lcActiune, "UPDATE",'INSERT')
			lcNume = NVL(ALLTRIM(UPPER(toRec.nume)),"")
			lcPrenume = NVL(ALLTRIM(UPPER(toRec.prenume)),"")
		
			lcApelativ = NVL(ALLTRIM(UPPER(toRec.apelativ)),"")
			lcFunctia = NVL(ALLTRIM(UPPER(toRec.functia)),"")
			
			lcTelefon = NVL(ALLTRIM(UPPER(toRec.telefon)),"")
			lcEmail = NVL(ALLTRIM(UPPER(toRec.email)),"")
			
			lcPrincipal = NVL(ALLTRIM(STR(toRec.principal)),"0")
			lcInactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"0")
		ENDIF 
			
		
		*!*	DO CASE
		*!*		CASE lcActiune = "INSERT"
		*!*			lcSql = [begin nompartinsproc(']+gcS+[',']+LCNUME+[',']+lcCod_fiscal+[',']+lcReg_comert+[',']+lcAdresa+[',]+ALLTRIM(STR(lcId_loc))+[,']+lcBloc+[',']+lcScara+[',']+lcApartament+[',']+lcTelefon+[',']+lcBanca+[',']+lcCont_banca+[',']+lcZona+[',]+lcInactiv+[,']+lcIdString+[') ;end;]
		
		*!*		CASE lcActiune = "UPDATE"
		*!*			lcSql = [begin nompartmodproc(']+gcS+[',]+lcunid+[,']+LCNUME+[',']+lcCod_fiscal+[',']+lcReg_comert+[',']+lcAdresa+[',]+ALLTRIM(STR(lcId_loc))+[,']+lcBloc+[',']+lcScara+[',']+lcApartament+[',']+lcTelefon+[',']+lcBanca+[',']+lcCont_banca+[',']+lcZona+[',]+lcInactiv+[,']+lcIdString+[') ;end;]
		*!*		
		*!*		CASE lcActiune = "DELETE"
		*!*			lcSql = [begin NOMDELPROCN('] + GCS + [','] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + ['); end;]
		*!*	ENDCASE
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin pack_def.adauga_pers_contact(]+ALLTRIM(STR(pnId_part)) + [,']+ lcNume+[',']+lcPrenume+[',']+lcApelativ+ [','] +;
				lcFunctia+[',']+lcTelefon+[',']+lcEmail+[',]+lcPrincipal+[,]+lcInactiv+[,]+lcId_util+[); end;]
		
		Case lcActiune = "UPDATE"
			lcSql = [begin pack_def.modifica_pers_contact(]+lcId+[,']+ lcNume+[',']+lcPrenume+[',']+lcApelativ+ [','] +;
				lcFunctia+[',']+lcTelefon+[',']+lcEmail+[',]+lcPrincipal+[,]+lcInactiv+[,]+lcId_util+[); end;]
				
		Case lcActiune = "DELETE"
			lcSql = [begin pack_def.sterge_pers_contact(]+lcId+[,]+lcId_util+[); end;]
		ENDCASE
		
		this.csql = lcSql 
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_plcont AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_plcont"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec, tnId
		
		*!* 03.01.2006
		*!* MARIUS.MUTU - MODIFICAT lcLookupFields sa caute in BAL si BALANA
		
		Local lan, lcActiune, lcId, lcIdField, lcLookupFields, lcLookupValue, lcLookupValueType, lcSchema
		Local lcSql, lcTable, lcacont, lcCod, lcexpl, lcexpls, lcinactiv, lcnefolosit
		Local lcont, lcont_alt, lnIdValue, ltipc, ltips
		Local lcContAlt
		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')
			lcSchema = gcS
			lcTable = [plcont]
			lcIdField = [id_plcont]
			lnIdValue = tnId
			*!*		lcLookupFields = [ACT.SCD || ''.'' || NVL(ASCD,''XXXX'');ACT.SCC || ''.'' || NVL(ASCC,''XXXX'')]
			lcLookupFields = [BAL.CONT || ''.XXXX'';BALANA.CONT || ''.'' || NVL(ACONT,''XXXX'')]
			lcLookupValue = [CONT || ''.'' || NVL(ACONT,''XXXX'')]
			lcLookupValueType = [C]
			lcId = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE", 'INSERT')
			lcexpl = Nvl(Strtran(Alltrim(Upper(toRec.explicatie)), ['], ['']), "")
			lcacont = Nvl(Alltrim(toRec.acont), "")
			lcont = Nvl(Alltrim(toRec.Cont), "")
			lcContAlt = Nvl(Alltrim(toRec.cont_alt), "")
			lcCod = Nvl(Alltrim(toRec.cod), "")
			ltips = Nvl(Alltrim(toRec.tip_sold), "")
			lan = Nvl(Alltrim(Str(toRec.an)), "")
			ltipc = Nvl(Alltrim(Str(toRec.tip_cont)), "")
			lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)), "")
			lcnefolosit = Nvl(Alltrim(Str(toRec.nefolosit)), "")
			lcexpls = Nvl(Strtran(Alltrim(Upper(toRec.explicaties)), ['], ['']), "")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.plcont (explicatie,acont,cont,tip_sold,an,tip_cont,inactiv,nefolosit,explicaties, cont_alt, cod) VALUES ('] + ;
					lcexpl + [','] + lcacont + [','] + lcont + [','] + ltips + [',] + lan + [,] + ltipc + [,] + lcinactiv + [,] + lcnefolosit + [,'] + lcexpls + [','] + lcContAlt + [','] + lcCod + [')]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.plcont SET explicatie = '] + lcexpl + ;
					[',acont = '] + lcacont + [',cont ='] + lcont + [',tip_sold ='] + ltips + [',an =] + lan + [,tip_cont =] + ltipc + [,inactiv = ] + lcinactiv  + ;
					[,nefolosit = ] + lcnefolosit + [,explicaties = '] + lcexpls  + [',] + ;
					[cont_alt ='] + lcContAlt + [',cod = '] + m.lcCod + ['] + ;
					[ where id_plcont = ] + lcId
		
			Case lcActiune = "DELETE"
				*!*			lcsql = [delete from ]+gcs+[.plcont where id_plcont=]+lcid
				lcSql = [begin pack_nomenclatoare.nomdelete('] + lcSchema + [','] + lcTable + ;
					[','] + lcIdField + [',] + Transform(lnIdValue) + [,'] + lcLookupFields + [','] + lcLookupValue + ;
					[','] + lcLookupValueType + ['); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_proiecte AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_proiecte"
	*</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_proiect = Alltrim(Str(tnId))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcIdTipmodel = Iif(Empty(Nvl(toRec.id_modelproiect,0)),[NULL],Alltrim(Str(toRec.id_modelproiect)))
			lcIndicativ = Alltrim(toRec.indicativ)
			lcDenumire = Nvl(Alltrim(toRec.denumire),[null])
			lcDescriere = Nvl(Alltrim(toRec.descriere),[null])
			lcId_Part = Iif(Empty(Nvl(toRec.id_part,0)),[NULL],Alltrim(Str(toRec.id_part)))
			lcId_Responsabil = Iif(Empty(Nvl(toRec.id_responsabil,0)),[NULL],Alltrim(Str(toRec.id_responsabil)))
		
			lcData_proiect = IIF(EMPTY(NVL(torec.data_proiect,{})),[NULL],[to_date(']+DTOS(torec.data_proiect)+[','YYYYMMDD')])
			
		Endif
		
		Do Case
		Case lcActiune = "INSERT"
		     lcSql = [begin pack_contracte.adauga_proiect_din_tipuri(]+lcIdTipmodel+[,']+lcIndicativ+[',']+;
		                           lcDenumire+[',']+lcDescriere+[',]+lcId_Part +[,?gnIdUtil,]+lcData_proiect +[,]+;
		                           lcId_Responsabil +[ );end;]
		
		*!*		lcSql = [begin pack_contracte.adauga_proiect_din_tipuri('] + lcIndicativ + [','] + lcDenumire + [',] + ;
		*!*			['] + lcDescriere + [',] + lcId_Part +[,?gnIdUtil,] + lcData_proiect + [); end;]
		Case lcActiune = "UPDATE"
			lcSql = [begin pack_contracte.modifica_proiect(] + lcId_proiect + [,'] + lcIndicativ + [','] + lcDenumire + [',] + ;
				['] + lcDescriere + [',] + lcId_Part + [,?gnIdUtil,] + lcData_proiect + [); end;]
		Case lcActiune = "DELETE"
			lcSql = [begin pack_contracte.sterge_proiect(] + lcId_proiect + [,?gnIdUtil); end;]
		ENDCASE
		
		This.csql = lcSql
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_responsabili AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_responsabili"
	*</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_responsabili"
			lcamp = "nom_responsabili.id_responsabil"
			lclook = gcS + ".act"
			lclookid = "act.id_responsabil"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcIdPart = ALLTRIM(STR(toRec.id_responsabil))
		*!*		lcdenumire = NVL(UPPER(ALLTRIM(toRec.nume)),"")
		*!*		lcnume = SUBSTR(lcdenumire,1,AT(" ",lcdenumire,1)-1)
		*!*		lcprenume = SUBSTR(lcdenumire,AT(" ",lcdenumire,1)+1)
		*!*		lcfunct = NVL(UPPER(ALLTRIM(toRec.functie)),"")
		*!*		lcales = NVL(ALLTRIM(STR(toRec.ales)),"")
		*!*		lcinactiv = NVL(ALLTRIM(STR(toRec.inactiv)),"")
		Endif
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql=[begin pack_def.adauga_responsabil(]+lcIdPart+[); end;]
		*!*			lcSql = [INSERT INTO ] + gcS + [.nom_responsabili (nume,functie,ales,inactiv,ID_UTIL) VALUES ('] + lcnume + ;
		*!*					[','] + lcfunct + [',] + lcales + [,] + lcinactiv + [,?gnIdUtil)]
		
			Case lcActiune = "UPDATE"
		
		*!*			lcSql = [UPDATE ] + gcS + [.nom_responsabili SET nume = '] + lcnume + ;
		*!*					[',functie = '] + lcfunct + [',ales = ] + lcales + [,inactiv = ] + lcinactiv +;
		*!*					[, id_util = ?gnIdUtil ] +;
		*!*					[ where id_responsabil = ] + lcId 
		
			Case lcActiune = "DELETE"
			
		*!*			lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
			
		Endcase
		
		This.csql = lcSql
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_sectii AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_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_sectii"
			lcamp = "id_sectie"
			lclook = gcS + ".act"
			lclookid = "id_sectie"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcsectie = Nvl(STRTRAN(Alltrim(Upper(toRec.sectie)),['],['']),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
			lccsectie = Nvl(ALLTRIM(toRec.csectie),"")		
			lcIdSucursala = Iif(IsNull(toRec.id_sucursala),[NULL],ALLTRIM(STR(toRec.id_sucursala)))	&&	modificare ROADEF v 2.0.4
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql = [begin pack_def.adauga_sectie('] + lcsectie + [',] + lcinactiv +[,'] + lccsectie + [',] + lcIdSucursala + [); end;]
		*!*			lcSql = [INSERT INTO ] + gcS + [.nom_sectii (sectie,inactiv,csectie) VALUES ('] + lcsectie + [',] + lcinactiv +[,'] + lccsectie + [')]
		
			Case lcActiune = "UPDATE"
				lcSql = [begin pack_def.modifica_sectie(] + lcId + [,'] + lcsectie + [',] + lcinactiv + [,'] +lccsectie + [',] + lcIdSucursala + [); end;]
		*!*			lcSql = [UPDATE ] + gcS + [.nom_sectii SET sectie = '] + lcsectie + [',inactiv = ] + lcinactiv + [ ,csectie = '] +lccsectie + [' where id_sectie = ] + lcId
		
			Case lcActiune = "DELETE"
			
		*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
				lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		*!*	STRTOFILE(LCSQL,'C:\DELETE.SQL')
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_sucursale AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_sucursale"
	*</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_sucursale"
			lcamp = "id_sucursala"
			lclook = gcS + ".act"
			lclookid = "id_sucursala"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcsucursala = Nvl(STRTRAN(Alltrim(Upper(toRec.sucursala)),['],['']),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.nom_sucursale (sucursala,inactiv) VALUES ('] + lcsucursala + [',] + lcinactiv + [)]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.nom_sucursale SET sucursala = '] + lcsucursala + [',inactiv = ] + lcinactiv + [ where id_sucursala = ] + lcId
		
			Case lcActiune = "DELETE"
			
		*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
				lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		*!*	STRTOFILE(LCSQL,'C:\DELETE.SQL')
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_tipuri_ctr AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_tipuri_ctr"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		
		lcActiune = Alltrim(This.cActiune)
		lcId_util = Alltrim(Str(gnIdUtil))
		
		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))
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcDenumire = Strtran(Alltrim(toRec.denumire_tip),['],[''])
			lcId_tata = Alltrim(STR(NVL(toRec.id_tata,'0')))
		ENDIF
		
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin pack_nomenclatoare.adauga_tip_ctr('] + lcDenumire + [',]+ lcId_tata +[,]+lcId_util+[); end;]
		
		Case lcActiune = "UPDATE"
			lcSql = [begin pack_nomenclatoare.modifica_tip_ctr(]+lcId +[,']+lcDenumire + [',]+ lcId_tata +[,]+lcId_util+[); end;]
		
		Case lcActiune = "DELETE"
			* lcSql = [begin pack_nomenclatoare.sterge_tip_ctr(]+lcId+[,]+lcId_util+[); end;]
			lcSql = [begin pack_nomenclatoare.sterge_tip_ctr(]+lcId+[); end;]
		
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_tipuri_parteneri AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<DefinedPropArrayMethod>
		*p: cid
		*p: csql1
		*p: csql2
		*p: csql3
	*</DefinedPropArrayMethod>

	*<PropValue>
		cid = 0
		csql1 = 
		csql2 = 
		csql3 = 
		Name = "cus_odata_tipuri_parteneri"
	*</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))
			this.cId = lcId
			lcnom = gcS + ".nom_tip_parteneri"
			lcamp = "nom_tip_parteneri.id_tip_part"
		
		ENDIF 
		
		
		IF INLIST(lcActiune, "UPDATE",'INSERT')
			lcTip_partener = NVL(STRTRAN(ALLTRIM(UPPER(toRec.Tip_partener)),['],['']),"")
			lcinactiv = ALLTRIM(STR(toRec.inactiv))
		ENDIF 
			
		
		
		DO CASE
			CASE lcActiune = "INSERT"
				lcSql1 = [INSERT INTO ] + gcS + [.nom_tip_parteneri (tip_partener,inactiv) VALUES ('] + lcTip_partener + [',] + lcinactiv + [)]
		
			CASE lcActiune = "UPDATE"
				lcSql1 = [UPDATE ] + gcS + [.nom_tip_parteneri SET tip_partener = '] + lcTip_partener +[',inactiv = ] + lcinactiv + [ where id_tip_part = ] + lcId
		
			CASE lcActiune = "DELETE"
				
				lcSql = []
			
				lcSql1 = [update nom_tip_parteneri set sters=1 where id_tip_part=]+lcid
		
				lcSql2 = [delete coresp_tip_cont where id_tip_part=]+lcid
		
				this.csql2 = lcSql2 
				
				lcSql3 = [delete coresp_tip_part where id_tip_part=]+lcid
		
				this.csql3 = lcSql3 
		
		ENDCASE 
		this.csql1 = lcSql1 
		
	ENDPROC

	PROCEDURE salvare
		Lparameters toRec,tnId
		
		Private llSucces, lnSucces
		
		llSucces = .T.
		lnSucces = -1
		lcActiune = Upper(Alltrim(This.cactiune))
		lcMesaj = ''
		lcTitlu = ''
		Do Case
		Case lcActiune = "INSERT"
			lcMesaj = "Doriti sa adaugati inregistrarea?"
			lcTitlu = "Adaugare"
			lnOptiuni = 4 + 32
		Case lcActiune = "UPDATE"
			lcMesaj = "Doriti sa salvati modificarile?"
			lcTitlu = "Modificare"
			lnOptiuni = 4 + 32
		Case lcActiune = "DELETE"
			lcMesaj = "Doriti sa stergeti inregistrarea?"
			lcTitlu = "Stergere"
			lnOptiuni = 4 + 32 + 512
		Endcase
		
		
		If aMESSAGEBOX(lcMesaj,lnOptiuni,lcTitlu) = 6
			PNIESIRE=1
			If This.validare()
		
				This.make_sql(toRec,tnId)
		
		
				lcSql1 = Upper(Alltrim(This.csql1))
				lcSql2 = Upper(Alltrim(This.csql2))
				lcSql3 = Upper(Alltrim(This.csql3))
		
		
				llConditie = 'INSERT'$lcSql1 Or 'UPDATE'$lcSql1 Or 'DELETE'$lcSql1 Or 'BEGIN'$lcSql1
				If !Empty(lcSql2)
					llConditie = 'INSERT'$lcSql2 Or 'UPDATE'$lcSql2 Or 'DELETE'$lcSql2 Or 'BEGIN'$lcSql2
				Endif
		
				If llConditie
		*!* ver. 2.0.67
					lcSqlNr1 = [select count(*) as nr_tip_cont from coresp_tip_cont t where id_tip_part = ]+ALLTRIM(TRANSFORM(This.cId))
					lcCursor = [crsNrTipCont]
					lnSucces = goExecutor.oExecute(lcSqlNr1,lcCursor)
		
					If lnSucces < 0
						aMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
						Return
					Endif
		
					Select crsNrTipCont
					lnNrTipCont = nr_tip_cont
					If lnNrTipCont > 0
						lnRaspuns = aMESSAGEBOX('Sunt definite corespondente intre acest tip de parteneri si conturi. Doriti sa stergeti aceste relatii?',4+32,'Entitati - conturi')
						If lnRaspuns = 7
							Return
						Endif
					Endif
		
					lcSqlNr2 = [select count(*) as nr_tip_part from coresp_tip_part t where id_tip_part = ]+ALLTRIM(TRANSFORM(This.cId))
					lcCursor = [crsNrTipPart]
					lnSucces = goExecutor.oExecute(lcSqlNr2,lcCursor)
		
					If lnSucces < 0
						aMESSAGEBOX(goExecutor.cEroare,0+16,'Eroare')
						Return
					Endif
		
					Select crsNrTipPart
					lnNrTipPart = nr_tip_part
					If lnNrTipPart > 0
						lnRaspuns = aMESSAGEBOX('Sunt definite corespondente intre acest tip de parteneri si parteneri. Doriti sa stergeti aceste relatii?',4+32,'Entitati - parteneri')
						If lnRaspuns = 7
							Return
						Endif
					Endif
		*!* ver. 2.0.67
		
					lnSucces = SQLExec(gnHandle,lcSql1)
					If !Empty(lcSql2)
						lnSucces = SQLExec(gnHandle,lcSql2)
					Endif
					If !Empty(lcSql3)
						lnSucces = SQLExec(gnHandle,lcSql3)
					Endif
				Endif
		
				If lnSucces < 0
					Release laEroare
					Aerror(laEroare)
		
					lcTextEroare = ''
					If Type('laEroare')!= "U"
						lcTextEroare = lcSql1 + Chr(13) + Chr(10) + laEroare(3)
					Endif
		
					Release laEroare
		
					Do Case
					Case lcActiune = "INSERT"
						lcMesaj = "Inregistrarea nu a fost adaugata." + Chr(13) + Chr(10) + lcTextEroare
						lcTitlu = "Adaugare"
					Case lcActiune = "UPDATE"
						lcMesaj = "Inregistrarea nu a fost modificata." + Chr(13) + Chr(10) + lcTextEroare
						lcTitlu = "Modificare"
					Case lcActiune = "DELETE"
						lcMesaj = "Inregistrarea nu a fost stearsa." + Chr(13) + Chr(10) + lcTextEroare
						lcTitlu = "Stergere"
					Endcase
		
					aMESSAGEBOX(lcMesaj,0+48,lcTitlu)
					llSucces = .F.
				Endif
				If lnSucces >=1 And lcActiune = "DELETE"
					lcMesaj = "Inregistrarea a fost stearsa."
					lcTitlu = "Stergere"
					aMESSAGEBOX(lcMesaj,0+64,lcTitlu)
				Endif
			Endif
		Else
			PNIESIRE=2
		Endif
		
		
		Return llSucces
		
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_valute AS _cusodatabase OF "_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	#INCLUDE "..\..\program files\microsoft visual foxpro 8\foxpro.h"
	*<PropValue>
		Name = "cus_odata_valute"
	*</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')
			lcnume_valuta = Nvl(Strtran(Alltrim(Upper(toRec.nume_val)),['],['']),"")
			lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)),"")
			lcMonedaNationala = Nvl(Alltrim(Str(toRec.moneda_nationala)),"NULL")
			lcIdValutaIso = Alltrim(Str(toRec.id_valuta2))
		Endif
		
		Do Case
			Case lcActiune = "INSERT"
				*!*		lcSql = [INSERT INTO ] + gcS + [.nom_valute (nume_val,inactiv,moneda_nationala) VALUES ('] + lcnume_valuta + [',] + lcinactiv + [)]
				lcSql = [begin pack_def.adauga_valuta(']+lcnume_valuta+[',]+lcIdValutaIso+[,]+lcinactiv+[,]+lcMonedaNationala+[,]+;
					ALLTRIM(Str(gnIdUtil))+[); end;]
			Case lcActiune = "UPDATE"
				*!*			lcSql = [UPDATE ] + gcS + [.nom_valute SET nume_val = '] + lcnume_valuta + [',inactiv =] + lcinactiv + ;
				*!*				[,moneda_nationala = ]+lcMonedaNationala +[ where id_valuta = ] + lcId
				lcSql = [begin pack_def.modifica_valuta(]+lcId+[,']+lcnume_valuta+[',]+lcIdValutaIso+[,]+lcinactiv+[,]+lcMonedaNationala+[,]+;
					ALLTRIM(Str(gnIdUtil))+[); end;]
		
			Case lcActiune = "DELETE"
				*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
				*!*			lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
				lcSql = [begin pack_def.sterge_valuta(]+lcId+[,]+Alltrim(Str(gnIdUtil))+[); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_venchel AS _cusodatabase OF "..\..\..\roasuport\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_venchel"
	*</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_venit_cheltuieli"
			lcamp = "nom_venit_cheltuieli.id_venchelt"
			lclook = gcS + ".act"
			lclookid = "act.id_venchelt"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcvenchel = Nvl(Strtran(Alltrim(Upper(toRec.explicatie_fiu)),['],['']),"")
			lctip = Nvl(Alltrim(Str(toRec.tip_venchelt)),"")
			lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)),"")
			lcIdTata = Iif(Empty(Nvl(toRec.id_tata,0)),[NULL],Alltrim(Str(toRec.id_tata)))
		Endif
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.nom_venit_cheltuieli (explicatie,tip_venchelt,inactiv,id_tata) VALUES ('] + lcvenchel + [',] + lctip + [,] + lcinactiv + [,] + lcIdTata + [)]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.nom_venit_cheltuieli SET explicatie = '] + lcvenchel + [',tip_venchelt = ] + lctip + [,inactiv = ] + lcinactiv + [,id_tata = ] + lcIdTata + [ where id_venchelt = ] + lcId
		
			Case lcActiune = "DELETE"
			
		*!*			lcSql = [update nom_sectii set sters=1,id_util=]+ALLTRIM(STR(gcidutil))+[,id_modif=seq_modif_nomen.nextval where id_banca=]+lcid
				lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_categorii_entitati AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_categorie_entitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_categorii_entitati" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_categorii_entitati.cCategorie_entitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_categorii_entitati.cCategorie_entitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_categorii_entitati.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_categorii_entitati.cInactiv.Check1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_adauga2
		*m: do_modifica2
		*m: do_sterge2
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = grd_categorii_entitati
		DoCreate = .T.
		Height = 466
		Name = "frm_categorii_entitati"
		Width = 528
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 528
		_shape1.ZOrderSet = 2
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 401
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 133
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "CATEGORII ENTITATI"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 497
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Left = 240
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 12
	*</PropValue>

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 8, ;
		Left = 435, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 404, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 466, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'clb_categorie_entitate' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		Height = 29, ;
		Left = 9, ;
		Name = "clb_categorie_entitate", ;
		TabIndex = 1, ;
		Top = 37, ;
		Width = 303, ;
		Text_simplu1.Left = 114, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Categorie entitate", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 0, ;
		Left = 330, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 36
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 0, ;
		Left = 418, ;
		Name = "Cmd_reset1", ;
		TabIndex = 8, ;
		Top = 36
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grd_categorii_entitati' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 383, ;
		Left = 17, ;
		Name = "grd_categorii_entitati", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .F., ;
		RecordSource = "crscategorii_entitati", ;
		TabIndex = 3, ;
		Top = 73, ;
		Width = 495, ;
		Column1.ControlSource = "categorie_entitate", ;
		Column1.Name = "cCategorie_entitate", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 423, ;
		Column2.Alignment = 2, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "cInactiv", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 45
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grd_categorii_entitati.cCategorie_entitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Categorie entitate", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grd_categorii_entitati.cCategorie_entitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grd_categorii_entitati.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 22, ;
		Name = "Check1", ;
		Top = 58, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grd_categorii_entitati.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters lcFiltru
		If Empty(lcFiltru)
			lcFiltru = poCategorii_entitati.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		save_grid_tag(Thisform.grd_categorii_entitati)
		poCategorii_entitati.ca_baza1.cfiltru = lcFiltru
		poCategorii_entitati.ca_baza1.afisare()
		restore_grid_tag(Thisform.grd_categorii_entitati)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Select crsCategorii_entitati
		Scatter Name loRec Blank
		Do Adauga_Modifica_Inregistrare With "categorii_entitati",loRec,,"INSERT"
		If pniesire=1
			This.actualizeaza_grid1()
			Locate For categorie_entitate = loRec.categorie_entitate
			Thisform.grd_categorii_entitati.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_adauga2
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		Store '' To lcFiltru
		lcFiltru=[2=2]
		lcCategorieEntitate = Strtran(Upper(Alltrim(This.clb_categorie_entitate.text_simplu1.Value)),['],[''])
		
		If !Empty(lcCategorieEntitate)
			lcFiltru = lcFiltru + [ and categorie_entitate like '] + lcCategorieEntitate + [%']
		Endif
		
		Thisform.actualizeaza_grid1(lcFiltru)
		
		If Reccount('crsCategorii_entitati')>0
			Select crsCategorii_entitati
			Go Top
			Thisform.grd_categorii_entitati.SetFocus()
		Else
			aMessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.clb_categorie_entitate.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('crsCategorii_entitati')>0
			Private pniesire
			pniesire = 0
			Select crsCategorii_entitati
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "categorii_entitati",loRec,loRec.id_categorie_entitate,"UPDATE"
			If pniesire = 1
				This.actualizeaza_grid1()
				Locate For categorie_entitate = loRec.categorie_entitate
				Thisform.grd_categorii_entitati.SetFocus()
			Endif
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",0+48,"Atentie")
			Thisform.clb_categorie_entitate.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_modifica2
	ENDPROC

	PROCEDURE do_reset
		With Thisform.clb_categorie_entitate.text_simplu1
			.Value = []
			.SetFocus()
		Endwith
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('crsCategorii_entitati')>0
			Select crsCategorii_entitati
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "categorii_entitati",loRec.id_categorie_entitate
			This.actualizeaza_grid1()
			If Reccount('crsCategorii_entitati')>0
				Thisform.grd_categorii_entitati.SetFocus()
			Else
				Thisform.clb_categorie_entitate.SetFocus()
			Endif
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",0+48,"Atentie")
			Thisform.clb_categorie_entitate.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_sterge2
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_categorii_entitati_nou AS _frmbase OF "_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="ck_inactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_categorie_entitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_categorii_entitati1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 109
		Name = "frm_categorii_entitati_nou"
		nid = 0
		Width = 336
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 336
		_shape2.Height = 29
		_shape2.Left = 275
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 58
		Lb_titlu_alb_b121.Caption = "Categorie entitate"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Left = 305
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Left = 156
		GRIDSORT1.Name = "GRIDSORT1"
		GRIDSORT1.Top = 84
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 276, ;
		Name = "But_renunt1", ;
		TabIndex = 4, ;
		Top = 1, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'ck_inactiv' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 30, ;
		Name = "ck_inactiv", ;
		TabIndex = 2, ;
		TabStop = .F., ;
		Top = 85
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Clb_categorie_entitate' AS clb_tx_simplu WITH ;
		Left = 24, ;
		Name = "Clb_categorie_entitate", ;
		TabIndex = 1, ;
		Top = 48, ;
		Text_simplu1.ControlSource = "porec.categorie_entitate", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Categorie entitate", ;
		Lb_simplu1.Left = 2, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_categorii_entitati1' AS cus_odata_categorii_entitati WITH ;
		Left = 112, ;
		Name = "Cus_odata_categorii_entitati1", ;
		Top = 85
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		Local PLRETURN
		
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If   Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		If Empty(porec.categorie_entitate)
			aMessagebox('Nu ati completat categoria!',0+48,"Atentie")
			This.clb_categorie_entitate.SetFocus()
			PLRETURN=.F.
		Else
			PLRETURN=This.cus_odata_categorii_entitati1.salvare(This.OREC,This.NID)
		Endif
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DoDefault()
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_categorii_entitati1.cactiune = tcActiune
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_coduri_nou AS _frmbase OF "_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="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_cod1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cod
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cod = .F.
		DoCreate = .T.
		Height = 94
		Name = "frm_coduri_nou"
		nid = .F.
		orec = .F.
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Adaugare cod partener"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		Gridsort1.Left = 12
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 36
	*</PropValue>

	ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
		Left = 313, ;
		Name = "BUT_RENUNT1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 46, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 52, ;
		Text_simplu1.ControlSource = "porec.cod", ;
		Text_simplu1.Format = "", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Cod partener", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_cod1' AS cus_odata_cod WITH ;
		Left = 312, ;
		Name = "Cus_odata_cod1", ;
		Top = 36
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		
		lccontrol = UPPER(this.ActiveControl.BaseClass )
		IF   INLIST(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.Activecontrol.controlsource
			&lcval=thisform.ActiveControl.value
		ENDIF 	
		
		Do Case
		Case Empty(porec.cod)
			aMessagebox('Nu ati completat codul!',0+48,"Atentie")
			This.clb_tx_simplu1.SetFocus()
			plreturn=.F.
		OTHERWISE 
			If Alltrim(Upper(This.cus_odata_cod1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_cod1.cactiune))="UPDATE" And porec.cod!=thisform.cod) 
				pcexec=[select * from ]+gcS+[.parteneri_coduri where TRIM(cod)=']+Alltrim(porec.cod)+[']
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_cod')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_cod')>0
					amessagebox('Mai exista acest cod inregistrat!',0+48,"Atentie")
					Thisform.clb_tx_simplu1.SetFocus()
					Use In exista_cod
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_cod1.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
				PLRETURN=This.cus_odata_cod1.salvare(This.OREC,This.NID)
			ENDIF  
		ENDCASE 
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		DODEFAULT()
		
		this.orec= toRec
		this.cod=this.orec.cod
		
		this.nid = tnId
		this.cus_odata_cod1.cactiune = tcActiune
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_coduri_utilizatori AS _frmbase OF "_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="BUT_RENUNT1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdbase1" UniqueID="" Timestamp="" />

	*<PropValue>
		DoCreate = .T.
		Name = "frm_coduri_utilizatori"
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Coduri parteneri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_grdbase1' AS _grdbase WITH ;
		Height = 176, ;
		Left = 24, ;
		Name = "_grdbase1", ;
		Top = 72, ;
		Width = 320
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
		Left = 313, ;
		Name = "BUT_RENUNT1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

ENDDEFINE

DEFINE CLASS frm_config_cont_ireg_nou AS _frmbase OF "_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="clb_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_explicatie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_fel_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_config_cont_ireg1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: contm
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		contm = 
		DoCreate = .T.
		Height = 230
		Name = "frm_config_cont_ireg_nou"
		nid = 0
		orec = 
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 313
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 60
		Lb_titlu_alb_b121.Caption = "Configurare conturi cu inregistrari"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Left = 344
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 6
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Cu Inregistrari", ;
		ControlSource = "", ;
		Left = 36, ;
		Name = "_checkbox1", ;
		ReadOnly = .F., ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 134
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox2' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Venit / Cheltuiala", ;
		ControlSource = "", ;
		Left = 36, ;
		Name = "_checkbox2", ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 183
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox3' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Procent TVA", ;
		ControlSource = "", ;
		Left = 36, ;
		Name = "_checkbox3", ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 205
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 315, ;
		Name = "But_renunt1", ;
		TabIndex = 14, ;
		Top = 1, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_fel_cont' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 24, ;
		Name = "Cb_fel_cont", ;
		TabIndex = 4, ;
		Top = 96, ;
		Width = 314, ;
		_CBBASE1.ControlSource = "", ;
		_CBBASE1.Height = 23, ;
		_CBBASE1.Left = 101, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "Activ,Pasiv,Bifunctional", ;
		_CBBASE1.RowSourceType = 1, ;
		_CBBASE1.Top = 3, ;
		_CBBASE1.Width = 185, ;
		_LBBASE1.Caption = "Fel Cont", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_cont' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 24, ;
		Name = "clb_cont", ;
		TabIndex = 2, ;
		Top = 40, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Cont", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_explicatie' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 24, ;
		Name = "Clb_explicatie", ;
		TabIndex = 3, ;
		Top = 68, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Explicatie", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_config_cont_ireg1' AS cus_odata_config_cont_ireg WITH ;
		Left = 191, ;
		Name = "Cus_odata_config_cont_ireg1", ;
		Top = 174
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'Label1' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Defalcate dupa :", ;
		Height = 17, ;
		Left = 24, ;
		Name = "Label1", ;
		Top = 162, ;
		Width = 91
		*< END OBJECT: BaseClass="label" />
	
	PROCEDURE inainte_de_do_termin
		LOCAL plReturn 
		
		plReturn = .t.
		
		Do Case
		Case Empty(this.orec.Cont)
			amessagebox('Nu ati completat contul!',0+48,"Atentie")
			This.clb_cont.SetFocus()
			plreturn=.F.
		Case Empty(this.orec.Explicatie)
			amessagebox('Nu ati completat explicatia!',0+48,"Atentie")
			This.clb_explicatie.SetFocus()
			plreturn=.F.
		*!*	Case Empty(porec.Fel_cont)
		*!*		Messagebox('Nu ati completat felul contului!',0+48,"Atentie")
		*!*		This.cb_fel_cont.SetFocus()
		*!*		plreturn=.F.		
		OTHERWISE 
			*
		ENDCASE
		lcactiune = This.cus_odata_config_cont_ireg1.cactiune
		DO CASE 
			CASE lcactiune = 'INSERT'
				SELECT v_config_cont_ireg
				LOCATE FOR ALLTRIM(cont) = ALLTRIM(this.orec.cont)
				IF FOUND()
					amessagebox('Acest cont exista in lista de conturi cu inregistrari!' + CHR(13) + 'Nu poate fi adaugat!',48,'Atentie')
					plReturn = .f.
				ENDIF 
			CASE lcActiune = 'UPDATE'
				SELECT v_config_cont_ireg
				IF ALLTRIM(this.Contm) # ALLTRIM(this.orec.cont)
					LOCATE FOR ALLTRIM(cont) = ALLTRIM(this.orec.cont) 
					IF FOUND()
						amessagebox('Acest cont exista in lista de conturi cu inregistrari!' + CHR(13) + 'Nu poate fi adaugat!',48,'Atentie')
						plReturn = .f.
					ENDIF 		
				ENDIF 
		OTHERWISE 			
			
		ENDCASE 		
		IF plReturn
			plReturn = This.cus_odata_config_cont_ireg1.salvare(This.OREC,This.NID)
		ENDIF 	
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DoDefault()
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_config_cont_ireg1.cactiune = tcActiune
		
		This.contm=toRec.Cont
		This.clb_cont.text_simplu1.ControlSource = 'Thisform.orec.cont'
		This.clb_explicatie.text_simplu1.ControlSource = 'Thisform.orec.explicatie'
		This._checkbox1.ControlSource = 'Thisform.orec.cu_inregistrari'
		This._checkbox2.ControlSource = 'Thisform.orec.cu_venchelt'
		This._checkbox3.ControlSource = 'Thisform.orec.cu_proc_tva'
		
		If tcActiune = "UPDATE" Or tcActiune = "INSERT"
			Do Case
				Case This.orec.Fel_cont = 0
					Thisform.cb_fel_cont._CBBASE1.Value="Activ"
				Case This.orec.Fel_cont = 1
					Thisform.cb_fel_cont._CBBASE1.Value="Pasiv"
				Otherwise
					Thisform.cb_fel_cont._CBBASE1.Value="Bifunctional"
			Endcase
		Endif
		
		If This.orec.cu_inregistrari = 0
			Thisform._checkbox2.ReadOnly = .T.
			Thisform._checkbox3.ReadOnly = .T.
		Else
			Thisform._checkbox2.ReadOnly = .F.
			Thisform._checkbox3.ReadOnly = .F.
		Endif
		
		*!*	this.cb_tip_entitate.SetFocus
		
	ENDPROC

	PROCEDURE Cb_fel_cont._CBBASE1.LostFocus
		Do Case
			Case This.Value="Activ"
				Thisform.orec.Fel_cont=0
			Case This.Value="Pasiv"
				Thisform.orec.Fel_cont=1
			Otherwise
				Thisform.orec.Fel_cont=2
		Endcase
		
	ENDPROC

	PROCEDURE clb_cont.Text_simplu1.Valid
		IF !EMPTY(this.Value)
			lnVerificat = verific_cont(thisform.orec.cont)
			IF lnVerificat < 0
				RETURN 0
			ENDIF 
		ENDIF 
	ENDPROC

	PROCEDURE _checkbox1.Valid
		IF this.Value = 0
			thisform._checkbox2.ReadOnly = .t.
			thisform._checkbox3.ReadOnly = .t.
		ELSE 
			thisform._checkbox2.ReadOnly = .f.
			thisform._checkbox3.ReadOnly = .f.
		ENDIF 
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_contnou AS _frmbase OF "_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="_shape4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pgfrmconturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid2.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid2.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid2.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid2.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid2.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grid2.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_optiongrup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica2" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cacont
		*p: ccont
		*p: cdeunde
		*p: cfiltruacont
		*p: cpagcont
		*p: creturncont
	*</DefinedPropArrayMethod>

	*<PropValue>
		cacont = 
		ccont = 
		cdeunde = 
		cfiltruacont = 
		cpagcont = 
		creturncont = 
		DoCreate = .T.
		Height = 500
		Name = "frm_contnou"
		Width = 795
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 795
		_shape1.ZOrderSet = 3
		_shape2.Height = 29
		_shape2.Left = 726
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 70
		_shape2.ZOrderSet = 4
		Lb_titlu_alb_b121.Caption = "PLANUL DE CONTURI"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 13
		Lb_titlu_alb_b121.ZOrderSet = 5
		But_termin1.Left = 763
		But_termin1.Name = "But_termin1"
		But_termin1.TabIndex = 11
		But_termin1.Top = 1
		But_termin1.ZOrderSet = 6
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_optiongrup1' AS _optiongrup WITH ;
		Height = 27, ;
		Left = 426, ;
		Name = "_optiongrup1", ;
		TabIndex = 7, ;
		Top = 60, ;
		Width = 236, ;
		Option1.Caption = "Selectie", ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Toate simbolurile definite", ;
		Option2.Left = 74, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />

	ADD OBJECT '_pgfrmconturi' AS _pgfrmbase WITH ;
		ActivePage = 9, ;
		ErasePage = .T., ;
		Height = 420, ;
		Left = 36, ;
		Name = "_pgfrmconturi", ;
		PageCount = 9, ;
		TabIndex = 1, ;
		TabStyle = 1, ;
		Top = 60, ;
		Width = 336, ;
		ZOrderSet = 2, ;
		Page1.Caption = "1", ;
		Page1.Name = "Page1", ;
		Page2.Caption = "2", ;
		Page2.Name = "Page2", ;
		Page3.Caption = "3", ;
		Page3.Name = "Page3", ;
		Page4.Caption = "4", ;
		Page4.Name = "Page4", ;
		Page5.Caption = "5", ;
		Page5.Name = "Page5", ;
		Page6.Caption = "6", ;
		Page6.Name = "Page6", ;
		Page7.Caption = "7", ;
		Page7.Name = "Page7", ;
		Page8.Caption = "8", ;
		Page8.Name = "Page8", ;
		Page9.Caption = "Toate", ;
		Page9.Name = "Page9"
		*< END OBJECT: ClassLib="_frm_base.vcx" BaseClass="pageframe" />

	ADD OBJECT '_shape3' AS _shape WITH ;
		BackStyle = 0, ;
		BorderColor = 128,128,128, ;
		Height = 444, ;
		Left = 24, ;
		Name = "_shape3", ;
		Top = 48, ;
		Width = 360, ;
		ZOrderSet = 1
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT '_shape4' AS _shape WITH ;
		BackStyle = 0, ;
		BorderColor = 128,128,128, ;
		Height = 444, ;
		Left = 408, ;
		Name = "_shape4", ;
		Top = 48, ;
		Width = 360, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 697, ;
		Name = "But_modifica1", ;
		TabIndex = 9, ;
		ToolTipText = "Modificare cont analitic", ;
		Top = 58
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica2' AS but_modifica WITH ;
		Height = 27, ;
		Left = 306, ;
		Name = "But_modifica2", ;
		TabIndex = 4, ;
		ToolTipText = "Modificare cont sintetic", ;
		Top = 54
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 276, ;
		Name = "But_nou1", ;
		TabIndex = 3, ;
		ToolTipText = "Adaugare cont sintetic", ;
		Top = 54
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou2' AS but_nou WITH ;
		Height = 27, ;
		Left = 666, ;
		Name = "But_nou2", ;
		TabIndex = 8, ;
		ToolTipText = "Adaugare cont analitic", ;
		Top = 58
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 732, ;
		Name = "But_renunt1", ;
		TabIndex = 12, ;
		Top = 1, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 726, ;
		Name = "But_sterge1", ;
		TabIndex = 10, ;
		ToolTipText = "Stergere cont analitic", ;
		Top = 58
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge2' AS but_sterge WITH ;
		Height = 27, ;
		Left = 336, ;
		Name = "But_sterge2", ;
		TabIndex = 5, ;
		ToolTipText = "Stergere cont sintetic", ;
		Top = 54
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grid1' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 384, ;
		Left = 45, ;
		Name = "grid1", ;
		Panel = 1, ;
		RecordSource = "plcont", ;
		TabIndex = 2, ;
		Top = 92, ;
		Width = 320, ;
		ZOrderSet = 10, ;
		Column1.ControlSource = "cont", ;
		Column1.Name = "Column1", ;
		Column1.Width = 49, ;
		Column2.ControlSource = "explicatie", ;
		Column2.Name = "Column2", ;
		Column2.Width = 239
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid1.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.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 'grid1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid1.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid2' AS _grdrow WITH ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		Height = 384, ;
		Left = 430, ;
		Name = "grid2", ;
		Panel = 1, ;
		TabIndex = 6, ;
		Top = 92, ;
		Width = 320, ;
		ZOrderSet = 11, ;
		Column1.ControlSource = "cont", ;
		Column1.Name = "Column1", ;
		Column1.Width = 41, ;
		Column2.ControlSource = "acont", ;
		Column2.Name = "Column2", ;
		Column2.Width = 43, ;
		Column3.ControlSource = "explicatie", ;
		Column3.Name = "Column3", ;
		Column3.Width = 203
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grid2.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid2.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 'grid2.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Simbol", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid2.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grid2.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grid2.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Lb_simplu1' AS lb_simplu WITH ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Conturi", ;
		Left = 37, ;
		Name = "Lb_simplu1", ;
		TabIndex = 14, ;
		Top = 40, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'Lb_simplu2' AS lb_simplu WITH ;
		BackColor = 255,255,255, ;
		BackStyle = 1, ;
		Caption = "Simboluri analitice", ;
		Left = 422, ;
		Name = "Lb_simplu2", ;
		TabIndex = 15, ;
		Top = 40, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru=tcFiltru
		If Empty(lcFiltru)
			lcFiltru=poplcont.ca_baza1.cfiltru
		Endif
		save_grid_tag(Thisform.grid1)
		poplcont.ca_baza1.cfiltru=lcFiltru
		poplcont.ca_baza1.afisare()
		restore_grid_tag(Thisform.grid1)
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Lparameters tcFiltru
		Local lcFiltru
		lcFiltru=tcFiltru
		If Empty(lcFiltru)
			lcFiltru=[an=]+Alltrim(Str(gnAn))
		Else
			lcFiltru=[an=]+Alltrim(Str(gnAn))+tcFiltru
		Endif
		save_grid_tag(Thisform.grid2)
		poplcontana.ca_baza1.cfiltru=lcFiltru
		poplcontana.ca_baza1.afisare()
		restore_grid_tag(Thisform.grid2)
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[an=]+Alltrim(Str(gnAn))+[ and SUBSTR(explicatie,1,3)!='   ']
		If Thisform.cpagcont!="Toate"
			lcFiltru=lcFiltru+[ AND SUBSTR(cont,1,1)=']+Alltrim(Thisform.cpagcont)+[']
		Endif
		Thisform.actualizeaza_grid1(lcFiltru)
		Select plcont
		Go Top
		lcFiltru=[ and cont=']+Alltrim(pccont)+[']
		Thisform.cfiltruacont=lcFiltru
		Thisform.actualizeaza_grid2(lcFiltru)
		Select plcontana
		Go Top
		Thisform.cacont=acont
		Select plcont
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Select plcont
		Set Filter To
		Select plcontana
		Set Filter To
		If !Empty(Thisform.creturncont)
			lcVar=Thisform.creturncont
			&lcVar=Padr(Thisform.ccont,4," ")+Iif(!Empty(Thisform.cacont),"."+Padr(Thisform.cacont,4," "),"")
		Endif
		RETURN .T.
	ENDPROC

	PROCEDURE Init
		Parameters tcReturneazaCont
		If Parameters()=1 && in tcReturneazaCont am numele variabilei care trebuie setate cu contul ales
			Thisform.cReturnCont=Alltrim(tcReturneazaCont)
		Endif
		Select plcont
		Go Top
		Thisform.ccont=Cont
		Thisform.cacont=""
		Select plcontana
		lcFiltru=[ and cont=']+Alltrim(Thisform.ccont)+[']
		Thisform.cfiltruacont=lcFiltru
		Thisform.actualizeaza_grid2(lcFiltru)
		Select plcont
		DoDefault()
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = Upper(Alltrim(This.ActiveControl.Name))
		
		If nKeyCode=13 And lcActiveControl = 'GRID1'
			Nodefault
			Thisform.grid2.SetFocus()
		Endif
		
		If nKeyCode = 13 And lcActiveControl = 'GRID2'
			Nodefault
			Thisform.but_termin1.SetFocus()
		Endif
		
		DoDefault(nKeyCode, nShiftAltCtrl)
	ENDPROC

	PROCEDURE But_modifica1.Click
		Private pnbuton
		Local lcFiltru
		pnbuton=1
		Select plcontana
		Scatter Name loRec
		AddProperty(loRec,'balana',1)
		Do Adauga_Modifica_Inregistrare With "plcont",loRec,loRec.Id_plcont,"UPDATE"
		If pnbuton=1
			If Thisform._optiongrup1.Value=1
				lcFiltru=Thisform.cfiltruacont
			Else
				lcFiltru=""
			Endif
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
		Thisform.grid2.SetFocus()
	ENDPROC

	PROCEDURE But_modifica2.Click
		Private pnbuton,pnrec
		pnbuton=1
		Select plcont
		pnrec=RECNO()
		Scatter Name loRec
		AddProperty(loRec,'balana',0)
		Do Adauga_Modifica_Inregistrare With "plcont",loRec,loRec.Id_plcont,"UPDATE"
		If pnbuton=1
			Thisform.actualizeaza_grid1()
			Select plcont
			Go pnrec
			lcFiltru=[ and cont=']+Alltrim(cont)+[']
			Thisform.cfiltruacont=lcFiltru
			Thisform.actualizeaza_grid2(lcFiltru)
			Select plcontana
			Go Top
			Thisform.cacont=acont
			Select plcont
		Endif
		Thisform.grid1.SetFocus()
	ENDPROC

	PROCEDURE But_nou1.Click
		Private pnbuton
		Select plcont
		pnbuton=1
		Scatter Name loRec Blank
		With loRec
			.tip_cont=0
			.an = gnAn
		Endwith
		AddProperty(loRec,'balana',0)
		Do Adauga_Modifica_Inregistrare With "plcont",loRec,,"INSERT"
		If pnbuton=1
			Thisform.actualizeaza_grid1()
			Select plcont
			Locate For Cont=loRec.Cont
			lcFiltru=[ and cont=']+Alltrim(Cont)+[']
			Thisform.cfiltruacont=lcFiltru
			Thisform.actualizeaza_grid2(lcFiltru)
			Select plcontana
			Go Top
			Thisform.cacont=acont
			Select plcont
		Endif
		Thisform.grid1.SetFocus()
		Release loRec
	ENDPROC

	PROCEDURE But_nou2.Click
		Private pccont,pctipsold,pnbuton
		Local lcFiltru
		Select plcont
		pccont=Cont
		pctipsold=tip_sold
		pnbuton=1
		Select plcontana
		Scatter Name loRec Blank
		With loRec
			.Cont=pccont
			.tip_sold=pctipsold
			.tip_cont=1
			.an = gnAn
		Endwith
		AddProperty(loRec,'balana',1)
		Do Adauga_Modifica_Inregistrare With "plcont",loRec,,"INSERT"
		If pnbuton=1
			If Thisform._optiongrup1.Value=1
				lcFiltru=Thisform.cfiltruacont
			Else
				lcFiltru=""
			Endif
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
		Thisform.grid2.SetFocus()
	ENDPROC

	PROCEDURE But_sterge1.Click
		Private pniesire
		Local lcFiltru
		pniesire=1
		Select plcontana
		Scatter Name loRec
		Do STERGE_INREGISTRARE With "plcont",loRec.id_plcont
		If pniesire=1
			If Thisform._optiongrup1.Value=1
				lcFiltru=Thisform.cfiltruacont
			Else
				lcFiltru=""
			Endif
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
		Thisform.grid2.SetFocus()
	ENDPROC

	PROCEDURE But_sterge2.Click
		Private pniesire,pnrec
		pniesire=1
		Select plcont
		pnrec=RECNO()
		Scatter Name loRec
		Do STERGE_INREGISTRARE With "plcont",loRec.id_plcont
		If pniesire=1
			Thisform.actualizeaza_grid1()
			Select plcont
			pnrec=MIN(RECCOUNT(),pnrec)
			Go pnrec
			lcFiltru=[ and cont=']+Alltrim(cont)+[']
			Thisform.cfiltruacont=lcFiltru
			Thisform.actualizeaza_grid2(lcFiltru)
			Select plcontana
			Go Top
			Thisform.cacont=acont
			Select plcont
		Endif
		thisform.grid1.SetFocus()
	ENDPROC

	PROCEDURE grid1.AfterRowColChange
		LPARAMETERS nColIndex
		
		
		IF UPPER(ALLTRIM(THISFORM.cCont)) <> UPPER(ALLTRIM(plcont.CONT))
			*If This.RowColChange= 1 Or This.RowColChange=3
			LOCAL pccont,lcFiltru
			lcFiltru=""
			SELECT plcont
			pccont=CONT
			THISFORM.cCont=pccont
			IF THISFORM._optiongrup1.VALUE=1
				lcFiltru=[ and cont=']+ALLTRIM(pccont)+[']
				THISFORM.cfiltruacont=lcFiltru
				THISFORM.actualizeaza_grid2(lcFiltru)
				SELECT plcontana
				GO TOP
				THISFORM.cacont=acont
			ELSE
				THISFORM.actualizeaza_grid2()
				SELECT plcontana
				LOCATE FOR CONT=pccont
				THISFORM.cacont=acont
			ENDIF
			THISFORM.grid2.REFRESH
			SELECT plcont
		ENDIF
		
		
		DODEFAULT()
		
	ENDPROC

	PROCEDURE grid2.AfterRowColChange
		Lparameters nColIndex
		If This.RowColChange= 1 Or This.RowColChange= 3
			Thisform.ccont=plcontana.Cont
			Thisform.cacont=plcontana.acont
		Endif
		DoDefault()
	ENDPROC

	PROCEDURE _optiongrup1.Valid
		Local lcFiltru
		lcFiltru=""
		If This.Value=1
			lcFiltru=Thisform.cfiltruacont
		Endif
		Thisform.actualizeaza_grid2(lcFiltru)
	ENDPROC

	PROCEDURE _pgfrmconturi.Page1.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page2.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page3.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page4.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page5.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page6.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page7.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page8.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

	PROCEDURE _pgfrmconturi.Page9.Click
		thisform.cpagcont=this.Caption
		thisform.do_cauta()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_contract_nou AS _frmbase OF "_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="Clb_data" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_numar" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_curs" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_valftva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_responsabil" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_denumire_tip" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_nume_val" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_contract" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_tip_contract" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_contract1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_proc_Tva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_descriere" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1._label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1._textbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1._label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2._label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2._textbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2._label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu6" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_alege_contract
		*m: do_alege_partener
		*m: do_alege_responsabil
		*m: do_alege_tip
		*m: do_alege_valuta
		*m: do_schimba_tip
		*m: do_scrolldown
		*m: do_scrollup
		*p: nid
		*p: nmoneda_nationala		&& 0 - daca moneda aleasa nu este moneda nationala; 1 - daca este moneda nationala
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		Caption = "Contract"
		DoCreate = .T.
		Height = 484
		Name = "frm_contract_nou"
		nid = .F.
		nmoneda_nationala = 2
		orec = .NULL.
		Width = 532
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 600
		_shape1.ZOrderSet = 1
		_shape2.Height = 29
		_shape2.Left = 468
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 61
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "CONTRACT"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 23
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 498
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 18
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Left = 96
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 8
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 468, ;
		Name = "_checkbox1", ;
		TabIndex = 22, ;
		TabStop = .F., ;
		Top = 397, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
		Anchor = 8, ;
		Left = 469, ;
		Name = "BUT_RENUNT1", ;
		TabIndex = 19, ;
		Top = 1, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_proc_Tva' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 312, ;
		Name = "Cb_proc_Tva", ;
		TabIndex = 17, ;
		Top = 264, ;
		Width = 213, ;
		_CBBASE1.Height = 23, ;
		_CBBASE1.Left = 84, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSourceType = 1, ;
		_CBBASE1.Top = 3, ;
		_CBBASE1.Value = 1, ;
		_CBBASE1.Width = 124, ;
		_lbbase1.Caption = "Procent TVA", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 10, ;
		Top = 349, ;
		Width = 270, ;
		_cbbase1.BoundColumn = 2, ;
		_cbbase1.BoundTo = .T., ;
		_cbbase1.ColumnCount = 2, ;
		_cbbase1.ColumnLines = .F., ;
		_cbbase1.ColumnWidths = "200,0", ;
		_cbbase1.ControlSource = "poRec.tip_curs", ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 99, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "Ziua facturii,1,Ultima zi din luna precedenta,2", ;
		_cbbase1.RowSourceType = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Value = 0, ;
		_cbbase1.Width = 166, ;
		_lbbase1.Caption = "Zi curs factura", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_curs' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_curs", ;
		TabIndex = 9, ;
		Top = 321, ;
		Width = 270, ;
		ZOrderSet = 8, ;
		Text_simplu1.ControlSource = "porec.curs", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.InputMask = (get_mask(14,gnPCurs)), ;
		Text_simplu1.Left = 140, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 125, ;
		Lb_simplu1.Caption = "Curs", ;
		Lb_simplu1.Left = 6, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_data' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_data", ;
		TabIndex = 4, ;
		Top = 173, ;
		Width = 179, ;
		ZOrderSet = 6, ;
		TEXT_SIMPLU1.ControlSource = "poRec.data", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.Left = 85, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 3, ;
		TEXT_SIMPLU1.Width = 90, ;
		Lb_simplu1.Caption = "Data", ;
		Lb_simplu1.Left = 6, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_numar' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_numar", ;
		TabIndex = 3, ;
		Top = 145, ;
		Width = 272, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "poRec.numar", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 85, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Numar", ;
		Lb_simplu1.Left = 6, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 53, ;
		Left = 312, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 14, ;
		Top = 116, ;
		Width = 213, ;
		Text_simplu1.ControlSource = "poRec.coef_penalitati", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 138, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ToolTipText = "Procent penalitati / zi - perioada 1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 71, ;
		Lb_simplu1.Caption = "Procent penalitati/zi 1", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 5
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1._label1' AS _label WITH ;
		Caption = "dupa", ;
		Left = 10, ;
		Name = "_label1", ;
		Top = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Clb_tx_simplu1._label2' AS _label WITH ;
		Caption = "zile", ;
		Left = 86, ;
		Name = "_label2", ;
		Top = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Clb_tx_simplu1._textbox1' AS _textbox WITH ;
		ControlSource = "poRec.zile_penalitati", ;
		Format = "!k", ;
		Height = 23, ;
		Left = 42, ;
		Name = "_textbox1", ;
		ToolTipText = "Numar de zile de la data facturii, dupa care se aplica procentul de penalitate perioada 1 (de obicei numarul de zile de scadenta)", ;
		Top = 25, ;
		Width = 36
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Height = 53, ;
		Left = 312, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 15, ;
		Top = 168, ;
		Width = 213, ;
		Text_simplu1.ControlSource = "poRec.coef_penalitati2", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 138, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ToolTipText = "Procent penalitati / zi - perioada 2", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 71, ;
		Lb_simplu1.Caption = "Procent penalitati/zi 2", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 5
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2._label1' AS _label WITH ;
		Caption = "dupa", ;
		Left = 10, ;
		Name = "_label1", ;
		Top = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Clb_tx_simplu2._label2' AS _label WITH ;
		Caption = "zile", ;
		Left = 86, ;
		Name = "_label2", ;
		Top = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Clb_tx_simplu2._textbox1' AS _textbox WITH ;
		ControlSource = "poRec.zile_penalitati2", ;
		Format = "!k", ;
		Height = 23, ;
		Left = 42, ;
		Name = "_textbox1", ;
		ToolTipText = "Numar de zile de la data facturii, dupa care se aplica procentul de penalitate perioada 2 (daca este cazul)", ;
		Top = 25, ;
		Width = 36
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 312, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 16, ;
		Top = 220, ;
		Width = 213, ;
		Text_simplu1.ControlSource = "poRec.zile_gratie_penalitati", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 138, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ToolTipText = "Perioada de restanta in care nu se factureaza penalitati", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 71, ;
		Lb_simplu1.Caption = "Zile gratie penalitati", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu4' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_tx_simplu4", ;
		TabIndex = 5, ;
		Top = 201, ;
		Width = 179, ;
		ZOrderSet = 6, ;
		Text_simplu1.ControlSource = "poRec.data_inceput", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 85, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Data inceput", ;
		Lb_simplu1.Left = 6, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_tx_simplu5", ;
		TabIndex = 6, ;
		Top = 229, ;
		Width = 179, ;
		ZOrderSet = 6, ;
		Text_simplu1.ControlSource = "poRec.data_sfarsit", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 85, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 90, ;
		Lb_simplu1.Caption = "Data sfarsit", ;
		Lb_simplu1.Left = 6, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu6' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 312, ;
		Name = "Clb_tx_simplu6", ;
		TabIndex = 13, ;
		Top = 88, ;
		Width = 213, ;
		Text_simplu1.ControlSource = "poRec.scadenta_incasare", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 138, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ToolTipText = "Numar zile scadenta factura", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 71, ;
		Lb_simplu1.Caption = "Zile scadenta", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 5
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_valftva' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 9, ;
		Name = "Clb_valftva", ;
		TabIndex = 7, ;
		Top = 265, ;
		Width = 270, ;
		ZOrderSet = 8, ;
		Text_simplu1.ControlSource = "porec.valftva", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.InputMask = (get_mask(14,gnPc)), ;
		Text_simplu1.Left = 140, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 125, ;
		Lb_simplu1.Caption = "Valoare fara TVA", ;
		Lb_simplu1.Left = 6, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_contract' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_ctr,0)), ;
		cprocedura = thisform.do_alege_contract(), ;
		cvar_afisata = porec.numar2, ;
		Height = 50, ;
		Left = 101, ;
		Name = "Ct_clb_contract", ;
		TabIndex = 20, ;
		Top = 42, ;
		Visible = .F., ;
		Width = 218, ;
		ZOrderSet = 15, ;
		SHAPE_CAUTARE.Height = 48, ;
		SHAPE_CAUTARE.Left = 0, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		SHAPE_CAUTARE.Top = 0, ;
		SHAPE_CAUTARE.Width = 180, ;
		IMG_CAUTARE.Left = 191, ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		IMG_CAUTARE.Top = 24, ;
		LB_CAUTARE.Caption = "Contract", ;
		LB_CAUTARE.Left = 6, ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		LB_CAUTARE.Top = 5, ;
		TX_CAUTARE.ControlSource = "", ;
		TX_CAUTARE.Height = 23, ;
		TX_CAUTARE.Left = 5, ;
		TX_CAUTARE.Name = "TX_CAUTARE", ;
		TX_CAUTARE.Top = 22, ;
		TX_CAUTARE.Width = 170
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_denumire' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_part,0)), ;
		cprocedura = thisform.do_alege_partener(), ;
		cvar_afisata = porec.denumire, ;
		Height = 31, ;
		Left = 8, ;
		Name = "Ct_clb_denumire", ;
		TabIndex = 2, ;
		Top = 116, ;
		Width = 305, ;
		ZOrderSet = 12, ;
		shape_cautare.Height = 29, ;
		shape_cautare.Left = 1, ;
		shape_cautare.Name = "shape_cautare", ;
		shape_cautare.Top = 1, ;
		shape_cautare.Width = 272, ;
		img_cautare.Left = 281, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		lb_cautare.Caption = "Partener", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.ControlSource = "", ;
		tx_cautare.Left = 85, ;
		tx_cautare.Name = "tx_cautare", ;
		tx_cautare.Top = 4
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_denumire_tip' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_tip_ctr,0)), ;
		cprocedura = thisform.do_alege_tip(), ;
		cvar_afisata = porec.denumire_tip, ;
		Height = 31, ;
		Left = 8, ;
		Name = "Ct_clb_denumire_tip", ;
		TabIndex = 1, ;
		Top = 88, ;
		Width = 304, ;
		ZOrderSet = 13, ;
		shape_cautare.Height = 29, ;
		shape_cautare.Left = 1, ;
		shape_cautare.Name = "shape_cautare", ;
		shape_cautare.Top = 1, ;
		shape_cautare.Width = 272, ;
		img_cautare.Left = 282, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		lb_cautare.Caption = "Tip contract", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.ControlSource = "", ;
		tx_cautare.Height = 23, ;
		tx_cautare.Left = 85, ;
		tx_cautare.Name = "tx_cautare", ;
		tx_cautare.Top = 4, ;
		tx_cautare.Width = 184
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_nume_val' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_valuta,0)) AND !EMPTY(poRec.valftva), ;
		cprocedura = thisform.do_alege_valuta(), ;
		cvar_afisata = porec.nume_val, ;
		Height = 31, ;
		Left = 8, ;
		Name = "Ct_clb_nume_val", ;
		TabIndex = 8, ;
		Top = 292, ;
		Width = 307, ;
		ZOrderSet = 14, ;
		SHAPE_CAUTARE.Height = 29, ;
		SHAPE_CAUTARE.Left = 1, ;
		SHAPE_CAUTARE.Name = "SHAPE_CAUTARE", ;
		SHAPE_CAUTARE.Top = 1, ;
		SHAPE_CAUTARE.Width = 270, ;
		IMG_CAUTARE.Left = 281, ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		IMG_CAUTARE.Top = 5, ;
		LB_CAUTARE.Caption = "Valuta", ;
		LB_CAUTARE.Name = "LB_CAUTARE", ;
		TX_CAUTARE.ControlSource = "", ;
		TX_CAUTARE.Left = 140, ;
		TX_CAUTARE.Name = "TX_CAUTARE", ;
		TX_CAUTARE.Width = 125
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_responsabil' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_responsabil,0)), ;
		cprocedura = thisform.do_alege_responsabil(), ;
		cvar_afisata = porec.responsabil, ;
		Height = 31, ;
		Left = 9, ;
		Name = "Ct_clb_responsabil", ;
		TabIndex = 11, ;
		Top = 384, ;
		Width = 306, ;
		ZOrderSet = 12, ;
		shape_cautare.Height = 29, ;
		shape_cautare.Left = 1, ;
		shape_cautare.Name = "shape_cautare", ;
		shape_cautare.Top = 1, ;
		shape_cautare.Width = 270, ;
		img_cautare.Left = 281, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		lb_cautare.Caption = "Responsabil", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.ControlSource = "", ;
		tx_cautare.Left = 85, ;
		tx_cautare.Name = "tx_cautare"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_contract1' AS cus_odata_contract WITH ;
		Left = 192, ;
		Name = "Cus_odata_contract1", ;
		Top = 5
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'Ed_descriere' AS ed_tx_simplu WITH ;
		Height = 58, ;
		Left = 10, ;
		Name = "Ed_descriere", ;
		TabIndex = 12, ;
		Top = 420, ;
		Width = 519, ;
		_edbase1.ControlSource = "poRec.descriere", ;
		_edbase1.Format = "K!", ;
		_edbase1.Height = 53, ;
		_edbase1.Left = 85, ;
		_edbase1.MaxLength = 250, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.Top = 2, ;
		_edbase1.Width = 430, ;
		_lbbase1.Caption = "Descriere", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'opt_tip_contract' AS _optiongrup WITH ;
		AutoSize = .F., ;
		Height = 49, ;
		Left = 9, ;
		Name = "opt_tip_contract", ;
		TabIndex = 21, ;
		Top = 40, ;
		Width = 94, ;
		ZOrderSet = 16, ;
		Option1.AutoSize = .T., ;
		Option1.Caption = "Contract", ;
		Option1.FontBold = .T., ;
		Option1.Left = 7, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.AutoSize = .T., ;
		Option2.Caption = "Act aditional", ;
		Option2.FontCharSet = 238, ;
		Option2.Left = 5, ;
		Option2.Name = "Option2", ;
		Option2.Top = 27
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="optiongroup" />
	
	PROCEDURE do_alege_contract
		Local loCauta
		loCauta = caut_contract()
		If !Isnull(loCauta) And !Empty(Nvl(loCauta.id_ctr,0))
			poRec.id_tata = loCauta.id_ctr
			poRec.numar2 = loCauta.contract
			pnId_part = loCauta.id_part
			poRec.id_part = loCauta.id_part
			poRec.denumire = loCauta.denumire
			Thisform.ct_clb_denumire.Refresh()
			Thisform.ct_clb_denumire_tip.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_alege_partener
		*!*	LOCAL lcselect, lcfiltru, lcschema, lcorder, lccoloane, lcTitlu, lcTitluColoane, lcFiltruOriginal, lcNumeProc
		*!*	lcselect = [select id_tip_ctr, denumire FROM ] + gcs + [.vtipuri_contracte where]
		*!*	lcfiltru = [1=2]
		*!*	lcschema = []
		*!*	lcorder = [denumire]
		*!*	lccoloane = [denumire]
		*!*	lcTitlu = [Alegeti tip contract]
		*!*	lcTitluColoane = [Denumire]
		*!*	lcFiltruOriginal = []
		*!*	lcNumeProc = ""
		*!*	lnPornire = 6
		*!*	llDesktop = .T.
		*!*	locauta = cauta_alfa(lcselect, lcfiltru, lcschema, lcorder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, .F., lcFiltruOriginal,,lnPornire,,,llDesktop)
		
		If Type('pnId_tip_part')<>'U'
			locauta = caut_partener(pnId_tip_part)
		*!*	modificare	11.04.2012
		Else
			locauta = caut_parteneri()
		Endif
		*!*	modificare	11.04.2012	^
		If buton=2
			Return
		Endif
		
		pnId_part = locauta.id_part
		porec.id_part = locauta.id_part
		porec.denumire = locauta.denumire
		*!*		THISFORM.clb_denumire.teXT_SIMPLU1.REFRESH
		Thisform.clb_numar.SetFocus()
		*!*	modificare	11.04.2012
		*!*	Endif
		*!*	modificare	11.04.2012	^
	ENDPROC

	PROCEDURE do_alege_responsabil
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Responsabili??cTipuriParteneri=>]+Alltrim(Str(gnIdTipResponsabili))+[??lAdaugCorespondente=>1]))
		If !Empty(Nvl(loCauta.id_part,0))
			poRec.id_responsabil = loCauta.id_part
			poRec.responsabil = Alltrim(loCauta.nume)
			This.but_TERMIN1.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_alege_tip
		LOCAL lcselect, lcfiltru, lcschema, lcorder, lccoloane, lcTitlu, lcTitluColoane, lcFiltruOriginal, lcNumeProc
		lcselect = [select id_tip_ctr, denumire_tip FROM vtipuri_contracte]
		lcfiltru = [] && [1=2]
		lcschema = []
		lcorder = [denumire_tip]
		lccoloane = [denumire_tip]
		lcTitlu = [Alegeti tip contract]
		lcTitluColoane = [Denumire]
		
		IF TYPE('gnParametru_prog')<>'U'
			DO CASE
				CASE gnParametru_prog=1
					lcFiltruOriginal = [substr(tata,2,6)='CLIENT']
				CASE  gnParametru_prog=2
					lcFiltruOriginal = [substr(tata,2,6)='FURNIZ']
				OTHERWISE
					lcFiltruOriginal = []
			ENDCASE
		ELSE
			lcFiltruOriginal = []
		ENDIF
		lcNumeProc = ""
		lnPornire = 6
		llDesktop = .T.
		locauta = cauta_alfa(lcselect, lcfiltru, lcschema, lcorder, lccoloane, lcTitlu, lcTitluColoane, lcNumeProc, .F., lcFiltruOriginal,,lnPornire,,,llDesktop)	&& 11.07.2007
		
		IF buton=2
			RETURN
		ENDIF
		
		porec.id_tip_ctr = locauta.id_tip_ctr
		porec.denumire_tip = locauta.denumire_tip
		*!*	THISFORM.clb_denumire_tip.teXT_SIMPLU1.REFRESH
		thisform.but_TERMIN1.SetFocus()
		
	ENDPROC

	PROCEDURE do_alege_valuta
		Local loCauta
		loCauta = caut_valuta(1)
		*!*	modificare migrare v 1.0	>	v 2.0
		*!*	If !Isnull(loCauta) And !Empty(Nvl(loCauta.id_valuta,0))
		If gnButon = 1
		*!*	modificare migrare v 1.0	>	v 2.0	^
			poRec.id_valuta = loCauta.id_valuta
			poRec.nume_val = loCauta.nume_val
		*!*	modificare migrare v 1.0	>	v 2.0
			This.nmoneda_nationala = loCauta.moneda_nationala
		Else
			poRec.id_valuta = 0
			poRec.nume_val = []
			This.nmoneda_nationala = 2
		Endif
		*!*	modificare migrare v 1.0	>	v 2.0	^
		If This.nmoneda_nationala=0
			Thisform.clb_curs.text_simplu1.SetFocus()
			with Thisform.clb_valftva.text_simplu1
				.InputMask = get_mask(14,gnPc)
				.Refresh()
			Endwith
		Else
			Thisform.cb_proc_Tva.SetFocus()
			with Thisform.clb_valftva.text_simplu1
				.InputMask = get_mask(14,gnPVal)
				.Refresh()
			Endwith
		Endif
		*!*	modificare migrare v 1.0	>	v 2.0
		*!*	EndIf
		*!*	modificare migrare v 1.0	>	v 2.0
		
	ENDPROC

	PROCEDURE do_schimba_tip
		Lparameters tnTip
		If tnTip = 1
			poRec.tip_istoric = 'C'
			With Thisform.opt_tip_contract
				.option1.FontBold = .T.
				.option2.FontBold = .F.
			Endwith
		
			Thisform.ct_clb_contract.Visible = .F.
			poRec.id_tata = 0
			poRec.numar2 = []
		Else
			poRec.tip_istoric = 'A'
			With Thisform.opt_tip_contract
				.option1.FontBold = .F.
				.option2.FontBold = .T.
			Endwith
		
			With Thisform.ct_clb_contract
				.Refresh()
				.Visible = .T.
			Endwith
		Endif
	ENDPROC

	PROCEDURE do_scrolldown
		This.Height = 495
		This.ct_clb_nume_val.Refresh()
		This.ct_clb_responsabil.Refresh()
		This.but_jos1.Visible = .F.
		This.but_sus1.Visible = .T.
		
	ENDPROC

	PROCEDURE do_scrollup
		This.Height = 345
		This.nmoneda_nationala = 2
		poRec.valftva = 0
		poRec.id_valuta = 0
		poRec.Curs = 0
		poRec.nume_val = []
		poRec.id_responsabil = 0
		poRec.responsabil = []
		This.cb_proc_Tva._CBBASE1.Value = 1
		This.but_sus1.Visible = .F.
		This.but_jos1.Visible = .T.
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local llReturn
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If  Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		Do Case
		Case Thisform.opt_tip_contract.Value = 2 And Empty(Nvl(poRec.id_tata,0))
			amessagebox("Nu ati ales contractul!",48,"Atentie")
			Thisform.ct_clb_contract.tx_cautare.SetFocus()
			llReturn = .F.
		Case Empty(Nvl(poRec.id_part,0))
			amessagebox('Nu ati completat partenerul!',0+48,"Atentie")
			Thisform.ct_clb_denumire.tx_cautare.SetFocus()
			llReturn=.F.
		Case Empty(Nvl(poRec.numar,0))
			amessagebox('Nu ati completat numarul contractului!',0+48,"Atentie")
			This.clb_numar.texT_SIMPLU1.SetFocus()
			llReturn=.F.
		Case Empty(poRec.Data)
			amessagebox('Nu ati completat data contractului!',0+48,"Atentie")
			This.clb_data.texT_SIMPLU1.SetFocus()
			llReturn=.F.
		Case Empty(Nvl(poRec.id_tip_ctr,0))
			amessagebox('Nu ati completat tipul contractului!',0+48,"Atentie")
			Thisform.ct_clb_denumire_tip.tx_cautare.SetFocus()
			llReturn=.F.
		Case !Empty(NVL(poRec.valftva,0)) And Empty(Nvl(poRec.id_valuta,0)) And This.nmoneda_nationala = 2
			amessagebox("Nu ati ales moneda pentru suma introdusa!",48,"Atentie")
			Thisform.ct_clb_nume_val.tx_cautare.SetFocus()
			llReturn = .F.
		Case Empty(poRec.Curs) And This.nmoneda_nationala = 0
			amessagebox("Nu ati introdus cursul!",48,"Atentie")
			Thisform.clb_curs.texT_SIMPLU1.SetFocus()
			llReturn = .F.
		Otherwise
			llReturn=This.cus_odata_contract1.salvare(This.OREC,This.NID)
		Endcase
		
		Return llReturn
		
	ENDPROC

	PROCEDURE Init
		*!* 08.02.2016
		*!* marius.mutu
		*!* cotele de TVA se citesc din COTE_TVA, nu sunt scrise de mana
		
		Lparameters toRec, tnId, tcActiune
		DoDefault()
		
		Local lcListaTVA, lnSucces
		
		This.orec = toRec
		This.nid = tnId
		This.cus_odata_contract1.cactiune = tcActiune
		*!*	If gnAn * 12 + gnLuna <= 2010 * 12 + 6
		*!*		This.cb_PROC_TVA._cbbase1.RowSource = "0,5,9,19"
		*!*	Else
		*!*		This.cb_PROC_TVA._cbbase1.RowSource = "0,5,9,19,20,24"
		*!*	Endif
		
		lnSucces = update_cote_TVA()
		If lnSucces < 0
			AMESSAGEBOX(goExecutor.cEroare, 0 + 16, _Screen.Caption)
			lcListaTVA = "0,5,9,19,20,24"
		Else
			lcListaTVA = cursor2lista("cote_TVA", "procent", ",")
		Endif
		Use In (Select('cote_TVA'))
		This.cb_PROC_TVA._cbbase1.RowSource = m.lcListaTVA
		
		*!*	modificare	11.04.2012
		*!*	If Type('pnId_part')<>'U' And !Empty(Nvl(pnId_part,0))
		If !Empty(Nvl(toRec.id_part, 0))
			*!*	modificare	11.04.2012	^
			Private poDenPart
			Local lcschema, lcselect, lcFiltru, lcOrder, llAfiseaza, lcGroup, llModParam, lcFiltruOriginal
			Store '' To poDenPart
		
			lcschema = []
			lcselect = [SELECT id_part, denumire FROM VNOM_PARTENERI]
			lcOrder = [denumire]
			lcFiltru = [id_part = ] + Alltrim(Str(toRec.id_part))	&&	modificare	11.04.2012	:	Transform(pnId_part)
			llAfiseaza = .F.
			lcGroup = ""
			llModParam = .T.
			lcFiltruOriginal = []
			gencursor('poDenPart', 'crsDenPart', lcselect, lcFiltru, lcschema, lcOrder, llAfiseaza, lcGroup, llModParam, lcFiltruOriginal)
			poDenPart.ca_baza1.afisare()
		
			Select crsDenPart
			toRec.id_part = id_part
			toRec.denumire = Alltrim(denumire)
		
			If Used("crsDenPart")
				Use In crsDenPart
			Endif
			Release poDenPart
		
			*!*	modificare	11.04.2012
			Thisform.ct_clb_denumire.do_dezactiveaza()
			*!*	modificare	11.04.2012	^
		Endif
		
		If Type('pnId_tip_ctr') <> 'U' And !Empty(Nvl(pnId_tip_ctr, 0))
			Private poTipCtr
			Local lcschema, lcselect, lcFiltru, lcOrder, llAfiseaza, lcGroup, llModParam, lcFiltruOriginal
			Store '' To poTipCtr
		
			lcschema = []
			lcselect = [select id_tip_ctr, denumire_tip from vtipuri_contracte]
			lcOrder = [denumire_tip]
			*!*		lcFiltru = []
			llAfiseaza = .F.
			lcGroup = ""
			llModParam = .T.
			*lcFiltruOriginal = [id_tip_ctr = ] + ALLTRIM(STR(pnId_tip_ctr))
			If Type('gnParametru_prog') <> 'U'
				Do Case
					Case gnParametru_prog = 1
						lcFiltru = [substr(tata,2,6)='CLIENT']
					Case  gnParametru_prog = 2
						lcFiltru = [substr(tata,2,6)='FURNIZ']
					Otherwise
						lcFiltru = [2=2]
				Endcase
			Else
				lcFiltru = [id_tip_ctr = ?pnId_tip_ctr]
			Endif
			lcFiltruOriginal = []
		
			gencursor('poTipCtr', 'crsTipCtr', lcselect, lcFiltru, lcschema, lcOrder, llAfiseaza, lcGroup, llModParam, lcFiltruOriginal)
			poTipCtr.ca_baza1.afisare()
		
			Select crsTipCtr
			toRec.id_tip_ctr = id_tip_ctr
			toRec.denumire_tip = Alltrim(denumire_tip)
		
			* Adaugat ulterior, copiat din ct_contracte
			If Type('gnParametru_prog') <> 'U'	
				toRec.id_tip_ctr = Iif(gnParametru_prog = 1, -1, -2)
				toRec.denumire_tip = Iif(gnParametru_prog = 1, 'CLIENT', 'FURNIZOR')
			ENDIF 
			If Used("crsTipCtr")
				Use In crsTipCtr
			Endif
			Release poTipCtr
		
			Thisform.ct_clb_denumire_tip.do_dezactiveaza()	
		Endif
		
		*!*	modificare	11.04.2012
		*!*	If Type('pnId_tip_part') = 'U'
		*!*		Thisform.ct_clb_denumire.do_dezactiveaza()
		*!*	Endif
		*!*	modificare	11.04.2012	^
		
		*!*	If Type('pnId_tip_ctr') <> 'U'
		*!*		Thisform.ct_clb_denumire_tip.do_dezactiveaza()
		*!*	Endif
	ENDPROC

	PROCEDURE Cb_proc_Tva._CBBASE1.InteractiveChange
		poRec.proc_tva = Val(This.List(This.Value))
	ENDPROC

	PROCEDURE Cb_proc_Tva._CBBASE1.ProgrammaticChange
		This.InteractiveChange()
		
	ENDPROC

	PROCEDURE opt_tip_contract.Click
		Thisform.do_schimba_tip(This.Value)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_coresp_tipuri_conturi_nou AS frm_termin_renunt OF "_frm_child.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Cb_tip_entitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_coresp_tipuri_conturi1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 127
		Name = "frm_coresp_tipuri_conturi_nou"
		nid = 0
		orec = 
		Width = 374
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 311
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 63
		Lb_titlu_alb_b121.Caption = "Tipuri Entitati"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		Gridsort1.Name = "Gridsort1"
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 4
	*</PropValue>

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 312, ;
		Name = "But_nou1", ;
		TabIndex = 6, ;
		Top = 78
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_tip_entitate' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Cb_tip_entitate", ;
		TabIndex = 1, ;
		Top = 48, ;
		Width = 317, ;
		_cbbase1.BoundColumn = 2, ;
		_cbbase1.BoundTo = .T., ;
		_cbbase1.ControlSource = "poRec.id_tip_part", ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 101, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_nom_tip_parteneri.tip_partener,id_tip_part", ;
		_cbbase1.RowSourceType = 6, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 185, ;
		_lbbase1.Caption = "Tip entitate", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 2, ;
		Top = 76, ;
		Width = 290, ;
		_cbbase1.ControlSource = "porec.cont", ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 101, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_config_cont_ireg.cont", ;
		_cbbase1.RowSourceType = 2, ;
		_cbbase1.TabIndex = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 185, ;
		_lbbase1.Caption = "Cont", ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_coresp_tipuri_conturi1' AS cus_odata_coresp_tipuri_conturi WITH ;
		Left = 8, ;
		Name = "Cus_odata_coresp_tipuri_conturi1", ;
		Top = 32
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE do_adauga
		SELECT v_config_cont_ireg
		SCATTER NAME loRecI BLANK
		
		lorecI.Fel_cont = 0
		loRecI.cu_inregistrari = 0
		loRecI.cu_venchelt = 0
		loRecI.cu_proc_tva = 0
		*loRecI.cont = porec.cont
		
		*!*	ADDPROPERTY(lorec,"id_tip_part",0)
		
		lnSucces = Adauga_Modifica_Inregistrare("config_cont_ireg",loRecI,,"INSERT",.f.,'oAddConfig')
		
		IF lnSucces > 0
			=close_config_ireg()
			=config_ireg()
		ENDIF 
		
		IF lnSucces = 1
			porec.cont = loRecI.cont
		ENDIF
		
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		
		Do Case
		Case Empty(porec.Cont)
			aMessagebox('Nu ati completat contul!',0+48,"Atentie")
			This.cb_tx_simplu1.SetFocus()
			plreturn=.F.
		
		Otherwise
			PLRETURN=This.Cus_odata_coresp_tipuri_conturi1.salvare(This.OREC,This.NID)
		ENDCASE
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DODEFAULT()
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_coresp_tipuri_conturi1.cactiune = tcActiune
		
		*!*	porec.Fel_cont=0
		
		*!*	IF tcActiune = "UPDATE" OR tcActiune = "INSERT"
		*!*		IF torec.Fel_cont = 0
		*!*			thisform.cb_fel_cont._CBBASE1.Value="Activ"
		*!*		ELSE
		*!*			thisform.cb_fel_cont._CBBASE1.Value="Pasiv"	
		*!*		ENDIF 	
		*!*	ENDIF 
		
		*!*	this.cb_tip_entitate.SetFocus 
	ENDPROC

	PROCEDURE Cb_tip_entitate._cbbase1.Init
		*!*	SELECT v_nom_tip_parteneri
		*!*	LOCATE FOR id_tip_part = poRec.id_tip_part
		*!*	IF !FOUND()
		*!*		LOCATE FOR tip_partener = poRec.tip_partener
		*!*		IF !FOUND()
		*!*			GO TOP 
		*!*		ENDIF 
		*!*	ENDIF 	
		
		*!*	this.value = v_nom_tip_parteneri.tip_partener
		*!*	this.DisplayValue = v_nom_tip_parteneri.tip_partener
	ENDPROC

	PROCEDURE Cb_tip_entitate._cbbase1.LostFocus
		porec.id_tip_part=v_nom_tip_parteneri.id_tip_part
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_entitati_conturi AS _frmbase OF "_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="_pageframe1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow3.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow3.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow3.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow3.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow3.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow3.Column3._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1._grdrow4.Column5._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.But_nou3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.But_modifica3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.But_sterge3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.Lb_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE1.Lb_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column5._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column1.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2._grdrow4.Column6.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2.But_nou3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2.But_modifica3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2.But_sterge3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2.Ck_filtru_cont2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2.Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.PAGE2.Cmd_reset1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_grid3
		*m: actualizeaza_grid4
		*m: actualizeaza_grid5
		*m: adauga_cont
		*m: do_adauga_coresp_tc
		*m: do_adauga_tipuri
		*m: do_cauta2
		*m: do_modifica_coresp_tc
		*m: do_modifica_tipuri
		*m: do_reset2
		*m: do_sterge_coresp_tc
		*m: do_sterge_tipuri
		*m: modifica_cont
		*m: sterge_cont
		*p: cul_activ
		*p: temporar_id_tip_part
		*p: temporar_tip_partener
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		cgridsortlist = _pageframe1.page1._grdrow3
		DoCreate = .T.
		Height = 420
		Name = "frm_entitati_conturi"
		temporar_id_tip_part = 0
		temporar_tip_partener = 
		Width = 697
		WindowState = 0
		WindowType = 1
		_shape1.Anchor = 10
		_shape1.Comment = "*:OnResize=sR"
		_shape1.Height = 30
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "W"
		_shape1.Top = 0
		_shape1.Width = 698
		_shape2.Anchor = 8
		_shape2.Comment = "*:OnResize=RT"
		_shape2.Height = 29
		_shape2.Left = 665
		_shape2.Name = "_shape2"
		_shape2.Tag = "L"
		_shape2.Top = 1
		_shape2.Width = 32
		Lb_titlu_alb_b121.Caption = "Configurare Entitati"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 19
		Lb_titlu_alb_b121.Tag = ""
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Comment = "*:OnResize=RT"
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 666
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 18
		BUT_TERMIN1.Tag = "L"
		BUT_TERMIN1.Top = 2
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_pageframe1' AS _pageframe WITH ;
		Anchor = 15, ;
		Comment = "*:OnResize=sS", ;
		ErasePage = .T., ;
		Height = 391, ;
		Left = 0, ;
		Name = "_pageframe1", ;
		PageCount = 2, ;
		Tag = "WH", ;
		Top = 29, ;
		Width = 698, ;
		PAGE1.BackColor = 255,255,255, ;
		PAGE1.Caption = "Tipuri Entitati - Conturi", ;
		PAGE1.Comment = "", ;
		PAGE1.Name = "PAGE1", ;
		PAGE1.Tag = "HW", ;
		PAGE2.BackColor = 255,255,255, ;
		PAGE2.Caption = "Conturi", ;
		PAGE2.Comment = "", ;
		PAGE2.Name = "PAGE2", ;
		PAGE2.Tag = "HW"
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="pageframe" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow3' AS _grdrow WITH ;
		Anchor = 5, ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		Height = 296, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "_grdrow3", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "crstipuriparteneri", ;
		ScrollBars = 2, ;
		TabIndex = 16, ;
		Tag = "H", ;
		Top = 59, ;
		Width = 238, ;
		Column1.ControlSource = "crstipuriparteneri.id_tip_part", ;
		Column1.Name = "Column1", ;
		Column1.Width = 47, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "crstipuriparteneri.tip_partener", ;
		Column2.Name = "Column2", ;
		Column2.Width = 125, ;
		Column3.ColumnOrder = 3, ;
		Column3.ControlSource = "crstipuriparteneri.inactiv", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Sparse = .F., ;
		Column3.Width = 43
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow3.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow3.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 '_pageframe1.PAGE1._grdrow3.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip ", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow3.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow3.Column3._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 38, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 93
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow3.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 5, ;
		DeleteMark = .F., ;
		Height = 296, ;
		Left = 245, ;
		Name = "_grdrow4", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "crstipuriconturi", ;
		ScrollBars = 2, ;
		TabIndex = 17, ;
		Tag = "HW", ;
		Top = 59, ;
		Width = 442, ;
		Column1.ControlSource = "crstipuriconturi.tip_partener", ;
		Column1.Name = "Column1", ;
		Column1.Tag = "W", ;
		Column1.Width = 68, ;
		Column2.ControlSource = "crstipuriconturi.cont", ;
		Column2.Name = "Column2", ;
		Column2.Width = 72, ;
		Column3.ControlSource = "crstipuriconturi.explicatie", ;
		Column3.Name = "Column3", ;
		Column3.Width = 122, ;
		Column4.ControlSource = 'iif(crstipuriconturi.fel_cont<=0,"Activ","Pasiv")', ;
		Column4.Name = "Column4", ;
		Column4.Width = 71, ;
		Column5.ControlSource = "crstipuriconturi.cu_inregistrari", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Sparse = .F., ;
		Column5.Width = 83
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.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 '_pageframe1.PAGE1._grdrow4.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fel Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ControlSource = "crstipuriconturi.fel_cont", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column5._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 28, ;
		Name = "_checkbox1", ;
		Top = 45
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.PAGE1._grdrow4.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cu Inregistrari", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE1.But_modifica2' AS but_modifica WITH ;
		caction = do_modifica_tipuri, ;
		Comment = "*:OnResize=RT", ;
		Left = 183, ;
		Name = "But_modifica2", ;
		TabIndex = 8, ;
		Top = 29, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE1.But_modifica3' AS but_modifica WITH ;
		Anchor = 8, ;
		caction = do_modifica_coresp_tc, ;
		Comment = "*:OnResize=RT", ;
		Left = 630, ;
		Name = "But_modifica3", ;
		TabIndex = 9, ;
		Tag = "L", ;
		Top = 29, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE1.But_nou2' AS but_nou WITH ;
		caction = do_adauga_tipuri, ;
		Comment = "*:OnResize=RT", ;
		Left = 152, ;
		Name = "But_nou2", ;
		TabIndex = 6, ;
		Top = 29
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE1.But_nou3' AS but_nou WITH ;
		Anchor = 8, ;
		caction = do_adauga_coresp_tc, ;
		Comment = "*:OnResize=RT", ;
		Left = 599, ;
		Name = "But_nou3", ;
		TabIndex = 7, ;
		Tag = "L", ;
		Top = 29
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE1.But_sterge2' AS but_sterge WITH ;
		caction = do_sterge_tipuri, ;
		Comment = "*:OnResize=RT", ;
		Left = 212, ;
		Name = "But_sterge2", ;
		TabIndex = 11, ;
		Top = 29, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE1.But_sterge3' AS but_sterge WITH ;
		Anchor = 8, ;
		caction = do_sterge_coresp_tc, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_sterge3", ;
		TabIndex = 13, ;
		Tag = "L", ;
		Top = 29, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE1.Lb_simplu1' AS lb_simplu WITH ;
		Caption = "Tipuri Entitati", ;
		FontSize = 10, ;
		Left = 5, ;
		Name = "Lb_simplu1", ;
		Top = 42
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT '_pageframe1.PAGE1.Lb_simplu2' AS lb_simplu WITH ;
		Caption = "Conturi", ;
		Comment = "*:OnResize=RT", ;
		FontSize = 10, ;
		Left = 246, ;
		Name = "Lb_simplu2", ;
		Top = 42
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		Height = 297, ;
		HighlightStyle = 1, ;
		Left = 7, ;
		Name = "_grdrow4", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "crsconturi", ;
		TabIndex = 17, ;
		Tag = "HW", ;
		Top = 59, ;
		Width = 682, ;
		Column1.ControlSource = "cont", ;
		Column1.Name = "Column2", ;
		Column1.Width = 72, ;
		Column2.ControlSource = "explicatie", ;
		Column2.Name = "Column3", ;
		Column2.Width = 328, ;
		Column3.ControlSource = "fel_cont", ;
		Column3.Name = "Column4", ;
		Column3.Width = 89, ;
		Column4.ControlSource = "cu_inregistrari", ;
		Column4.Name = "Column5", ;
		Column4.ReadOnly = .T., ;
		Column4.Sparse = .F., ;
		Column4.Width = 83, ;
		Column5.ControlSource = "cu_venchelt", ;
		Column5.Name = "Column1", ;
		Column5.ReadOnly = .T., ;
		Column5.Sparse = .F., ;
		Column5.Width = 97, ;
		Column6.ControlSource = "cu_proc_tva", ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 70
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column1.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Height = 17, ;
		Left = 36, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 24, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Venituri/cheltuieli", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fel Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ControlSource = "crstipuriconturi.fel_cont", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column5._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 28, ;
		Name = "_checkbox1", ;
		Top = 45
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cu Inregistrari", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column6.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Height = 17, ;
		Left = 22, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 24, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.PAGE2._grdrow4.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent TVA", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.PAGE2.But_modifica3' AS but_modifica WITH ;
		Anchor = 8, ;
		caction = modifica_cont, ;
		Comment = "*:OnResize=RT", ;
		Left = 628, ;
		Name = "But_modifica3", ;
		TabIndex = 9, ;
		Tag = "L", ;
		Top = 12, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE2.But_nou3' AS but_nou WITH ;
		Anchor = 8, ;
		caction = adauga_cont, ;
		Comment = "*:OnResize=RT", ;
		Left = 598, ;
		Name = "But_nou3", ;
		TabIndex = 7, ;
		Tag = "L", ;
		Top = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE2.But_sterge3' AS but_sterge WITH ;
		Anchor = 8, ;
		caction = sterge_cont, ;
		Comment = "*:OnResize=RT", ;
		Left = 657, ;
		Name = "But_sterge3", ;
		TabIndex = 13, ;
		Tag = "L", ;
		Top = 12, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE2.Ck_filtru_cont2' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = cont, ;
		Caption = "Cont", ;
		Left = 4, ;
		Name = "Ck_filtru_cont2", ;
		Top = 3
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.PAGE2.Cmd_cauta1' AS cmd_cauta WITH ;
		caction = do_cauta2, ;
		Comment = "*:OnResize=RT", ;
		Left = 119, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 4, ;
		Tag = "L", ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.PAGE2.Cmd_reset1' AS cmd_reset WITH ;
		caction = do_reset2, ;
		Comment = "*:OnResize=RT", ;
		Left = 119, ;
		Name = "Cmd_reset1", ;
		Tag = "L", ;
		Top = 29
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />
	
	PROCEDURE actualizeaza_grid3
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = potipuri_parteneri.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(This._pageframe1.pAGE1._grdrow3)
		potipuri_parteneri.ca_baza1.cfiltru=lcfiltru
		potipuri_parteneri.ca_baza1.afisare()
		restore_grid_comment(This._pageframe1.pAGE1._grdrow3)
		*!*	Select crstipuriparteneri
		*!*	Go Top
		
	ENDPROC

	PROCEDURE actualizeaza_grid4
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = potipuri_conturi.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(THIS._pageframe1.pAGE1._grdrow4)
		potipuri_conturi.ca_baza1.cfiltru = lcFiltru
		potipuri_conturi.ca_baza1.afisare()
		restore_grid_comment(THIS._pageframe1.pAGE1._grdrow4)
		
		
	ENDPROC

	PROCEDURE actualizeaza_grid5
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poconturi.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(This._pageframe1.page2._grdrow4)
		poconturi.ca_baza1.cfiltru=lcfiltru
		poconturi.ca_baza1.afisare()
		restore_grid_comment(This._pageframe1.page2._grdrow4)
		
		
	ENDPROC

	PROCEDURE adauga_cont
		SELECT crsconturi
		SCATTER NAME loRecI BLANK
		
		lorecI.Fel_cont = 0
		loRecI.cu_inregistrari = 0
		loRecI.cu_venchelt = 0
		loRecI.cu_proc_tva = 0
		
		config_ireg()
		lnSucces = Adauga_Modifica_Inregistrare("config_cont_ireg",loRecI,,"INSERT",.f.,'oAddConfig')
		
		IF lnSucces > 0
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid5()
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
		ENDIF 
		
		close_config_ireg()
		
		
	ENDPROC

	PROCEDURE do_adauga_coresp_tc
		LOCAL loRec
		SELECT crstipuriconturi
		SCATTER NAME loRec BLANK
		
		loRec.Fel_cont = 0
		loRec.tip_partener = THISFORM.temporar_tip_partener
		loRec.id_tip_part = crstipuriparteneri.id_tip_part
		pncontinua = 0
		*!*	ADDPROPERTY(lorec,"id_tip_part",0)
		
		lnSucces = cctipuri()
		IF lnSucces < 0
			RETURN
		ENDIF
		lnSucces = config_ireg()
		IF lnSucces < 0
			RETURN
		ENDIF
		
		pncontinua = Adauga_Modifica_Inregistrare("coresp_tipuri_conturi",loRec,,"INSERT")
		
		=close_cctipuri()
		=close_config_ireg()
		
		IF pncontinua = 1
			THISFORM.actualizeaza_grid4()
		ENDIF
		
		
	ENDPROC

	PROCEDURE do_adauga_tipuri
		SELECT crstipuriparteneri
		SCATTER NAME loRec BLANK
		pccontinua=.F.
		
		DO Adauga_Modifica_Inregistrare WITH "tipuri_parteneri",loRec,,"INSERT" IN oproceduri_ams.prg
		
		IF pccontinua=.T.
			thisform.actualizeaza_grid3()
		ENDIF
		
		
	ENDPROC

	PROCEDURE do_cauta2
		Private lcfiltru,lcval1
		lcfiltru=''
		
		If ThisForm._pageframe1.pAGE2.Ck_filtru_cont2.Value = 1	
			lcfiltru=lcfiltru + thisform._pageframe1.page2.ck_filtru_cont2.filtru
		Endif
		
		If !Empty(lcfiltru)
			lcfiltru=Substr(lcfiltru,5)
		Else
			lcfiltru = [1=1]
		ENDIF
		
		thisform.actualizeaza_grid5(lcFiltru)
	ENDPROC

	PROCEDURE do_executa
		Local loPart, loCauta, lnIdPartProst,  lnIdPartBun, lnAn1, lnAn2, lnLuna1, lnLuna2, lnInit, lnFinal,  lcMesaj
		Local lcSelect, lcFiltru, lcSchema, lcOrder, lcColoane, lcTitlu, lcFiltruOriginal, lcNumeProc, llAllInlist
		
		Select crsParteneri
		Scatter Name loPart
		If loPart.id_part = 0
			Return
		Endif
		
		lcParola = Inputbox('Parola','Parola','')
		If lcParola # Transform(Year(Date())) + Padl(Transform(Month(Date())),2,'0') + Padl(Transform(Day(Date())),2,'0')
			Return
		Endif
		
		lcSelect = [select p.nume, p.cod_fiscal, p.id_part,p.inactiv FROM Vnom_parteneri p]
		lcFiltru = []
		lcSchema = []
		lcOrder = [P.NUME]
		lcColoane = [nume,cod_fiscal,id_part,inactiv]
		lcTitlu = [Alegeti parterul cu Id Partener corect]
		lcTitluColoane = [Nume,Cod fiscal,Id Partener, Inactiv]
		lcFiltruOriginal = [p.inactiv = 0 and id_part <> ] + Transform(loPart.id_part)
		lcNumeProc = ""
		llAllInlist = .F.
		loCauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lcColoane, lcTitlu, lcTitluColoane, lcNumeProc, llAllInlist, lcFiltruOriginal)	&& 11.07.2007
		
		
		If loCauta.id_part = 0
			Return
		Endif
		
		pcondper=""
		ofrmperioada=Createobject('frm_perioada_luni')
		ofrmperioada.Show(1)
		If gnButon=2
			Return
		Endif
		
		plPerioada=.F.
		lnPoz=At('_',pcondper)
		If lnPoz>0
			plPerioada=.T.
		Endif
		
		
		If plPerioada
			lnAn1 = Val(Substr(pcondper,3,4))
			lnLuna1 = Val(Substr(pcondper,1,2))
			lnAn2 = Val(Substr(pcondper,10,4))
			lnLuna2 = Val(Substr(pcondper,8,2))
		
			lnInit = lnAn1 * 12 + lnLuna1
			lnFinal = lnAn2 * 12 + lnLuna2
			lcPerioada = Substr(pcondper,1,2)+'/'+Substr(pcondper,3,4) + ' - ' + Substr(pcondper,8,2)+'/'+Substr(pcondper,10,4)
		Else
			lnAn1 = Val(Substr(pcondper,3,4))
			lnLuna1 = Val(Substr(pcondper,1,2))
			lnAn2 = Val(Substr(pcondper,3,4))
			lnLuna2 = Val(Substr(pcondper,1,2))
		
			lnInit = lnAn1 * 12 + lnLuna1
			lnFinal = lnAn2 * 12 + lnLuna2
			lcPerioada = Substr(pcondper,1,2)+'/'+Substr(pcondper,3,4) + ' - ' + Substr(pcondper,1,2)+'/'+Substr(pcondper,3,4)
		Endif
		
		lnRaspuns = aMessagebox('Doriti sa inlocuiti in registrul jurnal, balanta verificare, balanta partener si inregistrari partener ' + Chr(13) + ;
			lcPerioada + Chr(13) + ;
			ALLTRIM(loPart.Nume) + '(' + Transform(loPart.id_part)	+')' + Chr(13) + ;
			'cu ' + Alltrim(loCauta.Nume) + '(' + Transform(loCauta.id_part)	+')?',4+32,'Inlocuire ID Partener')
		If lnRaspuns # 6
			Return
		Endif
		
		
		lnIdPartProst = loPart.id_part
		lnIdPartBun = loCauta.id_part
		
		lcEroare = ''
		lcEroare = modifica_id_partener(lnIdPartProst, lnIdPartBun, lnAn1, lnLuna1, lnAn2, lnLuna2)
		If !Empty(lcEroare)
			lcMesaj = lcEroare
			aMESSAGEBOX(lcMesaj,0+16,"Eroare")
		Else
			lcMesaj = 'S-au terminat modificarile!'
			aMESSAGEBOX(lcMesaj,0+64,"Info")
		Endif
		
		
	ENDPROC

	PROCEDURE do_modifica_coresp_tc
		If Reccount('crstipuriconturi')>0
		
			Select crstipuriconturi
			Scatter Name loRec
		
			loRec.tip_partener = thisform.temporar_tip_partener
		
			pncontinua = 0
		
		    lnSucces = cctipuri()
			IF lnSucces < 0 
				RETURN 
			ENDIF 
			lnSucces = config_ireg()
			IF lnSucces < 0 
				RETURN 
			ENDIF 
		
			pnContinua = Adauga_Modifica_Inregistrare("coresp_tipuri_conturi",loRec,loRec.ID_coresp_tip_cont,"UPDATE") && IN oproceduri_ams.prg
			=close_cctipuri()
			=close_config_ireg()
		
			IF pncontinua = 1
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid4()
				
				Select crstipuriconturi
				LOCATE FOR ID_coresp_tip_cont = loRec.ID_coresp_tip_cont
				IF !FOUND()
					GO top
				ENDIF 
						
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
			Endif
		ENDIF
		
		
	ENDPROC

	PROCEDURE do_modifica_tipuri
		If Reccount('crstipuriparteneri')>0
		
			Select crstipuriparteneri
			Scatter Name loRec
		
			pctip_partener = loRec.tip_partener
		
			pccontinua=.F.
		
			Do Adauga_Modifica_Inregistrare With "tipuri_parteneri",loRec,loRec.ID_tip_part,"UPDATE" IN oproceduri_ams.prg
			If pccontinua=.T.
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid3()
				
				Select crstipuriparteneri
				LOCATE FOR id_tip_part = loRec.ID_tip_part
				IF !FOUND()
					GO top
				ENDIF 
				this._pageframe1.page1._grdrow3.Refresh()
				
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
			Endif
		Endif
	ENDPROC

	PROCEDURE do_reset2
		this._pageframe1.page2.ck_filtru_cont2.Value=0
		this._pageframe1.page2.cmd_cauta1.Click 
	ENDPROC

	PROCEDURE do_sterge_coresp_tc
		SELECT crstipuriconturi
		SCATTER NAME loRec
		DO sterge_inregistrare WITH "coresp_tipuri_conturi",loRec.id_coresp_tip_cont IN oproceduri_ams.prg
		THISFORM.actualizeaza_grid4()
		
	ENDPROC

	PROCEDURE do_sterge_tipuri
		Select crstipuriparteneri
		Scatter Name loRec
		
		Do sterge_inregistrare With "tipuri_parteneri",loRec.id_tip_part In oproceduri_ams.prg
		Thisform.actualizeaza_grid3()
		Thisform.actualizeaza_grid4()
		
	ENDPROC

	PROCEDURE modifica_cont
		SELECT crsconturi
		SCATTER NAME loRec 
		
		config_ireg()
		lnsucces = Adauga_Modifica_Inregistrare("config_cont_ireg",loRec,loRec.ID_cont_ireg,"UPDATE",.f.)
		
		
		IF lnSucces > 0
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid5()
				Select crsconturi
				LOCATE FOR ID_cont_ireg = loRec.ID_cont_ireg
				IF !FOUND()
					GO top
				ENDIF 
				this._pageframe1.page2._grdrow4.Refresh 		
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
		ENDIF 
		
		close_config_ireg()
		
		
		
		
	ENDPROC

	PROCEDURE sterge_cont
			Select crsconturi
			Scatter Name loRec
				lnsucces =  sterge_inregistrare("config_cont_ireg",lorec.id_cont_ireg)
			
					Thisform.actualizeaza_grid5()
		
	ENDPROC

	PROCEDURE _pageframe1.PAGE1.DblClick
		THIS.CMD_executa1.Visible = .T.
	ENDPROC

	PROCEDURE _pageframe1.PAGE1._grdrow3.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT()     
		
		SELECT crstipuriparteneri
		lcFiltru4 = [ID_TIP_PART=]+ALLTRIM(STR(crstipuriparteneri.id_tip_part))
		thisform.actualizeaza_grid4(lcFiltru4)
		
		thisform.temporar_tip_partener=crstipuriparteneri.tip_partener
	ENDPROC

	PROCEDURE _shape1.DblClick
		IF thisform.WindowState = 2
			thisform.WindowState = 0
		ELSE 
			thisform.WindowState = 2 
		ENDIF 
		THISFORM.Refresh 
		THISFORM._pageframe1.Page1._grdrow3.SetFocus()
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_fdoc AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_fdoc.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_fdoc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = _gnom_fdoc
		DoCreate = .T.
		Height = 500
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_fdoc"
		Width = 700
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 708
		_shape2.Height = 29
		_shape2.Left = 579
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 135
		Lb_titlu_alb_b121.Caption = "Documente"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 668
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_fdoc' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 407, ;
		Left = 9, ;
		Name = "_gnom_fdoc", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_fdoc", ;
		RowHeight = 19, ;
		ScrollBars = 3, ;
		TabIndex = 3, ;
		Top = 85, ;
		Width = 681, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "fel_document", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 231, ;
		Column2.ColumnOrder = 5, ;
		Column2.ControlSource = "inactiv", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 37, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "id_fdoc", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 38, ;
		Column4.ColumnOrder = 2, ;
		Column4.ControlSource = "tip_doc", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 54, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "descriere", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 161, ;
		Column6.ColumnOrder = 3, ;
		Column6.ControlSource = "paymentname", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 120
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_fdoc.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Document", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_fdoc.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_fdoc.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 11, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_fdoc.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_fdoc.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_fdoc.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_fdoc.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip D394", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_fdoc.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_fdoc.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descriere", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_fdoc.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_fdoc.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod plata SAFT", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_fdoc.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 8, ;
		Left = 611, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 581, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 639, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 299, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 44
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform._gnom_fdoc, ;
		Left = 405, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 46
		*< END OBJECT: ClassLib="..\..\..\roacont\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'lb_nom_fdoc' AS clb_tx_simplu WITH ;
		Left = 8, ;
		Name = "lb_nom_fdoc", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Tip Document", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=pofdoc.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_fdoc)
		pofdoc.ca_baza1.cfiltru=lcFiltru
		pofdoc.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_fdoc)
		IF RECCOUNT('v_fdoc')>0
			thisform._gnom_fdoc.SetFocus()
		ELSE
			thisform.lb_nom_fdoc.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_fdoc
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "fdoc",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_fdoc.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[fel_document like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		LOCAL loRec
		If Reccount('v_fdoc')>0
			Select v_fdoc
			Scatter Name loRec
			pcfel_document=loRec.fel_document
			Do Adauga_Modifica_Inregistrare With "fdoc",loRec,loRec.Id_fdoc,"UPDATE"
			Thisform.actualizeaza_grid1()
			SELECT v_fdoc
			LOCATE FOR id_fdoc = loRec.id_fdoc
			IF !FOUND()
				GO TOP 
			ENDIF 		
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_fdoc')>0
			Select v_fdoc
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "fdoc",lorec.id_fdoc
		
			This.actualizeaza_grid1()
		
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		
		This._gnom_fdoc.column6.Visible = m.gl406
		THIS.GRIdextra1.setup()
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_FDOC'
			Nodefault
			this.lb_nom_fdoc.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
		
		
	ENDPROC

	PROCEDURE _gnom_fdoc.Column1.Text1.DblClick
		thisform.log("NOM_FDOC",v_fdoc.id_fdoc)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_fdoc_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_fdoc1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_cod_plata" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: lusedtipdoc		&& Daca este deschis deja cursorul crsTipDoc la Load
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 155
		lusedtipdoc = .F.
		Name = "frm_fdoc_nou"
		Width = 372
		_memberdata = <VFPData>
			<memberdata name="lusedtipdoc" display="lUsedTipDoc"/>
		</VFPData>
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 309
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 70
		Lb_titlu_alb_b121.Caption = "Document"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		Gridsort1.Left = 4
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 42
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 8, ;
		Name = "_checkbox1", ;
		TabIndex = 6, ;
		TabStop = .F., ;
		Top = 131
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 5, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_cod_plata' AS cb_tx_simplu WITH ;
		Left = 8, ;
		Name = "Cb_cod_plata", ;
		TabIndex = 3, ;
		Top = 94, ;
		Width = 357, ;
		_CBBASE1.BoundColumn = 3, ;
		_CBBASE1.ColumnCount = 2, ;
		_CBBASE1.ColumnLines = .F., ;
		_CBBASE1.ColumnWidths = "250,150", ;
		_CBBASE1.ControlSource = "poRec.PaymentCode", ;
		_CBBASE1.Height = 23, ;
		_CBBASE1.Left = 112, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "Select paymentname, methodname, mechanismcode From saft_mecanisme_plati where afisat=1 Order By ordine Into Cursor crsMecanismePlati", ;
		_CBBASE1.RowSourceType = 3, ;
		_CBBASE1.ToolTipText = "Tip document pentru Declaratia 394", ;
		_CBBASE1.Top = 3, ;
		_CBBASE1.Width = 237, ;
		_LBBASE1.Caption = "Cod plata SAFT", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Left = 8, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 2, ;
		Top = 66, ;
		Width = 357, ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 112, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "crsTipDoc.descriere", ;
		_cbbase1.RowSourceType = 6, ;
		_cbbase1.ToolTipText = "Tip document pentru Declaratia 394", ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 237, ;
		_lbbase1.Caption = "Tip D394", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 8, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 38, ;
		Width = 357, ;
		Text_simplu1.ControlSource = "porec.fel_document", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 112, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 237, ;
		Lb_simplu1.Caption = "Document", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_fdoc1' AS cus_odata_fdoc WITH ;
		Left = 0, ;
		Name = "Cus_odata_fdoc1", ;
		Top = 60
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE Destroy
		IF !this.lUsedTipDoc
			close_tip_doc()
		ENDIF 	
	ENDPROC

	PROCEDURE inainte_de_do_termin
		
		Local PLRETURN
		
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If   Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		Do Case
			Case Empty(porec.fel_document)
				aMessagebox('Nu ati completat tipul documentului!',0+48,"Atentie")
				This.clb_tx_simplu1.SetFocus()
				PLRETURN=.F.
			Otherwise
				If Alltrim(Upper(This.cus_odata_fdoc1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_fdoc1.cactiune))="UPDATE" And porec.fel_document!=pcfel_document)
					pcexec=[select * from ]+gcS+[.vnom_fdoc where TRIM(fel_document)=']+Alltrim(porec.fel_document)+[']
					Do While .T.
						pnSucces = SQLExec(GNHANDLE,pcexec,'exista_fel_document')
						If pnSucces = 0
							* instructiunea in curs de executie
						Else
							Exit
						Endif
					Enddo
					If Reccount('exista_fel_document')>0
						aMessagebox('Mai exista acest tip de document inregistrat!',0+48,"Atentie")
						Thisform.clb_tx_simplu1.SetFocus()
						Use In exista_fel_document
						PLRETURN=.F.
					Else
						PLRETURN=This.cus_odata_fdoc1.salvare(This.OREC,This.NID)
					Endif
				Else
					PLRETURN=This.cus_odata_fdoc1.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_fdoc1.cactiune = tcActiune
		
		SELECT crsTipDoc
		LOCATE FOR NVL(tip, 'x') = NVL(torec.tip_doc, 'x')
		IF !FOUND()
			GO TOP 
		ENDIF 
		this.cb_tx_simplu1._cbbase1.Value = crsTipDoc.descriere
		
		this.cb_cod_plata.Visible = m.gl406
	ENDPROC

	PROCEDURE Load
		Local lcSelect, llSucces
		If !Used('crsTipDoc')
			This.lUsedTipDoc = .F.
			lcSelect = Select()
			llSucces = update_tip_doc(.T.)
		
			If !Used('saft_mecanisme_plati')
				update_saft_mecanisme_plati()
			ENDIF 	
			Select (m.lcSelect)
		ELSE
			This.lUsedTipDoc = .T.
		Endif
	ENDPROC

	PROCEDURE Cb_cod_plata._CBBASE1.LostFocus
		porec.tip_doc = ALLTRIM(NVL(crsTipDoc.tip, ''))
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.LostFocus
		porec.tip_doc = ALLTRIM(NVL(crsTipDoc.tip, ''))
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_gestiuni AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cNume_gestiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cNume_gestiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cCgest.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cCgest.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cCont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cCont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cNr_pag.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cNr_pag.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cAcont.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cAcont.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cId_gestiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cId_gestiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cSectie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cSectie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cAcontCheltuiala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cAcontCheltuiala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cAcontAdaos.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cAcontAdaos.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cLucrare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cLucrare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cReceptie1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cReceptie1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cReceptie2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cReceptie2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cReceptie3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cReceptie3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cGestionar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_gestiuni.cGestionar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_gestiuni" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = _gnom_gestiuni
		DoCreate = .T.
		Height = 451
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_gestiuni"
		Width = 561
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 564
		_shape2.Height = 29
		_shape2.Left = 434
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 129
		Lb_titlu_alb_b121.Caption = "Gestiuni"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 530
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		BUT_TERMIN1.Width = 30
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_gestiuni' AS _grdrow WITH ;
		ColumnCount = 17, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 363, ;
		Left = 8, ;
		Name = "_gnom_gestiuni", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_gestiuni", ;
		RowHeight = 19, ;
		TabIndex = 3, ;
		Top = 80, ;
		Width = 545, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "nume_gestiune", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNume_gestiune", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 238, ;
		Column2.ColumnOrder = 4, ;
		Column2.ControlSource = "cgest", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cCgest", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 50, ;
		Column3.ColumnOrder = 8, ;
		Column3.ControlSource = "cont", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cCont", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 63, ;
		Column4.ColumnOrder = 12, ;
		Column4.ControlSource = "nr_pag", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cNr_pag", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 123, ;
		Column5.ColumnOrder = 9, ;
		Column5.ControlSource = "acont", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cAcont", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 55, ;
		Column6.ColumnOrder = 17, ;
		Column6.ControlSource = "inactiv", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cInactiv", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 38, ;
		Column7.ColumnOrder = 1, ;
		Column7.ControlSource = "id_gestiune", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cId_gestiune", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 30, ;
		Column8.ColumnOrder = 3, ;
		Column8.ControlSource = "sucursala", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cSucursala", ;
		Column8.ReadOnly = .T., ;
		Column9.ColumnOrder = 5, ;
		Column9.ControlSource = "denumire", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cDenumire", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 122, ;
		Column10.ColumnOrder = 7, ;
		Column10.ControlSource = "sectie", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cSectie", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 147, ;
		Column11.ColumnOrder = 10, ;
		Column11.ControlSource = "acont_cheltuiala", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cAcontCheltuiala", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 72, ;
		Column12.ColumnOrder = 11, ;
		Column12.ControlSource = "acont_adaos", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cAcontAdaos", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 72, ;
		Column13.ColumnOrder = 6, ;
		Column13.ControlSource = "nrord", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "cLucrare", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 101, ;
		Column14.ColumnOrder = 14, ;
		Column14.ControlSource = "comisie_receptie1", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cReceptie1", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 152, ;
		Column15.ColumnOrder = 15, ;
		Column15.ControlSource = "comisie_receptie2", ;
		Column15.Name = "cReceptie2", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 134, ;
		Column16.ColumnOrder = 16, ;
		Column16.ControlSource = "comisie_receptie3", ;
		Column16.Name = "cReceptie3", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 112, ;
		Column17.ColumnOrder = 13, ;
		Column17.ControlSource = "gestionar", ;
		Column17.Name = "cGestionar", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 144
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_gestiuni.cAcont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cAcont.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cAcontAdaos.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic 37x", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cAcontAdaos.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cAcontCheltuiala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Analitic 60x", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cAcontCheltuiala.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cCgest.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Indicativ", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cCgest.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cCont.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cCont.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cDenumire.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Responsabil", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cDenumire.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cGestionar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Gestionar", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cGestionar.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cId_gestiune.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cId_gestiune.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 16, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 21, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_gestiuni.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cLucrare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lucrare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cLucrare.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cNr_pag.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cNr_pag.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cNume_gestiune.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Gestiune", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cNume_gestiune.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cReceptie1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Receptie 1", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cReceptie1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cReceptie2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Receptie 2", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cReceptie2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cReceptie3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Receptie 3", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cReceptie3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cSectie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sectie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cSectie.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_gestiuni.cSucursala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sucursala", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_gestiuni.cSucursala.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Left = 408, ;
		Name = "But_excel1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 469, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 438, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 499, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 307, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 44
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_gestiuni' AS clb_tx_simplu WITH ;
		Left = 11, ;
		Name = "lb_nom_gestiuni", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Gestiune", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=pogestiuni.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_gestiuni)
		pogestiuni.ca_baza1.cfiltru=lcFiltru
		pogestiuni.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_gestiuni)
		IF RECCOUNT('v_gestiuni')>0
			thisform._gnom_gestiuni.SetFocus()
		ELSE
			thisform.lb_nom_gestiuni.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		DO nom_gestiuni_nou IN onomenclatoare.prg
		
		IF gnButon = 1
			THISFORM.actualizeaza_grid1()
		ENDI
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_gestiuni.text_simplu1.value)),['],[''])
		
		If !Empty(lcNume)
			lcFiltru=[nume_gestiune like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]	
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_excel
		DO export_excel_grid WITH this._gnom_gestiuni, "nume_gestiune"
	ENDPROC

	PROCEDURE do_modifica
		LOCAL loRec, lnIdGestiune
		
		If Reccount('v_gestiuni')>0
			Select v_gestiuni
			lnIdGestiune = id_gestiune
			Scatter Name loRec
		
			loRec = nom_gestiuni_modifica(lnIdGestiune)
				
			IF !ISNULL(loRec)
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid1()
				SELECT v_gestiuni
				LOCATE FOR id_gestiune = lorec.id_gestiune
				IF !FOUND()
					GO top
				ENDIF 	
				thisform._gnom_gestiuni.SetFocus()		
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
			Endif
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_gestiuni')>0
			Select v_gestiuni
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "gestiuni",lorec.id_gestiune
		
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_GESTIUNI'
			Nodefault
			this.lb_nom_gestiuni.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_gestiuni')
			USE IN v_gestiuni
		ENDIF
	ENDPROC

	PROCEDURE _gnom_gestiuni.cNume_gestiune.Text1.DblClick
		thisform.log("NOM_GESTIUNI",v_gestiuni.id_gestiune)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_gestiuni_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_gestiuni1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_cont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_acont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_nr_pag" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_sucursala" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_responsabil" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_sectia" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_lucrare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtComisie1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtComisie2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtComisie3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtGestionar" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblComisie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblGestionar" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_alege_sucursala
		*m: do_cauta_lucrare
		*m: do_cauta_responsabil
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 437
		Name = "frm_gestiuni_nou"
		Width = 375
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 388
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 69
		Lb_titlu_alb_b121.Caption = "Gestiune"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 19
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 17
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 303, ;
		Name = "_checkbox1", ;
		TabIndex = 16, ;
		TabStop = .F., ;
		Top = 412
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 315, ;
		Name = "But_renunt1", ;
		TabIndex = 18, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_nr_pag' AS cb_tx_simplu WITH ;
		Left = 15, ;
		Name = "Cb_nr_pag", ;
		TabIndex = 3, ;
		Top = 100, ;
		Width = 321, ;
		_CBBASE1.ControlSource = "porec.nume_tip", ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "vtipuri_gestiuni.nume_tip", ;
		_CBBASE1.RowSourceType = 2, ;
		_CBBASE1.Width = 216, ;
		_LBBASE1.Caption = "Tip", ;
		_LBBASE1.FontBold = .T., ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_sectia' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 16, ;
		Name = "Cb_sectia", ;
		TabIndex = 8, ;
		Top = 184, ;
		Width = 321, ;
		_cbbase1.ControlSource = "porec.sectie", ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 101, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "vnom_sectii.sectie", ;
		_cbbase1.RowSourceType = 2, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 216, ;
		_lbbase1.Caption = "Sectie", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_sucursala' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 16, ;
		Name = "Cb_sucursala", ;
		TabIndex = 9, ;
		Top = 212, ;
		Visible = .F., ;
		Width = 321, ;
		_CBBASE1.ControlSource = "porec.sucursala", ;
		_CBBASE1.Height = 23, ;
		_CBBASE1.Left = 101, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "vnom_sucursale.sucursala", ;
		_CBBASE1.RowSourceType = 2, ;
		_CBBASE1.Top = 3, ;
		_CBBASE1.Width = 216, ;
		_LBBASE1.Caption = "Sucursala", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_acont' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 184, ;
		Name = "Clb_acont", ;
		TabIndex = 5, ;
		Top = 128, ;
		Width = 152, ;
		Text_simplu1.ControlSource = "porec.acont", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 82, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 64, ;
		Lb_simplu1.Caption = "Analitic 3xx", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.ToolTipText = "Analitic 3xx"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_cont' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 15, ;
		Name = "Clb_cont", ;
		TabIndex = 4, ;
		ToolTipText = "Cont 3xx", ;
		Top = 128, ;
		Width = 170, ;
		Text_simplu1.ControlSource = "porec.cont", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 101, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 64, ;
		Lb_simplu1.Caption = "Cont 3xx", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 15, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		Width = 321, ;
		Text_simplu1.ControlSource = "porec.nume_gestiune", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 216, ;
		Lb_simplu1.Caption = "Gestiune", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 15, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 72, ;
		Width = 170, ;
		Text_simplu1.ControlSource = "porec.cgest", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 101, ;
		Text_simplu1.MaxLength = 20, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 64, ;
		Lb_simplu1.Caption = "Indicativ scurt", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Left = 15, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 6, ;
		Top = 156, ;
		Width = 170, ;
		Text_simplu1.ControlSource = "porec.acont_cheltuiala", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 101, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 64, ;
		Lb_simplu1.Caption = "Analitic 60x", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.ToolTipText = "Analitic cheltuiala 6xx"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu4' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 184, ;
		Name = "Clb_tx_simplu4", ;
		TabIndex = 7, ;
		Top = 156, ;
		Width = 152, ;
		Text_simplu1.ControlSource = "porec.acont_adaos", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 82, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 64, ;
		Lb_simplu1.Caption = "Analitic 37x", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.ToolTipText = "Analitic adaos 37x"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_lucrare' AS ct_clb_cautare WITH ;
		cconditie = 1=2, ;
		cprocedura = thisform.do_cauta_lucrare, ;
		cvar_afisata = poRec.nrord, ;
		Height = 31, ;
		Left = 15, ;
		Name = "Ct_clb_lucrare", ;
		TabIndex = 11, ;
		Top = 267, ;
		Width = 349, ;
		img_cautare.Left = 325, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Height = 29, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Lucrare", ;
		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 = 101, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Top = 3, ;
		clb_tx_cautare.Text_simplu1.Width = 216, ;
		clb_tx_cautare.Top = 1, ;
		clb_tx_cautare.Width = 321
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_responsabil' AS ct_clb_cautare WITH ;
		cconditie = 1=2, ;
		cprocedura = thisform.do_cauta_responsabil, ;
		cvar_afisata = poRec.denumire, ;
		Height = 31, ;
		Left = 15, ;
		Name = "Ct_clb_responsabil", ;
		TabIndex = 10, ;
		Top = 239, ;
		Width = 346, ;
		img_cautare.Left = 325, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Height = 29, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Responsabil", ;
		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 = 101, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Top = 3, ;
		clb_tx_cautare.Text_simplu1.Width = 216, ;
		clb_tx_cautare.Top = 1, ;
		clb_tx_cautare.Width = 321
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_gestiuni1' AS cus_odata_gestiuni WITH ;
		Left = 180, ;
		Name = "Cus_odata_gestiuni1", ;
		Top = 24
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'lblComisie' AS _label WITH ;
		Caption = "Comisia de receptie", ;
		Left = 16, ;
		Name = "lblComisie", ;
		TabIndex = 20, ;
		Top = 299
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'lblGestionar' AS _label WITH ;
		Caption = "Gestionar", ;
		Left = 16, ;
		Name = "lblGestionar", ;
		TabIndex = 21, ;
		Top = 390
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'txtComisie1' AS _textbox WITH ;
		ControlSource = "porec.comisie_receptie1", ;
		Format = "!k", ;
		Height = 23, ;
		Left = 15, ;
		MaxLength = 50, ;
		Name = "txtComisie1", ;
		TabIndex = 12, ;
		Top = 316, ;
		Width = 216
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtComisie2' AS _textbox WITH ;
		ControlSource = "porec.comisie_receptie2", ;
		Format = "!k", ;
		Height = 23, ;
		Left = 15, ;
		MaxLength = 50, ;
		Name = "txtComisie2", ;
		TabIndex = 13, ;
		Top = 340, ;
		Width = 216
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtComisie3' AS _textbox WITH ;
		ControlSource = "porec.comisie_receptie3", ;
		Format = "!k", ;
		Height = 23, ;
		Left = 15, ;
		MaxLength = 50, ;
		Name = "txtComisie3", ;
		TabIndex = 14, ;
		Top = 364, ;
		Width = 216
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtGestionar' AS _textbox WITH ;
		ControlSource = "porec.gestionar", ;
		Format = "!k", ;
		Height = 23, ;
		Left = 16, ;
		MaxLength = 50, ;
		Name = "txtGestionar", ;
		TabIndex = 15, ;
		Top = 407, ;
		Width = 216
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE do_alege_sucursala
	ENDPROC

	PROCEDURE do_cauta_lucrare
		Local loCauta
		loCauta=caut_lucrare()
		If !Empty(Nvl(loCauta.id_lucrare,0))
			poRec.id_lucrare= loCauta.id_lucrare
			poRec.nrord = Alltrim(loCauta.nrord)
			Thisform.ct_clb_lucrare.Refresh()
			Thisform.cb_nr_pag.SetFocus()
		Else
			poRec.id_lucrare = Null
			poRec.nrord = []
		endif
		
		
	ENDPROC

	PROCEDURE do_cauta_responsabil
		Local loCauta
		loCauta=caut_responsabil()
		If !Empty(Nvl(loCauta.id_responsabil,0))
			poRec.id_responsabil = loCauta.id_responsabil
			poRec.denumire = Alltrim(loCauta.nume)
			Thisform.ct_clb_responsabil.Refresh()
			Thisform.ct_clb_lucrare.SetFocus()
		Else
			poRec.id_responsabil = Null
			poRec.denumire = []
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_termin
		*!* 22.06.2010
		*!* marius.mutu
		*!* exista gestiuni cu mai multe conturi
		*!* la transfer catre alta gestiune - sa apara conturile asociate tipului de gestiune, in loc de un contul configurat pe gestiune
		
		Local PLRETURN
		
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If   Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		
		Do Case
		Case Empty(porec.nume_gestiune)
			aMESSAGEBOX('Nu ati completat denumirea gestiunii!',0+48,"Atentie")
			This.clb_tx_simplu1.SetFocus()
			PLRETURN=.F.
		
		Case Empty(porec.cgest)
			aMESSAGEBOX('Nu ati completat indicativul gestiunii!',0+48,"Atentie")
			This.clb_tx_simplu2.SetFocus()
			PLRETURN=.F.
		
		*!* 22.06.2010
		*!*	Case Empty(porec.Cont)
		*!*		aMESSAGEBOX('Nu ati completat contul!',0+48,"Atentie")
		*!*		This.clb_cont.text_simplu1.SetFocus()
		*!*		PLRETURN=.F.
		*!* 22.06.2010 ^
		
		*!*	Case Empty(Nvl(porec.id_responsabil,0))
		*!*		aMESSAGEBOX('Nu ati completat responsabilul!',0+48,"Atentie")
		*!*		This.ct_clb_responsabil.SetFocus()
		*!*		PLRETURN=.F.
		
		Case Empty(porec.nume_tip)
			aMESSAGEBOX('Nu ati completat tipul!',0+48,"Atentie")
			This.cb_nr_pag._cbbase1.SetFocus()
			PLRETURN=.F.
		
		Case Empty(Nvl(porec.id_sucursala,0)) and glEMama
			aMESSAGEBOX('Nu ati completat sucursala!',0+48,"Atentie")
			This.cb_sucursala._cbbase1.SetFocus()
			PLRETURN=.F.
		
		otherwise
			PLRETURN=This.cus_odata_gestiuni1.salvare(This.OREC,This.NID)
		Endcase
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		
		DoDefault()
		
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_gestiuni1.cactiune = tcActiune
		If glEMama
			Thisform.cb_sucursala.Visible = .T.
		Endif
	ENDPROC

	PROCEDURE Cb_nr_pag._CBBASE1.Valid
		porec.nr_pag = vtipuri_gestiuni.id_tipgest
		
	ENDPROC

	PROCEDURE Cb_sectia._cbbase1.Valid
		porec.id_sectie = vnom_sectii.id_sectie
		
	ENDPROC

	PROCEDURE Cb_sucursala._CBBASE1.Valid
		porec.id_sucursala = vnom_sucursale.id_sucursala
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_judet AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column3.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_judet.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_judet" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = _gnom_judet
		DoCreate = .T.
		Height = 303
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_judet"
		Width = 379
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 385
		_shape2.Height = 29
		_shape2.Left = 260
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Visible = .T.
		_shape2.Width = 121
		Lb_titlu_alb_b121.Caption = "Județe"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 349
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		BUT_TERMIN1.Width = 30
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_judet' AS _grdrow WITH ;
		ColumnCount = 4, ;
		DeleteMark = .F., ;
		Height = 220, ;
		Left = 12, ;
		Name = "_gnom_judet", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_judet", ;
		ScrollBars = 2, ;
		TabIndex = 3, ;
		Top = 72, ;
		Width = 360, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "judet", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 213, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "indicativ", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 46, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "inactiv", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Sparse = .F., ;
		Column3.Width = 35, ;
		Column4.ColumnOrder = 1, ;
		Column4.ControlSource = "v_judet.id_judet", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 29
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_judet.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Judet", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_judet.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_judet.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Indicativ", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_judet.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_judet.Column3.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 13, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_judet.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_judet.Column4.Header1' AS header WITH ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_judet.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 292, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 262, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 320, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 293, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 37
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_judet' AS clb_tx_simplu WITH ;
		Left = 2, ;
		Name = "lb_nom_judet", ;
		TabIndex = 1, ;
		Top = 37, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 46, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 239, ;
		Lb_simplu1.Caption = "Județ", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters pcFiltru
		Local lcFiltru
		lcFiltru=pcFiltru
		If Empty(lcFiltru)
			lcFiltru=pojud.ca_baza1.cfiltru
		Endif
		Thisform._gnom_judet.salveaza_grid()
		pojud.ca_baza1.cfiltru=lcFiltru
		pojud.ca_baza1.afisare()
		Thisform._gnom_judet.incarca_grid()
		If Reccount('v_judet')>0
			Thisform._gnom_judet.SetFocus()
		Else
			Thisform.lb_nom_judet.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_judet
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "judet",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_judet.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[judet like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_judet')>0
			Select v_judet
			Scatter Name loRec
			pcjudet = loRec.judet
			pcindicativ = loRec.indicativ
			Do Adauga_Modifica_Inregistrare With "judet",loRec,loRec.Id_judet,"UPDATE"
			Thisform.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_judet')>0
			Select v_judet
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "judet",lorec.id_judet
		
			This.actualizeaza_grid1()
		
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_JUDET'
			Nodefault
			this.LB_nom_judet.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']&&[.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_judet')
			USE IN v_judet
		ENDIF
	ENDPROC

	PROCEDURE _gnom_judet.Column1.Text1.DblClick
		thisform.log("NOM_JUDETE",v_judet.id_judet)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_judet_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_judet1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tara" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 152
		Name = "frm_judet_nou"
		Width = 372
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Județ"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 31, ;
		Name = "_checkbox1", ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 127
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 6, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_tara' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 25, ;
		Name = "Cb_tara", ;
		TabIndex = 1, ;
		Top = 36, ;
		Width = 314, ;
		ZOrderSet = 14, ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 80, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.TabIndex = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 230, ;
		_lbbase1.Caption = "Țară", ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 2, ;
		Top = 64, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "porec.judet", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Județ", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 3, ;
		Top = 92, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "porec.indicativ", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.MaxLength = 2, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Indicativ", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_judet1' AS cus_odata_judet WITH ;
		Left = 336, ;
		Name = "Cus_odata_judet1", ;
		Top = 48
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		
		LOCAL PLRETURN
		
		lccontrol = UPPER(this.ActiveControl.BaseClass )
		IF   INLIST(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.Activecontrol.controlsource
			&lcval=thisform.ActiveControl.value
		ENDIF 	
		
		
		Do Case
		Case Empty(porec.judet)
			amessagebox('Nu ati completat judetul!',0+48,"Atentie")
			This.Clb_tx_simplu1.SetFocus()
			plreturn=.F.
		Case Empty(porec.indicativ)
			amessagebox('Nu ati completat indicativul!',0+48,"Atentie")
			This.Clb_tx_simplu2.SetFocus()
			plreturn=.F.		
		Otherwise
		*!*	modificare	ROADEF v 2.1.2
		*!*		If Alltrim(Upper(This.cus_odata_judet1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_judet1.cactiune))="UPDATE" And (porec.judet!=pcjudet OR porec.indicativ!=pcindicativ)) 
		*!*			pcexec=[select * from syn_vnom_judete where (TRIM(judet)=']+Alltrim(porec.judet)+[' or TRIM(indicativ)=']+Alltrim(porec.indicativ)+[') and id_judet !=]+ALLTRIM(STR(porec.id_judet))
		*!*			Do While .T.
		*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista')>0
		*!*				SELECT exista
		*!*				LOCATE FOR judet=Alltrim(porec.judet)
		*!*				IF FOUND()
		*!*					j=1
		*!*				ELSE
		*!*					j=0
		*!*				ENDIF   
		*!*				GO TOP 
		*!*				LOCATE FOR indicativ=Alltrim(porec.indicativ)
		*!*				IF FOUND()
		*!*					i=1
		*!*				ELSE
		*!*					i=0
		*!*				ENDIF
		*!*				
		*!*				DO CASE 
		*!*				CASE j=1 AND i=0   
		*!*					amessagebox('Mai exista acest judet inregistrat!',0+48,"Atentie")
		*!*					Thisform.clb_tx_simplu1.SetFocus()
		*!*					Use In exista
		*!*					plreturn=.F.
		*!*				CASE j=0 AND i=1
		*!*					amessagebox('Mai exista acest indicativ inregistrat!',0+48,"Atentie")
		*!*					Thisform.clb_tx_simplu2.SetFocus()
		*!*					Use In exista
		*!*					plreturn=.F.
		*!*				CASE j=1 AND i=1
		*!*					amessagebox('Mai exista acest judet si acest indicativ inregistrate!',0+48,"Atentie")
		*!*					Thisform.clb_tx_simplu1.SetFocus()
		*!*					Use In exista
		*!*					plreturn=.F.
		*!*				ENDCASE 
		*!*			ELSE 
		*!*				PLRETURN=This.cus_odata_judet1.salvare(This.OREC,This.NID)
		*!*			ENDIF 
		*!*		ELSE 
		*!*			PLRETURN=This.cus_odata_judet1.salvare(This.OREC,This.NID)
		*!*		ENDIF  
			PLRETURN=This.cus_odata_judet1.salvare(This.OREC,This.NID)
		*!*	modificare	ROADEF v 2.1.2 ^
		ENDCASE 
		
		
		
		Return PLRETURN
		
		*****
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		
		this.orec= toRec
		this.nid = tnId
		this.cus_odata_judet1.cactiune = tcActiune
		
		Local lcSql, lcCursor
		With This.cb_tara._cbbase1
			.ControlSource = []
			.RowSourceType = 0
			.RowSource = []
			.DisplayValue = []
			lcSql = [select id_tara, tara, prescurtare from syn_nom_tari order by tara]
			lcCursor = [crstari]
			If goExecutor.oExecuta(lcSql,lcCursor)
				Select (lcCursor)
				If Nvl(this.orec.id_tara,0) = 0
					Locate For prescurtare = [RO]
				Else
					Locate For id_tara = this.orec.id_tara
				Endif
				If !Found()
					Go Top
				Endif
				this.orec.id_tara = id_tara
				this.orec.tara = Alltrim(tara)
			Endif
			.ControlSource = [porec.tara]
			.RowSourceType = 2
			.RowSource = [crstari.tara]
			.DisplayValue = this.orec.tara
		Endwith
	ENDPROC

	PROCEDURE Cb_tara._cbbase1.InteractiveChange
		Thisform.oRec.id_tara = crstari.id_tara
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_localitati AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cLocalitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cLocalitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cJudet.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cJudet.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cId_loc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cId_loc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cSiruta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cSiruta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cTara.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cTara.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_local.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_local" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = _gnom_local
		DoCreate = .T.
		Height = 377
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_localitati"
		Width = 599
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 600
		_shape2.Anchor = 9
		_shape2.Height = 29
		_shape2.Left = 478
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 121
		Lb_titlu_alb_b121.Caption = "Localități"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Anchor = 9
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 567
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		BUT_TERMIN1.Width = 30
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_local' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 7, ;
		DeleteMark = .F., ;
		Height = 299, ;
		Left = 9, ;
		Name = "_gnom_local", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_local", ;
		TabIndex = 3, ;
		Top = 73, ;
		Width = 579, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "localitate_s", ;
		Column1.Name = "cLocalitate", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 145, ;
		Column2.ColumnOrder = 7, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "cInactiv", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 35, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "judet", ;
		Column3.Name = "cJudet", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 52, ;
		Column4.ColumnOrder = 1, ;
		Column4.ControlSource = "id_loc", ;
		Column4.Name = "cId_loc", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 34, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "siruta", ;
		Column5.Name = "cSiruta", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 41, ;
		Column6.ColumnOrder = 6, ;
		Column6.ControlSource = "tara", ;
		Column6.Name = "cTara", ;
		Column6.ReadOnly = .T., ;
		Column7.ColumnOrder = 3, ;
		Column7.ControlSource = "explicatie", ;
		Column7.Name = "cExplicatie", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 156
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_local.cExplicatie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_local.cExplicatie.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_local.cId_loc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_local.cId_loc.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_local.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 13, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_local.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_local.cJudet.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Judet", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_local.cJudet.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_local.cLocalitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Localitate", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_local.cLocalitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_local.cSiruta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Siruta", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_local.cSiruta.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_local.cTara.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tara", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_local.cTara.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 508, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 478, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 9, ;
		Height = 27, ;
		Left = 538, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 0, ;
		Left = 384, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 38
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_local' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		Left = 93, ;
		Name = "lb_nom_local", ;
		TabIndex = 1, ;
		Top = 37, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Localitate", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=poloc.ca_baza1.cfiltru
		ENDIF
		thisform._gnom_local.salveaza_grid()
		poloc.ca_baza1.cfiltru=lcFiltru
		poloc.ca_baza1.afisare()
		thisform._gnom_local.incarca_grid()
		IF RECCOUNT('v_local')>0
			thisform._gnom_local.SetFocus()
		ELSE
			thisform.lb_nom_local.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_local
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "localitati",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_local.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[localitate like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_local')>0
			Select v_local
			Scatter Name loRec
			pcid_judet = loRec.id_judet
			pclocalitate = loRec.localitate
			Do Adauga_Modifica_Inregistrare With "localitati",loRec,loRec.Id_loc,"UPDATE"
			Thisform.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_local')>0
			Select v_local
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "localitati",lorec.id_loc
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_LOCAL'
			Nodefault
			this.LB_nom_local.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_local')
			USE IN v_local
		ENDIF
	ENDPROC

	PROCEDURE _gnom_local.cLocalitate.Text1.DblClick
		thisform.log("NOM_LOCALITATI",v_local.id_loc)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_localitati_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_localitati1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_siruta" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tara" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_judet" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_tx_simplu1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_judete
		*m: actualizeaza_tari
		*m: modifica_judet
		*m: modifica_tara
		*p: cprescurtaretara
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		cprescurtaretara = 
		DoCreate = .T.
		Height = 240
		Name = "frm_localitati_nou"
		Width = 350
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 350
		_shape2.Height = 29
		_shape2.Left = 289
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Localitate"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		BUT_TERMIN1.Left = 319
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 19, ;
		Name = "_checkbox1", ;
		TabIndex = 6, ;
		TabStop = .F., ;
		Top = 215
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 289, ;
		Name = "But_renunt1", ;
		TabIndex = 8, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_judet' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 19, ;
		Name = "Cb_judet", ;
		TabIndex = 2, ;
		Top = 64, ;
		Width = 314, ;
		ZOrderSet = 14, ;
		_cbbase1.Enabled = .F., ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 80, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 230, ;
		_lbbase1.Caption = "Județ", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tara' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 19, ;
		Name = "Cb_tara", ;
		TabIndex = 1, ;
		Top = 36, ;
		Width = 314, ;
		ZOrderSet = 14, ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 80, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.TabIndex = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 230, ;
		_lbbase1.Caption = "Țară", ;
		_lbbase1.Name = "_lbbase1", ;
		_lbbase1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 3, ;
		Top = 92, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "porec.localitate_s", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Localitate", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_siruta' AS clb_tx_simplu WITH ;
		Left = 19, ;
		Name = "Clb_tx_siruta", ;
		TabIndex = 4, ;
		Top = 120, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "porec.siruta", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Siruta", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_localitati1' AS cus_odata_localitati WITH ;
		Left = 337, ;
		Name = "Cus_odata_localitati1", ;
		Top = 48
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'Ed_tx_simplu1' AS ed_tx_simplu WITH ;
		Left = 19, ;
		Name = "Ed_tx_simplu1", ;
		TabIndex = 5, ;
		Top = 148, ;
		_edbase1.ControlSource = "porec.explicatie", ;
		_edbase1.Left = 80, ;
		_edbase1.Name = "_edbase1", ;
		_edbase1.Width = 230, ;
		_lbbase1.Caption = "Explicație", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_judete
		Local lcSql, lcCursor
		With This.cb_judet
			With ._cbbase1
				.ControlSource = []
				.RowSourceType = 0
				.RowSource = []
				.DisplayValue = []
			Endwith
		
			If This.cprescurtaretara = [RO]
				.Visible = .T.
				This.Clb_tx_siruta.Visible = .T.		
				lcSql = [select 1 as tip,null as id_judet, '<ALEGETI JUDETUL>' as judet, '' as indicativ from dual] + ;
					[ union all ] +;
					[select 2 as tip,id_judet, judet, indicativ from syn_vnom_judete where inactiv = 0 and id_tara = 1 order by tip,judet]
				lcCursor = [crsjudete]
				If goExecutor.oExecuta(lcSql,lcCursor)
					Select (lcCursor)
					Locate For Nvl(id_judet,-1) = Nvl(This.oRec.id_judet,-1)
					If !Found()
						Go Top
					Endif
					This.oRec.id_judet = id_judet
					This.oRec.judet = Alltrim(judet)
					With ._cbbase1
						.Enabled = .T.
					Endwith
				Else
					This.oRec.id_judet = Null
					This.oRec.judet = []
					With ._cbbase1
						.Enabled = .F.
					Endwith
				Endif
		
				With ._cbbase1
					.ControlSource = [porec.judet]
					.RowSourceType = 2
					.RowSource = [crsjudete.judet]
					.DisplayValue = This.oRec.judet
				Endwith
			Else
				.Visible = .F.
				This.oRec.id_judet = Null
				This.oRec.judet = []
				This.oRec.siruta = 0
				This.Clb_tx_siruta.Refresh()
				This.Clb_tx_siruta.Visible = .F.
			Endif
		Endwith
	ENDPROC

	PROCEDURE actualizeaza_tari
		Local lcSql, lcCursor
		With This.cb_tara._cbbase1
			.ControlSource = []
			.RowSourceType = 0
			.RowSource = []
			.DisplayValue = []
			lcSql = [select id_tara, tara, prescurtare from syn_nom_tari order by tara]
			lcCursor = [crstari]
			If goExecutor.oExecuta(lcSql,lcCursor)
				Select (lcCursor)
				If Nvl(This.oRec.id_tara,0) = 0
					Locate For prescurtare = [RO]
				Else
					Locate For id_tara = This.oRec.id_tara
				Endif
				If !Found()
					Go Top
				Endif
				This.oRec.id_tara = id_tara
				This.oRec.tara = Alltrim(tara)
				This.cprescurtaretara = Alltrim(prescurtare)
			Endif
			.ControlSource = [porec.tara]
			.RowSourceType = 2
			.RowSource = [crstari.tara]
			.DisplayValue = This.oRec.tara
		Endwith
		This.actualizeaza_judete()
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		plreturn=.F.
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local PLRETURN
		
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If   Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		
		Do Case
		Case Empty(porec.tara)
			amessagebox('Nu ati completat tara!',0+48,"Atentie")
			This.cb_tara._cbbase1.SetFocus()
			PLRETURN=.F.
		Case EMPTY(NVL(porec.id_judet,0)) AND This.cprescurtaretara = [RO]
			amessagebox('Nu ati completat judetul!',0+48,"Atentie")
			This.cb_judet._cbbase1.SetFocus()
			PLRETURN=.F.
		Case Empty(porec.localitate_s)
			amessagebox('Nu ati completat denumirea localitatii!',0+48,"Atentie")
			This.clb_tx_simplu2.Text_simplu1.SetFocus()
			PLRETURN=.F.
		Otherwise
		*!*	modificare	ROADEF v 2.1.2
		*!*		If Alltrim(Upper(This.cus_odata_localitati1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_localitati1.cactiune))="UPDATE" And (porec.localitate!=pclocalitate OR porec.id_judet !=pcid_judet))
		*!*			pcexec=[select * from ]+gcS+[.vnom_localitati where (TRIM(localitate)=']+Alltrim(porec.localitate)+[' and TRIM(id_judet)=]+ALLTRIM(STR(porec.id_judet))+[) and id_loc !=]+ALLTRIM(STR(porec.id_loc))
		*!*			Do While .T.
		*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_loc_jud')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista_loc_jud')>0
		*!*				amessagebox('Mai exista acesta localitate inregistrata in acest judet!',0+48,"Atentie")
		*!*				Thisform.clb_tx_simplu2.SetFocus()
		*!*				Use In exista_loc_jud
		*!*				plreturn=.F.
		*!*			ELSE
		*!*				PLRETURN=This.cus_odata_localitati1.salvare(This.OREC,This.NID)
		*!*			ENDIF
		*!*		ELSE
		*!*			PLRETURN=This.cus_odata_localitati1.salvare(This.OREC,This.NID)
		*!*		ENDIF
			PLRETURN=This.cus_odata_localitati1.salvare(This.OREC,This.NID)
		*!*	modificare	ROADEF v 2.1.2	^
		Endcase
		
		Return PLRETURN
		
		
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		
		this.orec= toRec
		this.nid = tnId
		this.cus_odata_localitati1.cactiune = tcActiune
		
		Thisform.actualizeaza_tari()
	ENDPROC

	PROCEDURE modifica_judet
		This.oRec.id_judet = crsjudete.id_judet
		This.oRec.id_loc = Null
		This.oRec.localitate = []
	ENDPROC

	PROCEDURE modifica_tara
		This.oRec.id_tara = crstari.id_tara
		This.cprescurtaretara = Alltrim(crstari.prescurtare)
		This.oRec.id_judet = Null
		This.oRec.judet = []
		This.actualizeaza_judete()
	ENDPROC

	PROCEDURE Cb_judet._cbbase1.InteractiveChange
		Thisform.modifica_judet()
	ENDPROC

	PROCEDURE Cb_tara._cbbase1.InteractiveChange
		Thisform.modifica_tara()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_log AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column1.Responsabill" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_glog.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_cautare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_cautare2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_cautare3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_lbbase4" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 484
		Name = "frm_log"
		Width = 742
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 743
		_shape2.Height = 29
		_shape2.Left = 708
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 36
		Lb_titlu_alb_b121.Caption = "Log"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Left = 713
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 6
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_glog' AS _grdrow WITH ;
		ColumnCount = 7, ;
		DeleteMark = .F., ;
		Height = 354, ;
		Left = 3, ;
		Name = "_glog", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "v_log", ;
		ScrollBars = 3, ;
		TabIndex = 5, ;
		Top = 123, ;
		Width = 729, ;
		Column1.ControlSource = "tabel", ;
		Column1.Name = "Column1", ;
		Column1.Width = 132, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "id_tabel", ;
		Column2.Name = "Column2", ;
		Column2.Width = 50, ;
		Column3.ColumnOrder = 2, ;
		Column3.ControlSource = "camp", ;
		Column3.Name = "Column3", ;
		Column3.Width = 80, ;
		Column4.ControlSource = "valoarev", ;
		Column4.Name = "Column4", ;
		Column4.Width = 98, ;
		Column5.ControlSource = "valoaren", ;
		Column5.Name = "Column5", ;
		Column5.Width = 92, ;
		Column6.ControlSource = "utilizator", ;
		Column6.Name = "Column6", ;
		Column6.Width = 146, ;
		Column7.ControlSource = "dataora", ;
		Column7.Name = "Column7", ;
		Column7.Width = 102
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_glog.Column1.Responsabill' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tabel", ;
		Name = "Responsabill"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_glog.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 '_glog.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_glog.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_glog.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Camp", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_glog.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_glog.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare veche", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_glog.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_glog.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Valoare noua", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_glog.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_glog.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Operator", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_glog.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_glog.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data ora", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_glog.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_lbbase2' AS _lbbase WITH ;
		AutoSize = .F., ;
		Caption = "Tabel", ;
		Comment = "tabel", ;
		FontSize = 12, ;
		Height = 19, ;
		Left = 9, ;
		Name = "_lbbase2", ;
		TabIndex = 11, ;
		Top = 36, ;
		Width = 97
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase3' AS _lbbase WITH ;
		AutoSize = .F., ;
		Caption = "Camp", ;
		Comment = "camp", ;
		FontSize = 12, ;
		Height = 19, ;
		Left = 9, ;
		Name = "_lbbase3", ;
		TabIndex = 10, ;
		Top = 66, ;
		Width = 97
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT '_lbbase4' AS _lbbase WITH ;
		AutoSize = .F., ;
		Caption = "Operator", ;
		Comment = "utilizator", ;
		FontSize = 12, ;
		Height = 19, ;
		Left = 9, ;
		Name = "_lbbase4", ;
		TabIndex = 12, ;
		Top = 95, ;
		Width = 97
		*< END OBJECT: ClassLib="_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'Cb_tx_cautare1' AS cb_tx_cautare WITH ;
		Left = 109, ;
		Name = "Cb_tx_cautare1", ;
		TabIndex = 1, ;
		Top = 32, ;
		Text.Name = "Text", ;
		Criteriu.Name = "Criteriu"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_cautare2' AS cb_tx_cautare WITH ;
		Left = 109, ;
		Name = "Cb_tx_cautare2", ;
		TabIndex = 2, ;
		Top = 62, ;
		Text.Name = "Text", ;
		Criteriu.Name = "Criteriu"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_cautare3' AS cb_tx_cautare WITH ;
		Left = 109, ;
		Name = "Cb_tx_cautare3", ;
		TabIndex = 3, ;
		Top = 91, ;
		Text.Name = "Text", ;
		Criteriu.Name = "Criteriu"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 420, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 4, ;
		Top = 32
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=polog.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._glog)
		polog.ca_baza1.cfiltru=lcFiltru
		polog.ca_baza1.afisare()
		restore_grid_tag(thisform._glog)
		IF RECCOUNT('v_log')>0
			thisform._glog.SetFocus()
		ELSE
			thisform.cb_tx_cautare1.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_cauta
		LOCAL lcFiltru
		lcFiltru=[]
		
		
		&& make lcFiltru: [numele coloanelor din v_log sunt pe comment-urile labelurilor]
		FOR i = 1 TO 3
			lcExecuteString = " Thisform.cb_tx_cautare" + ALLTRIM(STR(i))
			WITH &lcExecuteString
				lcval1=STRTRAN(ALLTRIM(UPPER(.TEXT.VALUE)),['],[''])
				IF !EMPTY(.TEXT.VALUE) OR (EMPTY(.TEXT.VALUE) AND .criteriu.VALUE = "6")
					DO CASE
						CASE .criteriu.VALUE = "1"
							lcExecuteString = "lcfiltru = lcfiltru + [and ] + thisform._lbbase" + ALLTRIM(STR(i+1)) + ".comment + [ LIKE '] + lcval1 + [%']"
							&lcExecuteString
						CASE .criteriu.VALUE = "2"
							lcExecuteString = "lcfiltru = lcfiltru + [and ] + thisform._lbbase" + ALLTRIM(STR(i+1)) +".comment + [ ='] + lcval1 + [']"
							&lcExecuteString
						CASE .criteriu.VALUE = "3"
							lcExecuteString = "lcfiltru = lcfiltru + [and ] + thisform._lbbase" + ALLTRIM(STR(i+1))  + ".comment + [ !='] + lcval1 + [']"
							&lcExecuteString
						CASE .criteriu.VALUE = "4"
							lcExecuteString = "lcfiltru = lcfiltru + [and ] + thisform._lbbase" + ALLTRIM(STR(i+1))  + ".comment + [ LIKE '%] + lcval1 + [%']"
							&lcExecuteString
						CASE .criteriu.VALUE = "5"
							lcExecuteString = "lcfiltru = lcfiltru + [and ] + thisform._lbbase" + ALLTRIM(STR(i+1))  + ".comment + [ NOT LIKE '%] + lcval1 + [%']"
							&lcExecuteString
						CASE .criteriu.VALUE = "6"
							lcFiltru = lcFiltru + [and 2=2]
					ENDCASE
				ENDIF
			ENDWITH
		ENDFOR
		
		
		&& taiere and din fata:
		IF !EMPTY(lcFiltru)
			lcFiltru = SUBSTR(lcFiltru,5)
		ENDIF
		
		&&WAIT WINDOW ":"+lcFiltru
		
		
		&&from dis point all I need is lcFiltru:
		THIS.MOUSEPOINTER= 11
		THIS.LOCKSCREEN=.T.
		THISFORM.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		THIS.LOCKSCREEN=.F.
		THIS.MOUSEPOINTER= 0
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GLOG'
			Nodefault
			this.LB_log.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE Unload
		IF USED('v_log')
			USE IN v_log
		ENDIF
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_lucrari AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnom_lucrari" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnom_lucrari.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnom_lucrari.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnom_lucrari.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnom_lucrari.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnom_lucrari.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnom_lucrari.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_lucrari" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = gnom_lucrari
		DoCreate = .T.
		Height = 303
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_lucrari"
		Width = 388
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 385
		_shape2.Height = 29
		_shape2.Left = 264
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 125
		Lb_titlu_alb_b121.Caption = "Lucrari"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 355
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		BUT_TERMIN1.Width = 30
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 298, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 268, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 326, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 300, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 44
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'gnom_lucrari' AS _grdrow WITH ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		Height = 218, ;
		Left = 8, ;
		Name = "gnom_lucrari", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_nom_lucrari", ;
		TabIndex = 3, ;
		Top = 81, ;
		Width = 374, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "nrord", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 257, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 49, ;
		Column3.ColumnOrder = 1, ;
		Column3.ControlSource = "id_lucrare", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 35
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'gnom_lucrari.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Lucrare", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gnom_lucrari.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'gnom_lucrari.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 21, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 26, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'gnom_lucrari.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gnom_lucrari.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gnom_lucrari.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'lb_nom_lucrari' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "lb_nom_lucrari", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Lucrare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=polucrari.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(THISFORM.gnom_lucrari)
		polucrari.ca_baza1.cfiltru=lcFiltru
		polucrari.ca_baza1.afisare()
		restore_grid_tag(THISFORM.gnom_lucrari)
		IF RECCOUNT('v_nom_lucrari')>0
			THISFORM.gnom_lucrari.SETFOCUS()
		ELSE
			THISFORM.lb_nom_lucrari.SETFOCUS()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		DO nom_lucrari_nou
		
		IF gnButon = 1
			THISFORM.actualizeaza_grid1()
		ENDIF
		
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_lucrari.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[nrord like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		LOCAL loRec, lnIdLucrare
		
		If Reccount('v_nom_lucrari')>0
			Select v_nom_lucrari
			lnIdLucrare = id_lucrare
			Scatter Name loRec
		
			loRec = nom_lucrari_modifica(lnIdLucrare)
				
			IF !ISNULL(loRec)
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid1()
				SELECT v_nom_lucrari
				LOCATE FOR id_lucrare = lorec.id_lucrare
				IF !FOUND()
					GO top
				ENDIF 	
				thisform.gnom_lucrari.SetFocus()		
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
			Endif
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_nom_lucrari')>0
			Select v_nom_lucrari
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "lucrari",lorec.id_lucrare
		
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = 'GNOM_LUCRARI'
			Nodefault
			this.LB_nom_lucrari.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE gnom_lucrari.Column1.Text1.DblClick
		thisform.log("NOM_LUCRARI",v_nom_lucrari.ID_LUCRARE)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_lucrari_nou AS _frmbase OF "..\..\..\roaauto\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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_lucrari1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="img_parinte" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_parinte" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_alege_parinte
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 124
		Name = "frm_lucrari_nou"
		Width = 371
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Lucrare"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 6
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		Gridsort1.Left = -5
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 31
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 39, ;
		Name = "_checkbox1", ;
		TabIndex = 5, ;
		TabStop = .F., ;
		Top = 100
		*< END OBJECT: ClassLib="..\..\..\roaauto\comun\clase\_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 3, ;
		Top = 1
		*< END OBJECT: ClassLib="..\..\..\roaauto\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'clb_parinte' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "clb_parinte", ;
		TabIndex = 4, ;
		TabStop = .F., ;
		ToolTipText = "Pentru modificare, faceti dublu-click!", ;
		Top = 40, ;
		Width = 313, ;
		Text_simplu1.ControlSource = "porec.nume_parinte", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 101, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Value = , ;
		Text_simplu1.Width = 206, ;
		Lb_simplu1.Caption = "Parinte", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\..\roaauto\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 68, ;
		Width = 313, ;
		Text_simplu1.ControlSource = "porec.nrord", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 101, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 205, ;
		Lb_simplu1.Caption = "Lucrare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\..\..\roaauto\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_lucrari1' AS cus_odata_lucrari WITH ;
		Left = 180, ;
		Name = "Cus_odata_lucrari1", ;
		Top = 24
		*< END OBJECT: ClassLib="..\..\..\roaauto\comun\clase\onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'img_parinte' AS _image WITH ;
		Height = 24, ;
		Left = 331, ;
		Name = "img_parinte", ;
		Picture = ..\grafice\alege.bmp, ;
		Stretch = 2, ;
		ToolTipText = "Alegeti valuta", ;
		Top = 42, ;
		Width = 24
		*< END OBJECT: ClassLib="..\..\..\roaauto\comun\clase\_baza.vcx" BaseClass="image" />
	
	PROCEDURE do_alege_parinte
		Local loCauta
		loCauta = caut_lucrare()
		IF ISNULL(loCauta)
			RETURN
		ENDIF 
		
		IF !EMPTY(loCauta.id_lucrare)
			poRec.id_tata = loCauta.id_lucrare
			poRec.nume_parinte = loCauta.nrord
		ELSE
			poRec.id_tata = NULL
			poRec.nume_parinte = ""	
		ENDIF
		
		this.clb_parinte.text_simplu1.Refresh()
		
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		
		lccontrol = UPPER(this.ActiveControl.BaseClass )
		IF   INLIST(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.Activecontrol.controlsource
			&lcval=thisform.ActiveControl.value
		ENDIF 	
		
		
		IF EMPTY(porec.nrord)
			aMessagebox('Nu ati completat lucrarea!',0+48,"Atentie")
			This.clb_tx_simplu1.SetFocus()
			plreturn=.F.
		ELSE 
			PLRETURN=This.cus_odata_lucrari1.salvare(This.OREC,This.NID)
		ENDIF 
		
		Return PLRETURN
		
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		
		this.orec= toRec
		this.nid = tnId
		this.cus_odata_lucrari1.cactiune = tcActiune
	ENDPROC

	PROCEDURE clb_parinte.Text_simplu1.DblClick
		Thisform.do_alege_parinte()
	ENDPROC

	PROCEDURE img_parinte.Click
		Thisform.do_alege_parinte()
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_medii_transmisie AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_medii_transmisie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_medii_transmisie.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_medii_transmisie.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_medii_transmisie.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_medii_transmisie.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_medii_transmisie" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = _gnom_medii_transmisie
		DoCreate = .T.
		Height = 303
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_medii_transmisie"
		Width = 378
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 385
		_shape2.Height = 29
		_shape2.Left = 259
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 121
		Lb_titlu_alb_b121.Caption = "Medii_transmisie"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Left = 348
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_medii_transmisie' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 191, ;
		Left = 16, ;
		Name = "_gnom_medii_transmisie", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_medii_transmisie", ;
		ScrollBars = 2, ;
		TabIndex = 3, ;
		Top = 101, ;
		Width = 338, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "mediu_transmisie", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 231, ;
		Column2.ColumnOrder = 1, ;
		Column2.ControlSource = "id_mediu", ;
		Column2.Name = "Column3", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 38
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_medii_transmisie.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Mediu_transmisie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_medii_transmisie.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_medii_transmisie.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_medii_transmisie.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Left = 291, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 261, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Left = 319, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 293, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 44
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_medii_transmisie' AS clb_tx_simplu WITH ;
		Left = 2, ;
		Name = "lb_nom_medii_transmisie", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Medii transmisie", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=poMediu_transmisie.ca_baza1.cfiltru
		ENDIF
		
		save_grid_tag(thisform._gnom_medii_transmisie)
		poMediu_transmisie.ca_baza1.cfiltru=lcFiltru
		poMediu_transmisie.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_medii_transmisie)
		IF RECCOUNT('v_medii_transmisie')>0
			thisform._gnom_medii_transmisie.SetFocus()
		ELSE
			thisform.lb_nom_medii_transmisie.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_medii_transmisie
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "medii_transmisie",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_medii_transmisie.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[mediu_transmisie like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_medii_transmisie')>0
			Select v_medii_transmisie
			Scatter Name loRec
			pcmediu_transmisie=loRec.mediu_transmisie
			Do Adauga_Modifica_Inregistrare With "medii_transmisie",loRec,loRec.Id_mediu,"UPDATE"
			Thisform.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_medii_transmisie')>0
			Select v_medii_transmisie
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "medii_transmisie",lorec.id_mediu
		
			This.actualizeaza_grid1()
		
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_gnom_medii_transmisie'
			Nodefault
			this.lb_nom_medii_transmisie.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_medii_transmisie')
			USE IN v_medii_transmisie
		ENDIF
	ENDPROC

	PROCEDURE _gnom_medii_transmisie.Column1.Text1.DblClick
		thisform.log("NOM_FDOC",v_fdoc.id_fdoc)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_medii_transmisie_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_medii_transmisie1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 106
		Name = "frm_medii_transmisie_nou"
		Width = 372
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 309
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 70
		Lb_titlu_alb_b121.Caption = "Mediu transmisie"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 4, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 31, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		Width = 303, ;
		Text_simplu1.ControlSource = "porec.mediu_transmisie", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 111, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Mediu transmisie", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_medii_transmisie1' AS cus_odata_medii_transmisie WITH ;
		Left = 339, ;
		Name = "Cus_odata_medii_transmisie1", ;
		Top = 65
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		
		LOCAL PLRETURN
		
		lccontrol = UPPER(this.ActiveControl.BaseClass )
		IF   INLIST(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.Activecontrol.controlsource
			&lcval=thisform.ActiveControl.value
		ENDIF 	
		
		Do Case
		Case Empty(porec.mediu_transmisie)
			aMessagebox('Nu ati completat mediu transmisie!',0+48,"Atentie")
			This.clb_tx_simplu1.SetFocus()
			plreturn=.F.
		OTHERWISE 
		
			If Alltrim(Upper(This.cus_odata_medii_transmisie1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_medii_transmisie1.cactiune))="UPDATE" And porec.mediu_transmisie!=pcMediu_transmisie) 
				pcexec=[select * from vnom_medii_transmisie where TRIM(mediu_transmisie)=']+Alltrim(porec.mediu_transmisie)+[']
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_mediu_transmisie')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_mediu_transmisie')>0
					amessagebox('Mai exista acest mediu de transmisie inregistrat!',0+48,"Atentie")
					Thisform.clb_tx_simplu1.SetFocus()
					Use In exista_mediu_transmisie
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_medii_transmisie1.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
				PLRETURN=This.cus_odata_medii_transmisie1.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_medii_transmisie1.cactiune = tcActiune
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_partener AS _frmbase OF "_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="_grdrow1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cId.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cId.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cCod_fiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cCod_fiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cReg_comert.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cReg_comert.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cCont_banca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cCont_banca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cPrefix.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cPrefix.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cSufix.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cSufix.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cTip_persoana.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cTip_persoana.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cMotiv_inactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cMotiv_inactiv.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cLocalitate_inreg.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cLocalitate_inreg.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cCategorie_entitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow1.cCategorie_entitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.cDenumire.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_grdrow2.cDenumire.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_reg_comert" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_nume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_categorie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cStrada.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cStrada.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cLocalitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cLocalitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cTelefon1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cTelefon1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cBloc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cBloc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cScara.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cScara.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cApart.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cApart.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cNumar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cNumar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cPrincipala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cPrincipala.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cEtaj.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cEtaj.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cTelefon2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cTelefon2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cFax.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cFax.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cEmail.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cEmail.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cWeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cWeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cJudet.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.cJudet.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1._grdrow3.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page1.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2._grdrow3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2._grdrow3.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2._grdrow3.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Pageframe1.Page2.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_cod_fiscal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_copiaza1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_prenume" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_grid3
		*m: actualizeaza_grid_part
		*m: do_adauga2
		*m: do_adauga3
		*m: inainte_de_do_modifica2
		*m: inainte_de_do_modifica3
		*m: inainte_de_do_sterge2
		*m: inainte_de_do_sterge3
		*p: cul_activ
		*p: nid_tip_part
		*p: ntip_persoana_default		&& Tipul de persoana cu care intra implicit la adaugare (1 - persoana juridica,2 - persoana fizica)
	*</DefinedPropArrayMethod>

	*<PropValue>
		Caption = ""
		cgridsortlist = _grdrow1
		DoCreate = .T.
		Height = 593
		Name = "frm_partener"
		nid_tip_part = 0
		ntip_persoana_default = 1
		Width = 696
		WindowState = 2
		WindowType = 1
		_shape1.Anchor = 10
		_shape1.Comment = "*:OnResize=sR"
		_shape1.Height = 30
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "W"
		_shape1.Top = 0
		_shape1.Width = 698
		_shape1.ZOrderSet = 2
		_shape2.Anchor = 8
		_shape2.Comment = "*:OnResize=RT"
		_shape2.Height = 29
		_shape2.Left = 665
		_shape2.Name = "_shape2"
		_shape2.Tag = "L"
		_shape2.Top = 1
		_shape2.Width = 32
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "Parteneri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 17
		Lb_titlu_alb_b121.Tag = ""
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Comment = "*:OnResize=RT"
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 666
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 16
		BUT_TERMIN1.Tag = "L"
		BUT_TERMIN1.Top = 2
		BUT_TERMIN1.Width = 30
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Left = 408
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 8
	*</PropValue>

	ADD OBJECT '_grdrow1' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 15, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 340, ;
		HighlightStyle = 2, ;
		Left = 4, ;
		Name = "_grdrow1", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsparteneri", ;
		TabIndex = 8, ;
		Tag = "HW", ;
		Top = 80, ;
		Width = 524, ;
		ZOrderSet = 0, ;
		Column1.ControlSource = "crsparteneri.id_part", ;
		Column1.Name = "cId", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 52, ;
		Column2.ControlSource = "crsparteneri.denumire", ;
		Column2.Name = "cDenumire", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 174, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "crsparteneri.cod_fiscal", ;
		Column3.Name = "cCod_fiscal", ;
		Column3.ReadOnly = .T., ;
		Column4.ColumnOrder = 6, ;
		Column4.ControlSource = "crsparteneri.reg_comert", ;
		Column4.Name = "cReg_comert", ;
		Column4.ReadOnly = .T., ;
		Column5.Alignment = 2, ;
		Column5.ColumnOrder = 14, ;
		Column5.ControlSource = "crsparteneri.inactiv", ;
		Column5.Name = "cInactiv", ;
		Column5.ReadOnly = .T., ;
		Column5.Sparse = .F., ;
		Column5.Width = 38, ;
		Column6.ColumnOrder = 3, ;
		Column6.ControlSource = "crsparteneri.nume", ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column7.ColumnOrder = 4, ;
		Column7.ControlSource = "crsparteneri.prenume", ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column8.ColumnOrder = 12, ;
		Column8.ControlSource = "banca", ;
		Column8.Name = "cBanca", ;
		Column8.ReadOnly = .T., ;
		Column9.ColumnOrder = 13, ;
		Column9.ControlSource = "cont_banca", ;
		Column9.Name = "cCont_banca", ;
		Column9.ReadOnly = .T., ;
		Column10.ColumnOrder = 8, ;
		Column10.ControlSource = "prefix", ;
		Column10.Name = "cPrefix", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 58, ;
		Column11.ColumnOrder = 9, ;
		Column11.ControlSource = "sufix", ;
		Column11.Name = "cSufix", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 60, ;
		Column12.ColumnOrder = 10, ;
		Column12.ControlSource = "iif(tip_persoana=1,'Juridica','Fizica')", ;
		Column12.Name = "cTip_persoana", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 88, ;
		Column13.ColumnOrder = 15, ;
		Column13.ControlSource = "motiv_inactiv", ;
		Column13.Name = "cMotiv_inactiv", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 89, ;
		Column14.ColumnOrder = 7, ;
		Column14.ControlSource = "crsparteneri.localitate_inreg", ;
		Column14.Name = "cLocalitate_inreg", ;
		Column14.ReadOnly = .T., ;
		Column15.ColumnOrder = 11, ;
		Column15.ControlSource = "categorie_entitate", ;
		Column15.Name = "cCategorie_entitate", ;
		Column15.ReadOnly = .T.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_grdrow1.cBanca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Banca", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cBanca.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cCategorie_entitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Categorie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cCategorie_entitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cCod_fiscal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "C.I.F. / C.N.P.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cCod_fiscal.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cCont_banca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont banca", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cCont_banca.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cDenumire.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cDenumire.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cId.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cId.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 17, ;
		Name = "Check1", ;
		Top = 49, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_grdrow1.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cLocalitate_inreg.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Localitate", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cLocalitate_inreg.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cMotiv_inactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Motivul inactiv.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cMotiv_inactiv.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prenume", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cPrefix.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prefix", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cPrefix.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cReg_comert.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Reg. Comert", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cReg_comert.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cSufix.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sufix", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cSufix.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow1.cTip_persoana.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip persoana", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow1.cTip_persoana.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_grdrow2' AS _grdrow WITH ;
		Anchor = 13, ;
		ColumnCount = 1, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		GridLineColor = 192,192,192, ;
		Height = 340, ;
		HighlightStyle = 2, ;
		Left = 540, ;
		Name = "_grdrow2", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .F., ;
		RecordSource = "crscoresppart", ;
		TabIndex = 9, ;
		Tag = "HW", ;
		Top = 80, ;
		Width = 145, ;
		ZOrderSet = 0, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cDenumire", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 123
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_grdrow2.cDenumire.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Client", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_grdrow2.cDenumire.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_copiaza1' AS but_copiaza WITH ;
		Anchor = 8, ;
		Left = 533, ;
		Name = "But_copiaza1", ;
		TabIndex = 10, ;
		Top = 48
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=RT", ;
		Left = 594, ;
		Name = "But_modifica1", ;
		TabIndex = 12, ;
		Tag = "L", ;
		Top = 48, ;
		Visible = .T., ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=RT", ;
		Left = 564, ;
		Name = "But_nou1", ;
		TabIndex = 11, ;
		Tag = "L", ;
		Top = 48, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=RT", ;
		Left = 624, ;
		Name = "But_sterge1", ;
		TabIndex = 13, ;
		Tag = "L", ;
		Top = 48, ;
		Visible = .T., ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 8, ;
		Left = 654, ;
		Name = "But_verifica1", ;
		TabIndex = 14, ;
		ToolTipText = "Validare cod", ;
		Top = 48
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_cod_fiscal' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = cod_fiscal, ;
		Caption = "Cod Fiscal", ;
		criteriu = 4, ;
		criteriu2 = 4, ;
		Left = 5, ;
		Name = "Ck_cod_fiscal", ;
		TabIndex = 2, ;
		Top = 56, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_categorie' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = p.categorie_entitate, ;
		Caption = "Categorie", ;
		Left = 139, ;
		Name = "Ck_filtru_categorie", ;
		TabIndex = 6, ;
		Top = 56, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_denumire' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = denumire, ;
		Caption = "Denumire", ;
		Left = 5, ;
		Name = "Ck_filtru_denumire", ;
		TabIndex = 1, ;
		Top = 35, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_nume' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = nume, ;
		Caption = "Nume", ;
		Left = 76, ;
		Name = "Ck_filtru_nume", ;
		TabIndex = 3, ;
		Top = 35, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_prenume' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = prenume, ;
		Caption = "Prenume", ;
		Left = 76, ;
		Name = "Ck_filtru_prenume", ;
		TabIndex = 4, ;
		Top = 56, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_reg_comert' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = reg_comert, ;
		Caption = "Reg. Comerț", ;
		criteriu = 4, ;
		criteriu2 = 4, ;
		Left = 139, ;
		Name = "Ck_reg_comert", ;
		TabIndex = 5, ;
		Top = 35, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 2, ;
		Comment = "*:OnResize=RT", ;
		Left = 259, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 7, ;
		Tag = "L", ;
		Top = 43, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 2, ;
		Comment = "*:OnResize=RT", ;
		Left = 347, ;
		Name = "Cmd_reset1", ;
		TabIndex = 18, ;
		Tag = "L", ;
		Top = 43, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Pageframe1' AS pageframe WITH ;
		Anchor = 14, ;
		ErasePage = .T., ;
		Height = 168, ;
		Left = 0, ;
		Name = "Pageframe1", ;
		PageCount = 2, ;
		TabIndex = 15, ;
		TabStretch = 1, ;
		TabStyle = 1, ;
		Top = 420, ;
		Width = 720, ;
		Page1.Caption = "Adrese", ;
		Page1.Name = "Page1", ;
		Page2.Caption = "Coduri", ;
		Page2.Name = "Page2"
		*< END OBJECT: BaseClass="pageframe" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 17, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		FontSize = 8, ;
		GridLineColor = 192,192,192, ;
		Height = 121, ;
		HighlightStyle = 1, ;
		Left = 7, ;
		Name = "_grdrow3", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsAdrese", ;
		RowHeight = 17, ;
		TabIndex = 15, ;
		Tag = "HW", ;
		Top = 7, ;
		Width = 636, ;
		ZOrderSet = 22, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "strada", ;
		Column1.FontSize = 8, ;
		Column1.Name = "cStrada", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 105, ;
		Column2.ColumnOrder = 8, ;
		Column2.ControlSource = "localitate", ;
		Column2.FontSize = 8, ;
		Column2.Name = "cLocalitate", ;
		Column2.ReadOnly = .T., ;
		Column3.ColumnOrder = 10, ;
		Column3.ControlSource = "telefon1", ;
		Column3.FontSize = 8, ;
		Column3.Name = "cTelefon1", ;
		Column3.ReadOnly = .T., ;
		Column4.ColumnOrder = 17, ;
		Column4.ControlSource = "id_regiune", ;
		Column4.FontSize = 8, ;
		Column4.Name = "Column10", ;
		Column4.ReadOnly = .T., ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "bloc", ;
		Column5.FontSize = 8, ;
		Column5.Name = "cBloc", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 28, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "scara", ;
		Column6.FontSize = 8, ;
		Column6.Name = "cScara", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 36, ;
		Column7.ColumnOrder = 6, ;
		Column7.ControlSource = "apart", ;
		Column7.FontSize = 8, ;
		Column7.Name = "cApart", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 34, ;
		Column8.ColumnOrder = 3, ;
		Column8.ControlSource = "numar", ;
		Column8.FontSize = 8, ;
		Column8.Name = "cNumar", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 42, ;
		Column9.Alignment = 2, ;
		Column9.ColumnOrder = 15, ;
		Column9.ControlSource = "inactiv", ;
		Column9.FontSize = 8, ;
		Column9.Name = "cInactiv", ;
		Column9.ReadOnly = .T., ;
		Column9.Sparse = .F., ;
		Column9.Width = 39, ;
		Column10.Alignment = 2, ;
		Column10.ColumnOrder = 16, ;
		Column10.ControlSource = "principala", ;
		Column10.FontSize = 8, ;
		Column10.Name = "cPrincipala", ;
		Column10.ReadOnly = .T., ;
		Column10.Sparse = .F., ;
		Column10.Width = 59, ;
		Column11.ColumnOrder = 7, ;
		Column11.ControlSource = "etaj", ;
		Column11.FontSize = 8, ;
		Column11.Name = "cEtaj", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 36, ;
		Column12.ColumnOrder = 11, ;
		Column12.ControlSource = "telefon2", ;
		Column12.FontSize = 8, ;
		Column12.Name = "cTelefon2", ;
		Column12.ReadOnly = .T., ;
		Column13.ColumnOrder = 12, ;
		Column13.ControlSource = "fax", ;
		Column13.FontSize = 8, ;
		Column13.Name = "cFax", ;
		Column13.ReadOnly = .T., ;
		Column14.ColumnOrder = 13, ;
		Column14.ControlSource = "email", ;
		Column14.FontSize = 8, ;
		Column14.Name = "cEmail", ;
		Column14.ReadOnly = .T., ;
		Column15.ColumnOrder = 14, ;
		Column15.ControlSource = "web", ;
		Column15.FontSize = 8, ;
		Column15.Name = "cWeb", ;
		Column15.ReadOnly = .T., ;
		Column16.ColumnOrder = 9, ;
		Column16.ControlSource = "judet", ;
		Column16.FontSize = 8, ;
		Column16.Name = "cJudet", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 40, ;
		Column17.ColumnOrder = 1, ;
		Column17.ControlSource = "denumire_adresa", ;
		Column17.FontSize = 8, ;
		Column17.Name = "Column17", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 67
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cApart.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Apart.", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cApart.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cBloc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Bloc", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cBloc.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cEmail.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "E-mail", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cEmail.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cEtaj.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Etaj", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cEtaj.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cFax.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fax", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cFax.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontSize = 8, ;
		Height = 17, ;
		Left = 30, ;
		Name = "Check1", ;
		Top = 42, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cJudet.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Judetul", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cJudet.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cLocalitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Localitate", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cLocalitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cNumar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Numar", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cNumar.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Zona", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.Column10.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.Column17.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cPrincipala.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontSize = 8, ;
		Height = 17, ;
		Left = 26, ;
		Name = "Check1", ;
		Top = 42, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cPrincipala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Principala", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cScara.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Scara", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cScara.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cStrada.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Strada", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cStrada.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cTelefon1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon 1", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cTelefon1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cTelefon2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon 2", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cTelefon2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cWeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Web", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page1._grdrow3.cWeb.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page1.But_modifica2' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_modifica2, ;
		Comment = "*:OnResize=RT", ;
		Left = 655, ;
		Name = "But_modifica2", ;
		TabIndex = 12, ;
		Tag = "L", ;
		Top = 34, ;
		Visible = .T., ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Pageframe1.Page1.But_nou2' AS but_nou WITH ;
		Anchor = 12, ;
		caction = do_adauga2, ;
		Comment = "*:OnResize=RT", ;
		Left = 655, ;
		Name = "But_nou2", ;
		TabIndex = 10, ;
		Tag = "L", ;
		Top = 9, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Pageframe1.Page1.But_sterge2' AS but_sterge WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_sterge2, ;
		Comment = "*:OnResize=RT", ;
		Left = 655, ;
		Name = "But_sterge2", ;
		TabIndex = 13, ;
		Tag = "L", ;
		Top = 61, ;
		Visible = .T., ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Pageframe1.Page2._grdrow3' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 1, ;
		Comment = "", ;
		DeleteMark = .F., ;
		FontSize = 8, ;
		GridLineColor = 192,192,192, ;
		Height = 121, ;
		HighlightStyle = 1, ;
		Left = 7, ;
		Name = "_grdrow3", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsCoduri", ;
		RowHeight = 17, ;
		TabIndex = 15, ;
		Tag = "", ;
		Top = 7, ;
		Width = 636, ;
		ZOrderSet = 22, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "cod", ;
		Column1.FontSize = 8, ;
		Column1.Name = "Column17", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 350
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'Pageframe1.Page2._grdrow3.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod", ;
		FontSize = 8, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'Pageframe1.Page2._grdrow3.Column17.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		FontSize = 8, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Pageframe1.Page2.But_modifica2' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_modifica3, ;
		Comment = "*:OnResize=RT", ;
		Left = 655, ;
		Name = "But_modifica2", ;
		TabIndex = 12, ;
		Tag = "L", ;
		Top = 34, ;
		Visible = .T., ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Pageframe1.Page2.But_nou2' AS but_nou WITH ;
		Anchor = 12, ;
		caction = do_adauga3, ;
		Comment = "*:OnResize=RT", ;
		Left = 655, ;
		Name = "But_nou2", ;
		TabIndex = 10, ;
		Tag = "L", ;
		Top = 9, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Pageframe1.Page2.But_sterge2' AS but_sterge WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_sterge3, ;
		Comment = "*:OnResize=RT", ;
		Left = 655, ;
		Name = "But_sterge2", ;
		TabIndex = 13, ;
		Tag = "L", ;
		Top = 61, ;
		Visible = .T., ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />
	
	PROCEDURE Activate
		*!*
	ENDPROC

	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		
		&& Parteneri
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poparteneri.ca_baza1.cfiltru
		ENDIF
		This._grdrow1.salveaza_grid()
		poparteneri.ca_baza1.cfiltru = lcfiltru
		poparteneri.ca_baza1.afisare()
		This._grdrow1.incarca_grid()
		Select CRSPARTENERI
		IF (RECCOUNT()=0)
			aMESSAGEBOX("Nu exista rezultate!",0+64,"Info cautare")		
		ENDIF
		
		
		
	ENDPROC

	PROCEDURE actualizeaza_grid2
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poAdrese.ca_baza1.cfiltru
		ENDIF
		this.pageframe1.page1._grdrow3.salveaza_grid()
		poAdrese.ca_baza1.cfiltru = lcfiltru
		poAdrese.ca_baza1.afisare()
		this.pageframe1.page1._grdrow3.incarca_grid()
		
	ENDPROC

	PROCEDURE actualizeaza_grid3
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poCoduri.ca_baza1.cfiltru
		ENDIF
		this.pageframe1.page2._grdrow3.salveaza_grid()
		poCoduri.ca_baza1.cfiltru = lcfiltru
		poCoduri.ca_baza1.afisare()
		this.pageframe1.page2._grdrow3.incarca_grid()
		
	ENDPROC

	PROCEDURE actualizeaza_grid_part
		LPARAMETERS nColIndex
		If Thisform._grdrow1.RowColChange<>2
			Select crsparteneri
			lnIdPart = id_part
			This._grdrow2.salveaza_grid()
			lcSql = [select a.id_part, b.denumire from ] + gcS + [.coresp_delegati_part a ] + ;
				[left join ] + gcS + [.nom_parteneri b on a.id_part = b.id_part ] + ;
				[where a.id_delegat = ] + Alltrim(Str(lnIdPart)) + [ and a.sters = 0 and ] + ;
				[b.sters = 0 and b.inactiv = 0 order by b.denumire]
			goExecutor.oExecuta(lcSql,[crscoresppart])
			This._grdrow2.incarca_grid()
		Endif
	ENDPROC

	PROCEDURE Destroy
		If Used('crscoresppart')
			Use In crscoresppart
		Endif
	ENDPROC

	PROCEDURE do_adauga
		Do nom_parteneri_nou With Thisform.nid_tip_part,Thisform.lb_titlu_alb_b121.Caption,1,Thisform.ntip_persoana_default
		If gnButon = 1
			Thisform.actualizeaza_grid1()
		Endif
		
	ENDPROC

	PROCEDURE do_adauga2
		Local loRec, lnIdPart
		lnIdPart = crsparteneri.id_part
		If Isnull(lnIdPart) Or Empty(lnIdPart)
			Return
		Endif
		loRec = adrese_parteneri_nou(lnIdPart) && onomenclatoare.prg
		If !Isnull(loRec)
			Thisform.actualizeaza_grid2()
		Endif
		
	ENDPROC

	PROCEDURE do_adauga3
		Local loRec, lnIdPart
		
		lnIdPart = crsparteneri.id_part
		If Isnull(lnIdPart) Or Empty(lnIdPart)
			Return
		Endif
		
		loRec = coduri_parteneri_nou(lnIdPart) && onomenclatoare.prg
		
		If !Isnull(loRec)
			Thisform.actualizeaza_grid3()
		Endif
		
	ENDPROC

	PROCEDURE do_cauta
		Private lcfiltru,lcval1
		lcfiltru = ''
		
		If Thisform.Ck_filtru_denumire.Value = 1
			lcfiltru = lcfiltru + Thisform.Ck_filtru_denumire.filtru
		Endif
		
		If Thisform.Ck_filtru_nume.Value = 1
			lcfiltru = lcfiltru + Thisform.Ck_filtru_nume.filtru
		Endif
		
		If Thisform.Ck_filtru_prenume.Value = 1
			lcfiltru = lcfiltru + Thisform.Ck_filtru_prenume.filtru
		Endif
		
		If Thisform.Ck_cod_fiscal.Value = 1
			lcfiltru = lcfiltru + Thisform.Ck_cod_fiscal.filtru
		Endif
		
		If Thisform.Ck_reg_comert.Value = 1
			lcfiltru = lcfiltru + Thisform.Ck_reg_comert.filtru
		Endif
		
		If Thisform.ck_filtru_categorie.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_filtru_categorie.filtru
		Endif
		
		lcfiltru = lcfiltru + [ and ctp.id_tip_part = ] + Alltrim(Str(Thisform.nid_tip_part))
		
		If !Empty(lcfiltru)
			lcfiltru = Substr(lcfiltru,5)
		Else
			lcfiltru = [1=1]
		Endif
		
		Thisform.actualizeaza_grid1(lcfiltru)
		thisform._grdrow1.SetFocus()
		
	ENDPROC

	PROCEDURE do_copiaza
		Local lnButon, loPartener
		Select crsparteneri
		Scatter Name loPartener
		lnButon = nom_parteneri_copiaza(m.loPartener,Thisform.nid_tip_part,Thisform.ntip_persoana_default,1,Thisform.lb_titlu_alb_b121.Caption) && onom_parteneri.prg
		If m.lnButon = 1
			Thisform.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_reset
		This.ck_filtru_denumire.Value = 0
		This.ck_filtru_nume.Value = 0
		This.ck_filtru_prenume.Value = 0
		This.Ck_cod_fiscal.Value = 0
		This.ck_filtru_categorie.Value = 0
		This.Ck_reg_comert.Value = 0
		This.ck_filtru_denumire.SetFocus()
		
	ENDPROC

	PROCEDURE do_verifica
		#Define CRLF Chr(13) + Chr(10)
		Local lcFile, lcRun, lcSelect, llPlatitorTVA, lcCoduriEronate
		Local X, llVerificarePlatitorTVA, lcWhere, lcCodFiscal, llAtributFiscalRO
		Local lcXml, loPartener, lcEroare, lcKey
		Local lcFilter, lcTipInterogare, llMFIN, llValidare, lcNume
		lcNume = ALLTRIM(crsparteneri.denumire)
		
		lcSelect = Select()
		X = XMENU(m.lcNume + ' - Validitate CNP/CIF, platitor TVA VIES, informatii Ministerul de Finante;\-;' + ;
			'TOTI - Validitate CNP/CIF;TOTI - Informatii Ministerul de Finante;TOTI - Platitor TVA Registrul Operatorilor Intracomunitari VIES')
		
		IF !BETWEEN(x,1,5)
			RETURN
		ENDIF 
		llVerificarePlatitorTVA = INLIST(x, 1, 5)
		llMFIN = INLIST(x, 1, 4)
		llValidare = .T.
		
		lcFilter = FILTER("crsparteneri")
		lcWhere = IIF(x = 1, "recno() = " + ALLTRIM(STR(RECNO())), IIF(!EMPTY(m.lcFilter), m.lcFilter, ".T."))
		Select Distinct COD_FISCAL, denumire, IIF(LEFT(UPPER(COD_FISCAL), 2) = "RO", "RO", "  ") AS ATRIBUT_FISCAL, .T. As IsCIF, .F. As codvalid ;
			FROM crsparteneri ;
			WHERE &lcWhere ;
			INTO Cursor crsCoduriFiscale ;
			ORDER By denumire, COD_FISCAL  ;
			READWRITE
		
		
		LOCAL lcXMLParteneri
		lcXMLParteneri = ""
		CURSORTOXML('crsCoduriFiscale', "lcXMLParteneri",1,0,0,"1")
		
		DO verificare_parteneri WITH m.lcXMLParteneri, m.llValidare, m.llMFIN, m.llVerificarePlatitorTVA
	ENDPROC

	PROCEDURE inainte_de_do_modifica
		Local loRec, lnIdPart
		
		If Reccount('crsparteneri')>0
			Select crsparteneri
			lnIdPart = id_part
			Scatter Name loRec
		
			loRec = nom_parteneri_modifica(lnIdPart,Thisform.nid_tip_part,Thisform.lb_titlu_alb_b121.Caption,1)
		
			If !Isnull(loRec)
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid1()
				Select crsparteneri
				Locate For id_part = loRec.id_part
				If !Found()
					Go Top
				Endif
				Thisform._grdrow1.SetFocus()
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
			Endif
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_modifica2
		LOCAL lnIdAdresa, loRec
		
		SELECT crsAdrese
		IF RECCOUNT('crsAdrese')>0
			lnIdAdresa = id_adresa
			loRec = adrese_parteneri_modifica(lnIdAdresa) && onomenclatoare.prg
			IF !ISNULL(loRec)
				THISFORM.actualizeaza_grid2()
				SELECT crsAdrese
				LOCATE FOR id_adresa = lnIdAdresa
				IF !FOUND()
					LOCATE
				ENDIF 
			ENDIF 	
			thisform.pageframe1.page1._grdrow3.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE inainte_de_do_modifica3
		LOCAL lnIdAdresa, loRec
		SELECT crsCoduri
		IF RECCOUNT('crsCoduri')>0
			lnidcod = id
			loRec = coduri_parteneri_modifica(lnidcod) && onomenclatoare.prg
			IF !ISNULL(loRec)
				THISFORM.actualizeaza_grid3()
				SELECT crsCoduri
				LOCATE FOR id = lnidcod
				IF !FOUND()
					LOCATE
				ENDIF 
			ENDIF 	
			thisform.pageframe1.page2._grdrow3.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE inainte_de_do_sterge
		LOCAL lnSucces
		SELECT crsparteneri
		SCATTER NAME loRec
		llSucces = .F.
		llSucces = sterge_inregistrare("parteneri",loRec.id_part)
		IF llSucces
			SELECT crsParteneri
			THISFORM.actualizeaza_grid1()
		ENDIF
		
	ENDPROC

	PROCEDURE inainte_de_do_sterge2
		If Reccount('crsAdrese')>0
			Local loRec
			Select crsAdrese
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "parteneri_adrese",loRec.id_adresa
			This.actualizeaza_grid2()
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_sterge3
		If Reccount('crsCoduri')>0
			Local loRec
			Select crsCoduri
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "cod",loRec.id
			This.actualizeaza_grid3()
		Endif
		
	ENDPROC

	PROCEDURE Init
		Lparameters tnIdTipPart, tcTitlu, tnTipPersoana
		DoDefault()
		Thisform.nid_tip_part=tnIdTipPart
		Thisform.lb_titlu_alb_b121.Caption=tcTitlu
		If Empty(tnTipPersoana)
			Thisform.ntip_persoana_default = 1
		Else
			Thisform.ntip_persoana_default = tnTipPersoana
		Endif
		
		If Thisform.ntip_persoana_default = 2 && persoana fizica
			Thisform._grdrow1.cCod_fiscal.header1.Caption= 'CNP'
			Thisform._grdrow1.cReg_comert.header1.Caption= 'Act identitate'
		*!*		thisform._grdrow1.cDenumire.Width = 0
		*!*		thisform._grdrow1.cPrefix.Width = 0
		*!*		thisform._grdrow1.cSufix.Width = 0
		*!*		thisform._grdrow1.cTip_persoana.Width = 0
		*!*		thisform._grdrow1.cBanca.Width = 0
		*!*		thisform._grdrow1.cCont_banca.Width = 0
			With Thisform._grdrow1
				.RemoveObject('cDenumire')
				.RemoveObject('cPrefix')
				.RemoveObject('cSufix')
				.RemoveObject('cTip_persoana')
				.RemoveObject('cBanca')
				.RemoveObject('cCont_banca')
			Endwith
		Endif
		
		If !Inlist(tnIdTipPart,gnIdTipDelegati)
			With Thisform._grdrow1
				lnAnchor = .Anchor
				.Anchor = 0
				.Width = Thisform._grdrow2.Left + Thisform._grdrow2.Width
				Thisform.RemoveObject('_grdrow2')
				.Anchor = lnAnchor
			Endwith
			Thisform.Refresh()
		Else
			Bindevent(Thisform._grdrow1,'AfterRowColChange',Thisform,'actualizeaza_grid_part',1)
		Endif
		
		If !Inlist(Upper(tcTitlu),[CLIENTI],[CLIENȚI],[FURNIZORI])
			Thisform.but_verifica1.Visible = .F.
			Thisform.but_copiaza1.Visible = .F.
		Endif
	ENDPROC

	PROCEDURE Pageframe1.Page1._grdrow3.Init
		this.SetAll("DynamicBackColor","iif(INACTIV = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE _grdrow1.AfterRowColChange
		Lparameters nColIndex
		DoDefault()
		If Inlist(This.RowColChange,0,1,3)
			Select crsparteneri
			lcFiltru2 = [ID_PART=]+Alltrim(Str(crsparteneri.id_part))
			Thisform.actualizeaza_grid2(lcFiltru2)
			Thisform.actualizeaza_grid3(lcFiltru2)
		Endif
	ENDPROC

	PROCEDURE _grdrow1.cId.Text1.Click
		
		
		
	ENDPROC

	PROCEDURE _grdrow1.Init
		this.SetAll("DynamicBackColor","iif(inactiv = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE _grdrow2.cDenumire.Text1.Click
		
		
		
	ENDPROC

	PROCEDURE _shape1.DblClick
		IF thisform.WindowState = 2
			thisform.WindowState = 0
		ELSE 
			thisform.WindowState = 2 
		ENDIF 
		THISFORM.Refresh 
		THISFORM._grdrow1.SetFocus()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_parteneri AS _frmbase OF "_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="grdParteneri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column14.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column11.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column13.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cCategorie_entitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cCategorie_entitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cUtilizator.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cUtilizator.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cDataora.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cDataora.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cAdresa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cAdresa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cTelefon.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cTelefon.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cEmail.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cEmail.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cCodFiscal2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cCodFiscal2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column21.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column21.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column22.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.Column22.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cInstitutiePublica.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cInstitutiePublica.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdParteneri.cInstitutiePublica._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cStrada.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cStrada.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cLocalitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cLocalitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cTelefon1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cTelefon1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cBloc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cBloc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cScara.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cScara.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cApart.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cApart.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cNumar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cNumar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cPrincipala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cPrincipala.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cEtaj.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cEtaj.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cTelefon2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cTelefon2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cFax.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cFax.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cEmail.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cEmail.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cWeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cWeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cJudet.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cJudet.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cDA_apare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.grdAdrese.cDA_apare._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page1.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column7.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.grdPersoane.Column8.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.But_nou3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.But_modifica3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.But_sterge3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page2.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cData.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cData.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cNumar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cNumar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDenumire_tip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDenumire_tip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cScadentaIncasare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cScadentaIncasare.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDataInceput.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDataInceput.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDataSfarsit.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDataSfarsit.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cCoefPenalitati.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cCoefPenalitati.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cZilePenalitati.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cZilePenalitati.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cCoefPenalitati2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cCoefPenalitati2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cZilePenalitati2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cZilePenalitati2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cZileGratiePenalitati.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cZileGratiePenalitati.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDescriere.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cDescriere.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cTipCursExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.grd_contracte.cTipCursExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page3.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.grdCoduri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.grdCoduri.Column17.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.grdCoduri.Column17.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.grdCoduri.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.grdCoduri.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.grdCoduri.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.grdCoduri.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_pageframe1.Page4.Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdTipParteneri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdTipParteneri.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdTipParteneri.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_nume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_categorie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_tip_entitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_cod_fiscal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_prenume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_reg_comert" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_copiaza1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_contracte
		*m: actualizeaza_grid3
		*m: actualizeaza_grid4
		*m: do_adauga2
		*m: do_adauga3
		*m: do_adauga_contract
		*m: inainte_de_do_modifica2
		*m: inainte_de_do_modifica3
		*m: inainte_de_do_modifica_contract
		*m: inainte_de_do_sterge2
		*m: inainte_de_do_sterge3
		*m: inainte_de_do_sterge_contract
		*m: modifica_cont
		*m: refreshtabele
		*m: sterge_cont
		*p: cul_activ
		*p: id_tip_part
		*p: mesaj
		*p: ntip_persoana_default		&& Tip persoana: 1=PJ, 2=PF
		*p: special
		*p: temporar_id_tip_part
		*p: temporar_tip_partener
	*</DefinedPropArrayMethod>

	*<PropValue>
		Caption = "Form"
		cgridsortlist = grdParteneri
		DoCreate = .T.
		Height = 593
		id_tip_part = 0
		mesaj = 
		Name = "frm_parteneri"
		ntip_persoana_default = 1
		special = 0
		temporar_id_tip_part = 0
		temporar_tip_partener = 
		Width = 696
		WindowState = 0
		WindowType = 1
		_memberdata = <VFPData>
			<memberdata name="refreshtabele" display="RefreshTabele"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Comment = "*:OnResize=sR"
		_shape1.Height = 30
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "W"
		_shape1.Top = 0
		_shape1.Width = 698
		_shape1.ZOrderSet = 2
		_shape2.Anchor = 8
		_shape2.Comment = "*:OnResize=RT"
		_shape2.Height = 29
		_shape2.Left = 665
		_shape2.Name = "_shape2"
		_shape2.Tag = "L"
		_shape2.Top = 1
		_shape2.Width = 32
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "Parteneri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 15
		Lb_titlu_alb_b121.Tag = ""
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Comment = "*:OnResize=RT"
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 666
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 14
		BUT_TERMIN1.Tag = "L"
		BUT_TERMIN1.Top = 2
		BUT_TERMIN1.Width = 30
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Left = 408
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 8
	*</PropValue>

	ADD OBJECT '_pageframe1' AS _pageframe WITH ;
		Anchor = 14, ;
		ErasePage = .T., ;
		Height = 220, ;
		Left = 4, ;
		Name = "_pageframe1", ;
		PageCount = 4, ;
		TabIndex = 16, ;
		TabStyle = 1, ;
		Top = 372, ;
		Width = 702, ;
		ZOrderSet = 1, ;
		Page1.BackColor = 255,255,255, ;
		Page1.Caption = "Adrese", ;
		Page1.Name = "Page1", ;
		Page1.PageOrder = 1, ;
		Page2.BackColor = 255,255,255, ;
		Page2.Caption = "Persoane de contact", ;
		Page2.Name = "Page2", ;
		Page2.PageOrder = 3, ;
		Page3.BackColor = 255,255,255, ;
		Page3.Caption = "Contracte", ;
		Page3.FontSize = 10, ;
		Page3.Name = "Page3", ;
		Page3.PageOrder = 2, ;
		Page4.Caption = "Coduri", ;
		Page4.FontSize = 10, ;
		Page4.Name = "Page4", ;
		Page4.PageOrder = 4
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="pageframe" />

	ADD OBJECT '_pageframe1.Page1.But_modifica2' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_modifica2, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_modifica2", ;
		TabIndex = 11, ;
		Tag = "L", ;
		Top = 28, ;
		Visible = .T., ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page1.But_nou2' AS but_nou WITH ;
		Anchor = 12, ;
		caction = do_adauga2, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_nou2", ;
		TabIndex = 10, ;
		Tag = "L", ;
		Top = 2, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page1.But_sterge2' AS but_sterge WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_sterge2, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_sterge2", ;
		TabIndex = 12, ;
		Tag = "L", ;
		Top = 54, ;
		Visible = .T., ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 18, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 180, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "grdAdrese", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsAdrese", ;
		RowHeight = 19, ;
		TabIndex = 13, ;
		Tag = "HW", ;
		Top = 3, ;
		Width = 650, ;
		ZOrderSet = 22, ;
		Column1.ColumnOrder = 3, ;
		Column1.ControlSource = "strada", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cStrada", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 210, ;
		Column2.ColumnOrder = 9, ;
		Column2.ControlSource = "localitate", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cLocalitate", ;
		Column2.ReadOnly = .T., ;
		Column3.ColumnOrder = 11, ;
		Column3.ControlSource = "telefon1", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cTelefon1", ;
		Column3.ReadOnly = .T., ;
		Column4.ColumnOrder = 18, ;
		Column4.ControlSource = "id_regiune", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column10", ;
		Column4.ReadOnly = .T., ;
		Column5.ColumnOrder = 5, ;
		Column5.ControlSource = "bloc", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cBloc", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 28, ;
		Column6.ColumnOrder = 6, ;
		Column6.ControlSource = "scara", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cScara", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 36, ;
		Column7.ColumnOrder = 7, ;
		Column7.ControlSource = "apart", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cApart", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 34, ;
		Column8.ColumnOrder = 4, ;
		Column8.ControlSource = "numar", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cNumar", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 42, ;
		Column9.Alignment = 2, ;
		Column9.ColumnOrder = 16, ;
		Column9.ControlSource = "inactiv", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cInactiv", ;
		Column9.ReadOnly = .T., ;
		Column9.Sparse = .F., ;
		Column9.Width = 39, ;
		Column10.Alignment = 2, ;
		Column10.ColumnOrder = 17, ;
		Column10.ControlSource = "principala", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cPrincipala", ;
		Column10.ReadOnly = .T., ;
		Column10.Sparse = .F., ;
		Column10.Width = 59, ;
		Column11.ColumnOrder = 8, ;
		Column11.ControlSource = "etaj", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cEtaj", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 36, ;
		Column12.ColumnOrder = 12, ;
		Column12.ControlSource = "telefon2", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cTelefon2", ;
		Column12.ReadOnly = .T., ;
		Column13.ColumnOrder = 13, ;
		Column13.ControlSource = "fax", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "cFax", ;
		Column13.ReadOnly = .T., ;
		Column14.ColumnOrder = 14, ;
		Column14.ControlSource = "email", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cEmail", ;
		Column14.ReadOnly = .T., ;
		Column15.ColumnOrder = 15, ;
		Column15.ControlSource = "web", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cWeb", ;
		Column15.ReadOnly = .T., ;
		Column16.ColumnOrder = 10, ;
		Column16.ControlSource = "judet", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "cJudet", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 40, ;
		Column17.ColumnOrder = 1, ;
		Column17.ControlSource = "denumire_adresa", ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 10, ;
		Column17.Name = "Column17", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 137, ;
		Column18.ColumnOrder = 2, ;
		Column18.ControlSource = "da_apare", ;
		Column18.FontName = "Arial", ;
		Column18.FontSize = 10, ;
		Column18.Name = "cDA_apare", ;
		Column18.ReadOnly = .T., ;
		Column18.Sparse = .F., ;
		Column18.Width = 76
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cApart.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Apart.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cApart.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cBloc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Bloc", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cBloc.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cDA_apare._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Left = 11, ;
		Name = "_checkbox1", ;
		Top = 24
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cDA_apare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pe adresa", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cEmail.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "E-mail", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cEmail.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cEtaj.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Etaj", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cEtaj.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cFax.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fax", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cFax.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 30, ;
		Name = "Check1", ;
		Top = 42, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cJudet.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Judetul", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cJudet.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cLocalitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Localitate", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cLocalitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cNumar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Numar", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cNumar.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Zona", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.Column10.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.Column17.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cPrincipala.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 26, ;
		Name = "Check1", ;
		Top = 42, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cPrincipala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Principala", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cScara.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Scara", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cScara.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cStrada.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Strada", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cStrada.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cTelefon1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon 1", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cTelefon1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cTelefon2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon 2", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cTelefon2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cWeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Web", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page1.grdAdrese.cWeb.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page1.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform._pageframe1.page1.grdAdrese, ;
		Left = 667, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 114
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT '_pageframe1.Page2.But_modifica3' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_modifica3, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_modifica3", ;
		TabIndex = 11, ;
		Tag = "L", ;
		Top = 27, ;
		Visible = .T., ;
		ZOrderSet = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page2.But_nou3' AS but_nou WITH ;
		Anchor = 12, ;
		caction = do_adauga3, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_nou3", ;
		TabIndex = 10, ;
		Tag = "L", ;
		Top = 1, ;
		ZOrderSet = 29
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page2.But_sterge3' AS but_sterge WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_sterge3, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_sterge3", ;
		TabIndex = 12, ;
		Tag = "L", ;
		Top = 53, ;
		Visible = .T., ;
		ZOrderSet = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 8, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 180, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "grdPersoane", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsPers_contact", ;
		RowHeight = 19, ;
		TabIndex = 13, ;
		Tag = "HW", ;
		Top = 3, ;
		Width = 649, ;
		ZOrderSet = 28, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "nume", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column17", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 98, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ControlSource = "prenume", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 99, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ControlSource = "apelativ", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column4.BackColor = 255,255,255, ;
		Column4.ControlSource = "functia", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 77, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ControlSource = "telefon", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column6.BackColor = 255,255,255, ;
		Column6.ControlSource = "email", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column7.Alignment = 2, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ControlSource = "principal", ;
		Column7.FontSize = 10, ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column7.Sparse = .F., ;
		Column7.Width = 52, ;
		Column8.Alignment = 2, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ControlSource = "inactiv", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .T., ;
		Column8.Sparse = .F., ;
		Column8.Width = 42
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column17.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prenume", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Apelativ", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Functia", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "E-mail", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column7.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 38, ;
		Name = "Check1", ;
		Top = 20, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Principal", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column8.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 34, ;
		Name = "Check1", ;
		Top = 32, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.Page2.grdPersoane.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 212,208,200, ;
		Caption = "Inactiv", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page2.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform._pageframe1.page2.grdPersoane, ;
		Left = 667, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 90
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT '_pageframe1.Page3.But_modifica2' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_modifica_contract, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_modifica2", ;
		TabIndex = 11, ;
		Tag = "L", ;
		Top = 28, ;
		Visible = .T., ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page3.But_nou2' AS but_nou WITH ;
		Anchor = 12, ;
		caction = do_adauga_contract, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_nou2", ;
		TabIndex = 10, ;
		Tag = "L", ;
		Top = 2, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page3.But_sterge2' AS but_sterge WITH ;
		Anchor = 12, ;
		caction = inainte_de_do_sterge_contract, ;
		Comment = "*:OnResize=RT", ;
		Left = 659, ;
		Name = "But_sterge2", ;
		TabIndex = 12, ;
		Tag = "L", ;
		Top = 54, ;
		Visible = .T., ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 14, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		HeaderHeight = 37, ;
		Height = 180, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "grd_contracte", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsContracte", ;
		RowHeight = 19, ;
		TabIndex = 13, ;
		Tag = "HW", ;
		Top = 3, ;
		Width = 650, ;
		ZOrderSet = 22, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "data", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cData", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 120, ;
		Column2.ColumnOrder = 1, ;
		Column2.ControlSource = "numar", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cNumar", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 138, ;
		Column3.ColumnOrder = 12, ;
		Column3.ControlSource = "denumire_tip", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cDenumire_tip", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 106, ;
		Column4.Alignment = 2, ;
		Column4.ColumnOrder = 14, ;
		Column4.ControlSource = "inactiv", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cInactiv", ;
		Column4.ReadOnly = .T., ;
		Column4.Sparse = .F., ;
		Column4.Width = 45, ;
		Column5.ColumnOrder = 3, ;
		Column5.ControlSource = "scadenta_incasare", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cScadentaIncasare", ;
		Column5.ReadOnly = .T., ;
		Column6.ColumnOrder = 4, ;
		Column6.ControlSource = "data_inceput", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cDataInceput", ;
		Column6.ReadOnly = .T., ;
		Column7.ColumnOrder = 5, ;
		Column7.ControlSource = "data_sfarsit", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cDataSfarsit", ;
		Column7.ReadOnly = .T., ;
		Column8.ColumnOrder = 6, ;
		Column8.ControlSource = "coef_penalitati", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cCoefPenalitati", ;
		Column8.ReadOnly = .T., ;
		Column8.Sparse = .F., ;
		Column8.Width = 99, ;
		Column9.ColumnOrder = 7, ;
		Column9.ControlSource = "zile_penalitati", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cZilePenalitati", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 72, ;
		Column10.ColumnOrder = 8, ;
		Column10.ControlSource = "coef_penalitati2", ;
		Column10.FontSize = 10, ;
		Column10.Name = "cCoefPenalitati2", ;
		Column10.ReadOnly = .T., ;
		Column10.Sparse = .F., ;
		Column10.Width = 98, ;
		Column11.ColumnOrder = 9, ;
		Column11.ControlSource = "zile_penalitati2", ;
		Column11.FontSize = 10, ;
		Column11.Name = "cZilePenalitati2", ;
		Column11.ReadOnly = .T., ;
		Column12.ColumnOrder = 10, ;
		Column12.ControlSource = "zile_gratie_penalitati", ;
		Column12.FontSize = 10, ;
		Column12.Name = "cZileGratiePenalitati", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 89, ;
		Column13.ColumnOrder = 13, ;
		Column13.ControlSource = "descriere", ;
		Column13.FontSize = 10, ;
		Column13.Name = "cDescriere", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 169, ;
		Column14.ColumnOrder = 11, ;
		Column14.ControlSource = "tip_curs_explicatie", ;
		Column14.Name = "cTipCursExplicatie", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 160
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cCoefPenalitati.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent penalitati / zi (1)", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cCoefPenalitati.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cCoefPenalitati2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Procent penalitati / zi (2)", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cCoefPenalitati2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cData.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cData.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDataInceput.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data inceput", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDataInceput.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDataSfarsit.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data sfarsit", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDataSfarsit.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDenumire_tip.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip contract", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDenumire_tip.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDescriere.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Descriere", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cDescriere.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 43, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 35, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cNumar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Numar", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cNumar.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cScadentaIncasare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. zile scadenta", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cScadentaIncasare.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cTipCursExplicatie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Zi curs factura", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cTipCursExplicatie.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cZileGratiePenalitati.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. zile gratie penalitati", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cZileGratiePenalitati.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cZilePenalitati.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Zile penalitati (1)", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cZilePenalitati.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cZilePenalitati2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Zile penalitati (2)", ;
		FontSize = 10, ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page3.grd_contracte.cZilePenalitati2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page3.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform._pageframe1.page3.grd_contracte, ;
		Left = 655, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 102
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT '_pageframe1.Page4.grdCoduri' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 3, ;
		Comment = "", ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 180, ;
		HighlightStyle = 1, ;
		Left = 5, ;
		Name = "grdCoduri", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsCoduri", ;
		RowHeight = 19, ;
		TabIndex = 13, ;
		Tag = "", ;
		Top = 3, ;
		Width = 649, ;
		ZOrderSet = 28, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "id", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column17", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 98, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ControlSource = "id_part", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 99, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ControlSource = "cod", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_pageframe1.Page4.grdCoduri.Column17.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page4.grdCoduri.Column17.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page4.grdCoduri.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prenume", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page4.grdCoduri.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page4.grdCoduri.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Apelativ", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_pageframe1.Page4.grdCoduri.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_pageframe1.Page4.Gridextra1' AS gridextra WITH ;
		gridexpression = thisform._pageframe1.page4.grdCoduri, ;
		Left = 667, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 30
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'But_copiaza1' AS but_copiaza WITH ;
		Anchor = 8, ;
		Left = 514, ;
		Name = "But_copiaza1", ;
		Top = 2, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		caction = do_excel, ;
		Left = 636, ;
		Name = "But_excel1", ;
		Top = 2, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=RT", ;
		Left = 544, ;
		Name = "But_modifica1", ;
		TabIndex = 11, ;
		Tag = "L", ;
		Top = 2, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=RT", ;
		Left = 483, ;
		Name = "But_nou1", ;
		TabIndex = 10, ;
		Tag = "L", ;
		Top = 2, ;
		Visible = .F., ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Comment = "*:OnResize=RT", ;
		Left = 575, ;
		Name = "But_sterge1", ;
		TabIndex = 12, ;
		Tag = "L", ;
		Top = 2, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_verifica1' AS but_verifica WITH ;
		Anchor = 8, ;
		Left = 605, ;
		Name = "But_verifica1", ;
		TabIndex = 14, ;
		ToolTipText = "Validare cod", ;
		Top = 2
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_cod_fiscal' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = p.cod_fiscal, ;
		Caption = "Cod Fiscal", ;
		criteriu = 4, ;
		criteriu2 = 4, ;
		Left = 5, ;
		Name = "Ck_cod_fiscal", ;
		TabIndex = 2, ;
		Top = 56, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_categorie' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = p.categorie_entitate, ;
		Caption = "Categorie", ;
		Left = 166, ;
		Name = "Ck_filtru_categorie", ;
		TabIndex = 6, ;
		Top = 56, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_denumire' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = p.denumire, ;
		Caption = "Denumire", ;
		Left = 5, ;
		Name = "Ck_filtru_denumire", ;
		TabIndex = 1, ;
		Top = 35, ;
		ZOrderSet = 15
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_nume' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = p.nume, ;
		Caption = "Nume", ;
		Left = 92, ;
		Name = "Ck_filtru_nume", ;
		TabIndex = 3, ;
		Top = 35, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_prenume' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = p.prenume, ;
		Caption = "Prenume", ;
		Left = 92, ;
		Name = "Ck_filtru_prenume", ;
		TabIndex = 4, ;
		Top = 56, ;
		ZOrderSet = 20
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_reg_comert' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = p.reg_comert, ;
		Caption = "Reg. Comert", ;
		criteriu = 4, ;
		criteriu2 = 4, ;
		Left = 166, ;
		Name = "Ck_reg_comert", ;
		TabIndex = 5, ;
		Top = 35, ;
		ZOrderSet = 21
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_tip_entitate' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Tip Entitate", ;
		Left = 264, ;
		Name = "ck_tip_entitate", ;
		TabIndex = 7, ;
		Top = 35, ;
		Visible = .F., ;
		ZOrderSet = 17
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 2, ;
		Comment = "*:OnResize=RT", ;
		Left = 364, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 8, ;
		Tag = "L", ;
		Top = 42, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Anchor = 8, ;
		Caption = "\<Modicare Id Partener", ;
		FontBold = .F., ;
		Height = 27, ;
		Left = 552, ;
		Name = "Cmd_executa1", ;
		TabIndex = 20, ;
		Top = 33, ;
		Visible = .F., ;
		Width = 135, ;
		WordWrap = .T., ;
		ZOrderSet = 18
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 2, ;
		Comment = "*:OnResize=RT", ;
		Left = 460, ;
		Name = "Cmd_reset1", ;
		TabIndex = 17, ;
		Tag = "L", ;
		Top = 42, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdParteneri' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 23, ;
		Comment = "*:OnResize=SS", ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 290, ;
		HighlightStyle = 2, ;
		Left = 4, ;
		Name = "grdParteneri", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsparteneri", ;
		RowHeight = 19, ;
		TabIndex = 9, ;
		Tag = "HW", ;
		Top = 80, ;
		Width = 546, ;
		ZOrderSet = 0, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "crsparteneri.id_part", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 52, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "crsparteneri.denumire", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 192, ;
		Column3.ColumnOrder = 5, ;
		Column3.ControlSource = "crsparteneri.cod_fiscal", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 115, ;
		Column4.ColumnOrder = 7, ;
		Column4.ControlSource = "crsparteneri.reg_comert", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 124, ;
		Column5.Alignment = 2, ;
		Column5.ColumnOrder = 16, ;
		Column5.ControlSource = "crsparteneri.inactiv", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column14", ;
		Column5.ReadOnly = .T., ;
		Column5.Sparse = .F., ;
		Column5.Width = 38, ;
		Column6.ColumnOrder = 3, ;
		Column6.ControlSource = "crsparteneri.nume", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 197, ;
		Column7.ColumnOrder = 4, ;
		Column7.ControlSource = "crsparteneri.prenume", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 127, ;
		Column8.ColumnOrder = 12, ;
		Column8.ControlSource = "banca", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 188, ;
		Column9.ColumnOrder = 13, ;
		Column9.ControlSource = "cont_banca", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 172, ;
		Column10.ColumnOrder = 8, ;
		Column10.ControlSource = "prefix", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 58, ;
		Column11.ColumnOrder = 9, ;
		Column11.ControlSource = "sufix", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column11", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 60, ;
		Column12.ColumnOrder = 10, ;
		Column12.ControlSource = "iif(tip_persoana=1,'Juridica','Fizica')", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Column12", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 88, ;
		Column13.ColumnOrder = 17, ;
		Column13.ControlSource = "motiv_inactiv", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "Column13", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 89, ;
		Column14.ColumnOrder = 11, ;
		Column14.ControlSource = "categorie_entitate", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "cCategorie_entitate", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 88, ;
		Column15.ColumnOrder = 22, ;
		Column15.ControlSource = "utilizator", ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 10, ;
		Column15.Name = "cUtilizator", ;
		Column15.ReadOnly = .T., ;
		Column15.Width = 175, ;
		Column16.ColumnOrder = 23, ;
		Column16.ControlSource = "dataora", ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 10, ;
		Column16.Name = "cDataora", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 151, ;
		Column17.ColumnOrder = 18, ;
		Column17.ControlSource = "adresa", ;
		Column17.Name = "cAdresa", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 224, ;
		Column18.ColumnOrder = 19, ;
		Column18.ControlSource = "telefon", ;
		Column18.Name = "cTelefon", ;
		Column18.ReadOnly = .T., ;
		Column18.Width = 123, ;
		Column19.ColumnOrder = 21, ;
		Column19.ControlSource = "email", ;
		Column19.Name = "cEmail", ;
		Column19.ReadOnly = .T., ;
		Column19.Width = 148, ;
		Column20.ColumnOrder = 6, ;
		Column20.ControlSource = "cod_fiscal2", ;
		Column20.Name = "cCodFiscal2", ;
		Column20.ReadOnly = .T., ;
		Column20.ToolTipText = "Cod identificare fiscala diferit de CIF. Cand CIF este folosit doar pentru activitati in scopuri TVA, iar firma nu desfasoara activitati in sfera TVA.", ;
		Column20.Width = 96, ;
		Column21.ColumnOrder = 14, ;
		Column21.ControlSource = "swift_banca", ;
		Column21.Name = "Column21", ;
		Column21.ReadOnly = .T., ;
		Column21.Width = 124, ;
		Column22.ColumnOrder = 15, ;
		Column22.ControlSource = "adresa_banca", ;
		Column22.Name = "Column22", ;
		Column22.ReadOnly = .T., ;
		Column22.Width = 177, ;
		Column23.ColumnOrder = 20, ;
		Column23.ControlSource = "institutie_publica", ;
		Column23.CurrentControl = "_checkbox1", ;
		Column23.Name = "cInstitutiePublica", ;
		Column23.ReadOnly = .T., ;
		Column23.Sparse = .F., ;
		Column23.Width = 93
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdParteneri.cAdresa.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Adresa principala", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cAdresa.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.cCategorie_entitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Categorie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cCategorie_entitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.cCodFiscal2.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 240,240,240, ;
		Caption = "CUI", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cCodFiscal2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.cDataora.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Data adaugare/modificare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cDataora.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.cEmail.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Email", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cEmail.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.cInstitutiePublica._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Left = 53, ;
		Name = "_checkbox1", ;
		ReadOnly = .T., ;
		Top = 51
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'grdParteneri.cInstitutiePublica.Header1' AS header WITH ;
		Caption = "Institutie publica", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cInstitutiePublica.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prefix", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column10.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column11.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sufix", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column11.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column12.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip persoana", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column12.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column13.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Motivul inactiv.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column13.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column14.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 17, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 49, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grdParteneri.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column21.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "SWIFT", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column21.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column22.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Adresa banca", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column22.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "C.I.F. / C.N.P.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Reg. Comert", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prenume", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column7.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Banca", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column8.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont banca", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.Column9.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.cTelefon.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cTelefon.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdParteneri.cUtilizator.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Utilizator adaugare/modificare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdParteneri.cUtilizator.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grdTipParteneri' AS _grdrow WITH ;
		Anchor = 9, ;
		ColumnCount = 1, ;
		crgb_row = 255,255,255, ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 292, ;
		Left = 552, ;
		Name = "grdTipParteneri", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "crscoresp_tip_parteneri", ;
		RowHeight = 19, ;
		TabIndex = 13, ;
		Tag = "HL", ;
		Top = 80, ;
		Width = 136, ;
		ZOrderSet = 10, ;
		Column1.ControlSource = "crscoresp_tip_parteneri.tip_partener", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.Width = 93
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdTipParteneri.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdTipParteneri.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 10, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.grdParteneri, ;
		Left = 404, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 275
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Lb_simplu3' AS lb_simplu WITH ;
		Anchor = 8, ;
		Caption = "Tip(uri) entitate selectata", ;
		Comment = "*:OnResize=RT", ;
		Left = 545, ;
		Name = "Lb_simplu3", ;
		TabIndex = 19, ;
		Tag = "L", ;
		Top = 64, ;
		ZOrderSet = 14
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />
	
	PROCEDURE Activate
		thisform.WindowState = 2
		THIS.Refresh 
	ENDPROC

	PROCEDURE actualizeaza_contracte
		LPARAMETERS pcFiltru
		
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		
		IF EMPTY(lcFiltru)
			lcFiltru = poContracte.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(this._pageframe1.page3.grd_contracte)
		poContracte.ca_baza1.cfiltru = lcfiltru
		poContracte.ca_baza1.afisare()
		
		restore_grid_comment(this._pageframe1.page3.grd_contracte)
	ENDPROC

	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		
		&& Parteneri
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poparteneri.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(This.grdParteneri)
		poparteneri.ca_baza1.cfiltru = lcfiltru
		poparteneri.ca_baza1.afisare()
		restore_grid_comment(This.grdParteneri)
		Select CRSPARTENERI
		IF (RECCOUNT()=0)
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")		
		ENDIF
		
		
		
	ENDPROC

	PROCEDURE actualizeaza_grid2
		LPARAMETERS pcFiltru
		
		* Daca este vizualizare de clienti, furnizori etc., nu exista gridul grdTipParteneri
		IF TYPE('This.grdTipParteneri.height') = 'U'
			RETURN 
		ENDIF 
		
		&& tipuri
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poparteneri.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(This.grdTipParteneri)
		pocoresp_tip_parteneri.ca_baza1.cfiltru = lcfiltru
		pocoresp_tip_parteneri.ca_baza1.afisare()
		restore_grid_comment(This.grdTipParteneri)
		Select crscoresp_tip_parteneri
		Go Top
		IF (RECCOUNT()=0)
		*	WAIT "Acest partener nu are setat tipul." WINDOW NOWAIT 
		ELSE  
		**	thisform.grdParteneri.SetFocus()
		ENDIF
		
		
	ENDPROC

	PROCEDURE actualizeaza_grid3
		LPARAMETERS pcFiltru
		
		*!*	LOCAL lcFiltru
		*!*	lcFiltru = pcFiltru
		*!*	IF EMPTY(lcFiltru)
		*!*		lcFiltru = poAdrese.ca_baza1.cfiltru
		*!*	ENDIF
		*!*	save_grid_comment(This.grdAdrese)
		*!*	poAdrese.ca_baza1.cfiltru = lcfiltru
		*!*	poAdrese.ca_baza1.afisare()
		*!*	restore_grid_comment(This.grdAdrese)
		
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poAdrese.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(this._pageframe1.page1.grdAdrese)
		poAdrese.ca_baza1.cfiltru = lcfiltru
		poAdrese.ca_baza1.afisare()
		restore_grid_comment(this._pageframe1.page1.grdAdrese)
		
	ENDPROC

	PROCEDURE actualizeaza_grid4
		LPARAMETERS pcFiltru
		
		*!*	LOCAL lcFiltru
		*!*	lcFiltru = pcFiltru
		*!*	IF EMPTY(lcFiltru)
		*!*		lcFiltru = poPers.ca_baza1.cfiltru
		*!*	ENDIF
		*!*	save_grid_comment(This._grdrow4)
		*!*	poPers.ca_baza1.cfiltru = lcfiltru
		*!*	poPers.ca_baza1.afisare()
		*!*	restore_grid_comment(This._grdrow4)
		
		LOCAL lcFiltru
		lcFiltru = pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru = poPers.ca_baza1.cfiltru
		ENDIF
		save_grid_comment(this._pageframe1.paGE2.grdPersoane)
		poPers.ca_baza1.cfiltru = lcfiltru
		poPers.ca_baza1.afisare()
		restore_grid_comment(this._pageframe1.paGE2.grdPersoane)
	ENDPROC

	PROCEDURE DblClick
		thisform.cmd_executa1.Visible = .T.
	ENDPROC

	PROCEDURE do_adauga
		IF !EMPTY(thisform.id_tip_part) OR !EMPTY(thisform.special)
			loPartener = nom_parteneri_nou(Thisform.id_tip_part,Thisform.lb_titlu_alb_b121.Caption,thisform.special,Thisform.ntip_persoana_default) &&in onomenclatoare.prg
		ELSE 
			loPartener = nom_parteneri_nou()  &&in onomenclatoare.prg
		ENDIF 	
		IF gnButon = 1
			THISFORM.actualizeaza_grid1()
		ENDIF
		
		
	ENDPROC

	PROCEDURE do_adauga2
		LOCAL loRec, lnIdPart
		
		lnIdPart = crsparteneri.id_part
		IF ISNULL(lnIdPart) OR EMPTY(lnIdPart) 
			RETURN
		ENDIF 
		*!*	Scatter Name loRecPart
		*!*	Private pnId_part
		*!*	pnId_part = loRecPart.id_part
		
		*!*	=cclocalitati()
		*!*	=ccJudete()
		*!*	=ccTari()
		
		*!*	Select crsAdrese
		*!*	Scatter Name loRec Blank
		*!*	Do Adauga_Modifica_Inregistrare With "parteneri_adrese",loRec,,"INSERT" In oproceduri_ams.prg
		
		*!*	=close_cclocalitati()
		*!*	=close_ccJudete()
		*!*	=close_ccTari()
		loRec = adrese_parteneri_nou(lnIdPart) && onomenclatoare.prg
		
		IF !ISNULL(loRec)
			Thisform.actualizeaza_grid3()
		ENDIF 	
		
		
	ENDPROC

	PROCEDURE do_adauga3
		SELECT crsparteneri
		SCATTER NAME loRecPart
		PRIVATE pnId_part
		pnId_part = loRecPart.id_part
		
		SELECT crsPers_contact
		SCATTER NAME loRec BLANK 
		DO Adauga_Modifica_Inregistrare WITH "pers_contact",loRec,,"INSERT" IN oproceduri_ams.prg
		
		thisform.actualizeaza_grid4()
		
		
	ENDPROC

	PROCEDURE do_adauga_contract
		*!*	SELECT crsParteneri
		*!*	pnCtrIdPart = id_part
		*!*	pcCtrDenumirePart = denumire
		
		SELECT crsparteneri
		SCATTER NAME loRecPart
		
		*!*	PRIVATE pnId_part && sa am deja completat numele partenerului (si sa nu mai poata sa-l modifice)
		*!*	pnId_part = loRecPart.id_part
		
		*!*	SELECT crsContracte
		*!*	SCATTER NAME loRec BLANK 
		*!*	DO Adauga_Modifica_Inregistrare WITH "contract",loRec,,"INSERT" IN oproceduri_ams.prg
		IF gcAppName = 'ROAACNPRO' OR This.id_tip_part = 16
			DO contracte_nou WITH loRecPart.id_part, -1 && tip contract = CLIENTI
		ELSE 
			DO contracte_nou WITH loRecPart.id_part
		ENDIF 
		&& sa am deja completat numele partenerului (si sa nu mai poata sa-l modifice)
		
		thisform.actualizeaza_contracte()
		
		
	ENDPROC

	PROCEDURE do_cauta
		Private lcfiltru,lcval1
		lcfiltru = ''
		
		If ThisForm.Ck_filtru_denumire.Value = 1	
			lcfiltru = lcfiltru + thisform.Ck_filtru_denumire.filtru
		ENDIF
		
		If ThisForm.Ck_filtru_nume.Value = 1	
			lcfiltru = lcfiltru + thisform.ck_filtru_nume.filtru
		ENDIF
		
		If ThisForm.Ck_filtru_prenume.Value = 1	
			lcfiltru = lcfiltru + thisform.ck_filtru_prenume.filtru
		Endif
		
		If ThisForm.Ck_tip_entitate.Value = 1	
			If !empty(ThisForm.temporar_id_tip_part)
				lcfiltru = lcfiltru + [ and p.id_tip_part = ] + ALLTRIM(STR(thisform.temporar_id_tip_part))
			ENDIF
		ENDIF	
		
		
		If ThisForm.Ck_cod_fiscal.Value = 1	
			lcfiltru = lcfiltru + thisform.ck_cod_fiscal.filtru
		ENDIF
		
		If ThisForm.Ck_reg_comert.Value = 1	
			lcfiltru = lcfiltru + thisform.ck_reg_comert.filtru
		ENDIF
		
		If Thisform.ck_filtru_categorie.Value = 1
			lcFiltru = lcFiltru + Thisform.ck_filtru_categorie.filtru
		Endif
		
		If !Empty(lcfiltru)
			lcfiltru = Substr(lcfiltru,5)
		Else
			lcfiltru = [1=1]
		ENDIF
		
		thisform.actualizeaza_grid1(lcFiltru)
		thisform.grdParteneri.SetFocus()
		thisform.RefreshTabele()
	ENDPROC

	PROCEDURE do_copiaza
		LOCAL lnButon, loPartener
		
		SELECT crsparteneri
		SCATTER NAME loPartener
		IF !EMPTY(thisform.id_tip_part) OR !EMPTY(thisform.special)
			lnButon = nom_parteneri_copiaza(m.loPartener,Thisform.nid_tip_part,Thisform.ntip_persoana_default,thisform.special,Thisform.lb_titlu_alb_b121.Caption) && onom_parteneri.prg
		ELSE 
			lnButon = nom_parteneri_copiaza(m.loPartener) && onom_parteneri.prg
		ENDIF 	
		
		IF m.lnButon = 1
			THISFORM.actualizeaza_grid1()
		ENDIF
	ENDPROC

	PROCEDURE do_excel
		*!*	If !Thisform.lactiv1
		*!*		Return
		*!*	Endif
		
		Local lcAlias, lcFiltru, lcColumnList, lcHeaderList, lcSelect, lcOutput, lcFrom, lcWhere, lcOrder
		
		If !Used('crsParteneri') Or Reccount('crsParteneri') = 0
			Return
		Endif
		
		lcAlias = 'crsParteneri'
		lcFiltru = Filter(lcAlias)
		If Empty(lcFiltru)
			lcFiltru = '.T.'
		Endif
		
		
		lcColumnList = ''
		lcHeaderList = ''
		lcSelect = ''
		llSelect = .T.
		lcType = 'CURSOR'
		lcFrom = lcAlias
		lcWhere = lcFiltru
		lcOrder = 'denumire'
		lcOutput = 'crsP'
		
		get_schema_grid(This.grdParteneri, @lcColumnList, @lcHeaderList, @lcSelect, llSelect, lcType, lcFrom, lcWhere, lcOrder, lcOutput)
		*!*MESSAGEBOX(lcSelect)
		&lcSelect
		
		If Used(lcOutput)
			Do export_xls With lcOutput IN oproceduri_comune.prg
			Use In (lcOutput)
		Endif
		
		Return
	ENDPROC

	PROCEDURE do_executa
		Local loUnificarePart As "frm_parteneri_unificare"
		Local lcMesaj, lcParola, lcPerioada, llSucces, lnFinal, lnInit, lnRaspuns, loPart
		PRIVATE pdData1, pnAn1, pnAn2, pnIdPartBun, pnIdPartProst, pnLuna1, pnLuna2, pnLunaMinima
		SELECT crsParteneri
		SCATTER NAME loPart
		IF loPart.id_part = 0
			RETURN
		ENDIF
		
		lcParola = INPUTBOX('Parola','Parola','')
		IF lcParola # TRANSFORM(YEAR(DATE())) + PADL(TRANSFORM(MONTH(DATE())),2,'0') + PADL(TRANSFORM(DAY(DATE())),2,'0')
			RETURN
		ENDIF
		
		PRIVATE xrec
		xrec = Createobject('custom')
		xrec.AddProperty('id_part1', loPart.id_part)
		xrec.AddProperty('numepart1', ALLTRIM(loPart.denumire))
		xrec.AddProperty('id_part2', 0)
		xrec.AddProperty('numepart2', '')
		
		xrec.AddProperty('lunai', Padl(Alltrim(Str(gnLuna)), 2, '0'))
		xrec.AddProperty('lunaf', Padl(Alltrim(Str(gnLuna)), 2, '0'))
		xrec.AddProperty('ani', Alltrim(Str(gnAn)))
		xrec.AddProperty('anf', Alltrim(Str(gnAn)))
		
		xrec.AddProperty('verificarelunai', .T.)
		xrec.AddProperty('datai', {//})
		
		
		loUnificarePart = CREATEOBJECT("frm_parteneri_unificare")
		loUnificarePart.show(1)
		IF gnButon = 2
			RETURN
		ENDIF 
		IF EMPTY(NVL(xrec.id_part2,0))
			RETURN
		ENDIF
		
		
		pnAn1 = INT(VAL(xrec.ani))
		pnLuna1 = INT(VAL(xrec.lunai))
		pnAn2 = INT(VAL(xrec.anf))
		pnLuna2 = INT(VAL(xrec.lunaf))
		pdData1 = IIF(EMPTY(NVL(xrec.datai,{})), null, xrec.datai)
		
		pnIdPartProst = xrec.id_part1
		pnIdPartBun = xrec.id_part2
		pnLunaMinima = IIF(xrec.verificarelunai, 0, 1)
		
		lnInit = pnAn1 * 12 + pnLuna1
		lnFinal = pnAn2 * 12 + pnLuna2
		lcPerioada = IIF(!EMPTY(NVL(m.pdData1, {})), DTOC(m.pdData1), xrec.lunai +'/'+ xrec.ani) + ' - ' + xrec.lunaf +'/'+ xrec.anf
		
		lnRaspuns = aMESSAGEBOX('Doriti sa inlocuiti in baza de date ' + CHR(13) + ;
			'Perioada: ' + lcPerioada + CHR(13) + ;
			ALLTRIM(xrec.numepart1) + '(' + TRANSFORM(xrec.id_part1)	+')' + CHR(13) + ;
			'cu ' + ALLTRIM(xrec.numepart2) + '(' + TRANSFORM(xrec.id_part2)	+')?' + ;
			IIF(!EMPTY(NVL(m.pdData1, {})), CHR(13) + CHR(13) + 'ATENTIE! Trebuie sa dati redeschideri de luna incepand cu ' + DTOC(m.pdData1) + ' pentru ca faceti modificari pe o luna partiala', '');
			,4+32,'Inlocuire ID Partener')
		IF m.lnRaspuns # 6
			RETURN
		ENDIF
		SET STEP ON 
		llSucces = goExecutor.oExecuta("BEGIN PACK_PARTENERI.IDPART2IDPART(?pnIdPartProst, ?pnIdPartBun, ?pnAn1, ?pnLuna1, ?pnAn2, ?pnLuna2, ?pnLunaMinima, ?pdData1); END;")
		
		IF m.llSucces
			lcMesaj = 'S-au terminat modificarile!'
			aMESSAGEBOX(lcMesaj,0+64,"Info")
		ENDIF
		 
	ENDPROC

	PROCEDURE do_reset
		*!*	This.ck_filtru_denumire.Value = 0
		*!*	This.ck_filtru_nume.Value = 0
		*!*	This.ck_filtru_prenume.Value = 0
		*!*	This.Ck_cod_fiscal.Value = 0
		*!*	This.ck_tip_entitate.Value = 0
		*!*	This.Ck_reg_comert.Value = 0
		*!*	This.ck_filtru_categorie.Value = 0
		*!*	This.Ck_filtru_cont.Value = 0
		
		
		With This
			For i=1 To .Objects.Count
				If Upper(.Objects(i).BaseClass)='CHECKBOX'
					.Objects(i).Value=0
				Endif
			Endfor
		ENDWITH
		
		This.ck_filtru_denumire.SetFocus()
		
	ENDPROC

	PROCEDURE do_verifica
		#DEFINE CRLF CHR(13) + CHR(10)
		
		LOCAL lcFilter, lcSelect, lcWhere, llAutoVerificare, llMFIN, llValidare, llVerificarePlatitorTVA, lnOptiune
		LOCAL loDate AS "empty"
		LOCAL lcCodFiscal, lcDenumire, lcNume, llDontCloseCursor, llExperimental, llServiciuWebANAF
		LOCAL lnRaspuns, loPartener
		
		lcSelect = SELECT()
		lcNume = ALLTRIM(crsparteneri.denumire)
		lcDenumire = ALLTRIM(crsparteneri.denumire)
		lcCodFiscal = crsparteneri.cod_fiscal
		
		IF EMPTY(NVL(m.lcNume, ''))
			RETURN
		ENDIF
		lnOptiune = XMENU('VERIFICA... ' + m.lcNume + ';VERIFICA TOTI PARTENERII - ANAF (EXTRA RAPID)')
		
		IF !BETWEEN(m.lnOptiune, 1, 2)
			RETURN
		ENDIF
		
		IF lnOptiune = 1
			lnOptiune = 0
			loPartener = NULL
			loDate = CREATEOBJECT("empty")
		
			ADDPROPERTY(loDate, "denumire", m.lcDenumire)
			ADDPROPERTY(loDate, "cod_fiscal", m.lcCodFiscal)
			ADDPROPERTY(loDate, "judet", "")
			ADDPROPERTY(loDate, "cod_auto", "")
			ADDPROPERTY(loDate, "cod_judet", "")
			*ADDPROPERTY(loDate, "mesaj_intrebare", 'Doriti sa se completeze datele in formular?')
		
			lnRaspuns = VerificaCodFiscal(loDate, @lnOptiune, @loPartener)
		ELSE
			llVerificarePlatitorTVA = .F. && verific VIES pentru toti partenerii
			llMFIN = .T. && verific MFIN pentru toata lumea
			llValidare = .T. && verific algoritmul codurilor fiscale
			llAutoVerificare = .T. && lanseaza verificarea automata la activate-ul formularului de verificare
			llExperimental = .T.
			llServiciuWebANAF = .T.
			llDontCloseCursor = .F.
		
			lcFilter = FILTER("crsparteneri")
			lcWhere = IIF(m.lnOptiune = 1, "recno() = " + ALLTRIM(STR(RECNO())), IIF(!EMPTY(m.lcFilter), m.lcFilter, ".T."))
			SELECT DISTINCT id_part, cod_fiscal, denumire, IIF(LEFT(UPPER(cod_fiscal), 2) = "RO", "RO", "  ") AS ATRIBUT_FISCAL, .T. AS IsCIF, .F. AS codvalid ;
				FROM crsparteneri ;
				WHERE &lcWhere ;
				INTO CURSOR crsCoduriFiscale ;
				ORDER BY denumire, cod_fiscal  ;
				READWRITE
		
		
			LOCAL lcXMLParteneri
			lcXMLParteneri = ""
			CURSORTOXML('crsCoduriFiscale', "lcXMLParteneri", 1, 0, 0, "1")
		
			*DO verificare_parteneri WITH m.lcXMLParteneri, m.llValidare, m.llMFIN, m.llVerificarePlatitorTVA, m.llAutoVerificare 
			DO verificare_parteneri WITH m.lcXMLParteneri, m.llValidare, m.llMFIN, m.llVerificarePlatitorTVA, m.llAutoVerificare, m.llDontCloseCursor, m.llExperimental, m.llServiciuWebANAF
		ENDIF
	ENDPROC

	PROCEDURE inainte_de_do_modifica
		LOCAL loRec, lnIdPart
		
		If Reccount('crsparteneri')>0
			Select crsparteneri
			lnIdPart = id_part
			Scatter Name loRec
		
			IF !EMPTY(thisform.id_tip_part) AND !EMPTY(thisform.special)
				IF !EMPTY(thisform.mesaj)
					loRec=nom_parteneri_modifica(lnIdPart,thisform.id_tip_part,,thisform.special,thisform.mesaj) &&in onomenclatoare.prg
				ELSE 
					loRec=nom_parteneri_modifica(lnIdPart,thisform.id_tip_part,,thisform.special) &&in onomenclatoare.prg
				ENDIF 		
			ELSE 
				loRec = nom_parteneri_modifica(lnIdPart)
			ENDIF 	
				
			IF !ISNULL(loRec)
				Thisform.MousePointer= 11
				Thisform.LockScreen=.T.
				Thisform.actualizeaza_grid1()
				SELECT crsParteneri
				LOCATE FOR id_part = lorec.id_part
				IF !FOUND()
					GO top
				ENDIF 	
				thisform.grdParteneri.SetFocus()		
				Thisform.LockScreen=.F.
				Thisform.MousePointer= 0
			Endif
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_modifica2
		LOCAL lnIdAdresa, loRec
		
		SELECT crsAdrese
		IF RECCOUNT('crsAdrese')>0
			lnIdAdresa = id_adresa
		*!*		SCATTER NAME loRec
		*!*		
		*!*		=cclocalitati()
		*!*		=ccJudete()
		*!*		=ccTari()
		
		*!*		DO Adauga_Modifica_Inregistrare WITH "parteneri_adrese",loRec,loRec.ID_adresa,"UPDATE" IN oproceduri_ams.prg
		*!*		
		*!*		=close_cclocalitati()
		*!*		=close_ccJudete()
		*!*		=close_ccTari()
			loRec = adrese_parteneri_modifica(lnIdAdresa) && onomenclatoare.prg
			IF !ISNULL(loRec)
				THISFORM.actualizeaza_grid3()
				SELECT crsAdrese
				LOCATE FOR id_adresa = lnIdAdresa
				IF !FOUND()
					LOCATE
				ENDIF 
			ENDIF 	
			this._pageframe1.page1.grdAdrese.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE inainte_de_do_modifica3
		LOCAL lnRecno
		STORE 0 TO lnRecno
		
		SELECT crsPers_contact
		IF RECCOUNT('crsPers_contact')>0
			lnRecno = RECNO()
			SCATTER NAME loRec
		
			DO Adauga_Modifica_Inregistrare WITH "pers_contact",loRec,loRec.id_pers,"UPDATE" IN oproceduri_ams.prg
		
			THISFORM.actualizeaza_grid4()
			SELECT crsPers_contact
			GOTO lnRecno
			this._pageframe1.page2.grdPersoane.SETFOCUS()
		
		ENDIF
	ENDPROC

	PROCEDURE inainte_de_do_modifica_contract
		LOCAL lnRecno
		STORE 0 TO lnRecno
		
		SELECT crsContracte
		IF RECCOUNT('crsContracte')>0
			lnRecno = RECNO()
			SCATTER NAME loRec
			*!*	modificare	ROACONT v 2.2.9
			AddProperty(loRec,"numar2","")
			If Type('loRec.curs')='U'
				AddProperty(loRec,"curs",0)
			Endif
			*!*	modificare	ROACONT v 2.2.9	^
			DO Adauga_Modifica_Inregistrare WITH "contract",loRec,loRec.id_ctr,"UPDATE" IN oproceduri_ams.prg
		
			THISFORM.actualizeaza_contracte()
			SELECT crsContracte
			GOTO lnRecno
			this._pageframe1.page3.grd_contracte.SetFocus()
		ENDIF
	ENDPROC

	PROCEDURE inainte_de_do_sterge
		LOCAL lnSucces
		SELECT crsparteneri
		SCATTER NAME loRec
		*!*	SQLSETPROP(gnHandle,"Transactions",2) && tranzactie manuala
		
		****inceput exceptii***
		IF gnId_prg_owner = 69
			PRIVATE lnId_tip_part 
			lnId_tip_part = thisform.id_tip_part
		*!*	lnIdPart,thisform.id_tip_part,,thisform.special,thisform.mesaj
			lcSel = [{call pack_def.get_partener_tipuri(?loRec.id_part, ?lnId_tip_part , 0)}]
			lcCursor = 'v_nom_tip_parteneri'
			lnSucces = goExecutor.oExecute(lcSel,lcCursor)
		
			IF lnSucces < 0
				amessagebox(goExecutor.cEroare,0+16,"Eroare")
				RETURN
			ENDIF
			=cctipuri_selectate(loRec.id_part)	
			IF RECCOUNT('v_nom_tip_parteneri_selectati')>1
				IF thisform.id_tip_part<>0 AND thisform.special<>0 AND !EMPTY(thisform.mesaj)
					aMESSAGEBOX(thisform.mesaj,16,'Atentie!')
					RETURN NULL
				ENDIF
			ENDIF
		
			IF RECCOUNT('v_nom_tip_parteneri_selectati')=1 AND v_nom_tip_parteneri_selectati.id_tip_part <> thisform.id_tip_part
				aMESSAGEBOX(thisform.mesaj,16,'Atentie!')
				RETURN NULL
			ENDIF
		ENDIF
		****sfarsit exceptii***
		
		llSucces = .F.
		*!*	lnSucces = -1
		
		llSucces = sterge_inregistrare("parteneri",loRec.id_part)
		*!*	IF llSucces
		*!*		lcSql = [DELETE FROM ] + gcS + [.CORESP_TIP_PART WHERE ID_PART = ] + ALLTRIM(STR(loRec.id_part))
		*!*		lnSucces = goExecutor.oExecute(lcSql)
		*!*	ENDIF
		*!*	IF lnSucces > 0
		*!*		SQLCOMMIT(gnHandle)
		*!*	ELSE
		*!*		SQLROLLBACK(gnHandle)
		*!*	ENDIF
		*!*	SQLSETPROP(gnHandle,"Transactions",1) && tranzactie automata
		
		IF llSucces
			SELECT crsparteneri
			THISFORM.actualizeaza_grid1()
		ENDIF
		
	ENDPROC

	PROCEDURE inainte_de_do_sterge2
		If Reccount('crsAdrese')>0
			Local loRec
			Select crsAdrese
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "parteneri_adrese",loRec.id_adresa
			This.actualizeaza_grid3()
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_sterge3
		If Reccount('crsPers_contact')>0
			Local loRec
			Select crsPers_contact
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "pers_contact",loRec.id_pers
			This.actualizeaza_grid4()
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_sterge_contract
		If Reccount('crsContracte')>0
			Local loRec
			Select crsContracte
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "contract",loRec.id_ctr
			This.actualizeaza_contracte()
		Endif
		
	ENDPROC

	PROCEDURE Init
		Lparameters tnIdTipPart,tnSpecial,tcMesaj, tcTitlu, tnTipPersoana
		DoDefault()
		Thisform.id_tip_part=tnIdTipPart
		Thisform.Special=tnSpecial
		Thisform.mesaj=tcMesaj
		
		Thisform.lb_titlu_alb_b121.Caption=tcTitlu
		If Empty(tnTipPersoana)
			Thisform.ntip_persoana_default = 1
		Else
			Thisform.ntip_persoana_default = tnTipPersoana
		Endif
		
		* Sterg gridul Tip Parteneri daca intru cu un sigur tip (Clienti, Furnizori etc.)
		If !EMPTY(NVL(tnIdTipPart,0)) AND !Inlist(tnIdTipPart,gnIdTipDelegati)
			With Thisform.grdParteneri
				lnAnchor = .Anchor
				.Anchor = 0
				.Width = Thisform.grdTipParteneri.Left + Thisform.grdTipParteneri.Width
				Thisform.RemoveObject('grdTipParteneri')
				.Anchor = lnAnchor
			Endwith
			Thisform.Refresh()
		Endif
		
		If !EMPTY(m.tnIdTipPart) AND !Inlist(Upper(tcTitlu),[CLIENTI],[CLIENȚI],[FURNIZORI])
			Thisform.but_verifica1.Visible = .F.
			Thisform.but_copiaza1.Visible = .F.
		ENDIF
		
		thisform.gridextra1.setup()
		thisform._pageframe1.page1.gridextra1.setup()
		thisform._pageframe1.page2.gridextra1.setup()
		thisform._pageframe1.page3.gridextra1.setup()
		thisform._pageframe1.page4.gridextra1.setup()
	ENDPROC

	PROCEDURE modifica_cont
	ENDPROC

	PROCEDURE refreshtabele
		LOCAL lcFiltru
		lcFiltru = [ID_PART = ] + Alltrim(Str(crsparteneri.id_part))
		Thisform.actualizeaza_grid2(m.lcFiltru)
		Thisform.actualizeaza_grid3(m.lcFiltru)
		Thisform.actualizeaza_grid4(m.lcFiltru)
		Thisform.actualizeaza_contracte(m.lcFiltru)
		
	ENDPROC

	PROCEDURE Resize
		THISFORM.Refresh()
		*this.resizer1.onresize
	ENDPROC

	PROCEDURE sterge_cont
	ENDPROC

	PROCEDURE ck_tip_entitate.Valid
		IF this.Value = 1
			pcselect = [select tip_partener,id_tip_part from VNOM_TIP_PARTENERI]
			pcfiltru = []
			pcschema = []
			pcorder = [tip_partener]
			pccoloane = [tip_partener]
			pcTitlu = [Tip partener]
			pcTitluColoane = [Tip partener]	
			pcFiltruOriginal = [inactiv = 0]
			locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,"",.f.,pcFiltruOriginal)		&& 11.07.2007
		
			thisform.temporar_id_tip_part = locauta.id_tip_part
		ENDIF 
	ENDPROC

	PROCEDURE grdParteneri.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT()    
		LOCAL lcFiltru2
		IF INLIST(this.RowColChange,1,3)
			Thisform.RefreshTabele()
		ENDIF 	
		
	ENDPROC

	PROCEDURE grdParteneri.Column1.Text1.Click
		
		
		
	ENDPROC

	PROCEDURE grdParteneri.Init
		this.SetAll("DynamicBackColor","iif(inactiv = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE Gridextra1.applyfilter
		DODEFAULT()
		thisform.RefreshTabele()
	ENDPROC

	PROCEDURE Gridextra1.clearfilter
		DODEFAULT()
		thisform.RefreshTabele()
	ENDPROC

	PROCEDURE _pageframe1.Page1.grdAdrese.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT()     
		
		SELECT crsparteneri
		lcFiltru2 = [ID_PART=]+ALLTRIM(STR(crsparteneri.id_part))
		thisform.actualizeaza_grid2(lcFiltru2)
		
	ENDPROC

	PROCEDURE _pageframe1.Page1.grdAdrese.Init
		this.SetAll("DynamicBackColor","iif(INACTIV = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE _pageframe1.Page1.grdAdrese.Valid
		**thisform.grdTipParteneri.Left=thisform.grdTipParteneri.Left+30
	ENDPROC

	PROCEDURE _pageframe1.Page1.grdAdrese.When
		**thisform.grdTipParteneri.Left=thisform.grdTipParteneri.Left-30
	ENDPROC

	PROCEDURE _pageframe1.Page2.grdPersoane.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT()     
		
		SELECT crsparteneri
		lcFiltru2 = [ID_PART=]+ALLTRIM(STR(crsparteneri.id_part))
		thisform.actualizeaza_grid2(lcFiltru2)
		
	ENDPROC

	PROCEDURE _pageframe1.Page2.grdPersoane.Init
		this.SetAll("DynamicBackColor","iif(INACTIV = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE _pageframe1.Page2.grdPersoane.Valid
		**thisform.grdTipParteneri.Left=thisform.grdTipParteneri.Left+30
	ENDPROC

	PROCEDURE _pageframe1.Page2.grdPersoane.When
		**thisform.grdTipParteneri.Left=thisform.grdTipParteneri.Left-30
	ENDPROC

	PROCEDURE _pageframe1.Page3.grd_contracte.Init
		this.SetAll("DynamicBackColor","iif(INACTIV = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE _pageframe1.Page4.grdCoduri.AfterRowColChange
		LPARAMETERS nColIndex
		DODEFAULT()     
		
		SELECT crsparteneri
		lcFiltru2 = [ID_PART=]+ALLTRIM(STR(crsparteneri.id_part))
		thisform.actualizeaza_grid2(lcFiltru2)
	ENDPROC

	PROCEDURE _pageframe1.Page4.grdCoduri.Init
		this.SetAll("DynamicBackColor","iif(INACTIV = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE _pageframe1.Page4.grdCoduri.Valid
		**thisform.grdTipParteneri.Left=thisform.grdTipParteneri.Left+30
	ENDPROC

	PROCEDURE _pageframe1.Page4.grdCoduri.When
		**thisform.grdTipParteneri.Left=thisform.grdTipParteneri.Left-30
	ENDPROC

	PROCEDURE _shape1.DblClick
		IF thisform.WindowState = 2
			thisform.WindowState = 0
		ELSE 
			thisform.WindowState = 2 
		ENDIF 
		THISFORM.Refresh 
		THISFORM.grdParteneri.SetFocus()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_parteneri_adrese_nou AS _frmbase OF "_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="Clb_bloc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu13" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu13._checkbox3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_scara" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_apartament" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_telefon" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu6" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu10" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu11" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="CUS_ODATA_PARTENERI_ADRESE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_localitate1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 550
		Name = "frm_parteneri_adrese_nou"
		nid = .F.
		orec = .NULL.
		Width = 348
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 287
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 61
		Lb_titlu_alb_b121.Caption = "ADRESĂ"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 19
		BUT_TERMIN1.Left = 318
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 17
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 96
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 8
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 274, ;
		Name = "_checkbox1", ;
		TabIndex = 16, ;
		TabStop = .F., ;
		Top = 532
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox2' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Principală", ;
		ControlSource = "porec.principala", ;
		Left = 12, ;
		Name = "_checkbox2", ;
		TabIndex = 15, ;
		TabStop = .F., ;
		Top = 532
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
		Left = 289, ;
		Name = "BUT_RENUNT1", ;
		TabIndex = 18, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_apartament' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_apartament", ;
		TabIndex = 8, ;
		Top = 314, ;
		Width = 314, ;
		ZOrderSet = 9, ;
		TEXT_SIMPLU1.ControlSource = "poRec.apart", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Left = 80, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Width = 230, ;
		Lb_simplu1.Caption = "Apartament", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_bloc' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_bloc", ;
		TabIndex = 5, ;
		Top = 230, ;
		Width = 314, ;
		ZOrderSet = 7, ;
		TEXT_SIMPLU1.ControlSource = "poRec.bloc", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Left = 80, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Width = 230, ;
		Lb_simplu1.Caption = "Bloc", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_scara' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_scara", ;
		TabIndex = 6, ;
		Top = 258, ;
		Width = 314, ;
		ZOrderSet = 8, ;
		TEXT_SIMPLU1.ControlSource = "poRec.scara", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Left = 80, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Width = 230, ;
		Lb_simplu1.Caption = "Scara", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_telefon' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_telefon", ;
		TabIndex = 10, ;
		Top = 385, ;
		Width = 314, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.ControlSource = "poRec.telefon1", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Left = 80, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Width = 230, ;
		Lb_simplu1.Caption = "Telefon 1", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 3, ;
		Top = 174, ;
		Width = 314, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "poRec.strada", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Strada", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu10' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu10", ;
		TabIndex = 9, ;
		Top = 342, ;
		Width = 314, ;
		ZOrderSet = 9, ;
		Text_simplu1.ControlSource = "poRec.codpostal", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Cod poștal", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu11' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu11", ;
		TabIndex = 7, ;
		Top = 286, ;
		Width = 314, ;
		ZOrderSet = 9, ;
		Text_simplu1.ControlSource = "poRec.etaj", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Etaj", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu13' AS clb_tx_simplu WITH ;
		BackStyle = 0, ;
		Height = 47, ;
		Left = 12, ;
		Name = "Clb_tx_simplu13", ;
		TabIndex = 1, ;
		Top = 38, ;
		Width = 314, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "poRec.denumire_adresa", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 5, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Text_simplu1.Top = 21, ;
		Text_simplu1.Width = 305, ;
		Lb_simplu1.Caption = "Denumire adresă", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Left = 8, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 3, ;
		Lb_simplu1.Top = 4
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu13._checkbox3' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Apare pe adresă", ;
		ControlSource = "poRec.da_apare", ;
		Left = 200, ;
		Name = "_checkbox3", ;
		TabIndex = 2, ;
		Top = 4
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 4, ;
		Top = 202, ;
		Width = 314, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "poRec.numar", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Număr", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 11, ;
		Top = 413, ;
		Width = 314, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "poRec.telefon2", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Telefon 2", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu4' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu4", ;
		TabIndex = 12, ;
		Top = 441, ;
		Width = 314, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "poRec.fax", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Fax", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu5", ;
		TabIndex = 13, ;
		Top = 469, ;
		Width = 314, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "poRec.EMAIL", ;
		Text_simplu1.Format = "K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "E-mail", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu6' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu6", ;
		TabIndex = 14, ;
		Top = 497, ;
		Width = 314, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "poRec.web", ;
		Text_simplu1.Format = "K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 230, ;
		Lb_simplu1.Caption = "Web", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_localitate1' AS ct_localitate WITH ;
		cdate = poRec, ;
		Left = 12, ;
		Name = "Ct_localitate1", ;
		TabIndex = 2, ;
		Top = 90, ;
		Cb_localitate_af.img_atentie.Name = "img_atentie", ;
		Cb_localitate_af.Name = "Cb_localitate_af", ;
		Cb_localitate_af._cbautofill1.Name = "_cbautofill1", ;
		Cb_localitate_af._lbbase1.Name = "_lbbase1", ;
		Cb_tara.Name = "Cb_tara", ;
		Cb_tara._cbbase1.Name = "_cbbase1", ;
		Cb_tara._lbbase1.Name = "_lbbase1", ;
		Cb_judet.Name = "Cb_judet", ;
		Cb_judet._cbbase1.Name = "_cbbase1", ;
		Cb_judet._lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="container" />

	ADD OBJECT 'CUS_ODATA_PARTENERI_ADRESE1' AS cus_odata_parteneri_adrese WITH ;
		Left = 216, ;
		Name = "CUS_ODATA_PARTENERI_ADRESE1", ;
		Top = 7
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		Local plReturn
		plReturn=.F.
		lccontrol = Upper(This.ActiveControl.BaseClass)
		If Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		Do Case
		Case Isnull(poRec.id_loc) And !Isnull(poRec.id_judet)
			amessagebox("Nu ati ales localitatea!",48,"Atentie")
			Thisform.ct_LOCALITATE1.cb_localitate_af.SetFocus()
		Otherwise
			If Isnull(poRec.id_judet)	&&	adica poRec.judet = [<ALEGETI JUDETUL>]
				poRec.judet = []
			Endif
			If Isnull(poRec.id_loc)		&&	adica poRec.localitate = [<ALEGETI LOCALITATEA>]
				poRec.localitate = []
			Endif
			plReturn=This.cuS_ODATA_PARTENERI_ADRESE1.salvare(This.OREC,This.NID)
		Endcase
		
		Return plReturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DoDefault()
		
		This.orec = toRec
		This.nid = tnId
		This.cus_odata_parteneri_adrese1.cactiune = tcActiune
		
		*!*	modificare adrese parteneri 12.2013
		This.ct_localitate1.initializeaza()
		*!*	*!*	modificare	04.07.2012
		*!*	If tcActiune = [INSERT]
		*!*		Thisform.clb_tx_simplu9.text_simplu1.ReadOnly = .T.
		*!*		Select v_nom_tari
		*!*		Locate For prescurtare = [RO]
		*!*		If !Found()
		*!*			Go Top
		*!*		Endif
		*!*		porec.id_tara = v_nom_tari.id_tara
		*!*		porec.tara = v_nom_tari.tara
		*!*		Thisform.cb_tara._cbbase1.Refresh()
		*!*	Endif
		*!*	*!*	modificare	04.07.2012	^
		*!*	modificare adrese parteneri 12.2013	^
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_parteneri_nou AS _frmbase OF "_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_parteneri1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate._shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.clb_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_nume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_prenume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_cod_fiscal" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_cod_fiscal.But_verifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_cod_fiscal.txtCodFiscal2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_prefix" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_motiv_inactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.clb_numar" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_scara" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_codp" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_web" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_telefon2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_telefon1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_fax" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_email" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.clb_etaj" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_apartament" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_bloc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.clb_strada" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_sufix" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Clb_reg_comert" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Cb_categorie_entitate" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate._grdrow1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate._grdrow1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate._grdrow1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate._grdrow1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate._grdrow1.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.cbAdrese" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.butAdresaNou" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Optiongroup1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Ct_coresp_delegati_part1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.Ct_localitate1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.chkInactiva" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.chkPrincipala" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.date_entitate.chkInstitutiePublica" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cStrada.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cStrada.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cLocalitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cLocalitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cTelefon1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cTelefon1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cId_regiune.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cId_regiune.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cBloc.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cBloc.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cScara.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cScara.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cApart.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cApart.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cNumar.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cNumar.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cPrincipala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cPrincipala.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cEtaj.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cEtaj.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cTelefon2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cTelefon2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cFax.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cFax.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cEmail.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cEmail.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cWeb.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cWeb.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cJudet.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cJudet.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cDenumire_adresa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cDenumire_adresa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cDA_apare.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow3.cDA_apare._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cPrenume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cPrenume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cApelativ.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cApelativ.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cFunctia.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cFunctia.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cTelefon.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cTelefon.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cEmail.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cEmail.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cPrincipal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cPrincipal.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese._grdrow4.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.But_modifica3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.But_sterge3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.But_nou3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.LB_SIMPLU1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.adrese.Lb_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.banca.Clb_cont_banca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.banca.Clb_banca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.banca.Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="pf_date.banca.Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="CUS_ODATA_PARTENERI_ADRESE1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_pers_contact1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_grid3
		*m: adauga_tip_partener
		*m: cuivalid
		*m: do_adauga2
		*m: do_adauga3
		*m: do_modifica2
		*m: do_modifica3
		*m: do_sterge2
		*m: do_sterge3
		*m: modifica_tip_persoana
		*m: seteazacorespdelegati
		*m: sterge_tip_partener
		*p: lnsters
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 3
		Caption = "Partener"
		DoCreate = .T.
		Height = 598
		lnsters = 0
		Name = "frm_parteneri_nou"
		orec = .NULL.
		Width = 782
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 780
		_shape1.ZOrderSet = 0
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 719
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Caption = "Entitate"
		Lb_titlu_alb_b121.Left = 8
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 3
		Lb_titlu_alb_b121.Top = 6
		Lb_titlu_alb_b121.ZOrderSet = 2
		But_termin1.Anchor = 8
		But_termin1.Left = 751
		But_termin1.Name = "But_termin1"
		But_termin1.TabIndex = 1
		But_termin1.Top = 1
		But_termin1.ZOrderSet = 20
		Gridsort1.Left = 180
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 12
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Anchor = 8, ;
		Left = 721, ;
		Name = "But_renunt1", ;
		TabIndex = 2, ;
		Top = 1, ;
		ZOrderSet = 19
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cus_odata_parteneri1' AS cus_odata_parteneri WITH ;
		Left = 151, ;
		Name = "Cus_odata_parteneri1", ;
		Top = 8
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'CUS_ODATA_PARTENERI_ADRESE1' AS cus_odata_parteneri_adrese WITH ;
		Left = 222, ;
		Name = "CUS_ODATA_PARTENERI_ADRESE1", ;
		Top = 6
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'Cus_odata_pers_contact1' AS cus_odata_pers_contact WITH ;
		Left = 256, ;
		Name = "Cus_odata_pers_contact1", ;
		Top = 7
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'pf_date' AS _pfbase WITH ;
		Anchor = 15, ;
		ErasePage = .T., ;
		Height = 571, ;
		Left = 1, ;
		Name = "pf_date", ;
		PageCount = 3, ;
		TabIndex = 4, ;
		Top = 29, ;
		Width = 785, ;
		Page1.BackColor = 255,255,255, ;
		Page1.Caption = "Date entitate", ;
		Page1.FontBold = .T., ;
		Page1.FontSize = 10, ;
		Page1.Name = "date_entitate", ;
		Page1.PageOrder = 1, ;
		Page2.BackColor = 255,255,255, ;
		Page2.Caption = "Adrese, persoane de contact", ;
		Page2.FontBold = .T., ;
		Page2.FontSize = 10, ;
		Page2.Name = "adrese", ;
		Page2.PageOrder = 3, ;
		Page3.Caption = "Banca", ;
		Page3.FontBold = .T., ;
		Page3.Name = "banca", ;
		Page3.PageOrder = 2
		*< END OBJECT: ClassLib="_pf_base.vcx" BaseClass="pageframe" />

	ADD OBJECT 'pf_date.adrese._grdrow3' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 18, ;
		DeleteMark = .F., ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		GridLineColor = 192,192,192, ;
		Height = 222, ;
		HighlightStyle = 1, ;
		Left = 11, ;
		Name = "_grdrow3", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsAdreseEnt", ;
		RowHeight = 18, ;
		TabIndex = 1, ;
		Top = 35, ;
		Width = 708, ;
		ZOrderSet = 22, ;
		Column1.ColumnOrder = 5, ;
		Column1.ControlSource = "strada", ;
		Column1.FontCharSet = 1, ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 9, ;
		Column1.Name = "cStrada", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 105, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "localitate", ;
		Column2.FontCharSet = 1, ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 9, ;
		Column2.Name = "cLocalitate", ;
		Column2.ReadOnly = .T., ;
		Column3.ColumnOrder = 11, ;
		Column3.ControlSource = "telefon1", ;
		Column3.FontCharSet = 1, ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 9, ;
		Column3.Name = "cTelefon1", ;
		Column3.ReadOnly = .T., ;
		Column4.ColumnOrder = 18, ;
		Column4.ControlSource = "id_regiune", ;
		Column4.FontCharSet = 1, ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 9, ;
		Column4.Name = "cId_regiune", ;
		Column4.ReadOnly = .T., ;
		Column5.ColumnOrder = 7, ;
		Column5.ControlSource = "bloc", ;
		Column5.FontCharSet = 1, ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 9, ;
		Column5.Name = "cBloc", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 28, ;
		Column6.ColumnOrder = 8, ;
		Column6.ControlSource = "scara", ;
		Column6.FontCharSet = 1, ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 9, ;
		Column6.Name = "cScara", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 36, ;
		Column7.ColumnOrder = 9, ;
		Column7.ControlSource = "apart", ;
		Column7.FontCharSet = 1, ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 9, ;
		Column7.Name = "cApart", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 34, ;
		Column8.ColumnOrder = 6, ;
		Column8.ControlSource = "numar", ;
		Column8.FontCharSet = 1, ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 9, ;
		Column8.Name = "cNumar", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 42, ;
		Column9.Alignment = 2, ;
		Column9.ColumnOrder = 16, ;
		Column9.ControlSource = "inactiv", ;
		Column9.FontCharSet = 1, ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 9, ;
		Column9.Name = "cInactiv", ;
		Column9.ReadOnly = .T., ;
		Column9.Sparse = .F., ;
		Column9.Width = 39, ;
		Column10.Alignment = 2, ;
		Column10.ColumnOrder = 17, ;
		Column10.ControlSource = "principala", ;
		Column10.FontCharSet = 1, ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 9, ;
		Column10.Name = "cPrincipala", ;
		Column10.ReadOnly = .T., ;
		Column10.Sparse = .F., ;
		Column10.Width = 59, ;
		Column11.ColumnOrder = 10, ;
		Column11.ControlSource = "etaj", ;
		Column11.FontCharSet = 1, ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 9, ;
		Column11.Name = "cEtaj", ;
		Column11.ReadOnly = .T., ;
		Column11.Width = 36, ;
		Column12.ColumnOrder = 12, ;
		Column12.ControlSource = "telefon2", ;
		Column12.FontCharSet = 1, ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 9, ;
		Column12.Name = "cTelefon2", ;
		Column12.ReadOnly = .T., ;
		Column13.ColumnOrder = 13, ;
		Column13.ControlSource = "fax", ;
		Column13.FontCharSet = 1, ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 9, ;
		Column13.Name = "cFax", ;
		Column13.ReadOnly = .T., ;
		Column14.ColumnOrder = 14, ;
		Column14.ControlSource = "email", ;
		Column14.FontCharSet = 1, ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 9, ;
		Column14.Name = "cEmail", ;
		Column14.ReadOnly = .T., ;
		Column15.ColumnOrder = 15, ;
		Column15.ControlSource = "web", ;
		Column15.FontCharSet = 1, ;
		Column15.FontName = "Arial", ;
		Column15.FontSize = 9, ;
		Column15.Name = "cWeb", ;
		Column15.ReadOnly = .T., ;
		Column16.ColumnOrder = 4, ;
		Column16.ControlSource = "judet", ;
		Column16.FontCharSet = 1, ;
		Column16.FontName = "Arial", ;
		Column16.FontSize = 9, ;
		Column16.Name = "cJudet", ;
		Column16.ReadOnly = .T., ;
		Column16.Width = 28, ;
		Column17.ColumnOrder = 1, ;
		Column17.ControlSource = "denumire_adresa", ;
		Column17.FontCharSet = 1, ;
		Column17.FontName = "Arial", ;
		Column17.FontSize = 9, ;
		Column17.Name = "cDenumire_adresa", ;
		Column17.ReadOnly = .T., ;
		Column17.Width = 85, ;
		Column18.ColumnOrder = 2, ;
		Column18.ControlSource = "da_apare", ;
		Column18.FontCharSet = 1, ;
		Column18.FontName = "Arial", ;
		Column18.Name = "cDA_apare", ;
		Column18.ReadOnly = .T., ;
		Column18.Sparse = .F., ;
		Column18.Width = 36
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cApart.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Apart.", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cApart.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cBloc.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Bloc", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cBloc.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cDA_apare._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		Left = 37, ;
		Name = "_checkbox1", ;
		Top = 20
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cDA_apare.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pe adresa", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cDenumire_adresa.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cDenumire_adresa.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cEmail.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "E-mail", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cEmail.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cEtaj.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Etaj", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cEtaj.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cFax.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fax", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cFax.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cId_regiune.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Zona", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cId_regiune.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Height = 17, ;
		Left = 30, ;
		Name = "Check1", ;
		Top = 42, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cJudet.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Jud.", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cJudet.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cLocalitate.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Localitate", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cLocalitate.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cNumar.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Numar", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cNumar.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cPrincipala.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Height = 17, ;
		Left = 26, ;
		Name = "Check1", ;
		Top = 42, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cPrincipala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Principala", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cScara.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Scara", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cScara.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cStrada.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Strada", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cStrada.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cTelefon1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon 1", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cTelefon1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cTelefon2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon 2", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cTelefon2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cWeb.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Web", ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow3.cWeb.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontCharSet = 1, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 8, ;
		DeleteMark = .F., ;
		GridLineColor = 192,192,192, ;
		Height = 181, ;
		HighlightStyle = 1, ;
		Left = 11, ;
		Name = "_grdrow4", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .T., ;
		RecordSource = "crsPersContactEnt", ;
		RowHeight = 18, ;
		TabIndex = 5, ;
		Top = 284, ;
		Width = 708, ;
		ZOrderSet = 28, ;
		Column1.BackColor = 255,255,255, ;
		Column1.ColumnOrder = 1, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 9, ;
		Column1.Name = "cNume", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 98, ;
		Column2.BackColor = 255,255,255, ;
		Column2.ControlSource = "prenume", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 9, ;
		Column2.Name = "cPrenume", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 99, ;
		Column3.BackColor = 255,255,255, ;
		Column3.ControlSource = "apelativ", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 9, ;
		Column3.Name = "cApelativ", ;
		Column3.ReadOnly = .T., ;
		Column4.BackColor = 255,255,255, ;
		Column4.ControlSource = "functia", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 9, ;
		Column4.Name = "cFunctia", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 77, ;
		Column5.BackColor = 255,255,255, ;
		Column5.ControlSource = "telefon", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 9, ;
		Column5.Name = "cTelefon", ;
		Column5.ReadOnly = .T., ;
		Column6.BackColor = 255,255,255, ;
		Column6.ControlSource = "email", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 9, ;
		Column6.Name = "cEmail", ;
		Column6.ReadOnly = .T., ;
		Column7.Alignment = 2, ;
		Column7.BackColor = 255,255,255, ;
		Column7.ControlSource = "principal", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 9, ;
		Column7.Name = "cPrincipal", ;
		Column7.ReadOnly = .T., ;
		Column7.Sparse = .F., ;
		Column7.Width = 52, ;
		Column8.Alignment = 2, ;
		Column8.BackColor = 255,255,255, ;
		Column8.ControlSource = "inactiv", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 9, ;
		Column8.Name = "cInactiv", ;
		Column8.ReadOnly = .T., ;
		Column8.Sparse = .F., ;
		Column8.Width = 42
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cApelativ.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Apelativ", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cApelativ.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cEmail.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "E-mail", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cEmail.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cFunctia.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Functia", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cFunctia.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Height = 17, ;
		Left = 34, ;
		Name = "Check1", ;
		Top = 32, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 212,208,200, ;
		Caption = "Inactiv", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cNume.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cNume.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cPrenume.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prenume", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cPrenume.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cPrincipal.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Height = 17, ;
		Left = 38, ;
		Name = "Check1", ;
		Top = 20, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cPrincipal.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Principal", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cTelefon.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon", ;
		FontName = "Arial", ;
		FontSize = 9, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.adrese._grdrow4.cTelefon.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial", ;
		FontSize = 9, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.adrese.But_modifica2' AS but_modifica WITH ;
		Anchor = 9, ;
		caction = do_modifica2, ;
		Comment = "*:OnResize=RT", ;
		Left = 728, ;
		Name = "But_modifica2", ;
		TabIndex = 3, ;
		Tag = "L", ;
		Top = 62, ;
		Visible = .T., ;
		ZOrderSet = 26
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.adrese.But_modifica3' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = do_modifica3, ;
		Comment = "*:OnResize=RT", ;
		Left = 728, ;
		Name = "But_modifica3", ;
		TabIndex = 7, ;
		Tag = "L", ;
		Top = 312, ;
		Visible = .T., ;
		ZOrderSet = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.adrese.But_nou2' AS but_nou WITH ;
		Anchor = 9, ;
		caction = do_adauga2, ;
		Left = 728, ;
		Name = "But_nou2", ;
		TabIndex = 2, ;
		Tag = "L", ;
		Top = 34, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.adrese.But_nou3' AS but_nou WITH ;
		Anchor = 12, ;
		caction = do_adauga3, ;
		Comment = "*:OnResize=RT", ;
		Left = 728, ;
		Name = "But_nou3", ;
		TabIndex = 6, ;
		Tag = "L", ;
		Top = 283, ;
		ZOrderSet = 29
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.adrese.But_sterge2' AS but_sterge WITH ;
		Anchor = 9, ;
		caction = do_sterge2, ;
		Comment = "*:OnResize=RT", ;
		Left = 728, ;
		Name = "But_sterge2", ;
		TabIndex = 4, ;
		Tag = "L", ;
		Top = 90, ;
		Visible = .T., ;
		ZOrderSet = 27
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.adrese.But_sterge3' AS but_sterge WITH ;
		Anchor = 12, ;
		caction = do_sterge3, ;
		Comment = "*:OnResize=RT", ;
		Left = 728, ;
		Name = "But_sterge3", ;
		TabIndex = 8, ;
		Tag = "L", ;
		Top = 340, ;
		Visible = .T., ;
		ZOrderSet = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.adrese.LB_SIMPLU1' AS lb_simplu WITH ;
		Caption = "Adrese", ;
		Left = 16, ;
		Name = "LB_SIMPLU1", ;
		TabIndex = 9, ;
		Top = 13
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'pf_date.adrese.Lb_simplu2' AS lb_simplu WITH ;
		Caption = "Persoane de contact", ;
		Left = 16, ;
		Name = "Lb_simplu2", ;
		TabIndex = 10, ;
		Top = 263
		*< END OBJECT: ClassLib="lb.vcx" BaseClass="label" />

	ADD OBJECT 'pf_date.banca.Clb_banca' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 8, ;
		Name = "Clb_banca", ;
		TabIndex = 1, ;
		Top = 12, ;
		Width = 336, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.banca", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 90, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 240, ;
		Lb_simplu1.Caption = "Nume bancă", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.banca.Clb_cont_banca' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 8, ;
		Name = "Clb_cont_banca", ;
		TabIndex = 2, ;
		Top = 40, ;
		Width = 336, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.cont_banca", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 90, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 240, ;
		Lb_simplu1.Caption = "Cont bancă", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.banca.Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 8, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 3, ;
		Top = 68, ;
		Width = 336, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.swift_banca", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 90, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 240, ;
		Lb_simplu1.Caption = "SWIFT", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.banca.Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 8, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 4, ;
		Top = 96, ;
		Width = 336, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.adresa_banca", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 90, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 240, ;
		Lb_simplu1.Caption = "Adresa bancă", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate._checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		FontBold = .T., ;
		Left = 554, ;
		Name = "_checkbox1", ;
		TabIndex = 27, ;
		TabStop = .F., ;
		Top = 511
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf_date.date_entitate._grdrow1' AS _grdrow WITH ;
		Anchor = 9, ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		GridLines = 0, ;
		Height = 412, ;
		HighlightStyle = 2, ;
		Left = 340, ;
		Name = "_grdrow1", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "v_nom_tip_parteneri", ;
		ScrollBars = 3, ;
		TabIndex = 26, ;
		Top = 21, ;
		Width = 201, ;
		ZOrderSet = 15, ;
		Column1.ControlSource = "v_nom_tip_parteneri.tip_partener", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 115, ;
		Column2.Alignment = 2, ;
		Column2.ControlSource = "v_nom_tip_parteneri.ales", ;
		Column2.Name = "Column2", ;
		Column2.Sparse = .F., ;
		Column2.Width = 45
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'pf_date.date_entitate._grdrow1.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		BackColor = 212,208,200, ;
		Caption = "Tip Entitate", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.date_entitate._grdrow1.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'pf_date.date_entitate._grdrow1.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 42, ;
		Name = "Check1", ;
		Top = 100, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'pf_date.date_entitate._grdrow1.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Ales", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'pf_date.date_entitate._shape1' AS _shape WITH ;
		BackStyle = 0, ;
		BorderColor = 0,128,255, ;
		Height = 337, ;
		Left = 6, ;
		Name = "_shape1", ;
		Top = 197, ;
		Width = 327
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'pf_date.date_entitate.butAdresaNou' AS but_nou WITH ;
		Anchor = 0, ;
		caction = do_adauga2, ;
		Left = 300, ;
		Name = "butAdresaNou", ;
		TabIndex = 8, ;
		TabStop = .F., ;
		Tag = "L", ;
		Top = 199, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.date_entitate.Cb_categorie_entitate' AS cb_tx_simplu WITH ;
		Anchor = 0, ;
		Height = 29, ;
		Left = 341, ;
		Name = "Cb_categorie_entitate", ;
		TabIndex = 23, ;
		Top = 449, ;
		Width = 190, ;
		ZOrderSet = 14, ;
		_cbbase1.Anchor = 10, ;
		_cbbase1.ControlSource = "porec.categorie_entitate", ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 70, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_nom_categ_ent.categorie_entitate", ;
		_cbbase1.RowSourceType = 2, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 110, ;
		_lbbase1.Caption = "Categorie", ;
		_lbbase1.Left = 4, ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.cbAdrese' AS cb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "cbAdrese", ;
		TabIndex = 6, ;
		Top = 197, ;
		Width = 327, ;
		ZOrderSet = 14, ;
		_cbbase1.Anchor = 10, ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 80, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "crsAdreseEnt.strada", ;
		_cbbase1.RowSourceType = 6, ;
		_cbbase1.Top = 4, ;
		_cbbase1.Width = 211, ;
		_lbbase1.Caption = "Adresa", ;
		_lbbase1.FontBold = .T., ;
		_lbbase1.Left = 4, ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.chkInactiva' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		Caption = "Adresă inactivă", ;
		ControlSource = "crsAdreseEnt.inactiv", ;
		Height = 18, ;
		Left = 94, ;
		Name = "chkInactiva", ;
		TabIndex = 22, ;
		TabStop = .F., ;
		Top = 513, ;
		Width = 107, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf_date.date_entitate.chkInstitutiePublica' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Institutie Publica", ;
		ControlSource = "porec.institutie_publica", ;
		FontBold = .T., ;
		Left = 239, ;
		Name = "chkInstitutiePublica", ;
		TabIndex = 29, ;
		TabStop = .F., ;
		Top = 2
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf_date.date_entitate.chkPrincipala' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 0, ;
		Caption = "Principală", ;
		ControlSource = "crsAdreseEnt.principala", ;
		Left = 10, ;
		Name = "chkPrincipala", ;
		TabIndex = 21, ;
		TabStop = .F., ;
		Top = 513
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'pf_date.date_entitate.Clb_apartament' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 106, ;
		Name = "Clb_apartament", ;
		TabIndex = 14, ;
		Top = 365, ;
		Width = 114, ;
		ZOrderSet = 9, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.apart", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 36, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 73, ;
		Lb_simplu1.Caption = "Ap.", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_bloc' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_bloc", ;
		TabIndex = 11, ;
		Top = 337, ;
		Width = 214, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.bloc", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 36, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 172, ;
		Lb_simplu1.Caption = "Bloc", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_cod_fiscal' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 32, ;
		Left = 6, ;
		Name = "Clb_cod_fiscal", ;
		TabIndex = 4, ;
		Top = 124, ;
		Width = 327, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.cod_fiscal", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 64, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 112, ;
		Lb_simplu1.Caption = "C.I.F.", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_cod_fiscal.But_verifica1' AS but_verifica WITH ;
		Anchor = 8, ;
		Left = 291, ;
		Name = "But_verifica1", ;
		TabIndex = 3, ;
		ToolTipText = "Validare cod", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'pf_date.date_entitate.Clb_cod_fiscal.txtCodFiscal2' AS _textbox WITH ;
		ControlSource = "poRec.cod_fiscal2", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 179, ;
		Name = "txtCodFiscal2", ;
		TabIndex = 4, ;
		ToolTipText = "Cod identificare fiscala diferit de CIF. Daca CIF este folosit doar pentru activitati in scopuri TVA, iar firma nu desfasoara activitati in sfera TVA.", ;
		Top = 3, ;
		Width = 112
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'pf_date.date_entitate.Clb_codp' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 219, ;
		Name = "Clb_codp", ;
		TabIndex = 15, ;
		Top = 365, ;
		Width = 114, ;
		ZOrderSet = 9, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.codpostal", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 43, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 66, ;
		Lb_simplu1.Caption = "Cod p.", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.clb_denumire' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 6, ;
		Name = "clb_denumire", ;
		TabIndex = 1, ;
		Top = 23, ;
		Width = 327, ;
		ZOrderSet = 4, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.denumire", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 70, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 250, ;
		Lb_simplu1.Caption = "Denumire", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_email' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_email", ;
		TabIndex = 18, ;
		Top = 421, ;
		Width = 262, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.EMAIL", ;
		Text_simplu1.Format = "K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 211, ;
		Lb_simplu1.Caption = "Email", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.clb_etaj' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "clb_etaj", ;
		TabIndex = 13, ;
		Top = 365, ;
		Width = 88, ;
		ZOrderSet = 9, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.etaj", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 33, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 51, ;
		Lb_simplu1.Caption = "Etaj", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_fax' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_fax", ;
		TabIndex = 19, ;
		Top = 449, ;
		Width = 262, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.fax", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 211, ;
		Lb_simplu1.Caption = "Fax", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_motiv_inactiv' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		Height = 29, ;
		Left = 550, ;
		Name = "Clb_motiv_inactiv", ;
		TabIndex = 30, ;
		Top = 505, ;
		Width = 226, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.motiv_inactiv", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 70, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 151, ;
		Lb_simplu1.Caption = "Motiv inactivare", ;
		Lb_simplu1.Left = 265, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 12
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.clb_numar' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 245, ;
		Name = "clb_numar", ;
		TabIndex = 10, ;
		Top = 309, ;
		Width = 88, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.numar", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 26, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 57, ;
		Lb_simplu1.Caption = "Nr.", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_nume' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_nume", ;
		TabIndex = 2, ;
		Top = 51, ;
		Width = 327, ;
		ZOrderSet = 4, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.nume", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 70, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 250, ;
		Lb_simplu1.Caption = "Nume", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_prefix' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		Height = 29, ;
		Left = 341, ;
		Name = "Clb_prefix", ;
		TabIndex = 24, ;
		Top = 477, ;
		Width = 190, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.prefix", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 70, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 110, ;
		Lb_simplu1.Caption = "Prefix", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_prenume' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_prenume", ;
		TabIndex = 3, ;
		Top = 79, ;
		Width = 327, ;
		ZOrderSet = 4, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.prenume", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 70, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 250, ;
		Lb_simplu1.Caption = "Prenume", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_reg_comert' AS clb_tx_simplu WITH ;
		Anchor = 10, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_reg_comert", ;
		TabIndex = 5, ;
		Top = 155, ;
		Width = 327, ;
		ZOrderSet = 6, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.reg_comert", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 80, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Width = 240, ;
		Lb_simplu1.Caption = "Reg. Comerț", ;
		Lb_simplu1.Height = 18, ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 7, ;
		Lb_simplu1.Width = 75
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_scara' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 219, ;
		Name = "Clb_scara", ;
		TabIndex = 12, ;
		Top = 337, ;
		Width = 114, ;
		ZOrderSet = 8, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.scara", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 43, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 66, ;
		Lb_simplu1.Caption = "Scara", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.clb_strada' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "clb_strada", ;
		TabIndex = 9, ;
		Top = 309, ;
		Width = 240, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.strada", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 36, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 198, ;
		Lb_simplu1.Caption = "Str.", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_sufix' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		Height = 29, ;
		Left = 341, ;
		Name = "Clb_sufix", ;
		TabIndex = 25, ;
		Top = 505, ;
		Width = 190, ;
		ZOrderSet = 5, ;
		Text_simplu1.Anchor = 10, ;
		Text_simplu1.ControlSource = "poRec.sufix", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 70, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 110, ;
		Lb_simplu1.Caption = "Sufix", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_telefon1' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_telefon1", ;
		TabIndex = 16, ;
		Top = 393, ;
		Width = 174, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.telefon1", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 36, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 129, ;
		Lb_simplu1.Caption = "Tel. 1", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_telefon2' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 179, ;
		Name = "Clb_telefon2", ;
		TabIndex = 17, ;
		Top = 393, ;
		Width = 154, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.telefon2", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 40, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 111, ;
		Lb_simplu1.Caption = "Tel. 2 ", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Clb_web' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		Height = 29, ;
		Left = 6, ;
		Name = "Clb_web", ;
		TabIndex = 20, ;
		Top = 477, ;
		Width = 262, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "crsAdreseEnt.web", ;
		Text_simplu1.Format = "K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 211, ;
		Lb_simplu1.Caption = "Web", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Ct_coresp_delegati_part1' AS ct_coresp_delegati_part WITH ;
		Anchor = 0, ;
		Height = 441, ;
		Left = 523, ;
		Name = "Ct_coresp_delegati_part1", ;
		TabIndex = 31, ;
		Top = 1, ;
		Width = 251, ;
		lb_explicatie.Left = 23, ;
		lb_explicatie.Name = "lb_explicatie", ;
		lb_explicatie.Top = 5, ;
		grd_parteneri.cAles.FontSize = 9, ;
		grd_parteneri.cAles.Header1.FontSize = 9, ;
		grd_parteneri.cAles.Header1.Name = "Header1", ;
		grd_parteneri.cAles.Name = "cAles", ;
		grd_parteneri.cAles._checkbox1.Alignment = 2, ;
		grd_parteneri.cAles._checkbox1.FontSize = 9, ;
		grd_parteneri.cAles._checkbox1.Name = "_checkbox1", ;
		grd_parteneri.cDenumire.FontSize = 9, ;
		grd_parteneri.cDenumire.Header1.FontSize = 9, ;
		grd_parteneri.cDenumire.Header1.Name = "Header1", ;
		grd_parteneri.cDenumire.Name = "cDenumire", ;
		grd_parteneri.cDenumire.Text1.FontSize = 9, ;
		grd_parteneri.cDenumire.Text1.Name = "Text1", ;
		grd_parteneri.Height = 367, ;
		grd_parteneri.Left = 23, ;
		grd_parteneri.Name = "grd_parteneri", ;
		grd_parteneri.RowHeight = 18, ;
		grd_parteneri.Top = 65, ;
		grd_parteneri.Width = 228, ;
		tx_cautare.Left = 23, ;
		tx_cautare.Name = "tx_cautare", ;
		tx_cautare.Top = 29
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Ct_localitate1' AS ct_localitate WITH ;
		Anchor = 0, ;
		BorderColor = 0,128,255, ;
		ccrsjudete = crsJudetex, ;
		ccrslocalitati = crsLocalitatix, ;
		ccrstari = crsTarix, ;
		cdate = poRec, ;
		Height = 85, ;
		Left = 6, ;
		Name = "Ct_localitate1", ;
		TabIndex = 7, ;
		Top = 225, ;
		Width = 328, ;
		Cb_localitate_af.BorderColor = 0,128,255, ;
		Cb_localitate_af.Height = 29, ;
		Cb_localitate_af.img_atentie.Name = "img_atentie", ;
		Cb_localitate_af.Left = 0, ;
		Cb_localitate_af.Name = "Cb_localitate_af", ;
		Cb_localitate_af.Top = 56, ;
		Cb_localitate_af.Width = 327, ;
		Cb_localitate_af._cbautofill1.BorderColor = 0,128,255, ;
		Cb_localitate_af._cbautofill1.Height = 23, ;
		Cb_localitate_af._cbautofill1.Left = 80, ;
		Cb_localitate_af._cbautofill1.Name = "_cbautofill1", ;
		Cb_localitate_af._cbautofill1.Top = 3, ;
		Cb_localitate_af._cbautofill1.Width = 242, ;
		Cb_localitate_af._lbbase1.Name = "_lbbase1", ;
		Cb_tara.BorderColor = 0,128,255, ;
		Cb_tara.Height = 29, ;
		Cb_tara.Left = 0, ;
		Cb_tara.Name = "Cb_tara", ;
		Cb_tara.Top = 0, ;
		Cb_tara.Width = 327, ;
		Cb_tara._cbbase1.Height = 23, ;
		Cb_tara._cbbase1.Left = 80, ;
		Cb_tara._cbbase1.Name = "_cbbase1", ;
		Cb_tara._cbbase1.Top = 3, ;
		Cb_tara._cbbase1.Width = 242, ;
		Cb_tara._lbbase1.Name = "_lbbase1", ;
		Cb_judet.BorderColor = 0,128,255, ;
		Cb_judet.Height = 29, ;
		Cb_judet.Left = 0, ;
		Cb_judet.Name = "Cb_judet", ;
		Cb_judet.Top = 28, ;
		Cb_judet.Width = 327, ;
		Cb_judet._cbbase1.Height = 23, ;
		Cb_judet._cbbase1.Left = 80, ;
		Cb_judet._cbbase1.Name = "_cbbase1", ;
		Cb_judet._cbbase1.Top = 3, ;
		Cb_judet._cbbase1.Width = 242, ;
		Cb_judet._lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="container" />

	ADD OBJECT 'pf_date.date_entitate.Label1' AS label WITH ;
		BackStyle = 0, ;
		Caption = "Tip persoană", ;
		FontBold = .T., ;
		FontCharSet = 238, ;
		FontName = "Arial", ;
		Height = 17, ;
		Left = 6, ;
		Name = "Label1", ;
		TabIndex = 32, ;
		Top = 3, ;
		Width = 75
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'pf_date.date_entitate.Optiongroup1' AS optiongroup WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		ButtonCount = 2, ;
		ControlSource = "poRec.tip_persoana", ;
		Height = 27, ;
		Left = 96, ;
		Name = "Optiongroup1", ;
		TabIndex = 28, ;
		Top = -2, ;
		Value = 1, ;
		Width = 140, ;
		Option1.BackStyle = 0, ;
		Option1.Caption = "Juridică", ;
		Option1.FontCharSet = 238, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option1.Value = 1, ;
		Option1.Width = 61, ;
		Option2.BackStyle = 0, ;
		Option2.Caption = "Fizică", ;
		Option2.FontCharSet = 238, ;
		Option2.Height = 17, ;
		Option2.Left = 74, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option2.Width = 61
		*< END OBJECT: BaseClass="optiongroup" />
	
	PROCEDURE actualizeaza_grid3
	ENDPROC

	PROCEDURE adauga_tip_partener
	ENDPROC

	PROCEDURE cuivalid
		LPARAMETERS tcCodFiscal
		
		Local lcCodFiscal, llValid
		Local loPartener As "empty"
		Local lcDenumire, llIsCIF
		lcCodFiscal = IIF(!EMPTY(m.tcCodFiscal), m.tcCodFiscal, poRec.cod_fiscal)
		lcDenumire = Alltrim(poRec.denumire)
		llIsCIF = (poRec.tip_persoana = 1)
		llValid = .T.
		If !Empty(m.lcCodFiscal)
			loPartener = Createobject("empty")
			AddProperty(loPartener, "cod_fiscal", m.lcCodFiscal)
			AddProperty(loPartener, "denumire", m.lcDenumire)
			AddProperty(loPartener, "isCIF", m.llIsCIF)
		
			llValid = verifica_partener("VALIDARE", m.loPartener)
		ENDIF
		
		RETURN m.llValid
	ENDPROC

	PROCEDURE do_adauga2
		Local loRecAdresa, lcCursor, loRecBckp
		lcCursor = This.pf_date.adrese._grdrow3.RecordSource
		loRecBckp = poRec
		loRecAdresa = adrese_parteneri_nou(poRec.id_part,[LOCAL],lcCursor) && onomenclatoare.prg
		poRec = loRecBckp
		If gnButon = 1
			Select (lcCursor)
			Append Blank
			Gather Name loRecAdresa
			This.pf_date.adrese._grdrow3.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_adauga3
		Local lcCursor, loRecContact, loRecBckp
		loRecBckp = poRec
		lcCursor = This.pf_date.adrese._grdrow4.RecordSource
		Select (lcCursor)
		Scatter Name loRecContact Blank
		Do Adauga_Modifica_Inregistrare With "pers_contact",loRecContact,,"LOCAL" In oproceduri_ams.prg
		poRec = loRecBckp
		If gnButon = 1
			Select (lcCursor)
			Append Blank
			Gather Name loRecContact
			This.pf_date.adrese._grdrow4.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Lparameters nKeyCode, nShiftAltCtrl
		*!*	06.01
		poRec.cod_fiscal = Thisform.pf_date.date_entitate.clb_cod_fiscal.text_simplu1.Value
		If Inlist(nKeyCode,9,13) And nShiftAltCtrl=0 And !Empty(Nvl(poRec.cod_fiscal,''))
			poRec.denumire = Alltrim(Nvl(poRec.denumire,[]))
			lcSql = [begin ] + gcS + [.pack_def.cauta_partener(?@poRec.denumire,?ALLTRIM(poRec.cod_fiscal),] + ;
				[?poRec.tip_persoana,?@poRec.nume,?@poRec.prenume,?@poRec.reg_comert,?@poRec.id_loc_inreg,] + ;
				[?@poRec.localitate_inreg,?@poRec.id_categorie_entitate,?@poRec.categorie_entitate,] + ;
				[?@poRec.prefix,?@poRec.sufix,?@poRec.Banca,?@poRec.cont_banca,?@poRec.inactiv,] + ;
				[?@poRec.motiv_inactiv); end;]
			If goExecutor.oExecuta(lcSql)
				Thisform.Refresh()
			Endif
		Endif
		*!*	^
	ENDPROC

	PROCEDURE do_modifica2
		Local lnIdAdresa, loRecAdresa, lcCursor, lnRecNo, loRecBckp
		lcCursor = This.pf_date.adrese._grdrow3.RecordSource
		If Reccount(lcCursor)>0
			Select (lcCursor)
			lnIdAdresa = id_adresa
			lnRecNo = RECNO()
			loRecBckp = poRec
			loRecAdresa = adrese_parteneri_modifica(lnIdAdresa,"LOCAL",lcCursor) && onomenclatoare.prg
			poRec = loRecBckp
			If gnButon = 1
				loRecAdresa.id_adresa_orig = (-1)*loRecAdresa.id_adresa_orig	&&	ca sa stiu ca am modificat valoarea
				Select (lcCursor)
				Goto lnRecno
				Gather Name loRecAdresa
			Endif
			This.pf_date.adrese._grdrow3.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_modifica3
		Local lnRecno, lcCursor, loRecBckp
		Store 0 To lnRecno
		lcCursor = This.pf_date.adrese._grdrow4.RecordSource
		If Reccount(lcCursor)>0
			Select (lcCursor)
			lnRecno = Recno()
			Scatter Name loRecContact
			loRecBckp = poRec
			Do Adauga_Modifica_Inregistrare With "pers_contact",loRecContact,loRecContact.id_pers,"LOCAL" In oproceduri_ams.prg
			poRec = loRecBckp
			If gnButon = 1
				loRecContact.id_pers_orig = (-1)*loRecContact.id_pers_orig	&&	ca sa stiu ca am modificat valoarea
				Select (lcCursor)
				Goto lnRecno
				Gather Name loRecContact
			Endif
			This.pf_date.adrese._grdrow4.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_sterge2
		Local lcCursor
		lcCursor = This.pf_date.adrese._grdrow3.RecordSource
		If Reccount(lcCursor)>0
			lcImagine = [intreb.ico]
			lcTip = [Intrebare]
			lcMesaj = "Doriți să ștergeți înregistrarea?"
			lcTitlu = "Ștergere"
			loFrmIntreb = Createobject('frm_mesaj',lcTitlu,lcImagine,lcTip,lcMesaj)
			loFrmIntreb.Show(1)
			If gnButon = 1
				Select (lcCursor)
				Delete
				Skip
			Endif
			This.pf_date.adrese._grdrow3.SetFocus()
		Endif
	ENDPROC

	PROCEDURE do_sterge3
		Local lcCursor
		lcCursor = This.pf_date.adrese._grdrow4.RecordSource
		If Reccount(lcCursor)>0
			lcImagine = [intreb.ico]
			lcTip = [Intrebare]
			lcMesaj = "Doriți să ștergeți înregistrarea?"
			lcTitlu = "Ștergere"
			loFrmIntreb = Createobject('frm_mesaj',lcTitlu,lcImagine,lcTip,lcMesaj)
			loFrmIntreb.Show(1)
			If gnButon = 1
				Select (lcCursor)
				Delete
				Skip
			Endif
			This.pf_date.adrese._grdrow4.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_verifica
		*!* 15.01.2020
		*!* marius.mutu
		*!* verificare cod_fiscal2
		*!* nu se mai suprascrie reg_com daca loPartener.recom este gol (verificarea ANAF nu are regcom)
		
		#Define CRLF Chr(13) + Chr(10)
		
		Local loDate As "empty"
		Local llCodRO, llPlatitorTVAMfin, lnRaspuns, loPartener, lnOptiune, lcCodFiscal, lcCodFiscal2, lcDenumire
		Local lcAdresa, lcLocalitate, lcNumar, lcStrada
		Local lcApart, lcBloc, lcEtaj, lcFax, lcScara, lcTelefon, lnCodPostal
		
		lnOptiune = 0
		loPartener = Null
		loDate = Createobject("empty")
		lcCodFiscal = Alltrim(Nvl(poRec.cod_fiscal, ''))
		lcCodFiscal2 = Alltrim(Nvl(poRec.cod_fiscal2, ''))
		If !Empty(m.lcCodFiscal) And !Empty(m.lcCodFiscal2)
			lnOptiune = xmenu('Verifica ' + m.lcCodFiscal + ';Verifica ' + m.lcCodFiscal2)
			If Empty(m.lnOptiune)
				Return .F.
			Else
				lcCodFiscal = Iif(m.lnOptiune = 1, m.lcCodFiscal, m.lcCodFiscal2)
			Endif
		Endif
		
		lcDenumire = Alltrim(poRec.denumire)
		AddProperty(loDate, "denumire", m.lcDenumire)
		AddProperty(loDate, "cod_fiscal", m.lcCodFiscal)
		AddProperty(loDate, "judet", "")
		AddProperty(loDate, "cod_auto", "")
		AddProperty(loDate, "cod_judet", "")
		AddProperty(loDate, "mesaj_intrebare", 'Doriti sa se completeze datele in formular?')
		
		lnRaspuns = VerificaCodFiscal(loDate, @lnOptiune, @loPartener)
		If Empty(m.lnOptiune)
			Return
		Endif
		
		If Pemstatus(loPartener, "platitortvamfin", 5)
			llPlatitorTVAMfin = loPartener.PlatitorTvaMfin
			llCodRO = (Left(m.lcCodFiscal, 2) = 'RO')
		
			If m.lnRaspuns = 6
				poRec.denumire = Upper(Alltrim(loPartener.firma))
				poRec.reg_comert = Iif(Left(Alltrim(loPartener.regcom), 1) <> '-' And !Empty(Nvl(loPartener.regcom, '')), Upper(Alltrim(loPartener.regcom)), poRec.reg_comert)
		
				* Adresa
				lcAdresa = Alltrim(loPartener.adresa)
				lcStrada = Upper(Alltrim(loPartener.strada))
				lcNumar = Upper(Alltrim(loPartener.nr))
				lcLocalitate = Upper(Alltrim(loPartener.localitate))
				lcBloc = Upper(Alltrim(loPartener.Bloc))
				lcScara = Upper(Alltrim(loPartener.scara))
				lcApart = Upper(Alltrim(loPartener.apart))
				lcEtaj = Upper(Alltrim(loPartener.etaj))
		
				Select (This.pf_date.date_entitate.ct_localitate1.cCrsJudete)
				Locate For judet = Alltrim(RemoveCharacters(Strtran(Upper(loPartener.judet), 'MUNICIPIUL', ''), .T.))
				If Found()
					This.pf_date.date_entitate.ct_localitate1.odate.judet = Alltrim(judet)
					This.pf_date.date_entitate.ct_localitate1.odate.id_judet = id_judet
					This.pf_date.date_entitate.ct_localitate1.modifica_judet()
		
					If Empty(m.lcLocalitate)
						lcLocalitate = Alltrim(RemoveCharacters(Getwordnum(m.lcAdresa, Getwordcount(m.lcAdresa), ' '), .T.)) && localitatea este ultimul cuvant din adresa (pot fi si mai multe cuvinte)!!!
					Endif
		
					If Left(m.lcLocalitate, 7) = "SECTOR "
						m.lcLocalitate = Strtran(m.lcLocalitate, "SECTOR ", "BUCURESTI SECTORUL ", 1, 1, 1)
					Endif
					Select (This.pf_date.date_entitate.ct_localitate1.cCrsLocalitati)
					Locate For Like(m.lcLocalitate + '*', localitate)
					If Found()
						This.pf_date.date_entitate.ct_localitate1.odate.localitate = Alltrim(localitate)
						This.pf_date.date_entitate.ct_localitate1.odate.id_loc = id_loc
						This.pf_date.date_entitate.ct_localitate1.modifica_localitate(id_loc)
						lcAdresa = Alltrim(Left(m.lcAdresa, Rat(' ', m.lcAdresa))) && scot localitatea din adresa
					Endif
				Endif
		
				If Empty(m.lcStrada)
					lcStrada = Alltrim(m.lcAdresa)
					lcStrada = Alltrim(Strtran(m.lcStrada, 'STR.', '', 1, 1, 1))
					lcStrada = Alltrim(Strtran(m.lcStrada, 'SOS.', '', 1, 1, 1))
					lcStrada = Alltrim(Strtran(m.lcStrada, 'B-DUL', '', 1, 1, 1))
				Endif
		
				If Empty(m.lcNumar)
					lcNumar = Getwordnum(lcStrada, Getwordcount(lcStrada), ' ')
					If Isdigit(m.lcNumar)
						lcStrada = Left(lcStrada, Rat(' ', lcStrada))
					Else
						lcNumar = ''
					Endif
				Endif
		
				lcStrada = Iif(!Empty(m.lcStrada), m.lcStrada, crsAdreseEnt.strada)
				lcNumar = Iif(!Empty(m.lcNumar), m.lcNumar, crsAdreseEnt.numar)
				lnCodPostal = Iif(!Empty(Int(Val(loPartener.codpostal))), Int(Val(loPartener.codpostal)), crsAdreseEnt.codpostal)
				lcTelefon = Iif(!Empty(loPartener.telefon), Alltrim(loPartener.telefon), crsAdreseEnt.telefon1)
				lcFax = Iif(!Empty(ALLTRIM(loPartener.fax)), Alltrim(loPartener.fax), crsAdreseEnt.fax)
				lcBloc = Iif(!Empty(m.lcBloc), m.lcBloc, crsAdreseEnt.Bloc)
				lcScara = Iif(!Empty(m.lcScara), m.lcScara, crsAdreseEnt.scara)
				lcApart = Iif(!Empty(m.lcApart), m.lcApart, crsAdreseEnt.apart)
				lcEtaj = Iif(!Empty(m.lcEtaj), m.lcEtaj, crsAdreseEnt.etaj)
		
		
				Replace strada With m.lcStrada, numar With m.lcNumar, codpostal With m.lnCodPostal, ;
					telefon1 With m.lcTelefon, fax With m.lcFax In crsAdreseEnt
		
				Replace Bloc With m.lcBloc, scara With m.lcScara, apart With m.lcApart, etaj With m.lcEtaj In crsAdreseEnt
			Endif
		
			If m.llPlatitorTVAMfin And !m.llCodRO And AMESSAGEBOX('Partenerul este Platitor de TVA!' + CRLF + 'Doriti sa adaugati RO la codul fiscal?', 4 + 32, _Screen.Caption) = 6
				poRec.cod_fiscal = 'RO' + m.lcCodFiscal
				Thisform.pf_date.date_entitate.clb_cod_fiscal.text_simplu1.SetFocus()
			Else
				If !m.llPlatitorTVAMfin And m.llCodRO And AMESSAGEBOX('Partenerul este Neplatitor de TVA!' + CRLF + 'Doriti sa stergeti RO din codul fiscal?', 4 + 32, _Screen.Caption) = 6
					poRec.cod_fiscal = Alltrim(Substr(m.lcCodFiscal, 3))
					Thisform.pf_date.date_entitate.clb_cod_fiscal.text_simplu1.SetFocus()
				Endif
			ENDIF
			thisform.pf_date.date_entitate.clb_denumire.teXT_SIMPLU1.Valid() && actualizare nume din denumire pentru persoana juridica
			Thisform.Refresh()
		Endif && pemstatus
		*********************************
		
		
		
		
		
		
		
		
	ENDPROC

	PROCEDURE inainte_de_do_renunt
		pccontinua=.F.
	ENDPROC

	PROCEDURE inainte_de_do_termin
		*!* 20.08.2009
		*!* marius.mutu
		
		*!* 02.03.2016
		*!* marius.mutu
		*!* optiune glCUIClientObligatoriu - trebuie completat CUI Client
		
		Private m.plreturn
		Local lcCodFiscal, lccontrol, lcval, llValid, lnRecNr
		*:Global pccontinua
		plreturn = .F.
		
		If Type('Thisform.ActiveControl.ControlSource')!= 'U'
			lccontrol = Upper(Thisform.ActiveControl.BaseClass )
			If   Inlist(m.lccontrol, "TEXTBOX", "EDITBOX", "COMBOBOX")
				lcval  = Thisform.ActiveControl.ControlSource
				IF !'crsadreseent'$LOWER(m.lcVal)
					&lcval = Thisform.ActiveControl.Value
				ENDIF 	
			Endif
		Endif
		
		Select v_nom_tip_parteneri
		Calculate Cnt() For ales = 1 To m.lnRecNr
		
		* Este obligatoriu completarea CUI/CNP client?
		llCUIClient = .F. 
		IF TYPE('glCUIClientObligatoriu') = 'L' AND m.glCUIClientObligatoriu
			Select v_nom_tip_parteneri
			Locate For ales = 1 AND id_tip_part = 16 && TIP CLIENT
			llCUIClient = FOUND()
			GO TOP 
		ENDIF 
		
		llCUIValid = .F.
		lcCodFiscal = ALLTRIM(Nvl(poRec.cod_fiscal, ''))
		If !Empty(m.lcCodFiscal)
			llCUIValid = Thisform.CUIValid()
		ENDIF 	
		
		llIBANValid = .F.
		lcIBAN = ALLTRIM(NVL(poRec.cont_banca, ''))
		IF !EMPTY(m.lcIBAN)
			llIBANValid = verifiban(m.lcIBAN)
		ENDIF 
		
		llExitClient = .F.
		DO CASE 
			CASE Empty(m.lcCodFiscal)
				IF m.llCUIClient
					amessagebox("Nu ati completat " + Iif(poRec.tip_persoana = 1, "C.I.F.-ul", "C.N.P.-ul") + "!",0+48,_screen.caption)
					Thisform.pf_date.date_entitate.clb_cod_fiscal.text_simplu1.SetFocus()			
					llExitClient = .T.
				ELSE 
					If amessagebox("Nu ati completat " + Iif(poRec.tip_persoana = 1, "C.I.F.-ul", "C.N.P.-ul") + "!" + crlf + "Doriti sa continuati?", 4 + 32, "Atentie") <> 6
						Thisform.pf_date.date_entitate.clb_cod_fiscal.text_simplu1.SetFocus()
						llExitClient = .T.
					ENDIF		
				ENDIF 	
		
			CASE !Empty(m.lcCodFiscal) AND !m.llCUIValid
				IF m.llCUIClient
					amessagebox(Iif(poRec.tip_persoana = 1, "C.I.F.-ul ", "C.N.P.-ul ") + m.lcCodFiscal + ' este INVALID!' + crlf + 'Completarea codului pentru clienti este obligatorie!',0+48,_screen.caption)
					llExitClient = .T.
				ELSE
					If amessagebox(Iif(poRec.tip_persoana = 1, "C.I.F.-ul ", "C.N.P.-ul ") + m.lcCodFiscal + ' este INVALID!' + crlf + 'Doriti sa continuati?', 4 + 32, "Atentie") <> 6
						llExitClient = .T.
					Endif
				ENDIF 	
		
			CASE !EMPTY(m.lcIBAN) AND !m.llIBANValid
					If amessagebox("Codul IBAN " + m.lcIBAN + ' este INVALID!' + crlf + 'Doriti sa continuati?', 4 + 32, "Atentie") <> 6
						llExitClient = .T.
					Endif				
		ENDCASE 			
		IF m.llExitClient
			plreturn = .F.
			RETURN m.plreturn
		ENDIF 
		
		*!*	modificare	11.12.2009	^
		Do Case
		Case poRec.tip_persoana = 1 And (Empty(poRec.denumire) Or Isnull(poRec.denumire))
			amessagebox('Nu ati completat denumirea!', 0 + 48, "Atentie")
			Thisform.pf_date.date_entitate.clb_denumire.SetFocus()
			plreturn = .F.
		
		Case poRec.tip_persoana = 2 And (Empty(poRec.nume) Or Isnull(poRec.nume))
			amessagebox('Nu ati completat numele!', 0 + 48, "Atentie")
			Thisform.pf_date.date_entitate.clb_nume.SetFocus()
			plreturn = .F.
		
		Case poRec.tip_persoana = 2 And (Empty(poRec.prenume) Or Isnull(poRec.prenume))
			amessagebox('Nu ati completat prenumele!', 0 + 48, "Atentie")
			Thisform.pf_date.date_entitate.clb_prenume.SetFocus()
			plreturn = .F.
		
		Case m.lnRecNr = 0
			amessagebox('Nu ati ales tipul/tipurile de partener(i)', 0 + 48, "Atentie")
			Thisform.pf_date.date_entitate._grdrow1.SetFocus()
			plreturn = .F.
		Otherwise
		
		*!*		If Alltrim(Upper(This.cus_odata_parteneri1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_parteneri1.cactiune))="UPDATE" And porec.cod_fiscal!=pccod_fiscal)
		*!*			pcexec=[select * from ]+gcS+[.vnom_parteneri where TRIM(cod_fiscal)=']+Alltrim(porec.cod_fiscal)+[']
		*!*			Do While .T.
		*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_codfiscal')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista_codfiscal')>0
		*!*				Amessagebox('Mai exista partener cu acest '+IIF(thisform.optiongroup1.Value=1,'cod fiscal','CNP')+' !',0+48,"Atentie")
		*!*				Thisform.clb_cod_fiscal.SetFocus()
		*!*				Use In exista_codfiscal
		*!*				plreturn=.F.
		*!*			ELSE
		*!*				***incarcare tipuri:***************************
		*!*				this.orec.tip_partener = ""
		*!*				SELECT v_nom_tip_parteneri
		*!*				SCAN FOR ales = 1
		*!*					this.orec.tip_partener = this.orec.tip_partener + ALLTRIM(STR(v_nom_tip_parteneri.id_tip_part)) + ";"
		*!*				ENDSCAN
		*!*	 			***		***************************************
		*!*				plreturn=This.cus_odata_parteneri1.salvare(This.OREC,This.NID)
		*!*			Endif
		*!*		ELSE
		***incarcare tipuri:***************************
			Thisform.orec.ccorespdel = Iif(Thisform.pf_date.date_entitate.ct_coresp_delegati_part1.Visible, ;
				Strtran(Strtran(Thisform.pf_date.date_entitate.ct_coresp_delegati_part1.clista_id_part, [>], [;]), [<], []), ;
				Thisform.pf_date.date_entitate.ct_coresp_delegati_part1.clista_initiala)
			Thisform.orec.tip_partener = ""
			Select v_nom_tip_parteneri
			Scan For ales = 1
				Thisform.orec.tip_partener = Thisform.orec.tip_partener + Alltrim(Str(v_nom_tip_parteneri.id_tip_part)) + ";"
			Endscan
		***		***************************************
		*!*	modificare adrese parteneri 12.2013
		*!*			plreturn = Thisform.cus_odata_parteneri1.salvare(Thisform.orec, Thisform.NID)
		*!*		Endif
			If Thisform.do_deschide_tranzactie()
				Private pnIdAdresa
				Store 0 To pnIdAdresa
				Local lcCursorAdCont, lcActiuneAdCont, lcDeleted
				If Thisform.cus_odata_parteneri1.salvare(Thisform.orec, Thisform.NID)
					plreturn = .T.
					lcDeleted = SET("Deleted")
					SET DELETED OFF
					If This.cus_odata_parteneri1.cactiune = [INSERT]
						*!*	salvare adrese
		
						lcCursorAdCont = Thisform.pf_date.adrese._grdrow3.RecordSource
						Thisform.cus_ODATA_PARTENERI_ADRESE1.cactiune = [INSERT]
						Select (lcCursorAdCont)
						Replace All id_part With pnIdPart
						Replace id_loc With Null For id_loc = 0
						Scan For !Deleted()
							Scatter Name loRecAdCont
							plreturn = Thisform.cus_ODATA_PARTENERI_ADRESE1.salvare(loRecAdCont,loRecAdCont.id_adresa)
							If !plreturn
								Exit
							Endif
							Select (lcCursorAdCont)
						Endscan
		
						If plreturn
							*!*	salvare persoane de contact
							PRIVATE pnId_part
							pnId_part = pnIdPart
							lcCursorAdCont = Thisform.pf_date.adrese._grdrow4.RecordSource
							Thisform.cus_odata_pers_contact1.cactiune = [INSERT]
							Select (lcCursorAdCont)
							Replace All id_part With pnIdPart
							Scan For !Deleted()
								Scatter Name loRecAdCont
								plreturn = Thisform.cus_odata_pers_contact1.salvare(loRecAdCont,loRecAdCont.id_pers)
								If !plreturn
									Exit
								Endif
								Select (lcCursorAdCont)
							Endscan
		
						Endif
					Else
						*!*	salvare adrese
						lcCursorAdCont = Thisform.pf_date.adrese._grdrow3.RecordSource
						Select (lcCursorAdCont)
						Replace id_loc With Null For id_loc = 0
						Scan
							Do Case
							Case id_adresa = 0 AND !DELETED()
								lcActiuneAdCont = [INSERT]
							Case id_adresa <> 0 And !Deleted() And id_adresa_orig = (-1)*id_adresa
								lcActiuneAdCont = [UPDATE]
							Case id_adresa <> 0 And Deleted()
								lcActiuneAdCont = [DELETE]
							Otherwise
								lcActiuneAdCont = []
							Endcase
							If !Empty(lcActiuneAdCont)
								Scatter Name loRecAdCont
								Thisform.cus_ODATA_PARTENERI_ADRESE1.cactiune = lcActiuneAdCont
								plreturn = Thisform.cus_ODATA_PARTENERI_ADRESE1.salvare(loRecAdCont,IIF(lcActiuneAdCont=[INSERT],[],loRecAdCont.id_adresa))
								If !plreturn
									Exit
								Endif
							Endif
							Select (lcCursorAdCont)
						Endscan
		
						If plreturn
							*!*	salvare persoane de contact
							lcCursorAdCont = Thisform.pf_date.adrese._grdrow4.RecordSource
							Select (lcCursorAdCont)
							Scan
								Do Case
								Case id_pers = 0 AND !DELETED()
									lcActiuneAdCont = [INSERT]
								Case id_pers <> 0 And !Deleted() And id_pers_orig = (-1)*id_pers
									lcActiuneAdCont = [UPDATE]
								Case id_pers <> 0 And Deleted()
									lcActiuneAdCont = [DELETE]
								Otherwise
									lcActiuneAdCont = []
								Endcase
								If !Empty(lcActiuneAdCont)
									Scatter Name loRecAdCont
									Thisform.cus_odata_pers_contact1.cactiune = lcActiuneAdCont
									plreturn = Thisform.cus_odata_pers_contact1.salvare(loRecAdCont,IIF(lcActiuneAdCont=[INSERT],[],loRecAdCont.id_pers))
									If !plreturn
										Exit
									Endif
								Endif
								Select (lcCursorAdCont)
							Endscan
						Endif
					Endif
					Set Deleted &lcDeleted
					Release pnIdAdresa
				Endif
				Thisform.do_inchide_tranzactie(Iif(plreturn,1,2))
			Endif
		*!*	modificare adrese parteneri 12.2013	^
		Endcase
		If m.plreturn
			pccontinua = .T.
		Endif
		Return m.plreturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DoDefault()
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_parteneri1.cactiune = tcActiune
		*!*	modificare adrese parteneri 12.2013
		This.cus_ODATA_PARTENERI_ADRESE1.lsilent = .T.
		This.cus_odata_pers_contact1.lsilent = .T.
		This.pf_date.adrese._grdrow3.AutoFit()
		This.pf_date.adrese._grdrow4.AutoFit()
		*!*	modificare adrese parteneri 12.2013	^
		
		If tcActiune='INSERT'
		*!*	modificare 06.01
			Bindevent(Thisform.pf_date.date_entitate.clb_cod_fiscal.text_simplu1,"KeyPress",Thisform,"do_cauta")
		*!*	^
		Endif
		
		IF !EMPTY(toRec.id_tip_part)
			Select v_nom_tip_parteneri
			Locate For id_tip_part = toRec.id_tip_part
			If Found()
				Replace ales With 1
			Endif
		ENDIF 
		
		If toRec.Special = 1
			Select v_nom_tip_parteneri
			LOCATE FOR ales = 1
			IF FOUND()
				Set Filter To ales=1
				Thisform.pf_date.date_entitate._grdrow1.Column2.ReadOnly=.T.
			ENDIF 	
		Else
			Select v_nom_tip_parteneri
			Set Filter To
			Thisform.pf_date.date_entitate._grdrow1.Column2.ReadOnly=.F.
		Endif
		
		*!*	modificare	30.10.2013
		*!*	If toRec.tip_persoana = 1 && juridica
		*!*		Thisform.clb_nume.Visible = .F.
		*!*		Thisform.clb_prenume.Visible = .F.
		*!*		Thisform.clb_cod_fiscal.lb_simplu1.Caption = "C.I.F."
		*!*		Thisform.clb_reg_comert.lb_simplu1.Caption = "Registru comert"
		*!*	Else
		*!*		Thisform.clb_denumire.text_simplu1.ReadOnly = .T.
		*!*		Thisform.clb_prefix.Visible = .F.
		*!*		Thisform.clb_sufix.Visible = .F.
		*!*		Thisform.clb_cod_fiscal.lb_simplu1.Caption = "C.N.P."
		*!*		Thisform.clb_reg_comert.lb_simplu1.Caption = "Serie, nr BI/CI"
		*!*		Thisform.clb_nume.SetFocus()
		*!*	Endif
		*!*	modificare	30.10.2013	^
		*!*	modificare 08.01
		Select v_nom_tip_parteneri
		Locate For ales = 1 And id_tip_part = Nvl(gnIdTipDelegati,-44)
		llGasit = Found()
		Thisform.pf_date.date_entitate.ct_coresp_delegati_part1.initializeaza_date(llGasit,toRec.id_part,toRec.id_tip_part,toRec.ccorespdel)
		Thisform.seteazaCorespDelegati(llGasit)
		*!*	^
		
		Select v_nom_tip_parteneri
		Locate For ales = 1
		If !Found()
			Go Top
		Endif
		Thisform.pf_date.date_entitate._grdrow1.Refresh()
		*!*	modificare	30.10.2013
		
		Thisform.modifica_tip_persoana(toRec.tip_persoana)
		*!*	modificare	30.10.2013	^
		
		this.pf_date.date_entitate.ct_localitate1.initializeaza()
		
		
		IF NVL(crsAdreseEnt.id_adresa,0) = NVL(crsAdreseEnt.id_adresa_orig,0)
			REPLACE id_adresa_orig with (-1)*id_adresa_orig IN crsAdreseEnt
		ENDIF 	
		this.pf_date.date_entitate.cbAdrese._cbbase1.DisplayValue = NVL(crsAdreseEnt.strada, '')
		this.pf_date.date_entitate.cbAdrese._cbbase1.Value = NVL(crsAdreseEnt.strada, '')
		IF EMPTY(NVL(toRec.id_part,0)) OR RECCOUNT('crsAdreseEnt') = 0
			this.pf_date.date_entitate.butAdresaNou.click()
			this.pf_date.date_entitate.clb_denumire.text_simplu1.SetFocus()
		ENDIF 
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		
		lcControlClass = Alltrim(Upper(Thisform.ActiveControl.BaseClass))
		Do Case
		*!*	modificare 08.01
		Case Inlist(nKeyCode,9,13) And lcControlClass = "GRID" And Thisform.pf_date.date_entitate.ct_coresp_delegati_part1.Visible
			Nodefault
			Thisform.pf_date.date_entitate.ct_coresp_delegati_part1.SetFocus()
		*!*	^
		Case Inlist(nKeyCode,9,13) And lcControlClass = "GRID"
			Nodefault
			Thisform.BUT_TERMIN1.SetFocus
		Otherwise
			DoDefault(nKeyCode, nShiftAltCtrl)
		Endcase
		
	ENDPROC

	PROCEDURE modifica_tip_persoana
		LPARAMETERS tnTip_persoana
		If tnTip_persoana = 1 && juridica
			With Thisform.pf_date.date_entitate.clb_denumire.text_simplu1
				.ReadOnly = .F.
				.TabStop = .T.
			Endwith
			Thisform.pf_date.date_entitate.clb_nume.Visible = .F.
			Thisform.pf_date.date_entitate.clb_prenume.Visible = .F.
			Thisform.pf_date.date_entitate.clb_prefix.Visible = .T.
			Thisform.pf_date.date_entitate.clb_sufix.Visible = .T.
			WITH Thisform.pf_date.date_entitate.clb_cod_fiscal
				.lb_simplu1.Caption = "C.I.F."
				.but_verifica1.Visible = .T.			&&	modificare	30.10.2013
			Endwith	
			Thisform.pf_date.date_entitate.clb_reg_comert.lb_simplu1.Caption = "Reg. Comerț"
			Thisform.pf_date.date_entitate.clb_denumire.SetFocus()
		Else && persoana fizica
			With Thisform.pf_date.date_entitate.clb_denumire.text_simplu1
				.ReadOnly = .T.
				.TabStop = .F.
			Endwith
			Thisform.pf_date.date_entitate.clb_nume.Visible = .T.
			Thisform.pf_date.date_entitate.clb_prenume.Visible = .T.
			Thisform.pf_date.date_entitate.clb_prefix.Visible = .F.
			Thisform.pf_date.date_entitate.clb_sufix.Visible = .F.
			With Thisform.pf_date.date_entitate.clb_cod_fiscal
				.lb_simplu1.Caption = "C.N.P."
				.but_verifica1.Visible = .F.			&&	modificare	30.10.2013
			Endwith
			Thisform.pf_date.date_entitate.clb_reg_comert.lb_simplu1.Caption = "Serie, nr BI/CI"
			Thisform.pf_date.date_entitate.clb_nume.SetFocus()
		Endif
	ENDPROC

	PROCEDURE seteazacorespdelegati
		Lparameters tlArataCorespDelegati
		Thisform.pf_date.date_entitate.ct_coresp_delegati_part1.modifica_vizibilitate(tlArataCorespDelegati)
		*!*	Thisform.Width = Iif(tlArataCorespDelegati,782,530)
		Thisform.AutoCenter = .T.
		Thisform.Refresh()
		
	ENDPROC

	PROCEDURE sterge_tip_partener
	ENDPROC

	PROCEDURE pf_date.adrese._grdrow3.Init
		DODEFAULT()
		this.SetAll("DynamicBackColor","iif(INACTIV = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

	PROCEDURE pf_date.adrese._grdrow4.Init
		DoDefault()
		This.SetAll("DynamicBackColor","iif(INACTIV = 1, RGB(200,200,200), RGB(255,255,255))","Column")
		
	ENDPROC

	PROCEDURE pf_date.banca.Clb_cont_banca.Text_simplu1.Valid
		LOCAL lcIBAN
		lcIBAN = ALLTRIM(NVL(poRec.cont_banca,''))
		If !Empty(m.lcIBAN) AND !verifiban(m.lcIBAN)
			AMESSAGEBOX("Codul IBAN " + m.lcIBAN + ' este INVALID!', 0 + 48, "Verificare cod")
		Endif
	ENDPROC

	PROCEDURE pf_date.date_entitate.Activate
		*!*	*!* daca am activat pagina Adrese si am modificat/adaugat o adresa, se inchid cursoarele crsTari, crsJudete, crsLocalitati
		*!*	*!* trebuie sa le reconstruiesc pentru modificarea adresei principale din pagina date_entitate
		*!*	IF !USED('crsLocalitati')
		*!*		this.ct_localitate1.initializeaza()
		*!*	ENDIF 	
	ENDPROC

	PROCEDURE pf_date.date_entitate.butAdresaNou.Click
		Local lnPrincipalaCnt, lnRecno
		Calculate Cnt(principala) For Nvl(principala, 0) = 1 To lnPrincipalaCnt In crsAdreseEnt
		
		Select crsAdreseEnt
		Append Blank
		Replace id_part With Nvl(poRec.id_part, 0), principala With Iif(m.lnPrincipalaCnt = 0, 1, 0)
		
		
		lnRecno = Recno()
		Locate
		Locate For Recno() = m.lnRecno
		If !Found()
			Go Top
		Endif
		
		poRec.strada = strada
		This.Parent.cbAdrese._cbbase1.Valid()
		This.Parent.cbAdrese._cbbase1.LostFocus()
		This.Parent.ct_localitate1.Cb_tara.SetFocus()
		
		This.Parent.clb_strada.text_simplu1.Refresh()
		This.Parent.clb_numar.text_simplu1.Refresh()
		This.Parent.Refresh()
	ENDPROC

	PROCEDURE pf_date.date_entitate.cbAdrese._cbbase1.LostFocus
		DODEFAULT()
		IF NVL(crsAdreseEnt.id_adresa,0) = NVL(crsAdreseEnt.id_adresa_orig,0)
			REPLACE id_adresa_orig with (-1)*id_adresa_orig IN crsAdreseEnt
		ENDIF 	
	ENDPROC

	PROCEDURE pf_date.date_entitate.cbAdrese._cbbase1.Valid
		WITH thisform.pf_date.Date_entitate.ct_localitate1
			.oDate.id_tara = crsAdreseEnt.id_tara
			.oDate.id_judet = crsAdreseEnt.id_judet
			.oDate.id_loc = crsAdreseEnt.id_loc
			.initializeaza()
		ENDWITH 
		
		thisform.pf_date.Date_entitate.refresh()
	ENDPROC

	PROCEDURE pf_date.date_entitate.Cb_categorie_entitate._cbbase1.LostFocus
		porec.id_categorie_entitate = v_nom_categ_ent.id_categorie_entitate
	ENDPROC

	PROCEDURE pf_date.date_entitate.Clb_cod_fiscal.Text_simplu1.Valid
		LOCAL lcCodFiscal
		lcCodFiscal = ALLTRIM(NVL(poRec.cod_fiscal,''))
		If !Empty(m.lcCodFiscal) AND !Thisform.CUIValid(m.lcCodFiscal)
			aMESSAGEBOX(Iif(poRec.tip_persoana = 1, "C.I.F.-ul ", "C.N.P.-ul ") + m.lcCodFiscal + ' este invalid', 0 + 48, "Verificare cod")
		Endif
	ENDPROC

	PROCEDURE pf_date.date_entitate.Clb_cod_fiscal.txtCodFiscal2.Valid
		LOCAL lcCodFiscal
		lcCodFiscal = ALLTRIM(NVL(poRec.cod_fiscal2,''))
		If !Empty(m.lcCodFiscal) AND !Thisform.CUIValid(m.lcCodFiscal)
			aMESSAGEBOX(Iif(poRec.tip_persoana = 1, "C.I.F.-ul ", "C.N.P.-ul ") + m.lcCodFiscal + ' este invalid', 0 + 48, "Verificare cod")
		Endif
	ENDPROC

	PROCEDURE pf_date.date_entitate.clb_denumire.Text_simplu1.Valid
		If poRec.tip_persoana = 1
			poRec.nume =  Nvl(Alltrim(poRec.denumire),'')
			poRec.prenume = ''
			Thisform.pf_date.date_entitate.clb_nume.Refresh
			Thisform.pf_date.date_entitate.clb_prenume.Refresh
		Endif
		
	ENDPROC

	PROCEDURE pf_date.date_entitate.Clb_nume.Text_simplu1.LostFocus
		porec.denumire = NVL(ALLTRIM(porec.nume),'') + ' ' + NVL(ALLTRIM(porec.prenume),'')
		thisform.pf_date.date_entitate.clb_denumire.Refresh
		
	ENDPROC

	PROCEDURE pf_date.date_entitate.Clb_prenume.LostFocus
		porec.denumire = ALLTRIM(porec.nume) + ' ' + ALLTRIM(porec.prenume)
	ENDPROC

	PROCEDURE pf_date.date_entitate.Clb_prenume.Text_simplu1.LostFocus
		porec.denumire = NVL(ALLTRIM(porec.nume),'') + ' ' + NVL(ALLTRIM(porec.prenume),'')
		thisform.pf_date.date_entitate.clb_denumire.Refresh
	ENDPROC

	PROCEDURE pf_date.date_entitate.clb_strada.Text_simplu1.LostFocus
		
		
	ENDPROC

	PROCEDURE pf_date.date_entitate.Ct_localitate1.actualizeaza_judete
		DODEFAULT()
		REPLACE id_judet with This.oDate.id_judet, judet with This.oDate.judet IN crsAdreseEnt
		
					
	ENDPROC

	PROCEDURE pf_date.date_entitate.Ct_localitate1.actualizeaza_localitati
		DODEFAULT()
		REPLACE id_loc WITH This.oDate.id_loc, localitate WITH this.oDate.localitate IN crsAdreseEnt
	ENDPROC

	PROCEDURE pf_date.date_entitate.Ct_localitate1.actualizeaza_tari
		DODEFAULT()
		REPLACE id_tara WITH this.odate.id_tara, tara WITH this.odate.tara IN crsAdreseEnt
	ENDPROC

	PROCEDURE pf_date.date_entitate.Ct_localitate1.modifica_judet
		DODEFAULT()
		REPLACE id_judet with This.oDate.id_judet, judet with This.oDate.judet IN crsAdreseEnt
	ENDPROC

	PROCEDURE pf_date.date_entitate.Ct_localitate1.modifica_localitate
		Lparameters tnIdLoc
		DoDefault(tnIdLoc)
		Replace id_loc With Iif(!Empty(Nvl(This.oDate.id_loc, 0)), This.oDate.id_loc, Null) In crsAdreseEnt
		
		* Pentru alte tari decat Romania, adaug localitatile direct legate de tara, fara judet, in adrese parteneri, pentru a fi adaugate in nomenclatorul nom_localitati
		If This.cprescurtaretara <> [RO]
			lcLocalitate = Alltrim(Upper(This.oDate.localitate))
			Replace localitate With This.oDate.localitate In crsAdreseEnt
		Endif
		
		
	ENDPROC

	PROCEDURE pf_date.date_entitate.Ct_localitate1.modifica_tara
		DODEFAULT()
		REPLACE id_tara WITH this.odate.id_tara, tara WITH this.odate.tara IN crsAdreseEnt
	ENDPROC

	PROCEDURE pf_date.date_entitate.Optiongroup1.Valid
		*!*	modificare	30.10.2013	: am mutat totul in modifica_tip_persoana
		Thisform.modifica_tip_persoana(poRec.tip_persoana)
		*!*	modificare	30.10.2013	^
	ENDPROC

	PROCEDURE pf_date.date_entitate._grdrow1.Column2.Check1.Click
		If !This.ReadOnly
			Select v_nom_tip_parteneri
			If id_tip_part = gnIdTipDelegati
				Thisform.seteazacorespdelegati(This.Value = 1)
			Endif
		Endif
	ENDPROC

	PROCEDURE pf_date.date_entitate._grdrow1.Init
		this.SetAll("DynamicBackColor","iif(ales = 1, RGB(157,206,255), RGB(255,255,255))","Column")
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_parteneri_unificare AS frm_termin_renunt OF "_frm_child.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="clbPartener2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_perioada" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="chkVerificaLunaInceput" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clbPartener1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_data1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_data1.chkData1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: acont
		*p: acontexp
		*p: ccont
		*p: ccursoracont
		*p: ccursorcont
		*p: id_part
		*p: tip_sold
	*</DefinedPropArrayMethod>

	*<PropValue>
		acont = 
		acontexp = 
		BorderStyle = 1
		ccont = 
		ccursoracont = 
		ccursorcont = 
		DoCreate = .T.
		Height = 163
		id_part = 0
		Name = "frm_parteneri_unificare"
		tip_sold = 0
		Width = 500
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 500
		_shape2.Height = 29
		_shape2.Left = 438
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Unificare entitati"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Left = 469
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
		But_renunt1.Left = 440
		But_renunt1.Name = "But_renunt1"
		But_renunt1.TabIndex = 6
		But_renunt1.Top = 1
	*</PropValue>

	ADD OBJECT 'chkVerificaLunaInceput' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Se tine cont de luna inceput a aparitiei celor doi parteneri", ;
		ControlSource = "xrec.verificarelunai", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 12, ;
		Name = "chkVerificaLunaInceput", ;
		TabIndex = 4, ;
		Top = 132, ;
		Value = .T., ;
		Width = 348
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Clb_data1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 264, ;
		Name = "Clb_data1", ;
		TabIndex = 3, ;
		Top = 94, ;
		Width = 228, ;
		Text_simplu1.BorderStyle = 1, ;
		Text_simplu1.ControlSource = "xrec.datai", ;
		Text_simplu1.DisabledBackColor = 255,255,255, ;
		Text_simplu1.Enabled = .F., ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 135, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.SpecialEffect = 1, ;
		Text_simplu1.TabIndex = 2, ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 83, ;
		Lb_simplu1.Caption = "Data inceput", ;
		Lb_simplu1.Enabled = .F., ;
		Lb_simplu1.Left = 28, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 1, ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_data1.chkData1' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "", ;
		ControlSource = "", ;
		FontSize = 10, ;
		Height = 18, ;
		Left = 5, ;
		Name = "chkData1", ;
		TabIndex = 10, ;
		Top = 6, ;
		Width = 19
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'Clb_perioada' AS clb_luna_intre WITH ;
		Height = 29, ;
		Left = 14, ;
		Name = "Clb_perioada", ;
		TabIndex = 2, ;
		Top = 94, ;
		Width = 239, ;
		tx_n1.Left = 73, ;
		tx_n1.Name = "tx_n1", ;
		tx_n1.SpecialEffect = 1, ;
		tx_n1.Top = 3, ;
		Lb_simplu1.Caption = "Perioada", ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		tx_n2.Left = 158, ;
		tx_n2.Name = "tx_n2", ;
		tx_n2.SpecialEffect = 1, ;
		tx_n2.Top = 3
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clbPartener1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 14, ;
		Name = "clbPartener1", ;
		TabIndex = 7, ;
		Top = 38, ;
		Width = 478, ;
		Text_simplu1.ControlSource = "xrec.numepart1", ;
		Text_simplu1.DisabledBackColor = 255,255,255, ;
		Text_simplu1.Enabled = .F., ;
		Text_simplu1.FontItalic = .T., ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 148, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 271, ;
		Lb_simplu1.Caption = "Partener vechi/gresit", ;
		Lb_simplu1.Enabled = .F., ;
		Lb_simplu1.FontItalic = .T., ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clbPartener2' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 14, ;
		Name = "clbPartener2", ;
		TabIndex = 1, ;
		Top = 66, ;
		Width = 478, ;
		Text_simplu1.ControlSource = "xrec.numepart2", ;
		Text_simplu1.DisabledBackColor = 255,255,255, ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 148, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 271, ;
		Lb_simplu1.Caption = "Partener nou/corect", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE Init
		this.clb_perioada.tx_n1.Value = xrec.lunai + xrec.ani
		this.clb_perioada.tx_n2.Value = xrec.lunaf + xrec.anf
	ENDPROC

	PROCEDURE clbPartener2.Text_simplu1.GotFocus
		lcSelect = [select p.denumire, p.cod_fiscal, p.id_part FROM Vnom_parteneri p]
		lcFiltru = [1=2]
		lcSchema = []
		lcOrder = [P.denumire]
		lcColoane = [denumire,cod_fiscal,id_part]
		lcTitlu = [Alegeti parterul cu Id Partener corect]
		lcTitluColoane = [Nume,C.I.F. / C.N.P.,Id Partener]
		lcFiltruOriginal = [p.inactiv = 0 and id_part <> ] + TRANSFORM(xrec.id_part1)
		lcNumeProc = ""
		llAllInlist = .F.
		loCauta = cauta_alfa(lcSelect, lcFiltru, lcSchema, lcOrder, lcColoane, lcTitlu, lcTitluColoane, lcNumeProc, llAllInlist, lcFiltruOriginal)	&& 11.07.2007
		
		
		IF loCauta.id_part = 0 OR ISNULL(loCauta)
			RETURN
		ENDIF
		
		xrec.id_part2 = loCauta.id_part
		xrec.numepart2 = loCauta.denumire
	ENDPROC

	PROCEDURE Clb_data1.chkData1.Valid
		llEnabled = (this.Value = 1)
		This.parent.lb_simplu1.Enabled = m.llEnabled
		This.parent.text_simplu1.Enabled = m.llEnabled
		
		IF m.llEnabled
			xrec.datai = DATE(VAL(xrec.ani),VAL(xrec.lunai),1)
		ELSE
			xrec.datai = {}
		ENDIF 	
		
		IF m.llEnabled
			AMESSAGEBOX('ATENTIE! Va trebui sa dati redeschideri de luna incepand cu ' + DTOC(xrec.datai) + ' pentru ca faceti modificari pe o luna partiala',0+48,_screen.Caption)
		ENDIF 	
		
		this.Parent.text_simplu1.Refresh
	ENDPROC

	PROCEDURE Clb_data1.Text_simplu1.LostFocus
		IF xrec.datai < DATE(VAL(xrec.ani), VAL(xrec.lunai), 1)
			aMESSAGEBOX('Nu puteti selecta data de inceput anterioara lunii de inceput')
			RETURN 
		ENDIF 
	ENDPROC

	PROCEDURE Clb_perioada.LostFocus
		
		lcdatai = this.tx_n1.Value 
		lcdataf = this.tx_n2.Value 
		
		IF !EMPTY(lcdatai) AND !EMPTY(lcdataf)
			xrec.lunai = ALLTRIM(STR(VAL(LEFT(lcdatai,2))))
			xrec.lunaf = ALLTRIM(STR(VAL(LEFT(lcdataf,2))))
			xrec.ani = RIGHT(lcdatai,4)
			xrec.anf = RIGHT(lcdataf,4)
			IF VAL(xrec.ani)*12+VAL(xrec.lunai)>VAL(xrec.anf)*12+VAL(xrec.lunaf)
				aMESSAGEBOX('Luna initiala nu poate fi mai mare decat cea finala!',16,'Atentie!')
				RETURN 
			ENDIF 
			IF VAL(xrec.anf)*12+VAL(xrec.lunaf)>gnan*12+gnluna
				aMESSAGEBOX('Nu puteti selecta ca perioada finala o luna mai mare decat luna curenta!',16,'Atentie!')
				RETURN 
			ENDIF 		
		ENDIF 	
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_pers_contact_nou AS _frmbase OF "_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="Clb_bloc" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_scara" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_telefon" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_pers_contact1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 245
		Name = "frm_pers_contact_nou"
		nid = .F.
		orec = .NULL.
		Width = 348
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 287
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 61
		Lb_titlu_alb_b121.Caption = "PERSOANA CONTACT"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 11
		BUT_TERMIN1.Left = 318
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 9
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 96
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 8
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 274, ;
		Name = "_checkbox1", ;
		TabIndex = 8, ;
		TabStop = .F., ;
		Top = 218
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox2' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Principal", ;
		ControlSource = "porec.principal", ;
		Left = 12, ;
		Name = "_checkbox2", ;
		TabIndex = 7, ;
		TabStop = .F., ;
		Top = 218
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
		Left = 289, ;
		Name = "BUT_RENUNT1", ;
		TabIndex = 10, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_bloc' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_bloc", ;
		TabIndex = 3, ;
		Top = 100, ;
		Width = 314, ;
		ZOrderSet = 7, ;
		TEXT_SIMPLU1.ControlSource = "poRec.apelativ", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Left = 114, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		Lb_simplu1.Caption = "Apelativ", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_scara' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_scara", ;
		TabIndex = 4, ;
		Top = 128, ;
		Width = 314, ;
		ZOrderSet = 8, ;
		TEXT_SIMPLU1.ControlSource = "poRec.functia", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Left = 114, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		Lb_simplu1.Caption = "Functia", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_telefon' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_telefon", ;
		TabIndex = 5, ;
		Top = 156, ;
		Width = 314, ;
		ZOrderSet = 10, ;
		TEXT_SIMPLU1.ControlSource = "poRec.telefon", ;
		TEXT_SIMPLU1.Format = "!K", ;
		TEXT_SIMPLU1.Left = 114, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		Lb_simplu1.Caption = "Telefon", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		Width = 314, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "poRec.nume", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 114, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Nume", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 72, ;
		Width = 314, ;
		ZOrderSet = 7, ;
		Text_simplu1.ControlSource = "poRec.prenume", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 114, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Prenume", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 12, ;
		Name = "Clb_tx_simplu5", ;
		TabIndex = 6, ;
		Top = 184, ;
		Width = 314, ;
		ZOrderSet = 10, ;
		Text_simplu1.ControlSource = "poRec.email", ;
		Text_simplu1.Format = "K", ;
		Text_simplu1.Left = 114, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "E-mail", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_pers_contact1' AS cus_odata_pers_contact WITH ;
		Left = 187, ;
		Name = "Cus_odata_pers_contact1", ;
		Top = 18
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		Local plReturn
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If  Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		Do Case
		*!*	Case Empty(porec.nume_lista_preturi)
		*!*		Messagebox('Nu ati completat numele!',0+48,"Atentie")
		*!*		This.clb_nume.text_simplu1.SetFocus()
		*!*		plReturn=.F.
		
		Otherwise
			plReturn=This.cus_odata_pers_contact1.salvare(This.OREC,This.NID)
		endcase
		
		Return plReturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DODEFAULT()
		This.orec = toRec
		This.nid = tnId
		This.cus_odata_pers_contact1.cactiune = tcActiune
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_plcont AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column7.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.Column9.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.cContAlt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.cContAlt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.cAcontAlt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_plcont.cAcontAlt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_text2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_filtru_text3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = _gnom_plcont
		DoCreate = .T.
		Height = 303
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_plcont"
		Width = 770
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Tag = "W"
		_shape1.Top = 0
		_shape1.Width = 780
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 617
		_shape2.Name = "_shape2"
		_shape2.Tag = "L"
		_shape2.Top = -1
		_shape2.Width = 149
		Lb_titlu_alb_b121.Caption = "Plan conturi"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 735
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Tag = "L"
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.Visible = .T.
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_plcont' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 10, ;
		DeleteMark = .F., ;
		Height = 239, ;
		HighlightStyle = 2, ;
		Left = 13, ;
		Name = "_gnom_plcont", ;
		nrgbrow = 0, ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_plcont", ;
		TabIndex = 3, ;
		Tag = "HW", ;
		Top = 61, ;
		Width = 755, ;
		Column1.ColumnOrder = 7, ;
		Column1.ControlSource = "explicatie", ;
		Column1.Name = "Column2", ;
		Column1.ReadOnly = .T., ;
		Column1.Tag = "W", ;
		Column1.Width = 218, ;
		Column2.ColumnOrder = 2, ;
		Column2.ControlSource = "acont", ;
		Column2.Name = "Column4", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 54, ;
		Column3.ColumnOrder = 1, ;
		Column3.ControlSource = "cont", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 45, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "tip_sold", ;
		Column4.Name = "Column5", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 52, ;
		Column5.ColumnOrder = 6, ;
		Column5.ControlSource = 'iif(tip_cont =  0,"Sintetic","Analitic")', ;
		Column5.Name = "Column6", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 55, ;
		Column6.Alignment = 2, ;
		Column6.ColumnOrder = 10, ;
		Column6.ControlSource = "inactiv", ;
		Column6.Name = "Column7", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 43, ;
		Column7.ColumnOrder = 8, ;
		Column7.ControlSource = "explicaties", ;
		Column7.Name = "Column8", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 153, ;
		Column8.Alignment = 2, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "nefolosit", ;
		Column8.Name = "Column9", ;
		Column8.ReadOnly = .T., ;
		Column8.Sparse = .F., ;
		Column8.Width = 56, ;
		Column9.ColumnOrder = 3, ;
		Column9.ControlSource = "cont_alt", ;
		Column9.Name = "cContAlt", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 109, ;
		Column10.ColumnOrder = 4, ;
		Column10.ControlSource = "cod", ;
		Column10.Name = "cAcontAlt", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 102
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_plcont.cAcontAlt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.cAcontAlt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.cContAlt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont alt.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.cContAlt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Acont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip Cont", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.Column6.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T., ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.Column7.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 9, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_plcont.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie scurta", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_plcont.Column8.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		SelectedBackColor = 100,185,255
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_plcont.Column9.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 17, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 58, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_plcont.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nefolosit", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		Left = 705, ;
		Name = "But_excel1", ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 8, ;
		Left = 647, ;
		Name = "But_modifica1", ;
		TabIndex = 5, ;
		Tag = "L", ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 619, ;
		Name = "But_nou1", ;
		TabIndex = 6, ;
		Tag = "L", ;
		Top = 0, ;
		Visible = .F.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 676, ;
		Name = "But_sterge1", ;
		TabIndex = 4, ;
		Tag = "L", ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Ck_filtru_text1' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = explicatie, ;
		Caption = "Explicatie", ;
		Left = 128, ;
		Name = "Ck_filtru_text1", ;
		Top = 36
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_text2' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = cont, ;
		Caption = "Cont", ;
		Left = 24, ;
		Name = "Ck_filtru_text2", ;
		Top = 36
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_filtru_text3' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		camp_nume = acont, ;
		Caption = "Acont", ;
		Left = 72, ;
		Name = "Ck_filtru_text3", ;
		Top = 36
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 8, ;
		Left = 684, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Tag = "L", ;
		Top = 31
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform._gnom_plcont, ;
		Left = 270, ;
		Name = "Gridextra1", ;
		productname = ROA, ;
		Top = 34
		*< END OBJECT: ClassLib="..\utile\gridextras\gridextras.vcx" BaseClass="custom" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=poplcont.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_plcont)
		poplcont.ca_baza1.cfiltru=lcFiltru
		poplcont.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_plcont)
		IF RECCOUNT('v_plcont')>0
			thisform._gnom_plcont.SetFocus()
		
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_plcont
		SCATTER NAME loRec 
		WITH loRec
			.an = gnAn
		ENDWITH 
		DO Adauga_Modifica_Inregistrare WITH "plcont",loRec,,"INSERT"
		this.actualizeaza_grid1()
		SELECT v_plcont
		LOCATE FOR cont = loRec.cont AND NVL(acont,'xxxx') = NVL(loRec.acont,'xxxx')
		IF !FOUND()
			GO TOP 
		ENDIF 
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		
		If ThisForm.ck_filtru_text1.Value = 1	
			lcfiltru=lcfiltru + thisform.ck_filtru_text1.filtru 
		ENDIF
		If ThisForm.ck_filtru_text2.Value = 1	
			lcfiltru=lcfiltru + thisform.ck_filtru_text2.filtru 
		ENDIF
		If ThisForm.ck_filtru_text3.Value = 1	
			lcfiltru=lcfiltru + thisform.ck_filtru_text3.filtru 
		ENDIF
		
		If !Empty(lcfiltru)
			lcfiltru = [an=]+ALLTRIM(STR(gnan)) + lcFiltru
		Else
			lcfiltru = [an=]+ALLTRIM(STR(gnan))
		ENDIF
		
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		LOCAL lnId
		Select v_plcont
		Scatter Name loRec
		lnId = lorec.ID_PLCONT
		pccont = loRec.cont
		pcacont = loRec.acont
		Do Adauga_Modifica_Inregistrare With "plcont",loRec,loRec.Id_plcont,"UPDATE"
		IF gnButon = 1
			thisform.actualizeaza_grid1()
			LOCATE FOR id_plcont = lnId
			IF !FOUND()
				GO top
			ENDIF 
		ENDIF 
	ENDPROC

	PROCEDURE do_sterge
		LOCAL lnId
		
		SELECT v_plcont
		SCATTER NAME lorec
		llSucces = STERGE_INREGISTRARE("plcont",loRec.id_plcont)
		 
		IF llSucces AND gnButon = 1
			SELECT v_plcont
			DELETE 
			IF !EOF()
				SKIP 1
				IF EOF()
					SKIP -1
				ENDIF 
			ENDIF 	
			lnId = id_plcont
		*!*		this.actualizeaza_grid1()
		
			LOCATE FOR id_plcont = lnId
			IF !FOUND()
				GO top
			ENDIF 
		ENDIF 
		this._gnom_plcont.SetFocus()
		
		
	ENDPROC

	PROCEDURE inainte_de_do_excel
		DO export_excel_grid WITH thisform._gnom_plcont
		
	ENDPROC

	PROCEDURE Init
		DODEFAULT()
		this.WindowState = 2
		THIS.Resize 
		This.gridextra1.setup()
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_PLCONT'
			Nodefault
			this.lb_nom_plcont.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_gestiuni')
			USE IN v_gestiuni
		ENDIF
	ENDPROC

	PROCEDURE _gnom_plcont.Column2.Text1.DblClick
		thisform.log("PLCONT",v_plcont.id_plcont)
	ENDPROC

	PROCEDURE _gnom_plcont.Init
		this.SetAll("DynamicBackColor","iif(nefolosit = 1 or inactiv = 1, RGB(200,200,200), RGB(255,255,255))","Column")
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_plcont_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu5" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_plcont1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_cont_alt" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_cod" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 288
		Name = "frm_plcont_nou"
		Width = 510
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 510
		_shape2.Height = 29
		_shape2.Left = 439
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 71
		Lb_titlu_alb_b121.Caption = "Plan conturi"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 14
		BUT_TERMIN1.Left = 476
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 10
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 19, ;
		Name = "_checkbox1", ;
		TabIndex = 12, ;
		TabStop = .F., ;
		Top = 262
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_checkbox2' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Nefolosit", ;
		ControlSource = "porec.nefolosit", ;
		Left = 84, ;
		Name = "_checkbox2", ;
		TabIndex = 13, ;
		TabStop = .F., ;
		Top = 262
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 446, ;
		Name = "But_renunt1", ;
		TabIndex = 11, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 7, ;
		Top = 170, ;
		Width = 213, ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 105, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "A,P,B", ;
		_cbbase1.RowSourceType = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 89, ;
		_lbbase1.Caption = "Tip", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu2' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Cb_tx_simplu2", ;
		TabIndex = 8, ;
		Top = 198, ;
		Width = 213, ;
		_cbbase1.Height = 23, ;
		_cbbase1.Left = 105, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "Sintetic,Analitic", ;
		_cbbase1.RowSourceType = 1, ;
		_cbbase1.Top = 3, ;
		_cbbase1.Width = 88, ;
		_lbbase1.Caption = "Tip cont", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_cod' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 232, ;
		Name = "clb_cod", ;
		TabIndex = 4, ;
		Top = 76, ;
		Width = 272, ;
		Text_simplu1.ControlSource = "porec.cod", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 120, ;
		Text_simplu1.MaxLength = 20, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 145, ;
		Lb_simplu1.Caption = "Cod", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_cont_alt' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 232, ;
		Name = "clb_cont_alt", ;
		TabIndex = 3, ;
		Top = 48, ;
		Width = 272, ;
		Text_simplu1.ControlSource = "porec.cont_alt", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 120, ;
		Text_simplu1.MaxLength = 20, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 145, ;
		Lb_simplu1.Caption = "Cont alternativ", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 2, ;
		Top = 76, ;
		Width = 215, ;
		Text_simplu1.ControlSource = "porec.acont", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 106, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.TabIndex = 1, ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 105, ;
		Lb_simplu1.Caption = "Analitic", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.TabIndex = 2
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 5, ;
		Top = 109, ;
		Width = 486, ;
		Text_simplu1.ControlSource = "porec.explicatie", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 126, ;
		Text_simplu1.MaxLength = 100, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 356, ;
		Lb_simplu1.Caption = "Explicatie", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 1, ;
		Top = 48, ;
		Width = 215, ;
		Text_simplu1.ControlSource = "porec.cont", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 106, ;
		Text_simplu1.MaxLength = 4, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 105, ;
		Lb_simplu1.Caption = "Cont", ;
		Lb_simplu1.FontBold = .T., ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu4' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Clb_tx_simplu4", ;
		TabIndex = 6, ;
		Top = 137, ;
		Width = 486, ;
		Text_simplu1.ControlSource = "porec.explicaties", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 126, ;
		Text_simplu1.MaxLength = 100, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ToolTipText = "Explicatie Balanta Verificare", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 356, ;
		Lb_simplu1.Caption = "Explicatie balanta", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Clb_tx_simplu5", ;
		TabIndex = 9, ;
		Top = 226, ;
		Width = 213, ;
		Text_simplu1.ControlSource = "gnan", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 105, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.TabStop = .F., ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 88, ;
		Lb_simplu1.Caption = "An", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_plcont1' AS cus_odata_plcont WITH ;
		Left = 144, ;
		Name = "Cus_odata_plcont1", ;
		Top = 24
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN, lcSql, lnSucces, lcControl, lcFragmentSql
		PRIVATE pnReturnValue, pnTipCont
		pnReturnValue = 0
		PLRETURN = .T.
		
		THIS.but_TERMIN1.SetFocus()
		
		IF (THIS.cb_tx_simplu2._CBBASE1.VALUE = "Sintetic")
			pnTipCont = 0
		ELSE
			pnTipCont = 1
		ENDIF
		
		DO CASE
			CASE EMPTY(NVL(porec.CONT,''))
				amessagebox('Nu ati completat contul!',0+48,"Atentie")
				THIS.clb_tx_simplu3.SETFOCUS()
				PLRETURN=.F.
		
			CASE EMPTY(NVL(porec.acont,'')) AND pnTipCont = 1
				amessagebox('Nu ati completat contul analitic!',0+48,"Atentie")
				THIS.clb_tx_simplu1.SETFOCUS()
				PLRETURN=.F.
		
			CASE !EMPTY(NVL(porec.acont,'')) AND pnTipCont = 0
				amessagebox('Ati completat contul analitic! Alegeti tipul contului "Analitic"',0+48,"Atentie")
				THIS.cb_tx_simplu2._CBBASE1.SETFOCUS()
				PLRETURN=.F.
		
			CASE EMPTY(porec.tip_sold)
				amessagebox('Nu ati ales tipul contului!',0+48,"Atentie")
				THIS.cb_tx_simplu1.SETFOCUS()
				PLRETURN=.F.
			OTHERWISE
		*!* 23.05.2007
		*!* marius.mutu
		*!* verificare pe insert/update
				lcActiune = ALLTRIM(UPPER(THIS.cus_odata_plcont1.cactiune))
				IF INLIST(lcActiune, "INSERT", "UPDATE")
					IF pnTipCont = 0 && sintetic
						lcFragmentSql = []
					ELSE
						lcFragmentSql = [ and acont = ?ALLTRIM(poRec.acont)]
					ENDIF
		
					IF lcActiune = "INSERT"
						lcSql = [select COUNT(*) as nr from vnom_plcont where cont= ?ALLTRIM(porec.CONT) and tip_cont = ?pnTipCont and an = ?gnan] + lcFragmentSql
					ELSE
						lcSql = [select COUNT(*) as nr from vnom_plcont where cont= ?ALLTRIM(porec.CONT) and tip_cont = ?pnTipCont and an = ?gnan and id_plcont <> ?poRec.id_plcont] + lcFragmentSql
					ENDIF
		
					lnSucces = goExecutor.oSelect2Value(lcSql, @pnReturnValue)
					IF lnSucces < 0
						AMESSAGEBOX(goExecutor.cEroare, 0+16, "Eroare")
						plReturn = .F.
					ELSE 	
						IF pnReturnValue > 0
							amessagebox("Contul " + ALLTRIM(porec.CONT) + IIF(pnTipCont = 1, "." + ALLTRIM(porec.acont), "") + " mai este inregistrat!",0+48,"Atentie")
							THISFORM.clb_tx_simplu3.SETFOCUS()
							PLRETURN=.F.
						ENDIF
					ENDIF 	
				ENDIF 	
		
			ENDCASE
		
			IF plReturn
				PLRETURN=THIS.cus_odata_plcont1.salvare(THIS.OREC,THIS.NID)
			ENDIF 
				
			RETURN PLRETURN
		
		
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		Local lcTitlu, llAnalitic
		DoDefault()
		This.orec = toRec
		This.nid = tnId
		This.cus_odata_plcont1.cactiune = tcActiune
		If Type('toRec.balana') # 'U'
			Do Case
				Case tcActiune = 'INSERT'
					lcTitlu = 'Adaugare'
				Case tcActiune = 'UPDATE'
					lcTitlu = 'Modificare'
			Endcase
			If toRec.balana = 0
				Thisform.clb_tx_simplu1.text_simplu1.ReadOnly = .T.
				Thisform.cb_tx_simplu2._cbbase1.Enabled = .F.
				Thisform.lb_titlu_alb_b121.Caption = lcTitlu + ' cont sintetic'
			Else
				Thisform.clb_tx_simplu3.text_simplu1.ReadOnly = .T.
				Thisform.cb_tx_simplu2._cbbase1.Enabled = .F.
				Thisform.cb_tx_simplu1._cbbase1.Enabled = .F.
				Thisform.lb_titlu_alb_b121.Caption = lcTitlu + ' cont analitic'
			Endif
		Endif
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.Init
		DO CASE 
			CASE porec.tip_sold = "A"
				this.Value = "A"
			CASE porec.tip_sold = "P"
				this.Value = "P"
			CASE porec.tip_sold = "B"
				this.Value = "B"
			OTHERWISE 
				**nada..
		ENDCASE 
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.LostFocus
		DO CASE 
			CASE this.Value = "Activ"
				porec.tip_sold = "A"
			CASE this.Value = "Pasiv"
				porec.tip_sold = "P"
			CASE this.Value = "Bifunctional"
				porec.tip_sold = "B"
		ENDCASE 
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.Valid
		DO CASE 
			CASE this.Value = "A"
				porec.tip_sold = "A"
			CASE this.Value = "P"
				porec.tip_sold = "P"
			CASE this.Value = "B"
				porec.tip_sold = "B"
		ENDCASE 
	ENDPROC

	PROCEDURE Cb_tx_simplu2._cbbase1.Init
		IF porec.tip_cont = 0
			this.Value = "Sintetic"
		ELSE
			this.Value = "Analitic"
		ENDIF 
	ENDPROC

	PROCEDURE Cb_tx_simplu2._cbbase1.LostFocus
		IF this.Value = "Sintetic"
			porec.tip_cont = 0
		ELSE
			porec.tip_cont = 1
		ENDIF 
	ENDPROC

	PROCEDURE Clb_tx_simplu1.Text_simplu1.LostFocus
		Local llAnalitic
		llAnalitic = !Empty(Nvl(poRec.acont, ''))
		poRec.tip_cont = Iif(m.llAnalitic, 1, 0)
		Thisform.cb_tx_simplu2._CBBASE1.Value = Iif(m.llAnalitic, "Analitic", "Sintetic")
		Thisform.cb_tx_simplu2._CBBASE1.Refresh()
		
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_proiecte_nou AS _frmbase OF "_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="Clb_indicativ" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ed_descriere" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="BUT_RENUNT1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_client" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_proiecte1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_responsabil" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_cautare_var1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_alege_client
		*m: do_alege_modelproiect
		*m: do_alege_responsabil
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		FontCharSet = 238
		Height = 305
		Name = "frm_proiecte_nou"
		nid = 
		orec = 
		Width = 360
		_SHAPE1.Height = 29
		_SHAPE1.Left = 0
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE1.Top = 0
		_SHAPE1.Width = 360
		_SHAPE2.Height = 29
		_SHAPE2.Left = 300
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Width = 60
		LB_TITLU_ALB_B121.Caption = "PROIECT"
		LB_TITLU_ALB_B121.FontBold = .T.
		LB_TITLU_ALB_B121.FontCharSet = 238
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 10
		BUT_TERMIN1.Left = 331
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 24
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 222
	*</PropValue>

	ADD OBJECT 'BUT_RENUNT1' AS but_renunt WITH ;
		Left = 301, ;
		Name = "BUT_RENUNT1", ;
		TabIndex = 9, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_indicativ' AS clb_tx_simplu WITH ;
		Left = 21, ;
		Name = "Clb_indicativ", ;
		TabIndex = 1, ;
		Top = 45, ;
		TEXT_SIMPLU1.ControlSource = "porec.indicativ", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Indicativ", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 21, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 2, ;
		Top = 73, ;
		Text_simplu1.ControlSource = "porec.data_proiect", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Data", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_cautare_var1' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_modelproiect,0)), ;
		cprocedura = thisform.do_alege_modelproiect(), ;
		cvar_afisata = poRec.modelproiect, ;
		Height = 31, ;
		Left = 20, ;
		Name = "Ct_clb_cautare_var1", ;
		TabIndex = 6, ;
		Top = 242, ;
		Width = 326, ;
		shape_cautare.Height = 29, ;
		shape_cautare.Left = 1, ;
		shape_cautare.Name = "shape_cautare", ;
		shape_cautare.Top = 1, ;
		shape_cautare.Width = 290, ;
		img_cautare.Left = 299, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		lb_cautare.Caption = "Model de proiect", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.Left = 102, ;
		tx_cautare.Name = "tx_cautare", ;
		tx_cautare.Top = 4
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_client' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_part,0)), ;
		cprocedura = thisform.do_alege_client(), ;
		cvar_afisata = poRec.client, ;
		Height = 31, ;
		Left = 20, ;
		Name = "Ct_client", ;
		TabIndex = 5, ;
		Top = 214, ;
		Width = 326, ;
		shape_cautare.Height = 29, ;
		shape_cautare.Left = 1, ;
		shape_cautare.Name = "shape_cautare", ;
		shape_cautare.Top = 1, ;
		shape_cautare.Width = 290, ;
		img_cautare.Left = 299, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		lb_cautare.Caption = "Client", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.Left = 102, ;
		tx_cautare.Name = "tx_cautare", ;
		tx_cautare.Top = 4
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_responsabil' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_responsabil,0)), ;
		cprocedura = thisform.do_alege_responsabil(), ;
		cvar_afisata = poRec.responsabil, ;
		Height = 31, ;
		Left = 20, ;
		Name = "Ct_responsabil", ;
		TabIndex = 7, ;
		Top = 270, ;
		Width = 326, ;
		shape_cautare.Height = 29, ;
		shape_cautare.Left = 1, ;
		shape_cautare.Name = "shape_cautare", ;
		shape_cautare.Top = 1, ;
		shape_cautare.Width = 290, ;
		img_cautare.Left = 299, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		lb_cautare.Caption = "Responsabil", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.Left = 102, ;
		tx_cautare.Name = "tx_cautare", ;
		tx_cautare.Top = 4
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_proiecte1' AS cus_odata_proiecte WITH ;
		Left = 60, ;
		Name = "Cus_odata_proiecte1", ;
		Top = 222
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'Ed_denumire' AS ed_tx_simplu WITH ;
		Left = 21, ;
		Name = "Ed_denumire", ;
		TabIndex = 3, ;
		Top = 101, ;
		_edbase1.ControlSource = "porec.denumire", ;
		_edbase1.Format = "K!", ;
		_edbase1.Name = "_edbase1", ;
		_lbbase1.Caption = "Denumire", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ed_descriere' AS ed_tx_simplu WITH ;
		Left = 21, ;
		Name = "Ed_descriere", ;
		TabIndex = 4, ;
		Top = 158, ;
		_edbase1.ControlSource = "porec.descriere", ;
		_edbase1.Format = "K!", ;
		_edbase1.Name = "_edbase1", ;
		_lbbase1.Caption = "Descriere", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE do_alege_client
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Clienti??cCont=>4111??lAdaugCorespondente=>1]))
		If !Empty(Nvl(loCauta.id_part,0))
			poRec.id_part=loCauta.id_part
			poRec.client=Alltrim(loCauta.nume)
			thisform.ct_clb_cautare_var1.tx_cautare.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_alege_modelproiect
		PRIVATE pcselect,pcfiltru ,pcschema ,pcorder ,pccoloane ,pcTitlu ,pcTitluColoane ,pcFiltruOriginal
		LOCAL locauta
		
		pcselect = [select * from  con_modelproiect]
		
		pcfiltru = [1=2]
		pcschema = []
		pcorder = [denumire_model]
		pccoloane = [denumire_model]
		pcTitlu = [Alegeti modelul de proiect]
		pcTitluColoane = [Model]
		pcFiltruOriginal = [sters = 0]
		locauta = cauta_alfa(pcselect,pcfiltru,pcschema,pcorder,pccoloane,pcTitlu,pcTitluColoane,'crsnomluc',.F.,pcFiltruOriginal )&&30iul2007
		*!*		Parameters tcselect,tcfiltru,tcschema,tcorder,tccoloana,tcTitlu,tcTitluColoana,tcNume_Proc,tl_AllInList,tcFiltruOriginal
		
		IF buton # 2
			If !Empty(Nvl(loCauta.id_modelproiect,0))
				poRec.id_modelproiect=loCauta.id_modelproiect
				poRec.modelproiect=Alltrim(loCauta.denumire_model)
				Thisform.ct_responsabil.SetFocus()
			ENDIF
		ENDIF 
	ENDPROC

	PROCEDURE do_alege_responsabil
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Responsabili??cTipuriParteneri=>]+Alltrim(Str(gnIdTipResponsabili))+[??lAdaugCorespondente=>1]))
		If !Empty(Nvl(loCauta.id_part,0))
			poRec.id_responsabil = loCauta.id_part
			poRec.responsabil=Alltrim(loCauta.nume)
			Thisform.but_TERMIN1.SetFocus()
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local plReturn
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		Do Case
		Case Empty(NVL(poRec.indicativ,[]))
			amessagebox("Nu ati completat indicativul!",48,"Atentie")
			Thisform.clb_indicativ.SetFocus()
			plReturn = .F.
		Case Empty(NVL(poRec.data_proiect,[]))
			amessagebox("Nu ati completat data!",48,"Atentie")
			Thisform.clb_tx_simplu1.SetFocus()
			plReturn = .F.	
		Case Empty(NVL(poRec.id_responsabil,[])) AND This.cus_odata_proiecte1.cactiune<> [UPDATE]
			amessagebox("Nu ati completat responsabilul!",48,"Atentie")
			Thisform.ct_responsabil.SetFocus()
			plReturn = .F.	
		Otherwise
			plReturn=Thisform.cus_odata_proiecte1.salvare(This.OREC,This.NID)
			If !plReturn
				Thisform.clb_indicativ.SetFocus()
			Endif
		Endcase
		
		Return plReturn
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DoDefault()
		
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_proiecte1.cactiune=tcActiune
		
		If tcActiune = [UPDATE]
			Thisform.ct_responsabil.Visible=.f.
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_responsabili AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_responsabili" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_responsabili.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_responsabili.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_responsabili.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_responsabili.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_responsabili" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = _gnom_responsabili
		DoCreate = .T.
		Height = 303
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_responsabili"
		Width = 397
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 504
		_shape2.Height = 29
		_shape2.Left = 336
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 63
		Lb_titlu_alb_b121.Caption = "Responsabili"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Left = 367
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_responsabili' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 203, ;
		Left = 11, ;
		Name = "_gnom_responsabili", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_responsabili", ;
		TabIndex = 3, ;
		Top = 85, ;
		Width = 373, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "nume", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 305, ;
		Column2.ColumnOrder = 1, ;
		Column2.ControlSource = "id_responsabil", ;
		Column2.Name = "Column5", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 31
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_responsabili.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Responsabil", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_responsabili.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_responsabili.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_responsabili.Column5.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 336, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 309, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 44
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_responsabili' AS clb_tx_simplu WITH ;
		Left = 8, ;
		Name = "lb_nom_responsabili", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Responsabil", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=poresponsabili.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_responsabili)
		poresponsabili.ca_baza1.cfiltru=lcFiltru
		poresponsabili.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_responsabili)
		IF RECCOUNT('v_responsabili')>0
			thisform._gnom_responsabili.SetFocus()
		ELSE
			thisform.lb_nom_responsabili.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_responsabili
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "responsabili",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_responsabili.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[nume like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		*!*	Select v_responsabili
		*!*	Scatter Name loRec
		*!*	Do Adauga_Modifica_Inregistrare With "responsabili",loRec,loRec.Id_responsabil,"UPDATE"
		*!*	thisform.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_sterge
		*!*	SELECT v_responsabili
		*!*	SCATTER NAME lorec
		*!*	Do STERGE_INREGISTRARE With "responsabili",loRec.id_responsabil
		
		*!*	this.actualizeaza_grid1()
		
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_RESPONSABILI'
			Nodefault
			this.LB_nom_responsabili.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_responsabili')
			USE IN v_responsabili
		ENDIF
	ENDPROC

	PROCEDURE _gnom_responsabili.Column1.Text1.DblClick
		thisform.log("NOM_RESPONSABILI",v_responsabili.id_responsabil)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_responsabili_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_responsabili1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="img_zona" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_alege_partener
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 109
		Name = "frm_responsabili_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Responsabili"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 6, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 31, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.ControlSource = "porec.nume", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.InputMask = "", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.ReadOnly = .T., ;
		Text_simplu1.Value = , ;
		Lb_simplu1.Caption = "Responsabil", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_responsabili1' AS cus_odata_responsabili WITH ;
		Left = 192, ;
		Name = "Cus_odata_responsabili1", ;
		Top = 84
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />

	ADD OBJECT 'img_zona' AS _image WITH ;
		Height = 24, ;
		Left = 333, ;
		Name = "img_zona", ;
		Picture = ..\..\..\roaoferta\comun\grafice\alege.bmp, ;
		Stretch = 2, ;
		ToolTipText = "Alegeti agentul", ;
		Top = 47, ;
		Visible = .T., ;
		Width = 24
		*< END OBJECT: ClassLib="..\..\..\roaoferta\comun\clase\_baza.vcx" BaseClass="image" />
	
	PROCEDURE do_alege_partener
		Local lnId,lcNume
		lnId=poRec.id_responsabil
		lcNume=poRec.nume
		If caut_partener_dupa_tip(gnIdTipSalariati,[Adauga responsabil],@lnId,@lcNume,Alltrim(Str(gnIdTipResponsabili)))
			poRec.id_responsabil=lnId
			poRec.nume=lcNume
			Thisform.clb_tx_simplu1.text_simplu1.Refresh()
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local PLRETURN
		
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If   Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		If Empty(porec.id_responsabil)
			AMESSAGEBOX("Nu ati ales un responsabil!",0+48,"Atentie")
			PLRETURN=.F.
		Else
			PLRETURN=This.cus_odata_responsabili1.salvare(This.OREC,This.NID)
		Endif
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		
		this.orec= toRec
		this.nid = tnId
		this.cus_odata_RESPONSABILI1.cactiune = tcActiune
	ENDPROC

	PROCEDURE Clb_tx_simplu1.Text_simplu1.DblClick
		Thisform.do_alege_partener()
	ENDPROC

	PROCEDURE Clb_tx_simplu1.Text_simplu1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		If Empty(poRec.id_responsabil) And Empty(poRec.nume) ;
				AND Inlist(nKeyCode,9,13) And nShiftAltCtrl=0
			Thisform.do_alege_partener()
		Else
			DoDefault()
		Endif
	ENDPROC

	PROCEDURE img_zona.Click
		Thisform.do_alege_partener()
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_sectii AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.cSucursala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sectii.cSucursala.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_sectii" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = _gnom_sectii
		DoCreate = .T.
		Height = 303
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_sectii"
		Width = 388
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 385
		_shape2.Height = 29
		_shape2.Left = 264
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 125
		Lb_titlu_alb_b121.Caption = "Sectii"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 355
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		BUT_TERMIN1.Width = 30
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_sectii' AS _grdrow WITH ;
		ColumnCount = 5, ;
		DeleteMark = .F., ;
		Height = 218, ;
		Left = 8, ;
		Name = "_gnom_sectii", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_sectii", ;
		ScrollBars = 3, ;
		TabIndex = 3, ;
		Top = 81, ;
		Width = 374, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "sectie", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 213, ;
		Column2.ColumnOrder = 4, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 58, ;
		Column3.ColumnOrder = 1, ;
		Column3.ControlSource = "id_sectie", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 24, ;
		Column4.ColumnOrder = 3, ;
		Column4.ControlSource = "csectie", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 46, ;
		Column5.ControlSource = "sucursala", ;
		Column5.Name = "cSucursala", ;
		Column5.ReadOnly = .T.
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_sectii.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sectie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sectii.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_sectii.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 21, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 26, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_sectii.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sectii.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sectii.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_sectii.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Csectie", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sectii.Column4.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_sectii.cSucursala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sucursala", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sectii.cSucursala.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 298, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 268, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 326, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 300, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 44
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_sectii' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "lb_nom_sectii", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Sectia", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=posectii.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_sectii)
		posectii.ca_baza1.cfiltru=lcFiltru
		posectii.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_sectii)
		IF RECCOUNT('v_sectii')>0
			thisform._gnom_sectii.SetFocus()
		ELSE
			thisform.lb_nom_sectii.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_sectii
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "sectii",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_sectii.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[sectie like ']+lcNume+[%']+gcCondSucursala
		ELSE 
			lcFiltru = [2=2]+gcCondSucursala
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_sectii')>0
			Select v_sectii
			Scatter Name loRec
			pcsectie = loRec.sectie
			Do Adauga_Modifica_Inregistrare With "sectii",loRec,loRec.Id_sectie,"UPDATE"
			Thisform.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_sectii')>0
			Select v_sectii
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "sectii",lorec.id_sectie
		
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE Init
		DoDefault()
		If (!glEMama AND ISNULL(gnIdSucursala)) Or !Isnull(gnIdSucursala)
			Thisform._gnom_sectii.RemoveObject('cSucursala')
		Endif
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_SECTII'
			Nodefault
			this.LB_nom_sectii.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_sectii')
			USE IN v_sectii
		ENDIF
	ENDPROC

	PROCEDURE _gnom_sectii.Column1.Text1.DblClick
		thisform.log("NOM_SECTII",v_sectii.id_sectie)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_sectii_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_sectii1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_sucursala" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_cauta_sucursala
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 164
		Name = "frm_sectii_nou"
		Width = 374
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Sectia"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Anchor = 4, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 31, ;
		Name = "_checkbox1", ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 137
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 6, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 20, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.ControlSource = "porec.sectie", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Sectia", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Left = 20, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 2, ;
		Top = 72, ;
		Text_simplu1.ControlSource = "porec.csectie", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Csectie", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_sucursala' AS ct_clb_cautare_var WITH ;
		cconditie = EMPTY(NVL(poRec.id_sucursala,0)), ;
		cprocedura = thisform.do_cauta_sucursala, ;
		cvar_afisata = poRec.sucursala, ;
		Left = 19, ;
		Name = "Ct_clb_sucursala", ;
		TabIndex = 3, ;
		Top = 99, ;
		shape_cautare.Name = "shape_cautare", ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		lb_cautare.Caption = "Sucursala", ;
		lb_cautare.Left = 10, ;
		lb_cautare.Name = "lb_cautare", ;
		lb_cautare.Top = 8, ;
		tx_cautare.Name = "tx_cautare"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_sectii1' AS cus_odata_sectii WITH ;
		Left = 336, ;
		Name = "Cus_odata_sectii1", ;
		Top = 48
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE do_cauta_sucursala
		Local loCauta
		loCauta = caut_sucursala()
		If !Isnull(loCauta)
			poRec.id_sucursala = loCauta.id_sucursala
			poRec.sucursala = loCauta.sucursala
			Thisform._checkbox1.SetFocus()
		Else
			poRec.id_sucursala = Null
			poRec.sucursala = []
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		
		Do Case
		Case Empty(porec.sectie)
			amessagebox('Nu ati completat sectia!',0+48,"Atentie")
			This.clb_tx_simplu1.SetFocus()
			plreturn=.F.
		CASE glEMama AND EMPTY(NVL(poRec.id_sucursala,0))
			amessagebox("Nu ati ales sucursala!",48,"Atentie")
			thisform.ct_clb_sucursala.SetFocus()
			plReturn = .F.
		OTHERWISE 
		*!*		If Alltrim(Upper(This.cus_odata_sectii1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_sectii1.cactiune))="UPDATE" And porec.sectie!=pcsectie) 
		*!*			pcexec=[select * from ]+gcS+[.vnom_sectii where TRIM(sectie)=']+Alltrim(porec.sectie)+[']
		*!*			Do While .T.
		*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_sectie')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista_sectie')>0
		*!*				amessagebox('Mai exista o sectie cu acest nume!',0+48,"Atentie")
		*!*				Thisform.clb_tx_simplu1.SetFocus()
		*!*				Use In exista_sectie
		*!*				plreturn=.F.
		*!*			ELSE 
		*!*				PLRETURN=This.cus_odata_sectii1.salvare(This.OREC,This.NID)		
		*!*			ENDIF 
		*!*		ELSE 
				PLRETURN=This.cus_odata_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_sectii1.cactiune = tcActiune
		
		If (!glEMama And Isnull(gnIdSucursala)) Or !Isnull(gnIdSucursala)
			Thisform.RemoveObject('ct_clb_sucursala')
			Thisform.Height = 135
			poRec.id_sucursala = gnIdSucursala
		Else
			poRec.id_sucursala = Null
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_sucursale AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sucursale" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sucursale.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sucursale.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sucursale.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sucursale.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sucursale.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_sucursale.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_sucursale" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = _gnom_sucursale
		DoCreate = .T.
		Height = 303
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_sucursale"
		Width = 388
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 385
		_shape2.Height = 29
		_shape2.Left = 264
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 125
		Lb_titlu_alb_b121.Caption = "Sucursale"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 355
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		BUT_TERMIN1.Width = 30
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_sucursale' AS _grdrow WITH ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		Height = 218, ;
		Left = 8, ;
		Name = "_gnom_sucursale", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_sucursale", ;
		ScrollBars = 3, ;
		TabIndex = 3, ;
		Top = 81, ;
		Width = 374, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "sucursala", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 245, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 58, ;
		Column3.ColumnOrder = 1, ;
		Column3.ControlSource = "id_sucursala", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 39
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_sucursale.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sucursala", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sucursale.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_sucursale.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 21, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 26, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_sucursale.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sucursale.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_sucursale.Column3.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 298, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 268, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 326, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 300, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 44
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_sucursale' AS clb_tx_simplu WITH ;
		Left = 9, ;
		Name = "lb_nom_sucursale", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Sucursala", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=posucursale.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_sucursale)
		posucursale.ca_baza1.cfiltru=lcFiltru
		posucursale.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_sucursale)
		IF RECCOUNT('v_sucursale')>0
			thisform._gnom_sucursale.SetFocus()
		ELSE
			thisform.lb_nom_sucursale.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_sucursale
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "sucursale",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_sucursale.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[sucursala like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_sucursale')>0
			Select v_sucursale
			Scatter Name loRec
			pcsucursala = loRec.sucursala
			Do Adauga_Modifica_Inregistrare With "sucursale",loRec,loRec.Id_sucursala,"UPDATE"
			Thisform.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_sucursale')>0
			Select v_sucursale
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "sucursale",lorec.id_sucursala
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_SUCURSALE'
			Nodefault
			this.LB_nom_sucursale.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_sucursale')
			USE IN v_sucursale
		ENDIF
	ENDPROC

	PROCEDURE _gnom_sucursale.Column1.Text1.DblClick
		thisform.log("NOM_sucursale",v_sucursale.id_sucursala)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_sucursale_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_sucursale1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 107
		Name = "frm_sucursale_nou"
		Width = 374
		_shape1.Name = "_shape1"
		_shape1.ZOrderSet = 1
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Sucursala"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 2
		BUT_TERMIN1.ZOrderSet = 4
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 31, ;
		Name = "_checkbox1", ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 82, ;
		ZOrderSet = 7
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 3, ;
		Top = 1, ;
		ZOrderSet = 5
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 31, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		ZOrderSet = 6, ;
		Text_simplu1.ControlSource = "porec.sucursala", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Sucursala", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_sucursale1' AS cus_odata_sucursale WITH ;
		Left = 350, ;
		Name = "Cus_odata_sucursale1", ;
		Top = 53
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		
		Do Case
		Case Empty(porec.sucursala)
			amessagebox('Nu ati completat sucursala!',0+48,"Atentie")
			This.clb_tx_simplu1.SetFocus()
			plreturn=.F.
		OTHERWISE 
			If Alltrim(Upper(This.cus_odata_sucursale1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_sucursale1.cactiune))="UPDATE" And porec.sucursala!=pcsucursala) 
				pcexec=[select * from ]+gcS+[.vnom_sucursale where TRIM(sucursala)=']+Alltrim(porec.sucursala)+[']
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_sucursala')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_sucursala')>0
					amessagebox('Mai exista aceasta sucursala inregistrata!',0+48,"Atentie")
					Thisform.clb_tx_simplu1.SetFocus()
					Use In exista_sucursala
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_sucursale1.salvare(This.OREC,This.NID)		
				ENDIF 
			ELSE 
				PLRETURN=This.cus_odata_sucursale1.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_sucursale1.cactiune = tcActiune
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_tipuri_ctr AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column3.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_tipuri_ctr.Column4.Text1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_adauga2
		*m: do_modifica2
		*m: do_sterge2
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = grd_tipuri_ctr
		DoCreate = .T.
		Height = 466
		lactiv3 = .T.
		Name = "frm_tipuri_ctr"
		Width = 711
		WindowState = 2
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 744
		_shape1.ZOrderSet = 2
		_shape2.Anchor = 8
		_shape2.Height = 29
		_shape2.Left = 577
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 136
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "TIPURI CONTRACTE"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 11
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 680
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 6
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.ZOrderSet = 5
		Gridsort1.Left = 240
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 12
	*</PropValue>

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Anchor = 8, ;
		Left = 615, ;
		Name = "But_modifica1", ;
		TabIndex = 8, ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 581, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 648, ;
		Name = "But_sterge1", ;
		TabIndex = 9, ;
		Top = 0
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'clb_denumire' AS clb_tx_simplu WITH ;
		Anchor = 0, ;
		Left = 9, ;
		Name = "clb_denumire", ;
		TabIndex = 1, ;
		Top = 37, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Denumire", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Anchor = 0, ;
		Left = 330, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 4, ;
		Top = 36
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Anchor = 0, ;
		Left = 418, ;
		Name = "Cmd_reset1", ;
		TabIndex = 10, ;
		Top = 36
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grd_tipuri_ctr' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 4, ;
		DeleteMark = .F., ;
		Height = 383, ;
		Left = 9, ;
		Name = "grd_tipuri_ctr", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordMark = .F., ;
		RecordSource = "cTipuri_ctr", ;
		Top = 73, ;
		Width = 687, ;
		Column1.ControlSource = "id_tip_ctr", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 51, ;
		Column2.ControlSource = "denumire_tip", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 198, ;
		Column3.Alignment = 2, ;
		Column3.ControlSource = "system", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Sparse = .F., ;
		Column3.Width = 45, ;
		Column4.ControlSource = "tip_sup", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 366
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grd_tipuri_ctr.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id tip ctr.", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grd_tipuri_ctr.Column1.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grd_tipuri_ctr.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire tip", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grd_tipuri_ctr.Column2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'grd_tipuri_ctr.Column3.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 22, ;
		Name = "Check1", ;
		Top = 58, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grd_tipuri_ctr.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sistem", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grd_tipuri_ctr.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip superior", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grd_tipuri_ctr.Column4.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 lcFiltru
		If Empty(lcFiltru)
			lcFiltru = poTipuri_ctr.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		save_grid_tag(Thisform.grd_tipuri_ctr)
		poTipuri_ctr.ca_baza1.cfiltru = lcFiltru
		poTipuri_ctr.ca_baza1.afisare()
		restore_grid_tag(Thisform.grd_tipuri_ctr)
		Thisform.LockScreen = .F.
		Thisform.MousePointer = 0
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Select cTipuri_ctr
		Scatter Name loRec Blank
		If Used('cTipuri_ctr2')
			Use In cTipuri_ctr2
		ENDIF
		Select id_tip_ctr, denumire_tip From cTipuri_ctr Order By denumire_tip Into Cursor cTipuri_ctr2
		
		Do Adauga_Modifica_Inregistrare With "tipuri_ctr",loRec,,"INSERT"
		If pniesire=1
			This.actualizeaza_grid1()
			Select cTipuri_ctr
			Locate For denumire_tip = loRec.denumire_tip
			Thisform.grd_tipuri_ctr.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_adauga2
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		Store '' To lcFiltru
		lcFiltru=[2=2]
		lcDenumire = Strtran(Upper(Alltrim(This.clb_denumire.text_simplu1.Value)),['],[''])
		
		If !Empty(lcDenumire)
			lcFiltru = lcFiltru + [ and denumire_tip like '] + lcDenumire + [%']
		Endif
		
		Thisform.actualizeaza_grid1(lcFiltru)
		
		If Reccount('cTipuri_ctr')>0
			Select cTipuri_ctr
			Go Top
			Thisform.grd_tipuri_ctr.SetFocus()
		Else
			aMessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.clb_denumire.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('cTipuri_ctr')>0
			Private pniesire
			pniesire = 0
			Select cTipuri_ctr
			Scatter Name loRec
			If loRec.id_tip_ctr = -1 Or loRec.id_tip_ctr = -2
				aMessagebox("Nu puteti modifica acest tip!",0+48,"Atentie")
				Return
			Endif
			If Used('cTipuri_ctr2')
				Use In cTipuri_ctr2
			Endif
		
			Select id_tip_ctr, denumire_tip From cTipuri_ctr Where id_tip_ctr!=loRec.id_tip_ctr ;
				Order By denumire_tip Into Cursor cTipuri_ctr2
		
			Do Adauga_Modifica_Inregistrare With "tipuri_ctr",loRec,loRec.id_tip_ctr,"UPDATE"
			If pniesire = 1
				This.actualizeaza_grid1()
			Endif
		Else
			aMessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_modifica2
	ENDPROC

	PROCEDURE do_reset
		thisform.clb_denumire.TEXT_SIMPLU1.Value = ''
		Thisform.Refresh
		Thisform.clb_denumire.TEXT_SIMPLU1.SetFocus()
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('cTipuri_ctr')>0
			Select cTipuri_ctr
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "tipuri_ctr",loRec.id_tip_ctr
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_sterge2
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_tipuri_ctr_nou AS _frmbase OF "_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="Clb_categ_ctr" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_tipuri_ctr1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tipSup" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cnumevechi
		*p: nid
		*p: nnivelmodificare		&& - 1 daca utilizatorul are voie sa modifice toate datele ; 0 daca are voie sa modifice doar nr. de telefon
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cnumevechi = 
		DoCreate = .T.
		Height = 105
		Name = "frm_tipuri_ctr_nou"
		nnivelmodificare = -1
		Width = 358
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 744
		_shape2.Height = 29
		_shape2.Left = 291
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 69
		Lb_titlu_alb_b121.Caption = "TIP CONTRACT"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 328
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.Width = 30
		Gridsort1.Left = 240
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 5
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Height = 27, ;
		Left = 296, ;
		Name = "But_renunt1", ;
		TabIndex = 4, ;
		Top = 0, ;
		Width = 30
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_tipSup' AS cb_tx_simplu WITH ;
		Left = 15, ;
		Name = "Cb_tipSup", ;
		TabIndex = 2, ;
		Top = 65, ;
		Width = 328, ;
		_CBBASE1.Left = 136, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.Top = 3, ;
		_LBBASE1.Caption = "Tip superior", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_categ_ctr' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 15, ;
		Name = "Clb_categ_ctr", ;
		TabIndex = 1, ;
		Top = 37, ;
		Width = 328, ;
		Text_simplu1.ControlSource = "porec.denumire_tip", ;
		Text_simplu1.Left = 136, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Denumire tip contract", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_tipuri_ctr1' AS cus_odata_tipuri_ctr WITH ;
		Left = 199, ;
		Name = "Cus_odata_tipuri_ctr1", ;
		Top = 8
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE Destroy
		If Used('cTipuri_ctr2')
			Use In cTipuri_ctr2
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local PLRETURN
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If  Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval = This.ActiveControl.ControlSource
			&lcval = Thisform.ActiveControl.Value
		ENDIF
		
		lcTata=Thisform.cb_tipSup._CBBASE1.Value
		If Empty(lcTata)
			porec.id_tata=0
		Else
			Select cTipuri_ctr2
			porec.id_tata = id_tip_ctr
		Endif
		
		Do Case
		Case Empty(porec.denumire_tip)
			amessagebox('Nu ati completat denumirea tipului!',0+48,"Atentie")
			this.clb_denumire.text_simplu1.SetFocus()
			PLRETURN = .F.
		Case Empty(porec.id_tata)
			amessagebox('Nu ati ales tipul superior!',0+48,"Atentie")
			this.cb_tipSup._cbbasE1.SetFocus()
			PLRETURN = .F.	
					
		OTHERWISE 
			PLRETURN = This.cus_odata_tipuri_ctr1.salvare(This.OREC, This.NID)
			
		ENDCASE 
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		lcGrupTata = ""
		
		THIS.orec = toRec
		THIS.nid = tnId
		THIS.cus_odata_tipuri_ctr1.cactiune = tcActiune
		IF tcActiune = 'UPDATE'
			*!*		Select v_zone
			*!*		Locate For id_zona=toRec.id_zona
			*!*		If Found()
			*!*			Thisform.cb_zona._cbbase1.Value=zona
			*!*			Thisform.cb_zona._cbbase1.Refresh
			*!*		Endif
			SELECT cTipuri_ctr2
			LOCATE FOR id_tip_ctr = porec.id_tata
			IF FOUND()
				lcGrupTata = denumire_tip
			ENDIF
			GO TOP
			THISFORM.nNivelModificare=0
		ENDIF
		
		THISFORM.cb_TipSup._cbbase1.ROWSOURCE = "cTipuri_ctr2.denumire_tip"
		THISFORM.cb_TipSup._cbbase1.ROWSOURCETYPE = 2
		THISFORM.cb_TipSup._cbbase1.VALUE = lcGrupTata
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_tipuri_parteneri_nou AS _frmbase OF "_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="clb_tip_part" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_tipuri_parteneri1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 106
		Name = "frm_tipuri_parteneri_nou"
		nid = 0
		Width = 376
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 316
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 58
		Lb_titlu_alb_b121.Caption = "Tipuri entitati"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Left = 347
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 30, ;
		Name = "_checkbox1", ;
		TabIndex = 2, ;
		TabStop = .F., ;
		Top = 78
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 318, ;
		Name = "But_renunt1", ;
		TabIndex = 4, ;
		Top = 1, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'clb_tip_part' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 33, ;
		Name = "clb_tip_part", ;
		TabIndex = 1, ;
		Top = 40, ;
		Width = 314, ;
		Text_simplu1.ControlSource = "poRec.tip_partener", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Denumire", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_tipuri_parteneri1' AS cus_odata_tipuri_parteneri WITH ;
		Left = 74, ;
		Name = "Cus_odata_tipuri_parteneri1", ;
		Top = 43
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE inainte_de_do_renunt
		pccontinua=.F.
	ENDPROC

	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		
		lccontrol = UPPER(this.ActiveControl.BaseClass )
		IF   INLIST(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.Activecontrol.controlsource
			&lcval=thisform.ActiveControl.value
		ENDIF 	
		
		
		Do Case
		Case Empty(porec.Tip_partener)
			amessagebox('Nu ati completat tipul de partener!',0+48,"Atentie")
			This.clb_tip_part.SetFocus()
			plreturn=.F.
		Otherwise
			If Alltrim(Upper(This.cus_odata_tipuri_parteneri1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_tipuri_parteneri1.cactiune))="UPDATE" And poRec.tip_partener!=pctip_partener) 
				pcexec=[select * from ]+gcS+[.vnom_tip_parteneri where TRIM(tip_partener)=']+Alltrim(poRec.tip_partener)+[']
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_tip_partener')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_tip_partener')>0
					amessagebox('Mai exista acest tip de partener inregistrat!',0+48,"Atentie")
					Thisform.clb_tip_part.SetFocus()
					Use In exista_tip_partener
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_tipuri_parteneri1.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
				PLRETURN=This.cus_odata_tipuri_parteneri1.salvare(This.OREC,This.NID)
			ENDIF  
		ENDCASE 
		
		If plreturn
			pccontinua=.T.
		Endif
		
		Return PLRETURN
		
		
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		DODEFAULT()
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_tipuri_parteneri1.cactiune = tcActiune
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_valute AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cNume_val.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cNume_val.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cId_valuta.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cId_valuta.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cMoneda_nationala.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cMoneda_nationala._checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cNume_val2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_valute.cNume_val2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_valute" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = _gnom_valute
		DoCreate = .T.
		Height = 309
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_valute"
		Width = 410
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 410
		_shape2.Height = 29
		_shape2.Left = 289
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 121
		Lb_titlu_alb_b121.Caption = "Valute"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Left = 378
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_valute' AS _grdrow WITH ;
		ColumnCount = 5, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		HeaderHeight = 34, ;
		Height = 200, ;
		Left = 13, ;
		Name = "_gnom_valute", ;
		Panel = 1, ;
		RecordSource = "v_valute", ;
		ScrollBars = 3, ;
		TabIndex = 3, ;
		Top = 84, ;
		Width = 384, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "nume_val", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cNume_val", ;
		Column1.Width = 159, ;
		Column2.ColumnOrder = 4, ;
		Column2.ControlSource = "inactiv", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "cInactiv", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 39, ;
		Column3.ColumnOrder = 1, ;
		Column3.ControlSource = "id_valuta", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "cId_valuta", ;
		Column3.Width = 38, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "moneda_nationala", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "cMoneda_nationala", ;
		Column4.Sparse = .F., ;
		Column4.Width = 63, ;
		Column5.ColumnOrder = 3, ;
		Column5.ControlSource = "nume_val2", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "cNume_val2", ;
		Column5.Width = 49
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_valute.cId_valuta.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_valute.cId_valuta.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_valute.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 11, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_valute.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_valute.cMoneda_nationala._checkbox1' AS _checkbox WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Left = 33, ;
		Name = "_checkbox1", ;
		Top = 42
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT '_gnom_valute.cMoneda_nationala.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Moneda nationala", ;
		FontName = "Arial Narrow", ;
		Name = "Header1", ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_valute.cNume_val.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Denumire valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_valute.cNume_val.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_valute.cNume_val2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Simbol", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_valute.cNume_val2.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Left = 321, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 291, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Left = 349, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 295, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 45
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_valute' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 30, ;
		Name = "lb_nom_valute", ;
		TabIndex = 1, ;
		Top = 44, ;
		Width = 252, ;
		Text_simplu1.Left = 63, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Valuta", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=povalute.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_valute)
		povalute.ca_baza1.cfiltru=lcFiltru
		povalute.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_valute)
		IF RECCOUNT('v_valute')>0
			thisform._gnom_valute.SetFocus()
		ELSE
			thisform.lb_nom_valute.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_valute
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "valute",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_valute.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[nume_val like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_valute')>0
			Select v_valute
			Scatter Name loRec
			pcnume_val = loRec.nume_val
			Do Adauga_Modifica_Inregistrare With "valute",loRec,loRec.Id_valuta,"UPDATE"
			Thisform.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_valute')>0
			Select v_valute
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "valute",lorec.id_valuta
		
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_VALUTE'
			Nodefault
			this.lb_nom_valute.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_valute')
			USE IN v_valute
		ENDIF
	ENDPROC

	PROCEDURE _gnom_valute.cNume_val.Text1.DblClick
		thisform.log("NOM_VALUTE",v_valute.id_valuta)
	ENDPROC

	PROCEDURE _gnom_valute.Init
		DoDefault()
		This.SetAll("ReadOnly",.T.,"Column")
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_valute_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_moneda_nationala" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_valute1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_inactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_valuta_iso" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_cauta_iso
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 130
		Name = "frm_valute_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Valuta"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 6, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'ck_inactiv' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 34, ;
		Name = "ck_inactiv", ;
		TabIndex = 3, ;
		TabStop = .F., ;
		Top = 107
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_moneda_nationala' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Moneda nationala", ;
		ControlSource = "porec.moneda_nationala", ;
		Left = 202, ;
		Name = "ck_moneda_nationala", ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 107
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 18, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 43, ;
		Width = 312, ;
		Text_simplu1.ControlSource = "porec.nume_val", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Left = 124, ;
		Text_simplu1.MaxLength = 10, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Lb_simplu1.Caption = "Denumire valuta", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_valuta_iso' AS ct_clb_cautare_var WITH ;
		cprocedura = Thisform.do_cauta_iso, ;
		ctooltip = Alegeti simbolul ISO pentru aceasta valuta, ;
		cvar_afisata = poRec.nume_val2, ;
		Left = 17, ;
		Name = "Ct_valuta_iso", ;
		TabIndex = 2, ;
		Top = 70, ;
		shape_cautare.Name = "shape_cautare", ;
		img_cautare.Name = "img_cautare", ;
		lb_cautare.Caption = "Simbol ISO", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.Name = "tx_cautare"
		*< END OBJECT: ClassLib="caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_valute1' AS cus_odata_valute WITH ;
		Left = 166, ;
		Name = "Cus_odata_valute1", ;
		Top = 116
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE do_cauta_iso
		Lparameters tcParametru
		Local loCautaV,lnTipCautare
		lnTipCautare = Iif(Empty(tcParametru),2,3)
		loCautaV = cauta_valuta_iso(lnTipCautare,tcParametru)
		If !Isnull(loCautaV)
			If !Empty(Nvl(loCautaV.id_valuta_iso,0))
				poRec.id_valuta2 = loCautaV.id_valuta_iso
				poRec.nume_val2 = loCautaV.iso_valuta
			Endif
		Endif
		Release loCautaV,lnTipCautare
	ENDPROC

	PROCEDURE inainte_de_do_termin
		Local PLRETURN
		
		lccontrol = Upper(This.ActiveControl.BaseClass )
		If Inlist(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.ActiveControl.ControlSource
			&lcval=Thisform.ActiveControl.Value
		Endif
		
		Do Case
			Case Empty(porec.nume_val)
				aMessagebox('Nu ati completat valuta!',0+48,"Atentie")
				This.clb_tx_simplu1.SetFocus()
				PLRETURN=.F.
			Case Empty(Nvl(porec.id_valuta2,0))
				aMessagebox("Nu ati ales simbolul ISO pentru aceasta valuta!",0+48,"Atentie")
				This.ct_valuta_iso.SetFocus()
				PLRETURN = .F.
			Otherwise
				*!*		If Alltrim(Upper(This.cus_odata_valute1.cactiune))="INSERT" Or (Alltrim(Upper(This.cus_odata_valute1.cactiune))="UPDATE" And porec.nume_val!=pcnume_val)
				*!*			pcexec=[select * from ]+gcS+[.vnom_valute where TRIM(nume_val)=']+Alltrim(porec.nume_val)+[']
				*!*			Do While .T.
				*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_nume_val')
				*!*				If pnSucces = 0
				*!*	* instructiunea in curs de executie
				*!*				Else
				*!*					Exit
				*!*				Endif
				*!*			Enddo
				*!*			If Reccount('exista_nume_val')>0
				*!*				Messagebox('Mai exista acesta valuta inregistrata!',0+48,"Atentie")
				*!*				Thisform.clb_tx_simplu1.SetFocus()
				*!*				Use In exista_nume_val
				*!*				plreturn=.F.
				*!*			ELSE
				*!*				PLRETURN=This.cus_odata_valute1.salvare(This.OREC,This.NID)
				*!*			ENDIF
				*!*		ELSE
				PLRETURN=This.cus_odata_valute1.salvare(This.OREC,This.NID)
				If !PLRETURN
					Thisform.clb_tx_simplu1.SetFocus()
				Endif
				*!*		ENDIF
		Endcase
		
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		
		this.orec= toRec
		this.nid = tnId
		this.cus_odata_valute1.cactiune = tcActiune
	ENDPROC

	PROCEDURE Clb_tx_simplu1.Text_simplu1.LostFocus
		If Empty(Nvl(poRec.id_valuta2,0))
			Thisform.do_cauta_iso(This.Value)
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_venchel AS _frmbase OF "_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="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cExplicatie_fiu.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cExplicatie_fiu.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cTip.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cTip.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cInactiv.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cInactiv.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cId_venchelt.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cId_venchelt.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cExplicatie_tata.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cExplicatie_tata.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cExplicatie.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_gnom_venchel.cExplicatie.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_nom_venchel" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_listare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: log
	*</DefinedPropArrayMethod>

	*<PropValue>
		cgridsortlist = _gnom_venchel
		DoCreate = .T.
		Height = 383
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_venchel"
		Width = 516
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 516
		_shape2.Height = 29
		_shape2.Left = 336
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 181
		Lb_titlu_alb_b121.Caption = "Venituri Cheltuieli"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Left = 485
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .T.
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_gnom_venchel' AS _grdrow WITH ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 290, ;
		Left = 16, ;
		Name = "_gnom_venchel", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_venchel", ;
		ScrollBars = 3, ;
		TabIndex = 3, ;
		Top = 82, ;
		Width = 485, ;
		Column1.ColumnOrder = 2, ;
		Column1.ControlSource = "explicatie_fiu", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cExplicatie_fiu", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 144, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = 'iif(tip_venchelt = 1,"C","V")', ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "cTip", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 45, ;
		Column3.ColumnOrder = 6, ;
		Column3.ControlSource = "inactiv", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "cInactiv", ;
		Column3.ReadOnly = .T., ;
		Column3.Sparse = .F., ;
		Column3.Width = 35, ;
		Column4.ColumnOrder = 1, ;
		Column4.ControlSource = "id_venchelt", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "cId_venchelt", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 35, ;
		Column5.ColumnOrder = 4, ;
		Column5.ControlSource = "explicatie_tata", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "cExplicatie_tata", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 98, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "explicatie", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "cExplicatie", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 89
		*< END OBJECT: ClassLib="_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT '_gnom_venchel.cExplicatie.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatie completa", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_venchel.cExplicatie.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_venchel.cExplicatie_fiu.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Explicatia", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_venchel.cExplicatie_fiu.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_venchel.cExplicatie_tata.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Parinte", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_venchel.cExplicatie_tata.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1"
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_venchel.cId_venchelt.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Id", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_venchel.cId_venchelt.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT '_gnom_venchel.cInactiv.Check1' AS checkbox WITH ;
		Alignment = 2, ;
		AutoSize = .T., ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 13, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 30, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT '_gnom_venchel.cInactiv.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_venchel.cTip.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Tip", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT '_gnom_venchel.cTip.Text1' AS textbox WITH ;
		BackColor = 255,255,255, ;
		BorderStyle = 0, ;
		FontName = "Arial Narrow", ;
		ForeColor = 0,0,0, ;
		Margin = 0, ;
		Name = "Text1", ;
		ReadOnly = .T.
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Left = 454, ;
		Name = "But_excel1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_listare1' AS but_listare WITH ;
		Left = 424, ;
		Name = "But_listare1", ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Left = 366, ;
		Name = "But_modifica1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Left = 336, ;
		Name = "But_nou1", ;
		TabIndex = 7, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Left = 394, ;
		Name = "But_sterge1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T.
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 361, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 2, ;
		Top = 40
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'lb_nom_venchel' AS clb_tx_simplu WITH ;
		Left = 61, ;
		Name = "lb_nom_venchel", ;
		TabIndex = 1, ;
		Top = 40, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Explicatia", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=povenchel.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform._gnom_venchel)
		povenchel.ca_baza1.cfiltru=lcFiltru
		povenchel.ca_baza1.afisare()
		restore_grid_tag(thisform._gnom_venchel)
		IF RECCOUNT('v_venchel')>0
			thisform._gnom_venchel.SetFocus()
		ELSE
			thisform.lb_nom_venchel.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		SELECT v_venchel
		SCATTER NAME loRec blank
		DO Adauga_Modifica_Inregistrare WITH "venchel",loRec,,"INSERT"
		this.actualizeaza_grid1()
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = STRTRAN(Upper(Alltrim(This.lb_nom_venchel.text_simplu1.value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[explicatie like ']+lcNume+[%']
		ELSE 
			lcFiltru = [2=2]		
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		IF RECCOUNT()=0
			aMESSAGEBOX("Cautarea nu a intors rezultate!",0+64,"Info cautare")
		ENDIF
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_venchel')>0
			Select v_venchel
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "venchel",loRec,loRec.Id_venchelt,"UPDATE"
			Thisform.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru modificare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_venchel')>0
			Select v_venchel
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "venchel",lorec.id_venchelt
		
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu exista inregistrari pentru stergere!",48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_excel
		lcTabel = Thisform._gnom_venchel.RecordSource
		If Reccount(lcTabel)>0
			Do export_excel_grid With Thisform._gnom_venchel
		Else
			amessagebox("Nu exista inregistrari pentru export in Excel!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE inainte_de_do_listare
		lcTabel = Thisform._gnom_venchel.RecordSource
		If Reccount(lcTabel)>0
			Thisform.AlwaysOnTop = .F.
		
			Private pcDataOra, pcTitlu
			pcDataOra = get_ora(2)
			pcTitlu = "Venituri / Cheltuieli"
		
			Local lcTabel, lcRaport
		
			lcRaport = 'rVenChelt.frx'
			Select (lcTabel)
			Report Form (lcRaport) To Printer Prompt Preview
			Thisform.AlwaysOnTop = .T.
		Else
			amessagebox("Nu exista inregistrari pentru listare!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcActiveControl = UPPER(ALLTRIM(this.ActiveControl.name))
		
		IF nKeyCode=13 AND lcActiveControl = '_GNOM_VENCHEL'
			Nodefault
			this.LB_nom_venchel.SetFocus 
		ENDIF 
		
		
		DODEFAULT(nKeyCode, nShiftAltCtrl)
		
		
	ENDPROC

	PROCEDURE log
		LPARAMETERS tctabela,tnId
		
		lcId = ALLTRIM(STR(tnId))
		lctabela = UPPER(ALLTRIM(tctabela))
		PRIVATE polog,pcschema1,pcselect1
		STORE '' TO polog
		pcschema1 = ['']
		pcselect1=['select * from ] + gcS + [.vlog where ']
		pcorder1=['dataora']
		pcfiltru1 = [tabel = '] + lctabela + [' and id_tabel = ] + lcId 
		gencursor('polog','v_log',pcselect1,pcfiltru1,pcschema1,pcorder1)
		polog.ca_baza1.afisare()
		ofrmlog=CREATEOBJECT('frm_log')
		ofrmlog.show(1)
		RELEASE polog
	ENDPROC

	PROCEDURE Unload
		IF USED('v_venchel')
			USE IN v_venchel
		ENDIF
	ENDPROC

	PROCEDURE _gnom_venchel.cExplicatie_fiu.Text1.DblClick
		thisform.log("NOM_VENIT_CHELTUIELI",v_venchel.id_venchelt)
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_venchel_nou AS _frmbase OF "_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="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_venchel1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_inactiv" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_tata" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_cauta_venchelt
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		DoCreate = .T.
		Height = 162
		Name = "frm_venchel_nou"
		Width = 373
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 62
		Lb_titlu_alb_b121.Caption = "Venituri Cheltuieli"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 7
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 5
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT 'But_renunt1' AS but_renunt WITH ;
		Left = 312, ;
		Name = "But_renunt1", ;
		TabIndex = 6, ;
		Top = 1
		*< END OBJECT: ClassLib="cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Left = 15, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 2, ;
		Top = 72, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "Cheltuieli,Venituri", ;
		_cbbase1.RowSourceType = 1, ;
		_lbbase1.Caption = "Tip", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'ck_inactiv' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 31, ;
		Name = "ck_inactiv", ;
		TabIndex = 4, ;
		TabStop = .F., ;
		Top = 138
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 15, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		Text_simplu1.ControlSource = "porec.explicatie_fiu", ;
		Text_simplu1.Format = "!K", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Explicatia", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_tata' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(NVL(poRec.id_tata,0)), ;
		cprocedura = thisform.do_cauta_venchelt, ;
		cvar_afisata = poRec.explicatie_tata, ;
		Left = 14, ;
		Name = "Ct_clb_tata", ;
		TabIndex = 3, ;
		Top = 99, ;
		IMG_CAUTARE.Name = "IMG_CAUTARE", ;
		CLB_TX_CAUTARE.LB_SIMPLU1.Caption = "Parinte", ;
		CLB_TX_CAUTARE.LB_SIMPLU1.Name = "LB_SIMPLU1", ;
		CLB_TX_CAUTARE.Name = "CLB_TX_CAUTARE", ;
		CLB_TX_CAUTARE.TEXT_SIMPLU1.Name = "TEXT_SIMPLU1"
		*< END OBJECT: ClassLib="..\..\..\roafacturare\comun\clase\caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_venchel1' AS cus_odata_venchel WITH ;
		Left = 336, ;
		Name = "Cus_odata_venchel1", ;
		Top = 48
		*< END OBJECT: ClassLib="onomenclatoare.vcx" BaseClass="custom" />
	
	PROCEDURE do_cauta_venchelt
		Local loCauta
		If This.cus_odata_venchel1.cactiune = 'INSERT'
			loCauta = caut_venchelt(1,.F.,poRec.tip_venchelt)
		Else
			loCauta = caut_venchelt(1,.F.,poRec.tip_venchelt,poRec.id_venchelt)
		Endif
		If !Empty(Nvl(loCauta.id_venchelt,0))
			poRec.id_tata = loCauta.id_venchelt
			poRec.explicatie_tata = loCauta.explicatie
		
			Thisform.ck_inactiv.SetFocus()
		Else
			poRec.id_tata = Null
			poRec.explicatie_tata = []
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		LOCAL PLRETURN
		
		lccontrol = UPPER(this.ActiveControl.BaseClass )
		IF INLIST(lccontrol,"TEXTBOX","EDITBOX","COMBOBOX")
			lcval=This.Activecontrol.controlsource
			&lcval=thisform.ActiveControl.value
		ENDIF 	
		
		
		PLRETURN=This.cus_odata_venchel1.salvare(This.OREC,This.NID)
		Return PLRETURN
		
	ENDPROC

	PROCEDURE Init
		LPARAMETERS toRec, tnId, tcActiune
		
		DODEFAULT()
		
		this.orec= toRec
		this.nid = tnId
		this.cus_odata_venchel1.cactiune = tcActiune
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.Init
		IF porec.tip_venchelt = 1
			this.Value = "Cheltuieli"
		ELSE
			this.Value = "Venituri"
		ENDIF 
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.InteractiveChange
		IF this.Value = "Cheltuieli"
			porec.tip_venchelt = 1
		ELSE
			porec.tip_venchelt = 2
		ENDIF 
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.ProgrammaticChange
		IF this.Value = "Cheltuieli"
			porec.tip_venchelt = 1
		ELSE
			porec.tip_venchelt = 2
		ENDIF 
	ENDPROC

ENDDEFINE
