*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="conversie.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="Command1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Cmdtermin1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="NOU1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Command3" 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 'Command1' AS commandbutton WITH ;
		Caption = "LINIE NOUA", ;
		FontBold = .F., ;
		Height = 27, ;
		Left = 624, ;
		Name = "Command1", ;
		Top = 276, ;
		Visible = .F., ;
		Width = 84, ;
		WordWrap = .F., ;
		ZOrderSet = 4
		*< END OBJECT: BaseClass="commandbutton" />

	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, ;
		Height = 276, ;
		Left = 11, ;
		Name = "Grid1", ;
		Panel = 1, ;
		RecordSource = "CONVERSIE", ;
		Top = 48, ;
		Width = 769, ;
		ZOrderSet = 3, ;
		Column1.ControlSource = "cont2001", ;
		Column1.Name = "Column1", ;
		Column1.Width = 45, ;
		Column2.ControlSource = "denum2001", ;
		Column2.Name = "Column2", ;
		Column2.Width = 317, ;
		Column3.ControlSource = "cont2002", ;
		Column3.Name = "Column3", ;
		Column3.Width = 51, ;
		Column4.ControlSource = "denum2002", ;
		Column4.Name = "Column4", ;
		Column4.Width = 312
		*< END OBJECT: BaseClass="grid" />

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

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

	ADD OBJECT 'Grid1.Column2.Header1' AS header WITH ;
		Caption = "Denumire 1", ;
		Name = "Header1"
		*< END OBJECT: BaseClass="header" />

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

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

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

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

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

	ADD OBJECT 'NOU1' AS nou WITH ;
		Left = 725, ;
		Name = "NOU1", ;
		Top = 0, ;
		IMBUTON1.Height = 27, ;
		IMBUTON1.Name = "IMBUTON1", ;
		IMBUTON1.Width = 30, ;
		COMMAND1.Name = "COMMAND1"
		*< END OBJECT: ClassLib="..\..\comun\clase\baza.vcx" BaseClass="container" />

	ADD OBJECT 'Titlu1' AS titlu WITH ;
		Caption = "OPTIUNI DE CONVERSIE", ;
		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.DBF')
			Copy File &gcAppPath\Date\Datean\CONVERSIE.* To &CALEFIRMA\DATEAN\CONVERSIE.Dbf
		Endif
		
		Use &CALEFIRMA\DATEAN\CONVERSIE.Dbf In 0 Alias CONVERSIE
		Select CONVERSIE
		Set Filter To Inlist(Val(Left(CONT2002,2)),20,21)
		
		
	ENDPROC

	PROCEDURE Release
		USE IN CONVERSIE
	ENDPROC

	PROCEDURE Command1.Click
		SELECT CONVERSIE
		APPEND BLANK
		REPLACE CONT2001 WITH '2'
		THISFORM.GRID1.REFRESH
	ENDPROC

	PROCEDURE Command2.Click
		Select Distinct CONT2001 As CONT_VECHI,CONT2002 As CONT_NOU From CONVERSIE Into Cursor FFF
		Local M.CONT_NOU,M.CONT_VECHI
		Store '' To M.CONT_NOU,M.CONT_VECHI
		
		Select FFF
		Scan
			Scatter Memv
		
			Select MF
			If Flock()
				Replace All SCD With M.CONT_NOU For SCD=M.CONT_VECHI
			Endif
			Unlock
		
			Select FFF
		Endscan
		
		Do MESAJ With 'CONVERSIA S-A INCHEIAT',''
		
	ENDPROC

	PROCEDURE Command3.Click
		SELECT DISTINCT CONT2001 AS CONT_VECHI,CONT2002 AS CONT_NOU FROM CONVERSIE INTO CURSOR FFF
		LOCAL M.CONT_NOU,M.CONT_VECHI
		STORE '' TO M.CONT_NOU,M.CONT_VECHI
		
		SELECT FFF
		SCAN 
		SCATTER MEMV
		
		SELECT MF
		IF FLOCK()
		REPLACE ALL SCD WITH M.CONT_VECHI FOR SCD=M.CONT_NOU
		ENDIF
		UNLOCK
		
		SELECT FFF
		ENDSCAN
		
		DO MESAJ WITH 'CONVERSIA S-A INCHEIAT',''
		
	ENDPROC

	PROCEDURE NOU1.COMMAND1.Click
		thisform.comMAND1.Click 
	ENDPROC

ENDDEFINE
