PUBLIC  oCust

oCust = CREATEOBJECT ('ClassCust')

DEFINE CLASS ClassCust AS CUSTOM 

id="" 
ruc=""
cname=""
comercio="" 
address="" 
city="" 
email="" 
phone="" 
pvp=1
codigo=""
opcionpvp=""
idsalesman=""
idzona="" 



FUNCTION set_id(cIdCust)
	LOCAL o as "adodb.recordset"
	
	IF !EMPTY(cIdCust)
	
		o = oJson.jexec("select * from customer where id="+cIdCust)
		
		IF o.count>0
			
			this.id=allt(TRANSFORM(o.item(1).item("id")))
			this.ruc=allt(o.item(1).item("ruc"))
			this.cname=allt(o.item(1).item("name"))
			this.comercio=allt(o.item(1).item("comercio"))
			this.address=allt(o.item(1).item("address"))
			this.city=allt(o.item(1).item("city"))
			this.email=allt(o.item(1).item("email")) 
			this.phone=allt(o.item(1).item("phone"))
			this.pvp=o.item(1).item("pvp")
			this.codigo=allt(o.item(1).item("codigo"))
			this.opcionpvp=o.item(1).item("opcionpvp")
			this.idsalesman=allt(TRANSFORM(o.item(1).item("idsalesman")))
			this.idzona=allt(TRANSFORM(o.item(1).item("idzona")))
		
		ENDIF
	ENDIF
			
	
ENDFUNC

FUNCTION set_(cCampo,cValor)
	
	this.&cCampo = ALLTRIM(cValor)
	
ENDFUNC



ENDDEFINE