*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="conversie_2005.scx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS dataenvironment AS dataenvironment 
 	*< CLASSDATA: Baseclass="dataenvironment" Timestamp="" Scale="" Uniqueid="" ClassIcon="1" />

	*<PropValue>
		Name = "Dataenvironment"
	*</PropValue>

ENDDEFINE

DEFINE CLASS ffergen1 AS ffergen OF "..\clase\ferestrebaza.vcx" 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="BANDA21" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Titlu1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column1.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column2.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column3.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Header1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Grid1.Column4.Text1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmdtermin1" UniqueID="" Timestamp="" />

	*<PropValue>
		BorderStyle = 1
		DoCreate = .T.
		Height = 334
		Name = "Ffergen1"
		Width = 785
	*</PropValue>

	ADD OBJECT 'BANDA21' AS banda2 WITH ;
		Height = 30, ;
		Left = -3, ;
		Name = "BANDA21", ;
		Top = 0, ;
		Width = 816, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="..\..\comun\clase\baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Cmdtermin1' AS cmdtermin WITH ;
		Left = 756, ;
		Name = "Cmdtermin1", ;
		Top = 0, ;
		ZOrderSet = 5, ;
		IMBUTON1.Height = 27, ;
		IMBUTON1.Name = "IMBUTON1", ;
		IMBUTON1.Width = 30, ;
		COMMAND1.Name = "COMMAND1"
		*< END OBJECT: ClassLib="..\clase\ferestrebaza.vcx" BaseClass="container" />

	ADD OBJECT 'Command2' AS commandbutton WITH ;
		Caption = "CONVERSIE !", ;
		FontBold = .T., ;
		ForeColor = 128,128,255, ;
		Height = 27, ;
		Left = 556, ;
		Name = "Command2", ;
		Top = 2, ;
		Width = 84, ;
		ZOrderSet = 6
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Command3' AS commandbutton WITH ;
		Caption = "REVENIRE!", ;
		FontBold = .T., ;
		ForeColor = 255,128,64, ;
		Height = 27, ;
		Left = 641, ;
		Name = "Command3", ;
		Top = 2, ;
		Width = 84, ;
		ZOrderSet = 7
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'Grid1' AS grid WITH ;
		ColumnCount = 4, ;
		DeleteMark = .F., ;
		FontName = "Arial Narrow", ;
		Height = 276, ;
		Left = 11, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RecordMark = .F., ;
		RecordSource = "CONVERSIE_2005", ;
		Top = 48, ;
		Width = 769, ;
		ZOrderSet = 3, ;
		Column1.ControlSource = "cod_vechi", ;
		Column1.FontName = "Arial Narrow", ;
		Column1.Name = "Column1", ;
		Column1.Width = 58, ;
		Column2.ControlSource = "text_vechi", ;
		Column2.FontName = "Arial Narrow", ;
		Column2.Name = "Column2", ;
		Column2.Width = 317, ;
		Column3.ControlSource = "cod_nou", ;
		Column3.FontName = "Arial Narrow", ;
		Column3.Name = "Column3", ;
		Column3.Width = 51, ;
		Column4.ControlSource = "text_nou", ;
		Column4.FontName = "Arial Narrow", ;
		Column4.Name = "Column4", ;
		Column4.Width = 312
		*< END OBJECT: BaseClass="grid" />

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

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

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

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

	ADD OBJECT 'Grid1.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 'Titlu1' AS titlu WITH ;
		Caption = "CONVERSIE CODURI", ;
		FontSize = 10, ;
		Left = 10, ;
		Name = "Titlu1", ;
		Top = 4, ;
		ZOrderSet = 2
		*< END OBJECT: ClassLib="..\clase\ferestrebaza.vcx" BaseClass="label" />
	
	PROCEDURE Load
		*!*	IF !FILE('&CALEFIRMA\DATEAN\CONVERSIE_2005.DBF')
		*!*	COPY FILE &DIRGEN\imob2005\DATE\CONVERSIE_2005.dbf TO &CALEFIRMA\DATEAN\CONVERSIE_2005.DBF
		*!*	ENDIF
		
		*!*	USE &CALEFIRMA\DATEAN\CONVERSIE_2005.DBF IN 0 ALIAS CONVERSIE_2005
		*!*	SELECT CONVERSIE_2005
		*!*	GO TOP 
		
		USE &gcAppPath\DATE\datean\CONVERSIE_2005.DBF IN 0 ALIAS CONVERSIE_2005 SHARED 
		SELECT CONVERSIE_2005
		GO TOP 
	ENDPROC

	PROCEDURE Release
		USE IN CONVERSIE_2005
	ENDPROC

	PROCEDURE Command2.Click
		LOCAL lcCod_vechi, lcCod_nou
		STORE "" TO lcCod_vechi, lcCod_nou
		
		Select Distinct cod_vechi, cod_nou From conversie_2005 Into Cursor cConversie
		
		Select cConversie
		Scan
			lcCod_vechi = cod_vechi
			lcCod_nou = cod_nou
		
			Select mf
			If Flock()
				Replace All codmf With lcCod_nou For codmf = lcCod_vechi AND !inactiv
			Endif
			Unlock
		
			Select cConversie
		Endscan
		
		IF USED("cConversie")
			USE IN cConversie
		ENDIF 
		
		Do mesaj With 'CONVERSIA S-A INCHEIAT',''
		
	ENDPROC

	PROCEDURE Command3.Click
		LOCAL lcCod_vechi, lcCod_nou
		STORE "" TO lcCod_vechi, lcCod_nou
		 
		Select Distinct cod_vechi, cod_nou From conversie_2005 Into Cursor cConversie
		
		Select cConversie
		Scan
			Scatter Memv
			lcCod_vechi = cod_vechi
			lcCod_nou = cod_nou
			
			Select mf
			If Flock()
				Replace All codmf With lcCod_vechi For codmf = lcCod_nou 
			Endif
			Unlock
		
			Select cConversie
		Endscan
		
		IF USED("cConversie")
			USE IN cConversie
		ENDIF 
		
		Do mesaj With 'CONVERSIA S-A INCHEIAT',''
		
	ENDPROC

ENDDEFINE
