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

	*<PropValue>
		Name = "cus_odata_ansamble"
	*</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')
			lcAnsamblu = Nvl(Alltrim(toRec.denumire),[])
			lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)),[])
		Endif
		
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin pack_auto.adauga_ansamblu('] + gcS + [','] + lcAnsamblu + [',]+ ;
				lcinactiv + [,] + Alltrim(Str(gnIdUtil)) + [); end;]
		
		Case lcActiune = "UPDATE"
			lcSql = [begin pack_auto.modifica_ansamblu('] + gcS + [',] + lcId + [,'] + ;
				lcAnsamblu + [',] + lcinactiv + [,] + Alltrim(Str(gnIdUtil)) + [); end;]
		
		Case lcActiune = "DELETE"
			lcSql = [begin pack_auto.sterge_ansamblu('] + gcS + [',] + lcId + [,] + ;
				Alltrim(Str(gnIdUtil)) + [); end;]
		Endcase
		
		This.csql = lcSql
	ENDPROC

ENDDEFINE

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

	*<PropValue>
		Name = "cus_odata_asiguratori"
	*</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 + ".dev_nom_asiguratori"
			lcamp = "id_asigurator"
			lclook = gcS + ".dev_ordl"
			lclookid = "id_asigurator"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
		*!*	modificare	v 2.0.33
			lcIdPart = ALLTRIM(STR(toRec.id_part))
		*!*		lcnrord = Nvl(STRTRAN(Alltrim(Upper(toRec.asigurator)),['],['']),"")
		*!*	modificare	v 2.0.33	^
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		*!*	modificare	v 2.0.33
		*!*			lcSql = [INSERT INTO ] + gcS + [.dev_nom_asiguratori (asigurator,inactiv) VALUES ('] + lcnrord + [',] + lcinactiv +[)]
				lcSql = [begin pack_auto.adauga_asigurator(] + lcIdPart + [,?gnIdUtil); end;]
			Case lcActiune = "UPDATE"
		*!*			lcSql = [UPDATE ] + gcS + [.dev_nom_asiguratori SET asigurator = '] + lcnrord + [',inactiv = ] + lcinactiv + [ where id_asigurator = ] + lcId
				lcSql = [begin pack_auto.modifica_asigurator(] + lcId + [,] + lcInactiv + [,?gnIdUtil); end;]
		*!*	modificare	v 2.0.33	^
			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_dealeri AS _cusodatabase OF "..\..\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_dealeri"
	*</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 + ".dev_nom_furnizorimasini"
			lcamp = "id_furnizor"
			lclook = gcS + ".dev_masiniclienti"
			lclookid = "id_furnizor"
		Endif
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcDenumire = NVL(ALLTRIM(torec.denumire),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.dev_nom_furnizorimasini (denumire,inactiv) VALUES ('] + lcDenumire+ [','] + lcInactiv + [')]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.dev_nom_furnizorimasini SET denumire = '] +;
				 lcDenumire + [',inactiv =] + lcInactiv + [ where id_furnizor = ] + 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;]
		*!*			lcSql = [UPDATE ] + gcS + [.dev_nom_delegati SET STERS = 1  WHERE id_nom_delegati = ] +  lcId
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

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

	*<PropValue>
		Name = "cus_odata_delegati"
	*</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 + ".dev_nom_delegati"
		*!*		lcamp = "id_nom_delegati"
		*!*		lclook = gcS + ".dev_oper_mecanici"
		*!*		lclookid = "dev_oper_mecanici.id_mecanic"
		Endif
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcIdclient = Nvl(Alltrim(Str(toRec.id_partener)),[])
			lcDelegat = Nvl(Alltrim(toRec.delegat),[])
			lcEliberatde = Nvl(Alltrim(toRec.eliberatde),[])
			lcBI = Nvl(Alltrim(toRec.bi),[])
			lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)),[])
			lcTelefon1 = Nvl(Alltrim(toRec.telefon1),[])
			lcTelefon2 = Nvl(Alltrim(toRec.telefon2),[])
		Endif
		
		
		Do Case
		Case lcActiune = "INSERT"
			lcSql = [begin pack_auto.adauga_delegat('] + gcS + [',] + lcIdclient+ [,'] + lcDelegat+ [','] + lcEliberatde+ ;
				[','] + lcBI + [',] + lcinactiv + [,'] + lcTelefon1 + [','] + lcTelefon2 + [',?gnIdUtil); end;]
		*!*		lcSql = [INSERT INTO ] + gcS + [.dev_nom_delegati (id_partener,delegat,eliberatde,bi,inactiv) VALUES ('] + lcIdclient+ [','] + lcDelegat+ [','] + lcEliberatde+ [','] + lcBI + [','] + lcinactiv + [')]
		
		Case lcActiune = "UPDATE"
			lcSql = [begin pack_auto.modifica_delegat('] + gcS + [',] + lcId + [,] + lcIdclient+ [,'] + lcDelegat+ [',] + ;
				['] + lcEliberatde + [','] + lcBI + [',] + lcinactiv + [,'] + lcTelefon1 + [','] + lcTelefon2 + [',?gnIdUtil); end;]
		*!*		lcSql = [UPDATE ] + gcS + [.dev_nom_delegati SET id_partener = '] + lcIdclient+ [',delegat='] + lcDelegat+[',eliberatde = '] + lcEliberatde+ [',bi = ']+ lcBI+ [',inactiv =] + lcinactiv + [ where id_nom_delegati = ] + lcId
		
		Case lcActiune = "DELETE"
			lcSql = [begin pack_auto.sterge_delegat('] + gcS + [',] + lcId+ [,?gnIdUtil); end;]
		*!*			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 = [UPDATE ] + gcS + [.dev_nom_delegati SET STERS = 1  WHERE id_nom_delegati = ] +  lcId
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS cus_odata_dev_clienti_201402 AS _cusodatabase OF "..\comun\clase\_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_inspectori AS _cusodatabase OF "..\..\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_inspectori"
	*</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 + ".dev_nom_inspectori"
			lcamp = "id_inspector"
			lclook = gcS + ".dev_ordl"
			lclookid = "id_inspector"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcinspector = Nvl(STRTRAN(Alltrim(Upper(toRec.inspector)),['],['']),"")
			lcidasigurator = NVL(ALLTRIM(STR(torec.id_asigurator)),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.dev_nom_inspectori (inspector,id_asigurator,inactiv) VALUES ('] + lcinspector + [','] + lcidasigurator + [',] + lcinactiv +[)]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.dev_nom_inspectori SET inspector = '] + lcinspector +[',id_asigurator = ] + lcidasigurator + [,inactiv = ] + lcinactiv + [ where id_inspector = ] + 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_marci AS _cusodatabase OF "..\..\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_marci"
	*</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 + ".dev_nom_marci"
			lcamp = "id_marca"
			lclook = gcS + ".dev_nom_masini"
			lclookid = "id_masina"
		Endif
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcmarca = NVL(ALLTRIM(torec.marca),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.dev_nom_marci (marca,inactiv) VALUES ('] + lcmarca + [',']+ lcInactiv + [')]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.dev_nom_marci SET marca = '] + lcmarca + [',inactiv =] + lcInactiv + [ where id_marca = ] + 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_masini AS _cusodatabase OF "..\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_masini"
	*</PropValue>
	
	PROCEDURE make_sql
		Lparameters toRec,tnId
		
		lcActiune=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 + ".dev_nom_masini"
			lcamp = "id_masina"
			lclook = gcS + ".dev_masiniclienti"
			lclookid = "id_masina"
		Endif
		
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcMasina = NVL(STRTRAN(ALLTRIM(UPPER(torec.masina)),['],['']),"")
			lcExplicatia = NVL(STRTRAN(ALLTRIM(UPPER(torec.sctip)),['],['']),"")
			lcId = NVL(ALLTRIM(STR(torec.id_masina)),"")
			lcID_marca = NVL(ALLTRIM(STR(torec.id_marca)),"")
		*!*		lcinspector = Nvl(STRTRAN(Alltrim(Upper(toRec.inspector)),['],['']),"")
		*!*		lcidasigurator = NVL(ALLTRIM(STR(torec.id_asigurator)),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")	
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.dev_nom_masini (masina,sctip,id_marca,inactiv) VALUES ('] + lcmasina + [','] + lcExplicatia + [',] + lcid_marca + [,] + lcinactiv +[)]
		
			Case lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.dev_nom_masini SET masina = '] + lcmasina +[',sctip = '] + lcExplicatia + [',id_marca = ] + lcid_marca + [,inactiv = ] + lcinactiv + [ where id_masina = ] + 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_masiniclienti AS _cusodatabase OF "..\..\roacomenzi\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_masiniclienti"
	*</PropValue>
	
	PROCEDURE make_sql
		LPARAMETERS toRec, tnId
		
		LOCAL lcActiune, lcAnFabricatie, lcCilindree, lcId, lcId_furnizor, lcId_masina, lcId_partener
		LOCAL lcPutereCP, lcPutereKW, lcSql, lcamp, lcculoare, lcinactiv, lckmint, lclook, lclookid, lcnom
		LOCAL lcnrinmat, lcserief, lcseriem, lcseries
		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 + ".dev_masiniclienti"
			lcamp = "id_masiniclient"
			lclook = gcS + ".dev_ordl"
			lclookid = "id_masiniclient"
		ENDIF
		
		IF INLIST(lcActiune, "UPDATE", 'INSERT')
			lcId_partener = NVL(ALLTRIM(STR(toRec.id_partener)), "")
			lcId_masina = NVL(ALLTRIM(STR(toRec.id_masina)), "")
			*!*		lcId_marca = Nvl(Alltrim(str(toRec.id_marca)),"")
			lcnrinmat = NVL(STRTRAN(ALLTRIM(UPPER(toRec.nrinmat)), ['], ['']), "")
			lcculoare = NVL(STRTRAN(ALLTRIM(UPPER(toRec.culoare)), ['], ['']), "")
			lcseries = NVL(STRTRAN(ALLTRIM(UPPER(toRec.series)), ['], ['']), "")
			lcseriem = NVL(STRTRAN(ALLTRIM(UPPER(toRec.seriem)), ['], ['']), "")
			lckmint = NVL(ALLTRIM(STR(toRec.kmint)), "")
			*!*		lcdataachi = Nvl(Alltrim(Dtos(toRec.dataachi)),"")
			lcserief = NVL(STRTRAN(ALLTRIM(UPPER(toRec.serief)), ['], ['']), "")
			lcId_furnizor = NVL(ALLTRIM(STR(toRec.id_furnizor)), "")
			lcinactiv = NVL(ALLTRIM(STR(toRec.inactiv)), "")
			lcAnFabricatie = IIF(ISNULL(toRec.anfabricatie) OR EMPTY(toRec.anfabricatie), [NULL], ALLTRIM(STR(toRec.anfabricatie)))
			*!*		lcAnFabricatie = IIF(ISNULL(toRec.anfabricatie) or EMPTY(toRec.anfabricatie),[NULL],[']+DTOS(toRec.anfabricatie)+['])
		
			lcCilindree = ALLTRIM(TRANSFORM(NVL(toRec.cilindree, 0)))
			lcPutereCP = ALLTRIM(TRANSFORM(NVL(toRec.puterecp, 0)))
			lcPutereKW = ALLTRIM(TRANSFORM(NVL(toRec.puterekw, 0)))
		ENDIF
		
		
		DO CASE
			CASE lcActiune = "INSERT"
		
				lcSql = [INSERT INTO ] + gcS + [.dev_masiniclienti (id_masina,nrinmat,culoare,series,seriem,kmint,serief,anfabricatie,id_furnizor,inactiv,id_partener, cilindree, puterecp, puterekw) VALUES (] + ;
					lcId_masina + [,'] + lcnrinmat + [','] + lcculoare + [','] + lcseries + [','] + lcseriem + [',] + lckmint + [,'] + lcserief + ['] + ;
					[,] + lcAnFabricatie + [,] + lcId_furnizor + [,] + lcinactiv + [,] + lcId_partener + [,] + m.lcCilindree + [,] + m.lcPutereCP + [,] + m.lcPutereKW + [)]
		
			CASE lcActiune = "UPDATE"
		
				lcSql = [UPDATE ] + gcS + [.dev_masiniclienti SET id_masina = ] + lcId_masina + ;
					[,nrinmat = '] + lcnrinmat + ;
					[',culoare = '] + lcculoare + ;
					[',series = '] + lcseries + ;
					[',seriem = '] + lcseriem + ;
					[',kmint = ] + lckmint + ;
					[,serief = '] + lcserief + ;
					[',id_furnizor = ] + lcId_furnizor + ;
					[,anfabricatie = ] + lcAnFabricatie + ;
					[,cilindree = ] + lcCilindree + ;
					[,puterecp = ] + lcPutereCP + ;
					[,puterekw = ] + lcPutereKW + ;
					[,inactiv = ] + lcinactiv + [ where id_masiniclient = ] + 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_mecanici AS _cusodatabase OF "..\..\roafacturare\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_mecanici"
	*</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 + ".dev_mecanici"
		*!*		lcamp = "id_mecanic"
		*!*		lclook = gcS + ".dev_oper_mecanici"
		*!*		lclookid = "id_mecanic"
		Endif
		If Inlist(lcActiune, "UPDATE",'INSERT')
		*!*		lcID_sal = NVL(ALLTRIM(STR(torec.id_salariat)),[NULL])
			lcId_part = NVL(ALLTRIM(STR(torec.id_part)),[NULL])
			lcId_sectie = NVL(ALLTRIM(STR(torec.id_sectie)),[NULL])
		*!*		lcfdoc = Nvl(STRTRAN(Alltrim(Upper(toRec.id_mecanic)),['],['']),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"0")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql = [begin ] + gcS + [.pack_auto.adauga_mecanic(?gcS,] + lcId_part + [,] + ;
					lcId_sectie + [,] + lcInactiv + [,?gnIdUtil); end;]
		*!*			lcSql = [INSERT INTO ] + gcS + [.dev_mecanici (id_salariat,id_sectie,inactiv) VALUES ('] + lcID_sal + [','] + lcId_sectie + [',']+ lcInactiv + [')]
			Case lcActiune = "UPDATE"
				lcSql = [begin ] + gcS + [.pack_auto.modifica_mecanic(?gcS,] + lcId + [,] + lcId_part + [,] + lcId_sectie + [,] + ;
					lcInactiv + [,?gnIdUtil); end;]
		*!*			lcSql = [UPDATE ] + gcS + [.dev_mecanici SET id_salariat = '] + lcID_sal + [',id_sectie =] + lcId_sectie + [,inactiv =] + lcInactiv + [ where id_mecanic = ] + lcId
			Case lcActiune = "DELETE"
				lcSql = [begin ] + gcS + [.pack_auto.sterge_mecanic(?gcS,] + lcId + [,?gnIdUtil); end;]	
		*!*			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_norme AS _cusodatabase OF "..\..\roafacturare\comun\clase\_cus_odata_base.vcx" 
 	*< CLASSDATA: Baseclass="custom" Timestamp="" Scale="Pixels" Uniqueid="" />

	*<PropValue>
		Name = "cus_odata_norme"
	*</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 + ".dev_nom_norme"
			lcamp = "id_norme"
			lclook = gcS + ".dev_oper"
			lclookid = "id_norme"
		Endif
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcID_masina = NVL(ALLTRIM(STR(torec.id_masina)),"NULL")
			lcId_ansamblu = NVL(ALLTRIM(STR(torec.id_ansamblu)),"NULL")
			lcdenop = Nvl(STRTRAN(Alltrim(Upper(toRec.denop)),['],['']),"")
			lccodop = Nvl(STRTRAN(Alltrim(Upper(toRec.codop)),['],['']),"")
			lcTimpn = NVL(ALLTRIM(STR(torec.timpn,5,3)),"")
			lcinactiv = Nvl(ALLTRIM(STR(toRec.inactiv)),"")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
		*!*	modificare v 2.0.12
				lcSql = [begin pack_auto.adauga_norma(] + lcId_masina + [,] + lcId_ansamblu + [,'] + lcDenop + [','] + lcCodOp + [',] + ;
					lcTimpn + [,] + lcInactiv + [,] + ALLTRIM(STR(gnIdUtil)) + [); end;]
		*!*			lcSql = [INSERT INTO ] + gcS + [.dev_nom_norme (id_masina,id_ansamblu,denop,codop,timpn,inactiv) VALUES (];
		*!*			 + lcID_masina + [,] + lcId_ansamblu + [,'] + lcdenop + [',']+ lccodop + [',]+ lcTimpn + [,]+ lcinactiv + [)]
		*!*	modificare v 2.0.12	^
			Case lcActiune = "UPDATE"
		*!*	modificare v 2.0.12
				lcSql = [begin pack_auto.modifica_norma(] + lcId + [,] + lcId_masina + [,] + lcId_ansamblu + [,'] + ;
					lcDenop + [','] + lcCodOp + [',] + ;
					lcTimpn + [,] + lcInactiv + [,] + ;
					ALLTRIM(STR(gnIdUtil)) + [); end;]
		*!*			lcSql = [UPDATE ] + gcS + [.dev_nom_norme SET id_masina = ] + lcid_masina + ;
		*!*			[,id_ansamblu =] + lcid_ansamblu + ;
		*!*			[,Denop = '] + lcdenop +;
		*!*			[',Codop = '] + lcCodop +;
		*!*			[',timpn = ] + lcTimpn +;
		*!*			[,inactiv =] + lcInactiv + [ where id_norme = ] + lcId
		*!*	modificare v 2.0.12	^
			Case lcActiune = "DELETE"
		*!*	modificare v 2.0.12
				lcSql = [begin pack_auto.sterge_norma(] + lcId + [,] + ALLTRIM(STR(gnIdUtil)) + [); end;]
		*!*	*!*			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;]
		*!*	modificare v 2.0.12	^
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

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

	*<PropValue>
		Name = "cus_odata_preturi"
	*</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 + ".dev_nom_preturi"
		*!*		lcamp = "id_pret"
			*!*		lclook = gcS + ".dev_oper"
			*!*		lclookid = "dev_oper.id_norme"
		Endif
		If Inlist(lcActiune, "UPDATE",'INSERT')
			lcId_MArca = Nvl(Alltrim(Str(toRec.id_marca)),"")
			lcId_asigurator = Nvl(Alltrim(Str(toRec.id_asigurator)),"")
			lcPret = Nvl(Alltrim(Str(toRec.Pret,18,gnPPretV)),"")
			lcPret_val = Nvl(Alltrim(Str(toRec.pret_val,10,gnPVal)),"")
			lcCurs = Nvl(Alltrim(Str(toRec.Curs,12,gnPCurs2)),"")
			lcId_valuta = Nvl(Alltrim(Str(toRec.id_valuta)),"")
			lcinactiv = Nvl(Alltrim(Str(toRec.inactiv)),"")
		Endif
		
		
		Do Case
			Case lcActiune = "INSERT"
				lcSql = [begin ] + gcS + [.pack_auto.adauga_pret(] + lcId_MArca + [,] + lcId_asigurator + [,] + lcPret + [,]+ lcPret_val + [,]+ lcCurs + ;
					[,] + lcId_valuta + [,]+ lcinactiv + [); end;]
				*!*			lcSql = [INSERT INTO ] + gcS + [.dev_nom_preturi (id_marca,id_asiguratori,Pret,Pret_val,Curs,Id_valuta,inactiv) VALUES (];
				*!*			 + lcId_MArca + [,] + lcId_asigurator + [,] + lcPret + [,]+ lcPret_val + [,]+ lcCurs + [,] + lcId_valuta + [,]+ lcinactiv + [)]
		
			Case lcActiune = "UPDATE"
				lcSql = [begin ] + gcS + [.pack_auto.modifica_pret(] + lcId + [,] + lcId_MArca + [,] + lcId_asigurator + [,] + lcPret + [,]+ lcPret_val + [,]+ lcCurs + ;
					[,] + lcId_valuta + [,]+ lcinactiv + [); end;]
				*!*			lcSql = [UPDATE ] + gcS + [.dev_nom_preturi SET id_marca = ] + lcId_MArca + ;
				*!*			[,id_asiguratori =] + lcId_asigurator + ;
				*!*			[,Pret= ] + lcPret +;
				*!*			[,Pret_val = ] + lcPret_val +;
				*!*			[,Curs= ] + lcCurs +;
				*!*			[,Id_valuta= ] + lcId_valuta +;
				*!*			[,inactiv =] + lcInactiv + [ where id_pret = ] + lcId
		
			Case lcActiune = "DELETE"
				lcSql = [begin ] + gcS + [.pack_auto.sterge_pret(] + lcId + [,?gnIdUtil); end;]
				*!*			lcSql = [update ] + GCS + [.dev_nom_preturi set sters = 1  where id_pret = ]+lcid
				*!*			lcSql = [begin nomdelproc('] + lcnom + [','] + lcamp + [',] + lcid + [,'] + lclook + [','] + lclookid + ['); end;]
		Endcase
		
		This.csql = lcSql
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_ansamble AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="grd_ansamble" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_ansamble.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_ansamble.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_ansamble.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grd_ansamble.Column7.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />

	*<PropValue>
		cgridsortlist = grd_ansamble
		DoCreate = .T.
		Height = 470
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_ansamble"
		Width = 456
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 456
		_shape2.Height = 29
		_shape2.Left = 332
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 124
		Lb_titlu_alb_b121.Caption = "Ansamble"
		Lb_titlu_alb_b121.Height = 21
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		Lb_titlu_alb_b121.Top = 6
		Lb_titlu_alb_b121.Width = 72
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 425
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 365, ;
		Name = "But_modifica1", ;
		TabIndex = 5, ;
		Top = 0, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 335, ;
		Name = "But_nou1", ;
		TabIndex = 4, ;
		Top = 0, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 394, ;
		Name = "But_sterge1", ;
		TabIndex = 6, ;
		Top = 0, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'clb_denumire' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "clb_denumire", ;
		TabIndex = 1, ;
		Top = 43, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Denumire", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

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

	ADD OBJECT 'grd_ansamble' AS _grdbase WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 372, ;
		Left = 20, ;
		Name = "grd_ansamble", ;
		Panel = 1, ;
		RecordSource = "v_ansamble", ;
		TabIndex = 3, ;
		Top = 84, ;
		Width = 420, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column1.Width = 343, ;
		Column2.ControlSource = "inactiv", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column7", ;
		Column2.Sparse = .F., ;
		Column2.Width = 39
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'grd_ansamble.Column1.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 'grd_ansamble.Column7.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 13, ;
		Name = "Check1", ;
		Top = 83, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'grd_ansamble.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters pcFiltru
		Local lcFiltru
		lcFiltru=pcFiltru
		If Empty(lcFiltru)
			lcFiltru=poansamble.ca_baza1.cfiltru
		Endif
		save_grid_tag(Thisform.grd_ansamble)
		poansamble.ca_baza1.cfiltru=lcFiltru
		poansamble.ca_baza1.afisare()
		restore_grid_tag(Thisform.grd_ansamble)
		Thisform.grd_ansamble.SetFocus()
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Select v_ansamble
		Scatter Name loRec Blank
		Do Adauga_Modifica_Inregistrare With "ansamble",loRec,,"INSERT"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcDenumire = Strtran(Upper(Alltrim(Thisform.clb_denumire.texT_SIMPLU1.Value)),['],[''])
		If !Empty(lcDenumire)
			lcFiltru = [denumire like '] + lcDenumire + [%']
		Else
			lcFiltru = [2=2]
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		This.LockScreen=.F.
		This.MousePointer= 0
		If Reccount('v_ansamble')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.clb_denumire.SetFocus()
		Else
			Thisform.grd_ansamble.SetFocus()
		Endif
		
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_ansamble')>0
			Private pniesire
			pniesire=0
			Select v_ansamble
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "ansamble",loRec,loRec.id_ansamblu,"UPDATE"
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_ansamble')>0
			Select v_ansamble
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "ansamble",lorec.id_ansamblu
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_ansamble_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Clb_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_ansamble1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 109
		Name = "frm_ansamble_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 311
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 66
		Lb_titlu_alb_b121.Caption = "Ansamblu"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 10
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

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

	ADD OBJECT 'Clb_denumire' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_denumire", ;
		TabIndex = 3, ;
		Top = 43, ;
		Text_simplu1.ControlSource = "porec.denumire", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Denumire", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_ansamble1' AS cus_odata_ansamble WITH ;
		Left = 336, ;
		Name = "Cus_odata_ansamble1", ;
		Top = 48
		*< END OBJECT: ClassLib="onom_devize.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(Thisform.clb_denumire.text_SIMPLU1.Value)
			amessagebox("Nu ati completat denumirea ansamblului!",0+48,"Atentie")
			Thisform.clb_denumire.text_SIMPLU1.SetFocus()
			PLRETURN = .F.
		Otherwise
			PLRETURN=This.cus_odata_ansamble1.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_ansamble1.cactiune = tcActiune
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_asiguratori AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="gasiguratori" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gasiguratori.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gasiguratori.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gasiguratori.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gasiguratori.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ginspectori" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ginspectori.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ginspectori.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ginspectori.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ginspectori.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_asigurator" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 340
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_asiguratori"
		Width = 800
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 804
		_shape2.Height = 29
		_shape2.Left = 676
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 125
		Lb_titlu_alb_b121.Caption = "Asiguratori"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 12
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 769
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 11
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 709, ;
		Name = "But_modifica1", ;
		TabIndex = 5, ;
		ToolTipText = "Modificare asigurator (CTRL+M)", ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica2' AS but_modifica WITH ;
		caction = do_modifica2, ;
		Height = 27, ;
		Left = 723, ;
		Name = "But_modifica2", ;
		TabIndex = 9, ;
		ToolTipText = "Modificare inspector", ;
		Top = 48, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 679, ;
		Name = "But_nou1", ;
		TabIndex = 4, ;
		ToolTipText = "Adaugare asigurator (CTRL+N)", ;
		Top = 1, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou2' AS but_nou WITH ;
		caction = do_adauga2, ;
		Height = 27, ;
		Left = 693, ;
		Name = "But_nou2", ;
		TabIndex = 8, ;
		ToolTipText = "Adaugare inspector", ;
		Top = 48, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 739, ;
		Name = "But_sterge1", ;
		TabIndex = 6, ;
		ToolTipText = "Stergere asigurator (CTRL+D)", ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge2' AS but_sterge WITH ;
		caction = do_sterge2, ;
		Height = 27, ;
		Left = 753, ;
		Name = "But_sterge2", ;
		TabIndex = 10, ;
		ToolTipText = "Stergere inspector", ;
		Top = 48, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'gasiguratori' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 252, ;
		Left = 12, ;
		Name = "gasiguratori", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_asiguratori", ;
		TabIndex = 3, ;
		Top = 72, ;
		Width = 339, ;
		Column1.ControlSource = "asigurator", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 268, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 34
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gasiguratori.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 'gasiguratori.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		AutoSize = .F., ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 19, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 24, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'ginspectori' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 240, ;
		Left = 408, ;
		Name = "ginspectori", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_inspectori", ;
		TabIndex = 7, ;
		Top = 84, ;
		Width = 374, ;
		Column1.ControlSource = "inspector", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 301, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 38
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'ginspectori.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 'ginspectori.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 22, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 31, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'lb_asigurator' AS clb_tx_simplu WITH ;
		Left = 16, ;
		Name = "lb_asigurator", ;
		TabIndex = 1, ;
		Top = 37, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Asigurator:", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=poasiguratori.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform.gasiguratori)
		poasiguratori.ca_baza1.cfiltru=lcFiltru
		poasiguratori.ca_baza1.afisare()
		restore_grid_tag(thisform.gasiguratori)
		IF RECCOUNT('v_asiguratori')>0
			thisform.gasiguratori.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_mecanici.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE actualizeaza_grid2
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=poinspector.ca_baza1.cfiltru
		ENDIF
		
		save_grid_tag(thisform.ginspectori)
		poinspector.ca_baza1.cfiltru=lcFiltru
		poinspector.ca_baza1.afisare()
		restore_grid_tag(thisform.ginspectori)
		
		IF RECCOUNT('v_inspectori')>0
			thisform.ginspectori.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_mecanici.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Select v_asiguratori
		Scatter Name loRec Blank
		Do Adauga_Modifica_Inregistrare With "asiguratori",loRec,,"INSERT",,"addasig"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_adauga2
		If Reccount('v_asiguratori')>0
			Private pniesire
			pniesire=0
			Select v_inspectori
			Scatter Name loRec Blank
			lnid_asigurator = v_asiguratori.id_asigurator
			loRec.id_asigurator = v_asiguratori.id_asigurator
		*!*	SELECT v_asiguratori
		*!*	SCATTER NAME loRec FIELDS id_asigurator
			Select v_inspectori
			Do Adauga_Modifica_Inregistrare With "inspectori",loRec,,"INSERT",,"addinsp"
			If pniesire=1
				This.actualizeaza_grid2()
			Endif
		Else
			amessagebox("Nu puteti adauga un inspector,deoarece nu ati selectat asiguratorul!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = Strtran(Upper(Alltrim(This.lb_asigurator.text_simplu1.Value)),['],[''])
		If !Empty(lcNume)
			lcFiltru=[asigurator like ']+lcNume+[%']
		Else
			lcFiltru = [2=2]
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('v_asiguratori')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			thisform.actualizeaza_grid2([1=2])
			thisform.lb_asigurator.SetFocus()
		Endif
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_asiguratori')>0
			Private pniesire
			pniesire=0
			Select v_asiguratori
			Scatter Name loRec
			pcNume = loRec.asigurator
			Do Adauga_Modifica_Inregistrare With "asiguratori",loRec,loRec.id_asigurator,"UPDATE",,"modasig"
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_modifica2
		If Reccount('v_inspectori')>0
			Private pniesire
			pniesire=0
			Select v_inspectori
			Scatter Name loRec
		*!*	lorec.id_asigurator = v_asiguratori.id_asigurator
		*!*	SELECT v_asiguratori
		*!*	SCATTER NAME loRec FIELDS id_asigurator
			Select v_inspectori
			Do Adauga_Modifica_Inregistrare With "inspectori",loRec,loRec.id_inspector,"UPDATE",,"modinsp"
			If pniesire=1
				This.actualizeaza_grid2()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_asiguratori')>0
			Select v_asiguratori
			Scatter Name loRec
			pcNume = loRec.asigurator
			Do STERGE_INREGISTRARE With "asiguratori",loRec.id_asigurator
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_sterge2
		If Reccount('v_inspectori')>0
			Select v_inspectori
			Scatter Name loRec
			pcNume = loRec.inspector
			Do STERGE_INREGISTRARE With "inspectori",loRec.id_inspector
			This.actualizeaza_grid2()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE gasiguratori.AfterRowColChange
		Lparameters nColIndex
		If This.RowColChange!=2
			DoDefault()
			lcFiltru=[id_asigurator=]+Alltrim(Str(v_asiguratori.id_asigurator))
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_asiguratori_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_asiguratori1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_asigurator" UniqueID="" Timestamp="" />

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

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 105
		Name = "frm_asiguratori_nou"
		Width = 370
		_shape1.Name = "_shape1"
		_shape1.ZOrderSet = 0
		_shape2.Height = 29
		_shape2.Left = 307
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		_shape2.ZOrderSet = 1
		Lb_titlu_alb_b121.Caption = "Asigurator"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		Lb_titlu_alb_b121.ZOrderSet = 7
		BUT_TERMIN1.Left = 339
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.ZOrderSet = 2
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 23, ;
		Name = "_checkbox1", ;
		TabIndex = 2, ;
		Top = 78, ;
		ZOrderSet = 3
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'Ct_clb_asigurator' AS ct_clb_cautare_var WITH ;
		cconditie = !EMPTY(NVL(porec.id_part,0)), ;
		cprocedura = Thisform.do_cauta_client, ;
		cvar_afisata = porec.asigurator, ;
		Left = 10, ;
		Name = "Ct_clb_asigurator", ;
		TabIndex = 1, ;
		Top = 42, ;
		shape_cautare.Name = "shape_cautare", ;
		img_cautare.Name = "img_cautare", ;
		lb_cautare.Caption = "Asigurator", ;
		lb_cautare.Name = "lb_cautare", ;
		tx_cautare.Name = "tx_cautare"
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_asiguratori1' AS cus_odata_asiguratori WITH ;
		Left = 288, ;
		Name = "Cus_odata_asiguratori1", ;
		Top = 72
		*< END OBJECT: ClassLib="onom_devize.vcx" BaseClass="custom" />
	
	PROCEDURE do_cauta_client
		Local loCauta
		loCauta = CautPartenerContabilitate(GetHash([cTitlu=>Cauta asigurator in clienti??cCont=>4111??lAdaugCorespondente=>1??cFiltruOrig=>tip_persoana=1]))
		If gnButon = 1
			poRec.id_part = loCauta.id_part
			poRec.asigurator = loCauta.denumire
		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
		*!*	modificare	v 2.0.33
		*!*	Case Empty(porec.asigurator)
		*!*		amessagebox('Nu ati completat denumirea asiguratorului!',0+48,"Atentie")
		*!*		This.clb_tx_simplu1.text_simplu1.SetFocus()
		*!*		PLRETURN=.F.
		*!*	Otherwise
		*!*		If Alltrim(Upper(This.cus_odata_asiguratori1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE")
		*!*			pcexec=[select * from ]+gcS+[.DEV_Vasiguratori where (TRIM(asigurator)=']+Alltrim(porec.asigurator)+[')]
		*!*			Do While .T.
		*!*				pnSucces = SQLExec(GNHANDLE,pcexec,'exista_asigurator')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista_asigurator')>0
		*!*				amessagebox('Mai exista acest asigurator inregistrat',0+48,"Atentie")
		*!*				This.clb_tx_simplu1.text_simplu1.SetFocus()
		*!*				Use In exista_asigurator
		*!*				PLRETURN=.F.
		*!*			Else
		*!*				PLRETURN=This.cus_odata_asiguratori1.salvare(This.OREC,This.NID)
		*!*			Endif
		*!*		Else
		*!*	*!*		WAIT WINDOW "pe else"
		*!*			PLRETURN=This.cus_odata_asiguratori1.salvare(This.OREC,This.NID)
		*!*		Endif
		CASE EMPTY(NVL(porec.id_part,0))
			amessagebox("Nu ati ales asiguratorul!",48,"Atentie")
			Thisform.ct_clb_asigurator.tx_cautare.SetFocus()
			plReturn = .F.
		OTHERWISE
			plReturn = This.cus_odata_asiguratori1.salvare(This.OREC,This.NID)
		*!*	modificare	v 2.0.33	^
		Endcase
		
		Return PLRETURN
	ENDPROC

	PROCEDURE Init
		Lparameters toRec, tnId, tcActiune
		
		DoDefault()
		
		This.orec= toRec
		This.nid = tnId
		This.cus_odata_asiguratori1.cactiune = tcActiune
		*!*	modificare	v 2.0.33
		If tcActiune = [UPDATE]
			Thisform.ct_clb_asigurator.do_dezactiveaza()
			*!*	modificare	v 2.0.35
			If toRec.blocat = 1
				Thisform._checkbox1.Caption = [Inactiv (trebuie activat mai intai clientul cu acelasi nume)]
				Thisform._checkbox1.Enabled = .F.
			Endif
			*!*	modificare	v 2.0.35	^
		Endif
		*!*	modificare	v 2.0.33	^
		*!*	Do Case
		*!*	Case tcActiune='UPDATE'
		*!*		Thisform.clb_tx_simplu1.text_simplu1.ReadOnly=.T.
		*!*	Endcase
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_cliemasini_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" 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_putere" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_putere.Text_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_putere._lbbase1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="clb_cilindree" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu7" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_masiniclienti1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou2" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: do_adauga_dealer
		*m: do_adauga_masina
		*p: canfabricatie
		*p: nid
		*p: orec
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		canfabricatie = 
		DoCreate = .T.
		Height = 386
		Name = "frm_cliemasini_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 64
		Lb_titlu_alb_b121.Caption = "Mașină client"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 18
		BUT_TERMIN1.Left = 344
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 13
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		caction = do_adauga_masina, ;
		Left = 324, ;
		Name = "But_nou1", ;
		TabIndex = 15, ;
		Top = 45
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou2' AS but_nou WITH ;
		caction = do_adauga_dealer, ;
		Left = 324, ;
		Name = "But_nou2", ;
		TabIndex = 16, ;
		Top = 325, ;
		Visible = .F.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		_cbbase1.ControlSource = "porec.marca", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_marci.marca,id_marca", ;
		_cbbase1.RowSourceType = 6, ;
		_lbbase1.Caption = "Marcă", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu2' AS cb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Cb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 72, ;
		_cbbase1.ControlSource = "porec.masina", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_masini.masina,id_masina", ;
		_cbbase1.RowSourceType = 6, ;
		_lbbase1.Caption = "Model", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu3' AS cb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Cb_tx_simplu3", ;
		TabIndex = 12, ;
		Top = 324, ;
		_cbbase1.ControlSource = "porec.furnizor", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_dealeri.furnizor", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Caption = "Furnizor:", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_cilindree' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 29, ;
		Name = "clb_cilindree", ;
		TabIndex = 7, ;
		TabStop = .T., ;
		Top = 212, ;
		Width = 105, ;
		ZOrderSet = 13, ;
		Text_simplu1.ControlSource = "porec.Cilindree", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 56, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 45, ;
		Lb_simplu1.Caption = "Cilindree", ;
		Lb_simplu1.Left = 3, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_putere' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 133, ;
		Name = "clb_putere", ;
		TabIndex = 8, ;
		TabStop = .T., ;
		Top = 212, ;
		Width = 186, ;
		ZOrderSet = 13, ;
		Text_simplu1.ControlSource = "porec.PutereCP", ;
		Text_simplu1.Height = 23, ;
		Text_simplu1.Left = 88, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Text_simplu1.Top = 3, ;
		Text_simplu1.Width = 41, ;
		Lb_simplu1.Caption = "Putere CP/KW", ;
		Lb_simplu1.Left = 4, ;
		Lb_simplu1.Name = "Lb_simplu1", ;
		Lb_simplu1.Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'clb_putere._lbbase1' AS _lbbase WITH ;
		Caption = "/", ;
		Left = 132, ;
		Name = "_lbbase1", ;
		Top = 6
		*< END OBJECT: ClassLib="..\comun\clase\_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'clb_putere.Text_simplu2' AS _txbase WITH ;
		ControlSource = "porec.PutereKW", ;
		Format = "!K", ;
		Height = 23, ;
		Left = 138, ;
		Name = "Text_simplu2", ;
		Top = 3, ;
		Width = 43
		*< END OBJECT: ClassLib="..\comun\clase\_tx_base.vcx" BaseClass="textbox" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 3, ;
		Top = 100, ;
		Text_simplu1.ControlSource = "porec.nrinmat", ;
		Text_simplu1.MaxLength = 35, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Nr. înmatriculare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 4, ;
		Top = 128, ;
		Text_simplu1.ControlSource = "porec.culoare", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Culoare", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 5, ;
		Top = 156, ;
		Text_simplu1.ControlSource = "porec.series", ;
		Text_simplu1.MaxLength = 17, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Serie șasiu", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu4' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu4", ;
		TabIndex = 6, ;
		Top = 184, ;
		Text_simplu1.ControlSource = "porec.seriem", ;
		Text_simplu1.MaxLength = 18, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Serie motor", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu5' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu5", ;
		TabIndex = 9, ;
		Top = 240, ;
		Text_simplu1.ControlSource = "porec.kmint", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Km la bord", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu6' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu6", ;
		TabIndex = 10, ;
		Top = 268, ;
		Text_simplu1.ControlSource = "porec.anfabricatie", ;
		Text_simplu1.InputMask = "9999", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "An fabricație", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu7' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu7", ;
		TabIndex = 11, ;
		Top = 296, ;
		Text_simplu1.ControlSource = "porec.serief", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Factură achiziție", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_masiniclienti1' AS cus_odata_masiniclienti WITH ;
		Left = 108, ;
		Name = "Cus_odata_masiniclienti1", ;
		Top = 360
		*< END OBJECT: ClassLib="onom_devize.vcx" BaseClass="custom" />
	
	PROCEDURE do_adauga_dealer
		this.AlwaysOnTop = .F.
		DO viz_dealeri IN onom_devize.prg
		Do update_furnizori In update_devize.prg
		this.AlwaysOnTop = .t.
	ENDPROC

	PROCEDURE do_adauga_masina
		Private pcmarca,pcmasina
		Store "" To pcmarca,pcmasina
		Do viz_masini_marci In onom_devize.prg With .T.
		Do update_marci In update_devize.prg
		Do update_masini In update_devize.prg
		If !Empty(pcmarca)
			porec.marca=pcmarca
			porec.masina=pcmasina
			Select v_marci
			Locate For Alltrim(marca)=pcmarca
			porec.id_marca=id_marca
			Thisform.cb_tx_simplu1._CBBASE1.Refresh()
			Select v_masini
			Set Filter To id_marca = porec.id_marca
			Locate For Alltrim(masina)=pcmasina
			porec.id_masina=id_masina
			Thisform.cb_tx_simplu2._CBBASE1.SetFocus()
			Thisform.clb_tx_simplu1.SetFocus()
		Else
			Thisform.cb_tx_simplu1.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(porec.marca)
			amessagebox('Nu ati completat marca masinii!',0+48,"Atentie")
			This.cb_tx_simplu1._CBBASE1.SetFocus()
			PLRETURN=.F.
		
		Case Empty(porec.masina)
			amessagebox('Nu ati completat tipul masinii!',0+48,"Atentie")
			This.cb_tx_simplu2._CBBASE1.SetFocus()
			PLRETURN=.F.
		
		Case Empty(porec.nrinmat)
			amessagebox('Nu ati completat numarul de inmatriculare al masinii!',0+48,"Atentie")
			This.clb_tx_simplu1.text_simplu1.SetFocus()
			PLRETURN=.F.
		
		Otherwise
		*!*		If Alltrim(Upper(This.cus_odata_masiniclienti1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE")
		*!*	*!*			pcexec=[select * from ]+gcS+[.DEV_Vmasiniclienti where (TRIM(delegat)=']+Alltrim(porec.delegat)+[')]
		*!*	*!*			Do While .T.
		*!*	*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_delegat')
		*!*	*!*				If pnSucces = 0
		*!*	*!*	* instructiunea in curs de executie
		*!*	*!*				Else
		*!*	*!*					Exit
		*!*	*!*				Endif
		*!*	*!*			Enddo
		*!*	*!*			If Reccount('exista_delegat')>0
		*!*	*!*				amessagebox('Mai exista acest delegat inregistrat',0+48,"Atentie")
		*!*	*!*	*!*					This.clb_tx_simplu2.Text_simplu1.SetFocus()
		*!*	*!*						this.cb_tx_simplu1._CBBASE1.SetFocus()
		*!*	*!*					Use In exista_delegat
		*!*	*!*				plreturn=.F.
		*!*	*!*			ELSE
		*!*			PLRETURN=This.cus_odata_masiniclienti1.salvare(This.OREC,This.NID)
		*!*	*!*			ENDIF
		*!*		Else
		*!*	*!*		WAIT WINDOW "pe else"
			PLRETURN=This.cus_odata_masiniclienti1.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_masiniclienti1.cactiune = tcActiune
		If tcActiune='UPDATE'
			Select v_masini
			Set Filter To id_marca = porec.id_marca
			Go Top
		*!*		porec.id_masina = v_masini.id_masina
		*!*		porec.masina = v_masini.masina
			Thisform.cb_tx_simplu2._cbbase1.Requery
			Thisform.cb_tx_simplu2._cbbase1.Refresh
		Endif
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.InteractiveChange
		*!*	Select v_marci
		*!*	porec.id_marca = v_marci.id_marca
		*!*	amessagebox(Alltrim(Str(porec.id_masina))+" "+Alltrim(Str(Thisform.orec.id_masina)))
		*!*	*!*	DO update_masini IN update_devize.prg
		*!*	Select v_masini
		*!*	Set Filter To id_marca = v_marci.id_marca
		*!*	Go Top
		*!*	Thisform.cb_tx_simplu2._CBBASE1.Value=v_masini.masina
		*!*	Thisform.cb_tx_simplu2.Refresh
		
		porec.id_marca = v_marci.id_marca
		Select v_masini
		Set Filter To id_marca = v_marci.id_marca
		Go Top
		porec.id_masina = v_masini.id_masina
		porec.masina = v_masini.masina
		Thisform.cb_tx_simplu2._cbbase1.Requery
		Thisform.cb_tx_simplu2._cbbase1.Refresh
	ENDPROC

	PROCEDURE Cb_tx_simplu2._cbbase1.InteractiveChange
		porec.id_masina = v_masini.id_masina
	ENDPROC

	PROCEDURE Cb_tx_simplu3._cbbase1.LostFocus
		porec.id_furnizor = v_dealeri.id_furnizor
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_clienti_verif AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="grdnume" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnume.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="grdnume.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_client" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_mesaj" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_mesaj_confirmare" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_da1" UniqueID="" Timestamp="" />

	*<PropValue>
		DoCreate = .T.
		Height = 500
		Name = "frm_clienti_verif"
		Width = 432
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 432
		_shape2.Height = 29
		_shape2.Left = 396
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Visible = .F.
		_shape2.Width = 37
		Lb_titlu_alb_b121.Caption = "VERIFICĂRI"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 3
		BUT_TERMIN1.Left = 400
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Visible = .F.
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_da1' AS but_da WITH ;
		Left = 141, ;
		Name = "But_da1", ;
		TabIndex = 2, ;
		Top = 456
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nu1' AS but_nu WITH ;
		Left = 225, ;
		Name = "But_nu1", ;
		TabIndex = 1, ;
		Top = 456
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'grdnume' AS _grdrow WITH ;
		AllowHeaderSizing = .F., ;
		ColumnCount = 1, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		GridLines = 0, ;
		Height = 313, ;
		Left = 48, ;
		Name = "grdnume", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "crsnumeclienti", ;
		ScrollBars = 2, ;
		TabIndex = 5, ;
		Top = 83, ;
		Width = 336, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "cNume", ;
		Column1.Width = 316
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'grdnume.cNume.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume client", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'grdnume.cNume.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 'Lb_client' AS lb_simplu WITH ;
		Caption = "Client", ;
		FontBold = .T., ;
		FontSize = 12, ;
		Height = 22, ;
		Left = 12, ;
		Name = "Lb_client", ;
		TabIndex = 6, ;
		Top = 38, ;
		Width = 46
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'Lb_mesaj' AS lb_simplu WITH ;
		Caption = "Clienți cu nume asemănătoare", ;
		Left = 24, ;
		Name = "Lb_mesaj", ;
		TabIndex = 7, ;
		Top = 60
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'Lb_mesaj_confirmare' AS lb_simplu WITH ;
		Alignment = 2, ;
		AutoSize = .F., ;
		Caption = "Mesaj", ;
		Height = 34, ;
		Left = 24, ;
		Name = "Lb_mesaj_confirmare", ;
		TabIndex = 8, ;
		Top = 410, ;
		Width = 384, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
	
	PROCEDURE Init
		Lparameters tcNume,tnTip,tcNumeVechi
		DoDefault()
		Thisform.lb_client.Caption=tcNume
		If tnTip=1 		&& inserare
			lcMesaj="Sunteți sigur că doriți să adaugați acest client?"
		Else			&& modificare
			lcMesaj="Sunteți sigur că doriți să modificați numele clientului "+Alltrim(tcNumeVechi)+" în "+ Alltrim(tcNume)+"?"
		Endif
		SELECT crsnumeclienti
		GO top
		Thisform.lb_mesaj_confirmare.Caption=lcMesaj
		Thisform.AutoCenter=.T.
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_codutilizator AS frm_termin_renunt OF "..\comun\clase\_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="Clb_tx_simplu1" UniqueID="" Timestamp="" />

	*<PropValue>
		DoCreate = .T.
		Height = 105
		Name = "frm_codutilizator"
		Width = 375
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE2.Name = "_SHAPE2"
		LB_TITLU_ALB_B121.Caption = "Introduceti codul utilizatorului"
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		GRIDSORT1.Name = "GRIDSORT1"
		BUT_RENUNT1.Name = "BUT_RENUNT1"
	*</PropValue>

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 29, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 50, ;
		TEXT_SIMPLU1.ControlSource = "pcCodTehnician", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Cod utilizator", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\..\..\..\contafin\comun\clase\lb_tx.vcx" BaseClass="container" />

ENDDEFINE

DEFINE CLASS frm_dealeri AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="gdealeri" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdealeri.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdealeri.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdealeri.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdealeri.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_dealer" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />

	*<PropValue>
		DoCreate = .T.
		Height = 381
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_dealeri"
		Width = 404
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 408
		_shape2.Height = 29
		_shape2.Left = 280
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 125
		Lb_titlu_alb_b121.Caption = "Dealeri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 373
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 284, ;
		Name = "But_nou1", ;
		TabIndex = 4, ;
		Top = 1, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'Clb_dealer' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_dealer", ;
		TabIndex = 1, ;
		Top = 43, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Denumire", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

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

	ADD OBJECT 'gdealeri' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 288, ;
		Left = 14, ;
		Name = "gdealeri", ;
		Panel = 1, ;
		RecordSource = "v_furnizori", ;
		TabIndex = 3, ;
		Top = 84, ;
		Width = 382, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column1.Width = 314, ;
		Column2.ControlSource = "inactiv", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.Sparse = .F., ;
		Column2.Width = 32
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gdealeri.Column1.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 'gdealeri.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 27, ;
		Name = "Check1", ;
		Top = 47, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'gdealeri.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=podealeri.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform.gdealeri)
		podealeri.ca_baza1.cfiltru=lcFiltru
		podealeri.ca_baza1.afisare()
		restore_grid_tag(thisform.gdealeri)
		*!*	IF RECCOUNT('v_mecanici')>0
			thisform.gdealeri.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_mecanici.SetFocus()
		*!*	ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Select v_furnizori
		Scatter Name loRec Blank
		*!*	lorec.id_asigurator = v_asiguratori.id_asigurator
		*!*	SELECT v_asiguratori
		*!*	SCATTER NAME loRec FIELDS id_asigurator
		Select v_furnizori
		Do Adauga_Modifica_Inregistrare With "dealeri",loRec,,"INSERT",,"adddeal"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcDealer = Strtran(Upper(Alltrim(thisform.clb_dealer.texT_SIMPLU1.Value)),['],[''])
		If !Empty(lcDealer)
			lcFiltru = [denumire like '] + lcDealer + [%']
		Else
			lcFiltru = [2=2]
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('v_furnizori')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			thisform.clb_dealer.SetFocus()
		Endif
		This.LockScreen=.F.
		This.MousePointer= 0
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_furnizori')>0
			Private pniesire
			pniesire=0
			Select v_furnizori
			Scatter Name loRec
		
			Select v_furnizori
			Do Adauga_Modifica_Inregistrare With "dealeri",loRec,loRec.id_furnizor,"UPDATE",,"moddeal"
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_furnizori')>0
			Select v_furnizori
			Scatter Name loRec
			pcNume = loRec.denumire
			Do STERGE_INREGISTRARE With "dealeri",loRec.id_furnizor
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_dealeri_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Cus_odata_dealeri1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 103
		Name = "frm_dealeri_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 313
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 66
		Lb_titlu_alb_b121.Caption = "Dealer"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		BUT_TERMIN1.Left = 346
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

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

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_tx_simplu1", ;
		Top = 42, ;
		Text_simplu1.ControlSource = "porec.denumire", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Denumire:", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_dealeri1' AS cus_odata_dealeri WITH ;
		Left = 348, ;
		Name = "Cus_odata_dealeri1", ;
		Top = 60
		*< END OBJECT: ClassLib="onom_devize.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.denumire)
			amessagebox('Nu ati completat denumirea dealerului!',0+48,"Atentie")
			this.clb_tx_simplu1.text_simplu1.SetFocus()
			
			plreturn=.F.
		
		OTHERWISE
			If Alltrim(Upper(This.cus_odata_dealeri1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE") 
				pcexec=[select * from ]+gcS+[.auto_Vfurnizori where (TRIM(denumire)=']+Alltrim(porec.denumire)+[')]
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_asigurator')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_asigurator')>0
					amessagebox('Mai exista acest dealer inregistrat',0+48,"Atentie")
						This.clb_tx_simplu1.Text_simplu1.SetFocus()
						Use In exista_asigurator
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_dealeri1.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
		*!*		WAIT WINDOW "pe else"
					PLRETURN=This.cus_odata_dealeri1.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_dealeri1.cactiune = tcActiune
		*!*	Do Case
		*!*	Case tcActiune='UPDATE'
		*!*		Thisform.clb_tx_simplu1.text_simplu1.ReadOnly=.T.
		*!*	Endcase
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_delegati AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="gdelegati" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.Column5.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.cTelefon1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.cTelefon1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.cTelefon2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gdelegati.cTelefon2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_delegat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_client" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_reset1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: cclient
		*p: nidpartener		&& Pentru cautarile in functie de un partener.
	*</DefinedPropArrayMethod>

	*<PropValue>
		cclient = 
		cgridsortlist = gdelegati
		DoCreate = .T.
		Height = 441
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_delegati"
		Width = 527
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 552
		_shape2.Height = 29
		_shape2.Left = 406
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 126
		Lb_titlu_alb_b121.Caption = "Delegati"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 497
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 408, ;
		Name = "But_nou1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'Clb_client' AS clb_tx_simplu WITH ;
		Left = 26, ;
		Name = "Clb_client", ;
		TabIndex = 2, ;
		Top = 64, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Client", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_delegat' AS clb_tx_simplu WITH ;
		Left = 26, ;
		Name = "Clb_delegat", ;
		TabIndex = 1, ;
		Top = 36, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Delegat", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 326, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 3, ;
		Top = 36
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cmd_reset1' AS cmd_reset WITH ;
		Left = 326, ;
		Name = "Cmd_reset1", ;
		Top = 68
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'gdelegati' AS _grdrow WITH ;
		ColumnCount = 7, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 321, ;
		Left = 12, ;
		Name = "gdelegati", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_delegati", ;
		TabIndex = 4, ;
		Top = 108, ;
		Width = 504, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 168, ;
		Column2.ControlSource = "delegat", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 169, ;
		Column3.ControlSource = "bi", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 74, ;
		Column4.ColumnOrder = 4, ;
		Column4.ControlSource = "eliberatde", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 196, ;
		Column5.ColumnOrder = 7, ;
		Column5.ControlSource = "inactiv", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Sparse = .F., ;
		Column5.Width = 48, ;
		Column6.ColumnOrder = 5, ;
		Column6.ControlSource = "telefon1", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "cTelefon1", ;
		Column7.ColumnOrder = 6, ;
		Column7.ControlSource = "telefon2", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "cTelefon2"
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gdelegati.Column1.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 'gdelegati.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Delegat", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gdelegati.Column2.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 'gdelegati.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "BI", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gdelegati.Column3.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 'gdelegati.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Eliberat de..", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gdelegati.Column4.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 'gdelegati.Column5.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 16, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 71, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

	ADD OBJECT 'gdelegati.cTelefon1.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 'gdelegati.cTelefon2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon 2", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gdelegati.cTelefon2.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" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=podelegati.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform.gdelegati)
		podelegati.ca_baza1.cfiltru=lcFiltru
		podelegati.ca_baza1.afisare()
		restore_grid_tag(thisform.gdelegati)
		*!*	IF RECCOUNT('v_delegati')>0
			thisform.gdelegati.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_delegati.SetFocus()
		*!*	ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Select v_delegati
		Scatter Name loRec Blank
		If !Empty(Thisform.nidpartener)
			loRec.id_partener=Thisform.nidpartener
			loRec.nume=Thisform.cclient
		*!*		Do update_clienti With Thisform.nidpartener In update_devize.prg
		*!*	Else
		*!*		Do update_clienti In update_devize.prg
		Endif
		Do Adauga_Modifica_Inregistrare With "delegati",loRec,,"INSERT",,"adddeleg"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcDelegat = Strtran(Upper(Alltrim(Thisform.clb_delegat.texT_SIMPLU1.Value)),['],[''])
		lcClient = Strtran(Upper(Alltrim(Thisform.clb_client.texT_SIMPLU1.Value)),['],[''])
		If !Empty(Thisform.nidpartener)
			lcFiltru = [id_partener = ] + Alltrim(Str(Thisform.nidpartener)) + [ and ]
		Endif
		
		If !Empty(lcClient)
			lcFiltru = lcFiltru + [nume like '] + lcClient + [%' and ]
		Endif
		
		If !Empty(lcDelegat) And Empty(Thisform.nidpartener)
			lcFiltru = lcFiltru + [delegat like '] + lcDelegat + [%' and ]
		Endif
		
		lcFiltru=lcFiltru + [2=2]
		
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('v_delegati')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.clb_delegat.SetFocus()
		Endif
		This.LockScreen=.F.
		This.MousePointer= 0
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_delegati')>0
			Private pnButon
			pnButon=0
		*!*	Do update_clienti In update_devize.prg
			Select v_delegati
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "delegati",loRec,loRec.id_nom_delegati,"UPDATE",,"moddeleg"
			If pnButon=1
				This.actualizeaza_grid1()
			Endif
		ELSE
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_reset
		Thisform.clb_client.text_simplu1.Value=[]
		Thisform.clb_delegat.text_simplu1.Value=[]
		Thisform.clb_delegat.SetFocus()
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_delegati')>0
			Private pnButon
			pnButon=1
			Select v_delegati
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "delegati",lorec.id_nom_delegati
			If pnButon=1
				This.actualizeaza_grid1()
			Endif
		ELSE
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE Init
		Lparameters tnidpartener,tcPartener
		DoDefault()
		If !Empty(tnidpartener)
			Thisform.nidpartener=tnidpartener
			thisform.cclient=tcPartener
			Thisform.clb_client.text_simplu1.Value=tcPartener
			Thisform.clb_client.text_simplu1.Enabled=.F.
		Endif
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcControl = Upper(Alltrim(This.ActiveControl.Name))
		If nKeyCode = 13 And nShiftAltCtrl=0 And lcControl = 'GDELEGATI' && enter
			Nodefault
			Thisform.but_TERMIN1.SetFocus
		Else
			DoDefault(nKeyCode, nShiftAltCtrl)
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_delegati_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Cus_odata_delegati1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_delegat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_bi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_eliberatde" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_telefon1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_telefon2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_client" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 236
		Name = "frm_delegati_nou"
		Width = 375
		_SHAPE1.Name = "_SHAPE1"
		_SHAPE2.Height = 29
		_SHAPE2.Left = 312
		_SHAPE2.Name = "_SHAPE2"
		_SHAPE2.Top = 0
		_SHAPE2.Width = 65
		LB_TITLU_ALB_B121.Caption = "Delegat"
		LB_TITLU_ALB_B121.Name = "LB_TITLU_ALB_B121"
		LB_TITLU_ALB_B121.TabIndex = 10
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		Gridsort1.Left = 336
		Gridsort1.Name = "Gridsort1"
		Gridsort1.Top = 144
	*</PropValue>

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

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

	ADD OBJECT 'Clb_bi' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_bi", ;
		TabIndex = 3, ;
		Top = 92, ;
		Text_simplu1.ControlSource = "porec.bi", ;
		Text_simplu1.MaxLength = 10, ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Serie,Nr BI:", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_delegat' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_delegat", ;
		TabIndex = 2, ;
		Top = 64, ;
		Text_simplu1.ControlSource = "porec.delegat", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Delegat:", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_eliberatde' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_eliberatde", ;
		TabIndex = 4, ;
		Top = 120, ;
		Text_simplu1.ControlSource = "porec.eliberatde", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Eliberat de:", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_telefon1' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_telefon1", ;
		TabIndex = 5, ;
		Top = 148, ;
		Text_simplu1.ControlSource = "porec.telefon1", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Telefon 1", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_telefon2' AS clb_tx_simplu WITH ;
		Left = 25, ;
		Name = "Clb_telefon2", ;
		TabIndex = 6, ;
		Top = 176, ;
		Text_simplu1.ControlSource = "porec.telefon2", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Telefon 2", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_client' AS ct_clb_cautare WITH ;
		cconditie = Empty(porec.id_partener), ;
		cprocedura = Thisform.do_alege_client, ;
		cvar_afisata = porec.nume, ;
		Height = 31, ;
		Left = 24, ;
		Name = "Ct_clb_client", ;
		TabIndex = 1, ;
		Top = 35, ;
		Width = 336, ;
		img_cautare.Left = 308, ;
		img_cautare.Name = "img_cautare", ;
		img_cautare.Top = 5, ;
		clb_tx_cautare.Lb_simplu1.Caption = "Client", ;
		clb_tx_cautare.Lb_simplu1.Name = "Lb_simplu1", ;
		clb_tx_cautare.Name = "clb_tx_cautare", ;
		clb_tx_cautare.Text_simplu1.Left = 102, ;
		clb_tx_cautare.Text_simplu1.Name = "Text_simplu1", ;
		clb_tx_cautare.Text_simplu1.Top = 3, ;
		clb_tx_cautare.Width = 290
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_delegati1' AS cus_odata_delegati WITH ;
		Left = 0, ;
		Name = "Cus_odata_delegati1", ;
		Top = 144
		*< END OBJECT: ClassLib="onom_devize.vcx" BaseClass="custom" />
	
	PROCEDURE do_alege_client
		Local lnId,lcNume
		lnId=poRec.id_partener
		lcNume=poRec.nume
		If cauta_client(@lnId,@lcNume)
			poRec.id_partener=lnId
			poRec.nume=lcNume
			Thisform.ct_clb_client.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
		
		Do Case
		Case Empty(porec.nume)
			amessagebox('Nu ati completat denumirea clientului!',0+48,"Atentie")
			Thisform.ct_clb_client.SetFocus()
			plReturn=.F.
		Otherwise
		*!*		If Alltrim(Upper(This.cus_odata_delegati1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE")
		*!*			If Used('exista_del')
		*!*				Use In exista_del
		*!*			Endif
		*!*			lcSql=[select count(*) as inreg from ]+gcS+[.DEV_Vdelegati ] + ;
		*!*				[where (TRIM(delegat)=']+Alltrim(porec.delegat)+[') and ] + ;
		*!*				[id_partener=]+Alltrim(Str(porec.id_partener))
		*!*			lnSucces = goExecutor.oExecute(lcSql,'exista_del')
		*!*			If lnSucces < 0
		*!*				amessagebox(goExecutor.cEroare,0+16,"Eroare")
		*!*				plReturn=.F.
		*!*			Else
		*!*				Select exista_del
		*!*				lnInreg=exista_del.inreg
		*!*				Use In exista_del
		*!*				If lnInreg>0
		*!*					amessagebox('Mai exista acest delegat inregistrat!',0+48,"Atentie")
		*!*					Thisform.clb_client.text_simplu1.SetFocus()
		*!*					plReturn=.F.
		*!*				Else
		*!*					plReturn=This.cus_odata_delegati1.salvare(This.OREC,This.NID)
		*!*				Endif
		*!*			Endif
		*!*		Else
				plReturn=This.cus_odata_delegati1.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_delegati1.cactiune = tcActiune
		If (tcActiune='INSERT' And !Empty(toRec.id_partener)) Or tcActiune='UPDATE'
			Thisform.ct_clb_client.do_dezactiveaza()
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_dev_clienti AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="gclienti" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cNume.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cNume.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cCod_fiscal.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cCod_fiscal.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cTelefon.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cTelefon.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cAdresa.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cAdresa.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cBanca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cBanca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cCont_banca.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cCont_banca.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cReg_comert.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cReg_comert.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cJudet.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cJudet.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cLocalitate.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gclienti.cLocalitate.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column7.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column8.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column8.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column9.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column9.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column10.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column10.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column11.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column11.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column12.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column12.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column13.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column13.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column14.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column14.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_marca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_masina" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_denumire" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_nrinmat" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="ck_seriem" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_series" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_clienti" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lbMasini" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_cautare1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="but_modifica3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ck_anfabricatie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_reset2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_cautare2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Gridextra2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDiscountManopera" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDiscountMateriale" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica4" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_excel1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: actualizeaza_discount
		*m: do_activeaza_cautare2
		*m: do_adauga2
		*m: do_cauta2
		*m: do_modifica2
		*m: do_modifica_adresa
		*m: do_modifica_discount
		*m: do_salveaza_discount
		*m: do_sterge2
		*m: leditmode_assign
		*p: lcautare2
		*p: leditmode
		*p: lmasiniactive		&& .T. daca se afiseaza doar masinile active.
		*p: nidctr		&& Id contract pentru discount-uri manopera si materiale
		*p: nidtippart
	*</DefinedPropArrayMethod>

	*<PropValue>
		BorderStyle = 1
		cbuton7 = but_modifica3
		cgridsortlist = gclienti,gmasini
		DoCreate = .T.
		Height = 590
		lcautare2 = .F.
		leditmode = .F.
		lmasiniactive = .F.
		Name = "frm_dev_clienti"
		nidctr = 0
		nidtippart = 0
		Width = 774
		_memberdata = <VFPData>
			<memberdata name="nidctr" display="nIdCtr"/>
		</VFPData>
		_shape1.Anchor = 10
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 775
		_shape1.ZOrderSet = 2
		_shape2.Height = 29
		_shape2.Left = 744
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 37
		_shape2.ZOrderSet = 3
		Lb_titlu_alb_b121.Caption = "CLIENTI - Generare, Vizualizare, Modificare"
		Lb_titlu_alb_b121.FontBold = .T.
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 19
		Lb_titlu_alb_b121.ZOrderSet = 4
		BUT_TERMIN1.Anchor = 8
		BUT_TERMIN1.Left = 741
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 18
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.ZOrderSet = 8
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_label1' AS _label WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		Caption = "Discount manopera %", ;
		Height = 18, ;
		Left = 642, ;
		Name = "_label1", ;
		Top = 76, ;
		Width = 128, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT '_label2' AS _label WITH ;
		Anchor = 8, ;
		AutoSize = .F., ;
		Caption = "Discount materiale %", ;
		Height = 18, ;
		Left = 642, ;
		Name = "_label2", ;
		Top = 125, ;
		Width = 124, ;
		WordWrap = .T.
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="label" />

	ADD OBJECT 'But_cautare1' AS but_cautare WITH ;
		Left = 424, ;
		Name = "But_cautare1", ;
		TabIndex = 2, ;
		ToolTipText = "Cauta", ;
		Top = 42
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_cautare2' AS but_cautare WITH ;
		Anchor = 12, ;
		caction = do_cauta2, ;
		Left = 667, ;
		Name = "But_cautare2", ;
		TabIndex = 2, ;
		ToolTipText = "Cauta", ;
		Top = 528
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_excel1' AS but_excel WITH ;
		Anchor = 8, ;
		Left = 710, ;
		Name = "But_excel1", ;
		Top = 0
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'But_modifica2' AS but_modifica WITH ;
		Anchor = 12, ;
		caction = do_modifica2, ;
		Left = 583, ;
		Name = "But_modifica2", ;
		TabIndex = 10, ;
		ToolTipText = "Modificare masina", ;
		Top = 373, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'but_modifica3' AS but_modiparam WITH ;
		Anchor = 8, ;
		caction = do_modifica_adresa, ;
		Left = 576, ;
		Name = "but_modifica3", ;
		TabIndex = 8, ;
		ToolTipText = "Modifica adresa principala", ;
		Top = 42
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica4' AS but_modifica WITH ;
		Anchor = 8, ;
		caction = do_modifica_discount, ;
		Left = 732, ;
		Name = "But_modifica4", ;
		TabIndex = 6, ;
		ToolTipText = "Modificare discount", ;
		Top = 141
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Anchor = 8, ;
		Left = 515, ;
		Name = "But_nou1", ;
		TabIndex = 5, ;
		Top = 42
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou2' AS but_nou WITH ;
		Anchor = 12, ;
		caction = do_adauga2, ;
		Left = 549, ;
		Name = "But_nou2", ;
		TabIndex = 9, ;
		ToolTipText = "Adaugare masina", ;
		Top = 373
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset1' AS but_reset WITH ;
		Left = 463, ;
		Name = "But_reset1", ;
		TabIndex = 22, ;
		Top = 42
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_reset2' AS but_reset WITH ;
		Anchor = 12, ;
		Left = 699, ;
		Name = "But_reset2", ;
		TabIndex = 22, ;
		Top = 528
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Anchor = 8, ;
		Left = 606, ;
		Name = "But_sterge1", ;
		TabIndex = 7, ;
		Top = 42
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge2' AS but_sterge WITH ;
		Anchor = 12, ;
		caction = do_sterge2, ;
		Left = 615, ;
		Name = "But_sterge2", ;
		TabIndex = 11, ;
		ToolTipText = "Stergere masina", ;
		Top = 373, ;
		Visible = .T.
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Cb_denumire' AS cb_tx_cautare WITH ;
		cpornire = 1, ;
		Left = 106, ;
		Name = "Cb_denumire", ;
		TabIndex = 1, ;
		Top = 42, ;
		Text.Name = "Text", ;
		criteriu.Name = "criteriu"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ck_anfabricatie' AS ck_filtru_numar WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		camp_nume = anfabricatie, ;
		Caption = "An fabricatie", ;
		Left = 655, ;
		Name = "Ck_anfabricatie", ;
		TabIndex = 17, ;
		Top = 503, ;
		ZOrderSet = 25
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_marca' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		camp_nume = marca, ;
		Caption = "Marca mașinii", ;
		Left = 655, ;
		Name = "Ck_marca", ;
		TabIndex = 12, ;
		Top = 428, ;
		Width = 100, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_masina' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		camp_nume = masina, ;
		Caption = "Model", ;
		Left = 655, ;
		Name = "Ck_masina", ;
		TabIndex = 13, ;
		Top = 442, ;
		Width = 54, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_nrinmat' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		camp_nume = nrinmat, ;
		Caption = "Nr. înmatriculare", ;
		Left = 655, ;
		Name = "Ck_nrinmat", ;
		TabIndex = 14, ;
		Top = 457, ;
		Width = 114, ;
		ZOrderSet = 11
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'ck_seriem' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		camp_nume = seriem, ;
		Caption = "Serie motor", ;
		Left = 655, ;
		Name = "ck_seriem", ;
		TabIndex = 15, ;
		Top = 472, ;
		Width = 86, ;
		ZOrderSet = 12
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'Ck_series' AS ck_filtru_text WITH ;
		Alignment = 0, ;
		Anchor = 12, ;
		camp_nume = series, ;
		Caption = "Serie șasiu", ;
		Left = 655, ;
		Name = "Ck_series", ;
		TabIndex = 16, ;
		Top = 487, ;
		Width = 84, ;
		ZOrderSet = 13
		*< END OBJECT: ClassLib="..\comun\clase\caut_ora.vcx" BaseClass="checkbox" />

	ADD OBJECT 'gclienti' AS _grdrow WITH ;
		Anchor = 15, ;
		ColumnCount = 9, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 274, ;
		Left = 12, ;
		Name = "gclienti", ;
		Panel = 1, ;
		RecordSource = "v_clie", ;
		RowHeight = 19, ;
		TabIndex = 3, ;
		Top = 74, ;
		Width = 624, ;
		ZOrderSet = 6, ;
		Column1.ControlSource = "denumire", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "cNume", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 239, ;
		Column2.ControlSource = "cod_fiscal", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "cCod_fiscal", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 91, ;
		Column3.ControlSource = "telefon", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "cTelefon", ;
		Column3.ReadOnly = .T., ;
		Column4.ControlSource = "adresa", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "cAdresa", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 270, ;
		Column5.ControlSource = "banca", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "cBanca", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 114, ;
		Column6.ControlSource = "cont_banca", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "cCont_banca", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 52, ;
		Column7.ControlSource = "reg_comert", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "cReg_comert", ;
		Column7.ReadOnly = .T., ;
		Column7.Width = 133, ;
		Column8.ColumnOrder = 9, ;
		Column8.ControlSource = "judet", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.Name = "cJudet", ;
		Column8.ReadOnly = .T., ;
		Column8.Visible = .T., ;
		Column8.Width = 68, ;
		Column9.ColumnOrder = 8, ;
		Column9.ControlSource = "localitate", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "cLocalitate", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 127
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gclienti.cAdresa.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 'gclienti.cBanca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Banca", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gclienti.cBanca.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 'gclienti.cCod_fiscal.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 'gclienti.cCod_fiscal.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 'gclienti.cCont_banca.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cont", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gclienti.cCont_banca.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 'gclienti.cJudet.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Judet", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gclienti.cJudet.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, ;
		Visible = .T.
		*< END OBJECT: BaseClass="textbox" />

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

	ADD OBJECT 'gclienti.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 'gclienti.cNume.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume client", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gclienti.cNume.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 'gclienti.cReg_comert.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr.Reg.Com.", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gclienti.cReg_comert.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 'gclienti.cTelefon.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Telefon", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gclienti.cTelefon.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 'gmasini' AS _grdrow WITH ;
		Anchor = 14, ;
		ColumnCount = 14, ;
		DeleteMark = .F., ;
		FontSize = 10, ;
		Height = 173, ;
		Left = 12, ;
		Name = "gmasini", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_masiniclie", ;
		RowHeight = 19, ;
		TabIndex = 4, ;
		Top = 403, ;
		Width = 633, ;
		ZOrderSet = 7, ;
		Column1.ControlSource = "marca", ;
		Column1.FontName = "Arial", ;
		Column1.FontSize = 10, ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 96, ;
		Column2.ControlSource = "masina", ;
		Column2.FontName = "Arial", ;
		Column2.FontSize = 10, ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 93, ;
		Column3.ControlSource = "nrinmat", ;
		Column3.FontName = "Arial", ;
		Column3.FontSize = 10, ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 99, ;
		Column4.ControlSource = "culoare", ;
		Column4.FontName = "Arial", ;
		Column4.FontSize = 10, ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Width = 77, ;
		Column5.ControlSource = "series", ;
		Column5.FontName = "Arial", ;
		Column5.FontSize = 10, ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 138, ;
		Column6.ControlSource = "seriem", ;
		Column6.FontName = "Arial", ;
		Column6.FontSize = 10, ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Width = 107, ;
		Column7.ControlSource = "kmint", ;
		Column7.FontName = "Arial", ;
		Column7.FontSize = 10, ;
		Column7.Name = "Column7", ;
		Column7.ReadOnly = .T., ;
		Column8.ColumnOrder = 11, ;
		Column8.ControlSource = "anfabricatie", ;
		Column8.FontName = "Arial", ;
		Column8.FontSize = 10, ;
		Column8.InputMask = "9999", ;
		Column8.Name = "Column8", ;
		Column8.ReadOnly = .T., ;
		Column8.Width = 76, ;
		Column9.ColumnOrder = 12, ;
		Column9.ControlSource = "serief", ;
		Column9.FontName = "Arial", ;
		Column9.FontSize = 10, ;
		Column9.Name = "Column9", ;
		Column9.ReadOnly = .T., ;
		Column9.Width = 104, ;
		Column10.ColumnOrder = 13, ;
		Column10.ControlSource = "furnizor", ;
		Column10.FontName = "Arial", ;
		Column10.FontSize = 10, ;
		Column10.Name = "Column10", ;
		Column10.ReadOnly = .T., ;
		Column10.Width = 133, ;
		Column11.ColumnOrder = 14, ;
		Column11.ControlSource = "inactiv", ;
		Column11.FontName = "Arial", ;
		Column11.FontSize = 10, ;
		Column11.Name = "Column11", ;
		Column11.ReadOnly = .T., ;
		Column11.Sparse = .F., ;
		Column11.Visible = .T., ;
		Column11.Width = 36, ;
		Column12.ColumnOrder = 8, ;
		Column12.ControlSource = "cilindree", ;
		Column12.FontName = "Arial", ;
		Column12.FontSize = 10, ;
		Column12.Name = "Column12", ;
		Column12.ReadOnly = .T., ;
		Column12.Width = 54, ;
		Column13.ColumnOrder = 9, ;
		Column13.ControlSource = "puterecp", ;
		Column13.FontName = "Arial", ;
		Column13.FontSize = 10, ;
		Column13.Name = "Column13", ;
		Column13.ReadOnly = .T., ;
		Column13.Width = 64, ;
		Column14.ColumnOrder = 10, ;
		Column14.ControlSource = "puterekw", ;
		Column14.FontName = "Arial", ;
		Column14.FontSize = 10, ;
		Column14.Name = "Column14", ;
		Column14.ReadOnly = .T., ;
		Column14.Width = 68
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gmasini.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 'gmasini.Column10.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Furnizor", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column11.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Height = 17, ;
		Left = 30, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 40, ;
		Visible = .T., ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

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

	ADD OBJECT 'gmasini.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 'gmasini.Column13.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Putere CP", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column14.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Putere KW", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.Column14.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 'gmasini.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Model", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nr. inmatriculare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Culoare", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie sasiu", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Serie motor", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Km. la bord", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column8.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "An fabricatie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'gmasini.Column9.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Fact. de achizitie", ;
		FontName = "Arial", ;
		FontSize = 10, ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gmasini.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 'Gridextra1' AS gridextra WITH ;
		gridexpression = Thisform.gclienti, ;
		Left = 708, ;
		Name = "Gridextra1", ;
		Top = 33
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'Gridextra2' AS gridextra WITH ;
		gridexpression = Thisform.gmasini, ;
		Left = 660, ;
		Name = "Gridextra2", ;
		Top = 408
		*< END OBJECT: ClassLib="..\comun\utile\gridextras\gridextras.vcx" BaseClass="custom" />

	ADD OBJECT 'lb_clienti' AS lb_simplu WITH ;
		Caption = "Nume client", ;
		Left = 24, ;
		Name = "lb_clienti", ;
		TabIndex = 21, ;
		Top = 47
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />

	ADD OBJECT 'lbMasini' AS _lbbase WITH ;
		Anchor = 4, ;
		BackStyle = 0, ;
		Caption = "Mașini", ;
		FontBold = .T., ;
		Left = 17, ;
		Name = "lbMasini", ;
		TabIndex = 20, ;
		Top = 378, ;
		ZOrderSet = 16
		*< END OBJECT: ClassLib="..\comun\clase\_lb_base.vcx" BaseClass="label" />

	ADD OBJECT 'txtDiscountManopera' AS _textbox WITH ;
		Anchor = 8, ;
		Format = "K", ;
		Height = 23, ;
		Left = 642, ;
		Name = "txtDiscountManopera", ;
		ReadOnly = .T., ;
		Top = 97, ;
		Width = 68
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="textbox" />

	ADD OBJECT 'txtDiscountMateriale' AS _textbox WITH ;
		Anchor = 8, ;
		Format = "K", ;
		Height = 23, ;
		Left = 642, ;
		Name = "txtDiscountMateriale", ;
		ReadOnly = .T., ;
		Top = 143, ;
		Width = 68
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="textbox" />
	
	PROCEDURE actualizeaza_discount
		LPARAMETERS tnIdPart
		LOCAL lnDiscountManopera, lnDiscountMateriale, lnIdCtr
		citeste_discount_contract(m.tnIdPart, @lnIdCtr, @lnDiscountManopera, @lnDiscountMateriale)
		
		this.nIdCtr = lnIdCtr
		this.txtDiscountManopera.Value = m.lnDiscountManopera
		this.txtDiscountMateriale.Value = m.lnDiscountMateriale
		
		this.txtDiscountManopera.Refresh
		this.txtDiscountMateriale.Refresh
		
	ENDPROC

	PROCEDURE actualizeaza_grid1
		Lparameters lcFiltru
		
		*!*	IF !tlFmasini AND thisform.ck_client.Value # 1
		*!*		lcFiltru = [2 = 2]
		*!*	ENDIF
		*!*	modificare v 2.0.6
		*!*	If !Thisform.lCautare2 And Empty(This.clb_denumire.text_simplu1.Value)
		If !Thisform.lCautare2 And Empty(This.cb_denumire.text.Value) AND VAL(This.cb_denumire.criteriu.Value) < 6
		*!*	modificare v 2.0.6	^
			lcFiltru = [a.id_tip_part = ] + Alltrim(Str(Thisform.nidtippart)) + [ and b.inactiv=0]
		Endif
		
		If Empty(lcFiltru)
			lcFiltru = poclie.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		Thisform.gclienti.salveaza_grid()
		poclie.ca_baza1.cfiltru=lcFiltru
		poclie.ca_baza1.afisare()
		Thisform.gclienti.incarca_grid()
		Thisform.LockScreen=.F.
		
		Thisform.MousePointer= 0
		Select v_clie
		Go Top
		Thisform.Refresh
	ENDPROC

	PROCEDURE actualizeaza_grid2
		Lparameters lcFiltru2
		
		If Empty(lcFiltru2)
			lcFiltru2 = pomasini.ca_baza1.cfiltru
		Endif
		Thisform.MousePointer= 11
		Thisform.LockScreen=.T.
		
		Thisform.GMASINI.salveaza_grid()
		pomasini.ca_baza1.cfiltru=lcFiltru2
		pomasini.ca_baza1.afisare()
		Thisform.GMASINI.incarca_grid()
		If Thisform.lcautare2
			Select v_masiniclie
			If Reccount() = 1
				lcFiltru = [a.id_tip_part = ] + Alltrim(Str(Thisform.nidtippart)) +  ;
					[and b.inactiv=0 and b.id_part = ]+ Alltrim(Str(id_partener))
				Thisform.actualizeaza_grid1(lcFiltru)
			Endif
		Endif
		Thisform.LockScreen=.F.
		
		Thisform.MousePointer= 0
		Select v_masiniclie
		Go Top
		Thisform.Refresh
	ENDPROC

	PROCEDURE do_activeaza_cautare2
		Local lnBife
		lnBife = Thisform.ck_anfabricatie.Value + Thisform.ck_marca.Value + Thisform.ck_masina.Value + Thisform.ck_nrinmat.Value + ;
			thisform.ck_seriem.Value + Thisform.ck_series.Value
		If lnBife > 0
			Thisform.cb_denumire.criteriu.Enabled = .F.
			Thisform.cb_denumire.Text.Enabled = .F.
			Thisform.but_cautare1.Visible = .F.
		Else
			Thisform.cb_denumire.criteriu.Enabled = .T.
			Thisform.cb_denumire.Text.Enabled = .T.
			Thisform.but_cautare1.Visible = .T.
		Endif
	ENDPROC

	PROCEDURE do_adauga
		loRec = nom_parteneri_nou(Thisform.nidtippart,Thisform.lb_titlu_alb_b121.Caption,1)
		If gnButon = 1
			If !Isnull(loRec)
		*!*			loRecAdresa = adrese_parteneri_nou(loRec.id_part)
		*!*	modificare v 2.0.6
		*!*			Thisform.clb_denumire.text_simplu1.Value = ALLTRIM(loRec.denumire)
				Thisform.cb_denumire.Text.Value = ALLTRIM(loRec.denumire)
		*!*	modificare v 2.0.6	^
				Thisform.do_cauta()
				Select v_clie
				Locate For id_part = loRec.id_part
				If !Found()
					Locate
				Endif
			Endif
			This.gclienti.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_adauga2
		Private pniesire
		pniesire=0
		Select v_masiniclie
		Do update_marci In update_devize.prg
		Do update_masini In update_devize.prg
		Do update_furnizori In update_devize.prg
		
		Select v_masiniclie
		Scatter Name loRec Blank
		loRec.id_partener = v_clie.id_part
		Do Adauga_Modifica_Inregistrare With "cliemasini",loRec,,"INSERT",,"addmasclie"
		If pniesire=1
			This.actualizeaza_grid2()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru1,lcFiltru2,lcNume
		Store '' To lcFiltru1,lcFiltru2
		lcFiltru1 = [a.id_tip_part=] + Alltrim(Str(Thisform.nidtippart))+[ and b.inactiv=0]
		lcFiltru2 = [1=2]
		lnCriteriu = Val(Thisform.cb_denumire.criteriu.Value)
		lcNume = Strtran(Upper(Alltrim(This.cb_denumire.Text.Value)),['],[''])
		Do Case
		Case lnCriteriu=1
			lcFiltru1 = lcFiltru1 + [ and b.denumire LIKE '] + Upper(Alltrim(lcNume)) + [%']
		Case lnCriteriu=2
			lcFiltru1 = lcFiltru1 + [ and b.denumire ='] + Upper(Alltrim(lcNume)) + [']
		Case lnCriteriu=3
			lcFiltru1 = lcFiltru1 + [ and b.denumire !='] + Upper(Alltrim(lcNume)) + [']
		Case lnCriteriu=4
			lcFiltru1 = lcFiltru1 + [ and b.denumire LIKE '%] + Upper(Alltrim(lcNume)) + [%']
		Case lnCriteriu=5
			lcFiltru1 = lcFiltru1 + [ and b.denumire NOT LIKE '%] + Upper(Alltrim(lcNume)) + [%']
		Case lnCriteriu=6
			lcFiltru1 = lcFiltru1
		Endcase
		Thisform.lcautare2 = .F.
		
		Thisform.actualizeaza_grid1(lcFiltru1)
		If Reccount('v_clie') > 0
			Select v_clie
			Go Top
			Thisform.gclienti.SetFocus()
		Else
			Thisform.actualizeaza_grid2([1=2])
			amessagebox("Cautarea nu a intors rezultate!",64,"Info cautare clienti")
			Thisform.cb_denumire.Text.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_cauta2
		Local lcFiltru1,lcFiltru2,llFMasini,lcNume
		Store '' To lcFiltru1,lcFiltru2
		lcFiltru1 = [1=2]
		lcFiltru2 = [id_partener not in (select id_part from nom_parteneri where sters = 1 or inactiv = 1)] + ;
			iif(Thisform.lmasiniactive,[ and inactiv = 0],[])	&&	modificare	v 2.1.1
		
		If Thisform.ck_marca.Value = 1
			lcFiltru2 = lcFiltru2 + Thisform.ck_marca.filtru
		Endif
		
		If Thisform.ck_masina.Value = 1
			lcFiltru2 = lcFiltru2 + Thisform.ck_masina.filtru
		Endif
		
		If Thisform.ck_nrinmat.Value = 1
			lcFiltru2 = lcFiltru2 + Thisform.ck_nrinmat.filtru
		Endif
		
		If Thisform.ck_seriem.Value = 1
			lcFiltru2 = lcFiltru2 + Thisform.ck_seriem.filtru
		Endif
		
		If Thisform.ck_series.Value = 1
			lcFiltru2 = lcFiltru2 + Thisform.ck_series.filtru
		Endif
		
		If Thisform.ck_anfabricatie.Value = 1
			lcFiltru2 = lcFiltru2 + Thisform.ck_anfabricatie.filtru
		Endif
		
		Thisform.lcautare2 = .T.
		Thisform.actualizeaza_grid2(lcFiltru2)
		If Reccount('v_masiniclie')>0
			Select v_masiniclie
			Go Top
			Thisform.gmasini.SetFocus()
		Else
			Thisform.actualizeaza_grid1([1=2])
			amessagebox("Cautarea nu a intors rezultate!",64,"Info cautare masini")
			Thisform.ck_marca.SetFocus()
		Endif
		
	ENDPROC

	PROCEDURE do_excel
		lcSql = [SELECT * FROM AUTO_VCLIENTIMASINI]
		llSucces = goExecutor.oExecuta(m.lcSql, "cauto_clientimasini")
		IF m.llSucces
			goExport.export2xlsx("cauto_clientimasini", "auto_clientimasini")
		ENDIF 	
		
		
	ENDPROC

	PROCEDURE do_modifica
		LOCAL lnIdPart
		If Thisform.but_modifica1.Visible
			If Reccount('v_clie')>0
				Select v_clie
				lnIdPart = id_part
				loRec = nom_parteneri_modifica(lnIdPart,Thisform.nidtippart,Thisform.lb_titlu_alb_b121.Caption,1)
				If !Isnull(loRec)
					This.actualizeaza_grid1()
					Select v_clie
					Locate For id_part = lnIdPart
					If !Found()
						Locate
					ENDIF
					thisform.gclienti.Refresh()
				Endif
			Endif
		Endif
	ENDPROC

	PROCEDURE do_modifica2
		If Reccount('v_masiniclie')>0
			Private pniesire
			pniesire=0
		
			Select v_masiniclie
			Do update_marci In update_devize.prg
			Do update_masini In update_devize.prg
			Do update_furnizori In update_devize.prg
		
			Select v_masiniclie
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "cliemasini",loRec,loRec.id_masiniclient,"UPDATE",,"modmasclie"
			If pniesire=1
				This.actualizeaza_grid2()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_modifica_adresa
		LOCAL lnIdAdresa, lnIdPart, loRec
		
		If Thisform.but_modifica3.Visible
			If Reccount('v_clie')>0
				lnIdAdresa = v_clie.id_adresa
				lnIdPart = v_clie.id_part
				
				IF !EMPTY(lnIdAdresa) AND !ISNULL(lnIdAdresa)
					loRec = adrese_parteneri_modifica(lnIdAdresa) && in onomenclatoare.prg
				ELSE 
					loRec = adrese_parteneri_nou(lnIdPart) && in onomenclatoare.prg		
				ENDIF 
				
				IF !ISNULL(loRec)
					This.actualizeaza_grid1()
					SELECT v_clie
					LOCATE FOR id_part = lnIdPart 
					IF !FOUND()
						LOCATE
					ENDIF 					
				ENDIF 	
			Endif
		ENDIF
	ENDPROC

	PROCEDURE do_modifica_discount
		IF !This.lEditMode
			This.lEditmode = .T.
		ELSE
			llSucces = This.do_salveaza_discount()
			IF !m.llSucces
				thisform.actualizeaza_discount()
			ELSE
				This.lEditmode = .F.	
			ENDIF 
			
		ENDIF 
		
	ENDPROC

	PROCEDURE do_reset
		*!*	thisform.ck_client.Value = 0
		Thisform.ck_marca.Value = 0
		Thisform.ck_masina.Value = 0
		Thisform.ck_nrinmat.Value = 0
		Thisform.ck_seriem.Value = 0
		Thisform.ck_series.Value = 0
		Thisform.ck_anfabricatie.Value = 0
		*!*	modificare v 2.0.6
		*!*	Thisform.clb_denumire.text_simplu1.Value = ''
		*!*	Thisform.clb_denumire.text_simplu1.Enabled = .T.
		*!*	Thisform.clb_denumire.text_simplu1.SetFocus()
		Thisform.do_activeaza_cautare2()
		Thisform.cb_denumire.text.Value = ''
		Thisform.cb_denumire.do_initializeaza_ct()
		Thisform.cb_denumire.SetFocus()
		*!*	modificare v 2.0.6	^
		Thisform.Refresh()
	ENDPROC

	PROCEDURE do_salveaza_discount
		Local llSucces, lnIdCtr, lnIdPart, lnProcDiscountManopera, lnProcDiscountMateriale
		lnIdPart = v_clie.id_part
		lnIdCtr = This.nIdCtr
		lnProcDiscountManopera = This.txtDiscountManopera.Value
		lnProcDiscountMateriale = This.txtDiscountMateriale.Value
		llSucces = salveaza_discount_contract(m.lnIdPart, m.lnIdCtr, m.lnProcDiscountManopera, m.lnProcDiscountMateriale)
		
		RETURN m.llSucces
		
	ENDPROC

	PROCEDURE do_sterge
		If Thisform.but_sterge1.Visible
			If Reccount('v_clie')>0
				Select v_clie
				Scatter Name loRec
				pcNume = loRec.nume
				Do STERGE_INREGISTRARE With "parteneri",loRec.id_part
				This.actualizeaza_grid1()
			Else
				amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
			Endif
		Endif
		
	ENDPROC

	PROCEDURE do_sterge2
		If Reccount('v_masiniclie')>0
			Select v_masiniclie
			Scatter Name loRec
		*!*	pcNume = lorec.nume
			Do STERGE_INREGISTRARE With "masiniclienti",loRec.id_masiniclient
			This.actualizeaza_grid2()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE Init
		*!* 19.08.2015
		*!* marius.mutu
		*!* drepturi buton modificare adresa
		
		*!*	modificare	v 2.1.1
		lparameters tlDoarMasiniActive
		Thisform.lmasiniactive = tlDoarMasiniActive
		*!*	modificare	v 2.1.1	^
		DoDefault()
		Thisform.nidtippart = GetContIdTipPart("4111")
		Thisform.cb_denumire.do_initializeaza_ct()
		Thisform.cb_denumire.Text.SetFocus()
		Thisform.gmasini.SetAll("DynamicBackColor","IIF(inactiv=1,rgb(128,128,128),rgb(255,255,255))","Column")	&&	modificare	v 2.1.1
		Bindevent(Thisform.ck_anfabricatie,"InteractiveChange",Thisform,"do_activeaza_cautare2",1)
		Bindevent(Thisform.ck_marca,"InteractiveChange",Thisform,"do_activeaza_cautare2",1)
		Bindevent(Thisform.ck_masina,"InteractiveChange",Thisform,"do_activeaza_cautare2",1)
		Bindevent(Thisform.ck_nrinmat,"InteractiveChange",Thisform,"do_activeaza_cautare2",1)
		Bindevent(Thisform.ck_seriem,"InteractiveChange",Thisform,"do_activeaza_cautare2",1)
		Bindevent(Thisform.ck_series,"InteractiveChange",Thisform,"do_activeaza_cautare2",1)
		
		thisform.but_modifica3.Visible = THISFORM.lactiv7 && modificare adresa
		thisform.but_modifica4.Visible = THISFORM.lactiv6 && modificare discount 
		
		this.gridextra1.setup()
		this.gridextra2.setup()
		
	ENDPROC

	PROCEDURE KeyPress
		Lparameters nKeyCode, nShiftAltCtrl
		lcControl = Upper(Alltrim(This.ActiveControl.Name))
		Do Case
		Case  nKeyCode = 13 And lcControl = 'TEXT'
			Nodefault
			Thisform.do_cauta()
		Case Between(nKeyCode,32,122) And lcControl = 'GCLIENTI'
			Nodefault
			Thisform.cb_denumire.Text.SetFocus()
			Thisform.cb_denumire.Text.Value = Alltrim(Thisform.cb_denumire.Text.Value) + Chr(nKeyCode)
			Keyboard '{END}'
		Case nKeyCode = 127 And lcControl = 'GCLIENTI'					&& backspace
			Nodefault
			Thisform.cb_denumire.Text.Value = Left(Alltrim(Thisform.cb_denumire.Text.Value),Len(Alltrim(Thisform.cb_denumire.Text.Value))-1)
			Thisform.cb_denumire.Text.SetFocus()
			Keyboard '{END}'
		Otherwise
			DoDefault(nKeyCode, nShiftAltCtrl)
		Endcase
		
	ENDPROC

	PROCEDURE leditmode_assign
		LPARAMETERS vNewVal
		*To do: Modify this routine for the Assign method
		THIS.lEditMode = m.vNewVal
		
		IF THIS.lEditMode 
			&& intru in modul editare
			this.txtDiscountManopera.ReadOnly = .F.
			this.txtDiscountMateriale.ReadOnly = .F.	
			This.but_modifica4.cpictureup="save_sus.bmp"
			This.but_modifica4.cpicturedown="save_jos.bmp"
			this.txtDiscountManopera.SetFocus()
		ELSE 
			this.txtDiscountManopera.ReadOnly = .T.
			this.txtDiscountMateriale.ReadOnly = .T.	
			This.but_modifica4.cpictureup="modific_sus.bmp"
			This.but_modifica4.cpicturedown="modific_jos.bmp"	
		ENDIF 
		this.txtDiscountManopera.Refresh
		this.txtDiscountMateriale.Refresh
		this.but_modifica4.Refresh
	ENDPROC

	PROCEDURE Show
		LPARAMETERS nStyle
		DODEFAULT(nStyle)
		* Centrez fereastra si o fac 70% din ecran
		lnHeight = _screen.Height
		lnWidth = _screen.Width
		This.Height = INT(0.7 * m.lnHeight)
		this.Width = INT(0.7 * m.lnWidth)
		this.AutoCenter = .T. 
		
	ENDPROC

	PROCEDURE gclienti.AfterRowColChange
		Lparameters nColIndex
		*!*	If (Thisform.ck_marca.Value # 1 And Thisform.ck_masina.Value # 1 And Thisform.ck_nrinmat.Value # 1 And;
		*!*			thisform.ck_seriem.Value # 1 And Thisform.ck_series.Value # 1)
		Local lcFiltru, llSucces
		If !Thisform.lcautare2
			If v_clie.id_part <> 0
				lcFiltru = [id_partener = ] + Alltrim(Str(v_clie.id_part)) + ;
					iif(Thisform.lmasiniactive, [ and inactiv = 0], [])	&&	modificare	v 2.1.1
			Else
				lcFiltru = [1=2]
			Endif
			* nu pune la schimbarea randului, pentru ca nu declanseaza afterrowcolchange la cautare, pentru primul rand
			Thisform.actualizeaza_grid2(lcFiltru)
			THISFORM.actualizeaza_discount(v_clie.id_part)
		Endif
	ENDPROC

	PROCEDURE gclienti.BeforeRowColChange
		LPARAMETERS nColIndex
		
		IF INLIST(this.RowColChange,1,3)
			IF Thisform.lEditMode
				IF AMESSAGEBOX('Doriti sa salvati modificarile?', 4 + 32, _screen.Caption) = 6
					llSucces = Thisform.do_salveaza_discount()
					IF !m.llSucces
						thisform.actualizeaza_discount()
						NODEFAULT
					ELSE
						Thisform.lEditmode = .F.
					ENDIF 			
				ELSE 	
					Thisform.lEditmode = .F.			
				ENDIF
			ENDIF
		ENDIF 	
	ENDPROC

	PROCEDURE gmasini.AfterRowColChange
		Lparameters nColIndex
		*!*	IF (thisform.ck_marca.Value = 1 OR thisform.ck_masina.Value = 1 OR thisform.ck_nrinmat.Value = 1 OR;
		*!*	 thisform.ck_seriem.Value = 1 OR thisform.ck_series.Value = 1)
		If Thisform.lcautare2
			lcFiltru = [a.id_tip_part = ] + Alltrim(Str(Thisform.nidtippart)) +  ;
				[and b.inactiv=0 and b.id_part = ] + Alltrim(Str(v_masiniclie.id_partener))
			Thisform.actualizeaza_grid1(lcFiltru)
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_inspectori_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_inspectori1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 114
		Name = "frm_inspectori_nou"
		Width = 332
		_shape1.Name = "_shape1"
		_shape2.Name = "_shape2"
		Lb_titlu_alb_b121.Caption = "Inspector"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Left = 301
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 3
		BUT_TERMIN1.Top = 2
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

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

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 21, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 42, ;
		Text_simplu1.ControlSource = "porec.inspector", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Inspector", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_inspectori1' AS cus_odata_inspectori WITH ;
		Left = 288, ;
		Name = "Cus_odata_inspectori1", ;
		Top = 84
		*< END OBJECT: ClassLib="onom_devize.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.inspector)
			amessagebox('Nu ati completat denumirea asiguratorului!',0+48,"Atentie")
			this.clb_tx_simplu1.text_simplu1.SetFocus()
			
			plreturn=.F.
		
		OTHERWISE
			If Alltrim(Upper(This.cus_odata_inspectori1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE") 
				pcexec=[select * from ]+gcS+[.auto_Vinspectori where (TRIM(inspector)=']+Alltrim(porec.inspector)+[')]
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_inspector')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_inspector')>0
					amessagebox('Mai exista acest inspector inregistrat',0+48,"Atentie")
						This.clb_tx_simplu1.Text_simplu1.SetFocus()
						Use In exista_inspector
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_inspectori1.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
		*!*		WAIT WINDOW "pe else"
					PLRETURN=This.cus_odata_inspectori1.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_inspectori1.cactiune = tcActiune
		Do Case
		Case tcActiune='UPDATE'
			Thisform.clb_tx_simplu1.text_simplu1.ReadOnly=.T.
		Endcase
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_marci_masini AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="_shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmarci" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmarci.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmarci.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmarci.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmarci.Column2.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gmasini.Column3.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Lb_titlu_alb_b122" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_marca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 481
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_marci_masini"
		Width = 409
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 408
		_shape1.ZOrderSet = 1
		_shape2.Height = 29
		_shape2.Left = 283
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 128
		_shape2.ZOrderSet = 2
		Lb_titlu_alb_b121.Caption = "Mărci"
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 12
		Lb_titlu_alb_b121.ZOrderSet = 3
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 380
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 11
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		BUT_TERMIN1.ZOrderSet = 4
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

	ADD OBJECT '_shape3' AS _shape WITH ;
		BackColor = 0,64,128, ;
		BorderColor = 128,128,128, ;
		Height = 29, ;
		Left = -9, ;
		Name = "_shape3", ;
		Top = 270, ;
		Width = 456, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 318, ;
		Name = "But_modifica1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_modifica2' AS but_modifica WITH ;
		caction = do_modifica2, ;
		Height = 27, ;
		Left = 352, ;
		Name = "But_modifica2", ;
		TabIndex = 9, ;
		Top = 271, ;
		Visible = .T., ;
		Width = 30, ;
		ZOrderSet = 9
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 287, ;
		Name = "But_nou1", ;
		TabIndex = 4, ;
		Top = 1, ;
		Width = 30, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou2' AS but_nou WITH ;
		caction = do_adauga2, ;
		Height = 27, ;
		Left = 323, ;
		Name = "But_nou2", ;
		TabIndex = 8, ;
		Top = 271, ;
		Width = 30, ;
		ZOrderSet = 8
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 348, ;
		Name = "But_sterge1", ;
		TabIndex = 6, ;
		Top = 1, ;
		Visible = .T., ;
		Width = 30, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge2' AS but_sterge WITH ;
		caction = do_sterge2, ;
		Height = 27, ;
		Left = 380, ;
		Name = "But_sterge2", ;
		TabIndex = 10, ;
		Top = 271, ;
		Visible = .T., ;
		Width = 30, ;
		ZOrderSet = 10
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_marca' AS clb_tx_simplu WITH ;
		Left = 12, ;
		Name = "Clb_marca", ;
		TabIndex = 1, ;
		Top = 36, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Marca", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

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

	ADD OBJECT 'gmarci' AS _grdrow WITH ;
		ColumnCount = 2, ;
		DeleteMark = .F., ;
		Height = 182, ;
		Left = 12, ;
		Name = "gmarci", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_marci", ;
		TabIndex = 3, ;
		Top = 80, ;
		Width = 384, ;
		ZOrderSet = 5, ;
		Column1.ControlSource = "marca", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 301, ;
		Column2.ControlSource = "inactiv", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Sparse = .F., ;
		Column2.Width = 47
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gmarci.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 'gmarci.Column2.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 19, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 35, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'gmasini' AS _grdrow WITH ;
		ColumnCount = 3, ;
		DeleteMark = .F., ;
		Height = 164, ;
		Left = 12, ;
		Name = "gmasini", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_masini", ;
		TabIndex = 7, ;
		Top = 310, ;
		Width = 384, ;
		ZOrderSet = 6, ;
		Column1.ControlSource = "masina", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 135, ;
		Column2.ControlSource = "sctip", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 167, ;
		Column3.ControlSource = "inactiv", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Sparse = .F., ;
		Column3.Width = 48
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

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

	ADD OBJECT 'gmasini.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 'gmasini.Column3.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		Height = 17, ;
		Left = 17, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 62, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'Lb_titlu_alb_b122' AS lb_titlu_alb_b12 WITH ;
		Caption = "Modele", ;
		Left = 6, ;
		Name = "Lb_titlu_alb_b122", ;
		TabIndex = 13, ;
		Top = 274
		*< END OBJECT: ClassLib="..\comun\clase\lb.vcx" BaseClass="label" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=pomarci.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform.gmarci)
		pomarci.ca_baza1.cfiltru=lcFiltru
		pomarci.ca_baza1.afisare()
		restore_grid_tag(thisform.gmarci)
		*!*	IF RECCOUNT('v_marci')>0
			thisform.gmarci.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_mecanici.SetFocus()
		*!*	ENDIF
		
	ENDPROC

	PROCEDURE actualizeaza_grid2
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=pomasini.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform.gmasini)
		pomasini.ca_baza1.cfiltru=lcFiltru
		pomasini.ca_baza1.afisare()
		restore_grid_tag(thisform.gmasini)
		*!*	IF RECCOUNT('v_marci')>0
			thisform.gmasini.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_mecanici.SetFocus()
		*!*	ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Select v_marci
		Scatter Name loRec Blank
		Do Adauga_Modifica_Inregistrare With "marci",loRec,,"INSERT",,"addmarca"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_adauga2
		If Reccount('v_marci')>0
			Private pniesire
			pniesire=0
			Select v_masini
			Scatter Name loRec Blank
			loRec.id_marca = v_marci.id_marca
			Do Adauga_Modifica_Inregistrare With "masini",loRec,,"INSERT",,"add_tip"
			If pniesire=1
				This.actualizeaza_grid2()
			Endif
		Else
			amessagebox("Nu puteti adauga un model,deoarece nu ati selectat marca!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcMarca = Strtran(Upper(Alltrim(Thisform.clb_marca.texT_SIMPLU1.Value)),['],[''])
		If !Empty(lcMarca)
			lcFiltru = [marca like '] + lcMarca + [%']
		Else
			lcFiltru = [2=2]
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('v_marci')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.actualizeaza_grid2([1=2])
			Thisform.clb_marca.SetFocus()
		Endif
		This.LockScreen=.F.
		This.MousePointer= 0
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_marci')>0
			Private pniesire
			pniesire=0
			Select v_marci
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "marci",loRec,loRec.id_marca,"UPDATE",,"modmarca"
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_modifica2
		If Reccount('v_masini')>0
			Private pniesire
			pniesire=0
			Select v_masini
			Scatter Name loRec
		*!*	lorec.id_marca = v_marci.id_marca
			Do Adauga_Modifica_Inregistrare With "masini",loRec,loRec.id_masina,"UPDATE",,"modtip"
			If pniesire=1
				This.actualizeaza_grid2()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_marci')>0
			Select v_marci
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "marci",loRec.id_marca
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE do_sterge2
		If Reccount('v_masini')>0
			Select v_masini
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "masini",loRec.id_masina
			This.actualizeaza_grid2()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
	ENDPROC

	PROCEDURE inainte_de_do_termin
		If Thisform.lreturnval=.T.
			pcmarca=Alltrim(v_marci.marca)
			pcmasina=Alltrim(v_masini.masina)
		Endif
		Return .T.
		
	ENDPROC

	PROCEDURE gmarci.AfterRowColChange
		Lparameters nColIndex
		If This.RowColChange!=2
			DoDefault()
			lcFiltru=[id_marca=]+Alltrim(Str(v_marci.id_marca))
			Thisform.actualizeaza_grid2(lcFiltru)
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_marci_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_marci1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 119
		Name = "frm_marci_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 311
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 67
		Lb_titlu_alb_b121.Caption = "Marca"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 5
		BUT_TERMIN1.Left = 345
		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 = 43, ;
		Name = "_checkbox1", ;
		TabIndex = 2, ;
		Top = 85
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 39, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 48, ;
		Text_simplu1.ControlSource = "porec.marca", ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Marca", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_marci1' AS cus_odata_marci WITH ;
		Left = 336, ;
		Name = "Cus_odata_marci1", ;
		Top = 84
		*< END OBJECT: ClassLib="onom_devize.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.marca)
			amessagebox('Nu ati completat marca!',0+48,"Atentie")
			This.clb_tx_simplu1.Text_simplu1.SetFocus()
			plreturn=.F.
		OTHERWISE
			If Alltrim(Upper(This.cus_odata_marci1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE") 
				pcexec=[select * from ]+gcS+[.DEV_nom_marci where (TRIM(marca)=']+Alltrim(porec.marca)+[') and sters = 0]
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_marca')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_marca')>0
					amessagebox('Aceasta marca a mai fost inregistrata!',0+48,"Atentie")
						This.clb_tx_simplu1.Text_simplu1.SetFocus()
						Use In exista_marca
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_marci1.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
					PLRETURN=This.cus_odata_marci1.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_marci1.cactiune = tcActiune
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_masini_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Cus_odata_masini1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_tx_simplu2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 138
		Name = "frm_masini_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 310
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 71
		Lb_titlu_alb_b121.Caption = "Model"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 6
		BUT_TERMIN1.Left = 344
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

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

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Left = 39, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 44, ;
		TEXT_SIMPLU1.ControlSource = "porec.masina", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Model", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Height = 28, ;
		Left = 39, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 72, ;
		Width = 290, ;
		TEXT_SIMPLU1.ControlSource = "porec.sctip", ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Explicația", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_masini1' AS cus_odata_masini WITH ;
		Left = 336, ;
		Name = "Cus_odata_masini1", ;
		Top = 36
		*< END OBJECT: ClassLib="onom_devize.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.masina)
			amessagebox('Nu ati completat denumirea masinii!',0+48,"Atentie")
			this.clb_tx_simplu1.text_simplu1.SetFocus()
			
			plreturn=.F.
		
		OTHERWISE
			If Alltrim(Upper(This.cus_odata_masini1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE") 
				pcexec=[select * from ]+gcS+[.auto_Vmasini where (TRIM(masina)=']+Alltrim(porec.masina)+[')]
				Do While .T.
					pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_masina')
					If pnSucces = 0
		* instructiunea in curs de executie
					Else
						Exit
					Endif
				Enddo
				If Reccount('exista_masina')>0
					amessagebox('Mai exista acest model inregistrat!',0+48,"Atentie")
						This.clb_tx_simplu1.Text_simplu1.SetFocus()
						Use In exista_masina
					plreturn=.F.
				ELSE 
					PLRETURN=This.cus_odata_masini1.salvare(This.OREC,This.NID)
				ENDIF 
			ELSE 
		*!*		WAIT WINDOW "pe else"
					PLRETURN=This.cus_odata_masini1.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_masini1.cactiune = tcActiune
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_mecanici AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="gMecanici" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column5.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gMecanici.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lb_mecanici" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_executa1" UniqueID="" Timestamp="" />

	*<PropValue>
		cgridsortlist = gmecanici
		DoCreate = .T.
		Height = 445
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_mecanici"
		Width = 417
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 420
		_shape2.Height = 29
		_shape2.Left = 288
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 130
		Lb_titlu_alb_b121.Caption = "Mecanici"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 387
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 293, ;
		Name = "But_nou1", ;
		TabIndex = 4, ;
		Top = 1, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

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

	ADD OBJECT 'Cmd_executa1' AS cmd_executa WITH ;
		Caption = "\<Adaugă salariat", ;
		Height = 27, ;
		Left = 300, ;
		Name = "Cmd_executa1", ;
		Top = 408, ;
		Width = 108
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'gMecanici' AS _grdrow WITH ;
		ColumnCount = 5, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 321, ;
		Left = 3, ;
		Name = "gMecanici", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_mecanici", ;
		TabIndex = 3, ;
		Top = 72, ;
		Width = 408, ;
		Column1.ControlSource = "nume", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column1.Width = 122, ;
		Column2.ColumnOrder = 3, ;
		Column2.ControlSource = "marca", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column3", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 37, ;
		Column3.ColumnOrder = 4, ;
		Column3.ControlSource = "sectie", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column4", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 85, ;
		Column4.ColumnOrder = 5, ;
		Column4.ControlSource = "inactiv", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column5", ;
		Column4.ReadOnly = .T., ;
		Column4.Sparse = .F., ;
		Column4.Width = 31, ;
		Column5.ColumnOrder = 2, ;
		Column5.ControlSource = "prenume", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column2", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 99
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gMecanici.Column1.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 'gMecanici.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Prenume", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gMecanici.Column2.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 'gMecanici.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Marca", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gMecanici.Column3.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 'gMecanici.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Sectie", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gMecanici.Column4.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 'gMecanici.Column5.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 20, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		SpecialEffect = 1, ;
		Top = 47, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'lb_mecanici' AS clb_tx_simplu WITH ;
		Left = 16, ;
		Name = "lb_mecanici", ;
		TabIndex = 1, ;
		Top = 37, ;
		Text_simplu1.Name = "Text_simplu1", ;
		LB_SIMPLU1.Caption = "Nume", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=pomecanici.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform.gmecanici)
		pomecanici.ca_baza1.cfiltru=lcFiltru
		pomecanici.ca_baza1.afisare()
		restore_grid_tag(thisform.gmecanici)
		IF RECCOUNT('v_mecanici')>0
			thisform.gmecanici.SetFocus()
		ELSE
			thisform.lb_mecanici.SetFocus()
		ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		Do update_sectie In update_devize.prg
		pniesire=0
		Select v_mecanici
		SCATTER NAME loRec Blank
		ADDPROPERTY(loRec,'denumire',[])
		Do Adauga_Modifica_Inregistrare With "mecanici",loRec,,"INSERT",,"addmec"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcNume = Strtran(Upper(Alltrim(This.lb_mecanici.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")
			Thisform.lb_mecanici.SetFocus()
		Endif
		This.LockScreen=.F.
		Thisform.MousePointer= 0
	ENDPROC

	PROCEDURE do_executa
		If Type('gnadauga_sal') # 'U' And gnadauga_sal = 1
		*!*		Private pniesire
		*!*		pniesire=0
		*!*		Select v_mecanici
		*!*		Scatter Name loRec Blank
		*!*		AddProperty(loRec,'marca',0)
		*!*		Do Adauga_Modifica_Inregistrare With "salariati",loRec,,"INSERT"
			amessagebox("Adaugarea salariatilor se poate face din Financiar - Contabilitate, prin adaugarea unei entitati cu tipul <SALARIAT>!",48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_mecanici')>0
			Private pniesire
			Do update_sectie In update_devize.prg
			pniesire=0
			Select v_mecanici
			Scatter Name loRec
			AddProperty(loRec,'denumire',Alltrim(loRec.nume)+' '+Alltrim(Nvl(loRec.prenume,[])))
			Do Adauga_Modifica_Inregistrare With "mecanici",loRec,loRec.id_mecanic,"UPDATE",,"modmec"
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
		
		*!*	pcid_judet = loRec.id_judet
		*!*	pclocalitate = loRec.localitate
		*!*	Do Adauga_Modifica_Inregistrare With "localitati",loRec,loRec.Id_loc,"UPDATE"
		*!*	thisform.actualizeaza_grid1()
		
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_mecanici')>0
			Select v_mecanici
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "mecanici",lorec.id_mecanic
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE Init
		DoDefault()
		If Type('gnadauga_sal') = 'U' OR gnadauga_sal = 0
		*!*	amessageboxmd_executa1.Visible=.F.
			this.cmd_executa1.Visible = .F.
			Thisform.Height=406
		Endif
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_mecanici_nou AS _frmbase OF "..\..\roafacturare\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Cus_odata_mecanici1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_sectie" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Ct_clb_mecanic" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 134
		Name = "frm_mecanici_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Name = "_shape2"
		Lb_titlu_alb_b121.Caption = "Mecanic"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 6
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 4
		BUT_TERMIN1.Top = 1
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT '_checkbox1' AS _checkbox WITH ;
		Alignment = 0, ;
		Caption = "Inactiv", ;
		ControlSource = "porec.inactiv", ;
		Left = 31, ;
		Name = "_checkbox1", ;
		TabIndex = 3, ;
		Top = 109
		*< END OBJECT: ClassLib="..\..\roafacturare\comun\clase\_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'Cb_sectie' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 17, ;
		Name = "Cb_sectie", ;
		TabIndex = 2, ;
		Top = 73, ;
		Width = 314, ;
		_CBBASE1.ControlSource = "porec.sectie", ;
		_CBBASE1.Left = 126, ;
		_CBBASE1.Name = "_CBBASE1", ;
		_CBBASE1.RowSource = "v_sectie.sectie", ;
		_CBBASE1.RowSourceType = 2, ;
		_CBBASE1.Top = 3, ;
		_LBBASE1.Caption = "Secția", ;
		_LBBASE1.Name = "_LBBASE1"
		*< END OBJECT: ClassLib="..\..\roafacturare\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Ct_clb_mecanic' AS ct_clb_cautare WITH ;
		cconditie = EMPTY(porec.id_part), ;
		cprocedura = thisform.do_alege_mecanic, ;
		cvar_afisata = poRec.denumire, ;
		Left = 16, ;
		Name = "Ct_clb_mecanic", ;
		TabIndex = 1, ;
		Top = 44, ;
		img_cautare.Name = "img_cautare", ;
		clb_tx_cautare.Lb_simplu1.Caption = "Mecanic", ;
		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="..\comun\clase\caut_ora.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_mecanici1' AS cus_odata_mecanici WITH ;
		Left = 336, ;
		Name = "Cus_odata_mecanici1", ;
		Top = 60
		*< END OBJECT: ClassLib="onom_devize.vcx" BaseClass="custom" />
	
	PROCEDURE do_alege_mecanic
		Local loCauta
		loCauta = caut_personal_devize()
		If !Isnull(loCauta) And !Empty(loCauta.id_part)
			poRec.id_part = loCauta.id_part
			poRec.nume = loCauta.nume
			poRec.prenume = loCauta.prenume
			poRec.denumire = Alltrim(poRec.nume)+' '+Alltrim(poRec.prenume)
			This.ct_clb_mecanic.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 	
		
		
		Do Case
		Case Empty(NVL(poRec.denumire,''))
			amessagebox('Nu ati completat numele mecanicului!',0+48,"Atentie")
			this.ct_clb_mecanic.SetFocus()	
			plreturn=.F.
		OTHERWISE
		*!*		If Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE") 
		*!*			pcexec=[select * from ]+gcS+[.DEV_VMECANICI where (TRIM(nume)=']+Alltrim(porec.nume)+[')]
		*!*			Do While .T.
		*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_mecanic')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista_mecanic')>0
		*!*				amessagebox('Mai exista acest mecanic inregistrat',0+48,"Atentie")
		*!*	*!*					This.clb_tx_simplu2.Text_simplu1.SetFocus()
		*!*						this.cb_tx_simplu1._CBBASE1.SetFocus()
		*!*					Use In exista_mecanic
		*!*				plreturn=.F.
		*!*			ELSE 
		*!*				PLRETURN=This.cus_odata_mecanici1.salvare(This.OREC,This.NID)
		*!*			ENDIF 
		*!*		ELSE 
		*!*		WAIT WINDOW "pe else"
					PLRETURN=This.cus_odata_mecanici1.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_mecanici1.cactiune = tcActiune
		If tcActiune='UPDATE'
			This.ct_clb_mecanic.do_dezactiveaza()
		Endif
		
	ENDPROC

	PROCEDURE Cb_sectie._CBBASE1.LostFocus
		porec.id_sectie = v_sectie.id_sectie
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_norme AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="gnorme" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gnorme.Column6.Check1" 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="Cb_denop" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="opt_inactive" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = gnorme
		DoCreate = .T.
		Height = 434
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_norme"
		Width = 606
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 684
		_shape2.Height = 29
		_shape2.Left = 482
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 127
		Lb_titlu_alb_b121.Caption = "Norme"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 576
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

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

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 488, ;
		Name = "But_nou1", ;
		TabIndex = 5, ;
		Top = 1, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

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

	ADD OBJECT 'Cb_denop' AS cb_tx_cautare WITH ;
		cpornire = 1, ;
		Left = 12, ;
		Name = "Cb_denop", ;
		TabIndex = 1, ;
		Top = 33, ;
		Text.Name = "Text", ;
		Criteriu.Name = "Criteriu"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cmd_cauta1' AS cmd_cauta WITH ;
		Left = 324, ;
		Name = "Cmd_cauta1", ;
		TabIndex = 3, ;
		Top = 32
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'gnorme' AS _grdrow WITH ;
		ColumnCount = 6, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 324, ;
		Left = 10, ;
		Name = "gnorme", ;
		Panel = 1, ;
		ReadOnly = .T., ;
		RecordSource = "v_norme", ;
		TabIndex = 4, ;
		Top = 96, ;
		Width = 588, ;
		Column1.ControlSource = "masina", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column1.ReadOnly = .T., ;
		Column2.ControlSource = "ansamblu", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.ReadOnly = .T., ;
		Column2.Width = 86, ;
		Column3.ControlSource = "denop", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column3", ;
		Column3.ReadOnly = .T., ;
		Column3.Width = 245, ;
		Column4.ControlSource = "timpn", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column4", ;
		Column4.ReadOnly = .T., ;
		Column4.Sparse = .F., ;
		Column4.Width = 56, ;
		Column5.ControlSource = "codop", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column5", ;
		Column5.ReadOnly = .T., ;
		Column5.Width = 54, ;
		Column6.ControlSource = "inactiv", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Name = "Column6", ;
		Column6.ReadOnly = .T., ;
		Column6.Sparse = .F., ;
		Column6.Width = 37
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

	ADD OBJECT 'gnorme.Column1.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Model masina", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gnorme.Column1.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 'gnorme.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Ansamblu", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

	ADD OBJECT 'gnorme.Column3.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 'gnorme.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Timp normat", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gnorme.Column4.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 'gnorme.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Cod operatie", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gnorme.Column5.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 'gnorme.Column6.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 34, ;
		Name = "Check1", ;
		ReadOnly = .T., ;
		Top = 59, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

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

	ADD OBJECT 'opt_inactive' AS _optiongrup WITH ;
		AutoSize = .F., ;
		ButtonCount = 3, ;
		Height = 27, ;
		Left = 12, ;
		Name = "opt_inactive", ;
		TabIndex = 2, ;
		Top = 63, ;
		Width = 222, ;
		Option1.Caption = "Toate", ;
		Option1.Left = 5, ;
		Option1.Name = "Option1", ;
		Option1.Top = 5, ;
		Option2.Caption = "Active", ;
		Option2.Left = 81, ;
		Option2.Name = "Option2", ;
		Option2.Top = 5, ;
		Option3.BackStyle = 0, ;
		Option3.Caption = "Inactive", ;
		Option3.Height = 17, ;
		Option3.Left = 156, ;
		Option3.Name = "Option3", ;
		Option3.Top = 5, ;
		Option3.Width = 61
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="optiongroup" />
	
	PROCEDURE actualizeaza_grid1
		LPARAMETERS pcFiltru
		LOCAL lcFiltru
		lcFiltru=pcFiltru
		IF EMPTY(lcFiltru)
			lcFiltru=ponorme.ca_baza1.cfiltru
		ENDIF
		save_grid_tag(thisform.gnorme)
		ponorme.ca_baza1.cfiltru=lcFiltru
		ponorme.ca_baza1.afisare()
		restore_grid_tag(thisform.gnorme)
		*!*	IF RECCOUNT('v_delegati')>0
			thisform.gnorme.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_delegati.SetFocus()
		*!*	ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Do update_ansamble In update_devize.prg
		Do update_masini In update_devize.prg
		
		Select v_norme
		Scatter Name loRec Blank
		Do Adauga_Modifica_Inregistrare With "norme",loRec,,"INSERT",,"addnorm"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[2=2]
		lcDenop = Strtran(Upper(Alltrim(Thisform.cb_denop.Text.Value)),['],[''])
		lnCriteriu = Val(Alltrim(Thisform.cb_denop.criteriu.Value))
		Do Case
		Case lnCriteriu=1
			lcFiltru = [denop LIKE '] + Upper(Alltrim(lcDenop)) + [%']
		Case lnCriteriu=2
			lcFiltru = [denop ='] + Upper(Alltrim(lcDenop)) + [']
		Case lnCriteriu=3
			lcFiltru = [denop !='] + Upper(Alltrim(lcDenop)) + [']
		Case lnCriteriu=4
			lcFiltru = [denop LIKE '%] + Upper(Alltrim(lcDenop)) + [%']
		Case lnCriteriu=5
			lcFiltru = [denop NOT LIKE '%] + Upper(Alltrim(lcDenop)) + [%']
		Case lnCriteriu=6
			lcFiltru = [2=2]
		*!*	Case lnCriteriu=7
		*!*		lcFiltru = [denop is not null]
		Endcase
		*!*	modificare	v 2.0.9
		lnCriteriu = Thisform.opt_inactive.Value
		Do Case
		Case lnCriteriu = 1
			lcFiltru = lcFiltru
		Case lnCriteriu = 2
			lcFiltru = lcFiltru + [ AND inactiv = 0]
		Case lnCriteriu = 3
			lcFiltru = lcFiltru + [ AND inactiv = 1]
		Endcase
		*!*	modificare	v 2.0.9	^
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('v_norme')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.cb_denop.SetFocus()
		Endif
		This.LockScreen=.F.
		This.MousePointer= 0
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_norme')>0
			Private pniesire
			pniesire=0
			Do update_ansamble In update_devize.prg
			Do update_masini In update_devize.prg
		
			Select v_norme
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "norme",loRec,loRec.id_norme,"UPDATE",,"modnorm"
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_norme')>0
			Select v_norme
			Scatter Name lorec
			Do STERGE_INREGISTRARE With "norme",lorec.id_norme
		
			This.actualizeaza_grid1()
		Else
			amessagebox("Nu puteti sterge,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE Init
		DoDefault()
		This.cb_denop.do_initializeaza_ct()
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_norme_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cus_odata_norme1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_tx_simplu2" 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="_checkbox1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Height = 231
		Name = "frm_norme_nou"
		Width = 375
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 312
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 67
		Lb_titlu_alb_b121.Caption = "Norma"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 9
		BUT_TERMIN1.Left = 345
		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 = 36, ;
		Name = "_checkbox1", ;
		TabIndex = 6, ;
		Top = 202
		*< END OBJECT: ClassLib="..\comun\clase\_baza.vcx" BaseClass="checkbox" />

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

	ADD OBJECT 'Cb_tx_simplu1' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Cb_tx_simplu1", ;
		TabIndex = 1, ;
		Top = 48, ;
		Width = 326, ;
		_cbbase1.ColumnCount = 1, ;
		_cbbase1.ControlSource = "porec.masina", ;
		_cbbase1.Left = 138, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.NullDisplay = "", ;
		_cbbase1.RowSource = "v_masini.masina", ;
		_cbbase1.RowSourceType = 2, ;
		_cbbase1.Top = 3, ;
		_lbbase1.Caption = "Model mașină", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_tx_simplu2' AS cb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Cb_tx_simplu2", ;
		TabIndex = 2, ;
		Top = 76, ;
		Width = 326, ;
		_cbbase1.ColumnCount = 1, ;
		_cbbase1.ControlSource = "porec.ansamblu", ;
		_cbbase1.Left = 138, ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_ansamble.denumire", ;
		_cbbase1.RowSourceType = 2, ;
		_cbbase1.Top = 3, ;
		_lbbase1.Caption = "Ansamblu:", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu1' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Clb_tx_simplu1", ;
		TabIndex = 3, ;
		Top = 104, ;
		Width = 326, ;
		TEXT_SIMPLU1.ControlSource = "porec.denop", ;
		TEXT_SIMPLU1.Height = 23, ;
		TEXT_SIMPLU1.Left = 99, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 3, ;
		TEXT_SIMPLU1.Width = 223, ;
		LB_SIMPLU1.Caption = "Den. operație:", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu2' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Clb_tx_simplu2", ;
		TabIndex = 4, ;
		Top = 132, ;
		Width = 326, ;
		TEXT_SIMPLU1.ControlSource = "porec.timpn", ;
		TEXT_SIMPLU1.Left = 138, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 3, ;
		LB_SIMPLU1.Caption = "Timp normat:", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_tx_simplu3' AS clb_tx_simplu WITH ;
		Height = 29, ;
		Left = 22, ;
		Name = "Clb_tx_simplu3", ;
		TabIndex = 5, ;
		Top = 160, ;
		Width = 326, ;
		TEXT_SIMPLU1.ControlSource = "porec.codop", ;
		TEXT_SIMPLU1.Left = 138, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		TEXT_SIMPLU1.Top = 3, ;
		LB_SIMPLU1.Caption = "Cod operație:", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_norme1' AS cus_odata_norme WITH ;
		Left = 348, ;
		Name = "Cus_odata_norme1", ;
		Top = 36
		*< END OBJECT: ClassLib="onom_devize.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
		*!*	modificare	v 2.0.12
		*!*	Case Empty(porec.masina)
		*!*		amessagebox('Nu ati completat modelul masinii!',0+48,"Atentie")
		*!*		This.cb_tx_simplu1._cbbase1.SetFocus()
		*!*		PLRETURN=.F.
		*!*	Case Empty(porec.ansamblu)
		*!*		amessagebox('Nu ati completat ansamblul!',0+48,"Atentie")
		*!*		This.cb_tx_simplu2._cbbase1.SetFocus()
		*!*		PLRETURN=.F.
		*!*	modificare	v 2.0.12	^
		Case Empty(porec.denop)
			amessagebox('Nu ati completat denumirea operatiei!',0+48,"Atentie")
			This.clb_tx_simplu1.text_simplu1.SetFocus()
			PLRETURN=.F.
		Otherwise
		*!*		If Alltrim(Upper(This.cus_odata_norme1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE")
		*!*			pcexec=[select * from ]+gcS+[.DEV_Vnorme where (TRIM(inspector)=']+Alltrim(porec.inspector)+[')]
		*!*			Do While .T.
		*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_inspector')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista_inspector')>0
		*!*				amessagebox('Mai exista acest inspector inregistrat',0+48,"Atentie")
		*!*					This.clb_tx_simplu1.Text_simplu1.SetFocus()
		*!*					Use In exista_inspector
		*!*				plreturn=.F.
		*!*			ELSE
		*!*				PLRETURN=This.cus_odata_inspectori1.salvare(This.OREC,This.NID)
		*!*			ENDIF
		*!*		ELSE
		*!*	*!*		WAIT WINDOW "pe else"
			PLRETURN=This.cus_odata_norme1.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_norme1.cactiune = tcActiune
		
		
	ENDPROC

	PROCEDURE Cb_tx_simplu1._cbbase1.InteractiveChange
		porec.id_masina = v_masini.id_masina
		If Type('porec.marca')<>'U'
			porec.marca = v_masini.marca
		Endif
	ENDPROC

	PROCEDURE Cb_tx_simplu2._cbbase1.InteractiveChange
		porec.id_ansamblu = v_ansamble.id_ansamblu
		
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_preturi AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="gpreturi" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column5.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column5.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column6.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column6.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column7.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="gpreturi.Column7.Check1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_nou1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_modifica1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_sterge1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_marca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmd_cauta1" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		cgridsortlist = gpreturi
		DoCreate = .T.
		Height = 470
		lactiv3 = .T.
		lactiv4 = .T.
		Name = "frm_preturi"
		Width = 661
		_shape1.Height = 29
		_shape1.Left = 0
		_shape1.Name = "_shape1"
		_shape1.Top = 0
		_shape1.Width = 720
		_shape2.Height = 29
		_shape2.Left = 538
		_shape2.Name = "_shape2"
		_shape2.Top = -1
		_shape2.Width = 132
		Lb_titlu_alb_b121.Caption = "Prețuri"
		Lb_titlu_alb_b121.Height = 21
		Lb_titlu_alb_b121.Left = 6
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 8
		Lb_titlu_alb_b121.Top = 6
		Lb_titlu_alb_b121.Width = 48
		BUT_TERMIN1.Height = 27
		BUT_TERMIN1.Left = 631
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 7
		BUT_TERMIN1.Top = 0
		BUT_TERMIN1.Width = 30
		Gridsort1.Name = "Gridsort1"
	*</PropValue>

	ADD OBJECT 'But_modifica1' AS but_modifica WITH ;
		Height = 27, ;
		Left = 571, ;
		Name = "But_modifica1", ;
		TabIndex = 5, ;
		Top = 0, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_nou1' AS but_nou WITH ;
		Height = 27, ;
		Left = 541, ;
		Name = "But_nou1", ;
		TabIndex = 4, ;
		Top = 0, ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'But_sterge1' AS but_sterge WITH ;
		Height = 27, ;
		Left = 600, ;
		Name = "But_sterge1", ;
		TabIndex = 6, ;
		Top = 0, ;
		Visible = .T., ;
		Width = 30
		*< END OBJECT: ClassLib="..\comun\clase\cmd_butoane.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Clb_marca' AS clb_tx_simplu WITH ;
		Left = 36, ;
		Name = "Clb_marca", ;
		TabIndex = 1, ;
		Top = 43, ;
		TEXT_SIMPLU1.Name = "TEXT_SIMPLU1", ;
		LB_SIMPLU1.Caption = "Marca", ;
		LB_SIMPLU1.Name = "LB_SIMPLU1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

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

	ADD OBJECT 'gpreturi' AS _grdbase WITH ;
		ColumnCount = 7, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 372, ;
		Left = 12, ;
		Name = "gpreturi", ;
		Panel = 1, ;
		RecordSource = "v_preturi", ;
		TabIndex = 3, ;
		Top = 84, ;
		Width = 636, ;
		Column1.ControlSource = "marca", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column1.Width = 141, ;
		Column2.ControlSource = "asigurator", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.Width = 112, ;
		Column3.ControlSource = "pret", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Format = "R", ;
		Column3.InputMask = (get_mask(12,gnPPretV)), ;
		Column3.Name = "Column3", ;
		Column4.ControlSource = "pret_val", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Format = "R", ;
		Column4.InputMask = (get_mask(12,gnPVal)), ;
		Column4.Name = "Column4", ;
		Column5.ControlSource = "nume_val", ;
		Column5.FontName = "Arial Narrow", ;
		Column5.Name = "Column5", ;
		Column6.ControlSource = "curs", ;
		Column6.FontName = "Arial Narrow", ;
		Column6.Format = "R", ;
		Column6.InputMask = (get_mask(12,gnPCurs2)), ;
		Column6.Name = "Column6", ;
		Column6.Width = 76, ;
		Column7.ControlSource = "inactiv", ;
		Column7.FontName = "Arial Narrow", ;
		Column7.Name = "Column7", ;
		Column7.Sparse = .F., ;
		Column7.Width = 39
		*< END OBJECT: ClassLib="..\comun\clase\_grd_base.vcx" BaseClass="grid" />

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

	ADD OBJECT 'gpreturi.Column1.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 'gpreturi.Column2.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Asigurator", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gpreturi.Column2.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 'gpreturi.Column3.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret lei", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gpreturi.Column3.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 'gpreturi.Column4.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Pret valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gpreturi.Column4.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 'gpreturi.Column5.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Nume valuta", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gpreturi.Column5.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 'gpreturi.Column6.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Curs valutar", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

	ADD OBJECT 'gpreturi.Column6.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 'gpreturi.Column7.Check1' AS checkbox WITH ;
		Alignment = 0, ;
		Caption = "", ;
		Centered = .T., ;
		FontName = "Arial Narrow", ;
		Height = 17, ;
		Left = 13, ;
		Name = "Check1", ;
		Top = 83, ;
		Width = 60
		*< END OBJECT: BaseClass="checkbox" />

	ADD OBJECT 'gpreturi.Column7.Header1' AS header WITH ;
		Alignment = 2, ;
		Caption = "Inactiv", ;
		FontName = "Arial Narrow", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />
	
	PROCEDURE actualizeaza_grid1
		Lparameters pcFiltru
		Local lcFiltru
		lcFiltru=pcFiltru
		If Empty(lcFiltru)
			lcFiltru=popreturi.ca_baza1.cfiltru
		Endif
		save_grid_tag(Thisform.gpreturi)
		popreturi.ca_baza1.cfiltru=lcFiltru
		popreturi.ca_baza1.afisare()
		restore_grid_tag(Thisform.gpreturi)
		*!*	IF RECCOUNT('v_preturi')>0
		Thisform.gpreturi.SetFocus()
		*!*	ELSE
		*!*		thisform.lb_mecanici.SetFocus()
		*!*	ENDIF
		
	ENDPROC

	PROCEDURE do_adauga
		Private pniesire
		pniesire=0
		Do update_marci In update_devize.prg
		Do update_asigurator In update_devize.prg
		Do ccvalute In updateserver.prg
		Select v_preturi
		Scatter Name loRec Blank
		Do Adauga_Modifica_Inregistrare With "preturi",loRec,,"INSERT",,"addpret"
		If pniesire=1
			This.actualizeaza_grid1()
		Endif
	ENDPROC

	PROCEDURE do_cauta
		Local lcFiltru
		lcFiltru=[]
		lcMarca = Strtran(Upper(Alltrim(Thisform.clb_marca.texT_SIMPLU1.Value)),['],[''])
		If !Empty(lcMarca)
			lcFiltru = [marca like '] + lcMarca + [%']
		Else
			lcFiltru = [2=2]
		Endif
		This.MousePointer= 11
		This.LockScreen=.T.
		Thisform.actualizeaza_grid1(lcFiltru)
		If Reccount('v_preturi')=0
			amessagebox("Cautarea nu a intors rezultate!",0+64,"Info cautare")
			Thisform.clb_marca.SetFocus()
		Endif
		This.LockScreen=.F.
		This.MousePointer= 0
		
	ENDPROC

	PROCEDURE do_modifica
		If Reccount('v_preturi')>0
			Private pniesire
			pniesire=0
			Do update_marci In update_devize.prg
			Do update_asigurator In update_devize.prg
			Do ccvalute In updateserver.prg
			Select v_preturi
			Scatter Name loRec
			Do Adauga_Modifica_Inregistrare With "preturi",loRec,loRec.id_pret,"UPDATE",,"modpret"
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

	PROCEDURE do_sterge
		If Reccount('v_preturi')>0
			Private pniesire
			pniesire=0
			Select v_preturi
			Scatter Name loRec
			Do STERGE_INREGISTRARE With "preturi",loRec.id_pret
			If pniesire=1
				This.actualizeaza_grid1()
			Endif
		Else
			amessagebox("Nu puteti face modificari,deoarece in aceasta selectie nu exista inregistrari!",0+48,"Atentie")
		Endif
	ENDPROC

ENDDEFINE

DEFINE CLASS frm_preturi_nou AS _frmbase OF "..\comun\clase\_frm_base.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Cus_odata_preturi1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_marca" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_asigurator" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_pret_lei" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_pret_val" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cb_nume_val" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Clb_curs" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_checkbox1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="But_renunt1" UniqueID="" Timestamp="" />

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

	*<PropValue>
		DoCreate = .T.
		Name = "frm_preturi_nou"
		_shape1.Name = "_shape1"
		_shape2.Height = 29
		_shape2.Left = 311
		_shape2.Name = "_shape2"
		_shape2.Top = 0
		_shape2.Width = 66
		Lb_titlu_alb_b121.Caption = "Prețuri"
		Lb_titlu_alb_b121.Name = "Lb_titlu_alb_b121"
		Lb_titlu_alb_b121.TabIndex = 10
		BUT_TERMIN1.Left = 345
		BUT_TERMIN1.Name = "BUT_TERMIN1"
		BUT_TERMIN1.TabIndex = 8
		BUT_TERMIN1.Top = 1
		GRIDSORT1.Name = "GRIDSORT1"
	*</PropValue>

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

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

	ADD OBJECT 'Cb_asigurator' AS cb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Cb_asigurator", ;
		TabIndex = 2, ;
		Top = 78, ;
		_cbbase1.ColumnCount = 1, ;
		_cbbase1.ControlSource = "porec.asigurator", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_asiguratori.asigurator", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Caption = "Asigurator", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_marca' AS cb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Cb_marca", ;
		TabIndex = 1, ;
		Top = 50, ;
		_cbbase1.ColumnCount = 1, ;
		_cbbase1.ControlSource = "porec.marca", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_marci.marca", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Caption = "Marcă", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cb_nume_val' AS cb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Cb_nume_val", ;
		TabIndex = 5, ;
		Top = 162, ;
		_cbbase1.ColumnCount = 1, ;
		_cbbase1.ControlSource = "porec.nume_val", ;
		_cbbase1.Name = "_cbbase1", ;
		_cbbase1.RowSource = "v_nom_valute.nume_val", ;
		_cbbase1.RowSourceType = 2, ;
		_lbbase1.Caption = "Valută", ;
		_lbbase1.Name = "_lbbase1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_curs' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_curs", ;
		TabIndex = 6, ;
		Top = 190, ;
		Text_simplu1.ControlSource = "porec.curs", ;
		Text_simplu1.InputMask = (get_mask(12,gnPCurs2)), ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Curs:", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_pret_lei' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_pret_lei", ;
		TabIndex = 3, ;
		Top = 106, ;
		Text_simplu1.ControlSource = "porec.pret", ;
		Text_simplu1.InputMask = (get_mask(12,gnPPretV)), ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Preț (lei)", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Clb_pret_val' AS clb_tx_simplu WITH ;
		Left = 42, ;
		Name = "Clb_pret_val", ;
		TabIndex = 4, ;
		Top = 134, ;
		Text_simplu1.ControlSource = "porec.pret_val", ;
		Text_simplu1.InputMask = (get_mask(12,gnPVal)), ;
		Text_simplu1.Name = "Text_simplu1", ;
		Lb_simplu1.Caption = "Preț (valută)", ;
		Lb_simplu1.Name = "Lb_simplu1"
		*< END OBJECT: ClassLib="..\comun\clase\lb_tx.vcx" BaseClass="container" />

	ADD OBJECT 'Cus_odata_preturi1' AS cus_odata_preturi WITH ;
		Left = 348, ;
		Name = "Cus_odata_preturi1", ;
		Top = 36
		*< END OBJECT: ClassLib="onom_devize.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
		
		porec.nume_val=Thisform.cb_nume_val._CBBASE1.Value
		
		Do Case
		Case Empty(Thisform.cb_marca._CBBASE1.Value)
			amessagebox("Nu ati completat marca!",0+48,"Atentie")
			Thisform.cb_marca._CBBASE1.SetFocus()
			PLRETURN = .F.
		*!*	Case Empty(Thisform.cb_tx_simplu2._CBBASE1.Value)
		*!*		amessagebox("Nu ati completat tipul reparatiei!",0+48,"Atentie")
		*!*		Thisform.cb_tx_simplu2._CBBASE1.SetFocus()
		*!*		PLRETURN=.F.
		Case porec.Pret<0
			amessagebox('Pretul nu poate fi negativ!',0+48,"Atentie")
			This.clb_pret_lei.text_simplu1.SetFocus()
			PLRETURN = .F.
		Case !Empty(porec.Pret_val) And Empty(porec.nume_val)
			amessagebox("Nu ati ales valuta!",0+48,"Atentie")
			Thisform.cb_nume_val._CBBASE1.SetFocus()
			PLRETURN = .F.
		Case !Empty(porec.Pret_val) And Empty(porec.Curs)
			amessagebox("Nu ati completat cursul!",0+48,"Atentie")
			Thisform.clb_curs.text_simplu1.SetFocus()
			PLRETURN = .F.
		Otherwise
		*!*		If Alltrim(Upper(This.cus_odata_norme1.cactiune))="INSERT" &&Or (Alltrim(Upper(This.cus_odata_mecanici1.cactiune))="UPDATE")
		*!*			pcexec=[select * from ]+gcS+[.DEV_Vnorme where (TRIM(inspector)=']+Alltrim(porec.inspector)+[')]
		*!*			Do While .T.
		*!*				pnSucces = SQLEXEC(GNHANDLE,pcexec,'exista_inspector')
		*!*				If pnSucces = 0
		*!*	* instructiunea in curs de executie
		*!*				Else
		*!*					Exit
		*!*				Endif
		*!*			Enddo
		*!*			If Reccount('exista_inspector')>0
		*!*				amessagebox('Mai exista acest inspector inregistrat',0+48,"Atentie")
		*!*					This.clb_tx_simplu1.Text_simplu1.SetFocus()
		*!*					Use In exista_inspector
		*!*				plreturn=.F.
		*!*			ELSE
		*!*				PLRETURN=This.cus_odata_inspectori1.salvare(This.OREC,This.NID)
		*!*			ENDIF
		*!*		ELSE
		*!*	*!*		WAIT WINDOW "pe else"
			PLRETURN=This.cus_odata_preturi1.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_preturi1.cactiune = tcActiune
		if tcActiune='UPDATE'
			Thisform.cb_marca._cbbase1.Enabled=.F.
			Thisform.cb_asigurator._cbbase1.Enabled=.F.
		Endif
		
	ENDPROC

	PROCEDURE Cb_asigurator._cbbase1.LostFocus
		porec.id_asigurator = v_asiguratori.id_asigurator
		
	ENDPROC

	PROCEDURE Cb_marca._cbbase1.LostFocus
		porec.id_marca = v_marci.id_marca
		
	ENDPROC

	PROCEDURE Cb_nume_val._cbbase1.LostFocus
		porec.id_valuta = v_nom_valute.id_valuta
		
	ENDPROC

ENDDEFINE
