public static string LoadSaleOrder(string sid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { B_YqSaleOrder bco = bsob.Query(" and sid='" + sid + "'"); if (bco != null) { B_CustormOrder bdj = bcob.Query(" and csid='" + bco.csid + "'"); r = js.Serialize(bco); } else { Sys_Depment sd = sdb.Query(" and dcode='" + iv.u.dcode + "'"); B_SaleOrder kco = new B_SaleOrder(); if (sd != null) { if (sd.dattr == "cs") { Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode + "'"); kco.city = sd.dpname; kco.citycode = sd.dpcode; kco.dname = sd.dname; kco.dcode = sd.dcode; kco.stelephone = sdd != null ? sdd.dcontact : ""; } else if (sd.dattr == "dm") { Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + sd.dcode.Substring(0, sd.dcode.Length - 4) + "'"); kco.city = sd.dpname; kco.citycode = sd.dpcode; kco.dname = sd.dname; kco.dcode = sd.dcode; kco.stelephone = sdd != null ? sdd.dcontact : ""; } else { kco.city = ""; kco.citycode = ""; kco.dname = ""; kco.dcode = ""; } } kco.maker = iv.u.ename; r = js.Serialize(kco); } } else { r = iv.badstr; } return(r); }
public static string CustQueryDepmentByDepCode(string dcode) { string r = ""; VDepment vsd = new VDepment(); Sys_Depment sd = new Sys_Depment(); Sys_DepmentBll sdb = new Sys_DepmentBll(); Sys_DepmentDpt sdd = new Sys_DepmentDpt(); Sys_DepmentDptBll sddb = new Sys_DepmentDptBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sd = sdb.Query(" and dcode='" + dcode + "'"); sdd = sddb.Query(" and dcode='" + dcode + "'"); if (sd != null) { vsd.dcode = sd.dcode; vsd.dname = sd.dname; vsd.dpname = sd.dpname; vsd.dpcode = sd.dpcode; vsd.id = sd.id; vsd.khcode = sd.khcode; vsd.dattr = sd.dattr; if (sdd != null) { vsd.dmanager = sdd.dmanager; vsd.dcontact = sdd.dcontact; } if (sd.dread) { r = "R"; } else { r = js.Serialize(vsd); } } else { r = iv.badstr; } } else { r = iv.badstr; } return(r); }
public static string QueryCompany(string dcode) { string r = ""; Sys_Depment sd = new Sys_Depment(); Sys_DepmentDpt sdd = new Sys_DepmentDpt(); Sys_DepmentBll sdb = new Sys_DepmentBll(); Sys_DepmentDptBll sddb = new Sys_DepmentDptBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { VDepment vd = new VDepment(); if (dcode == "") { vd.dcode = "0001" + sdb.CreateCode("0001").ToString().PadLeft(4, '0'); vd.id = 0; } else { sd = sdb.Query(" and dcode='" + dcode + "'"); sdd = sddb.Query(" and dcode='" + dcode + "'"); vd.id = sd.id; vd.dcode = sd.dcode; vd.dname = sd.dname; vd.dabc = sd.dabc; vd.dattr = sd.dattr; vd.daddress = sdd.daddress; vd.dcontact = sdd.dcontact; vd.dmanager = sdd.dmanager; vd.disused = sd.disused; vd.iadmin = sdd.iadmin == true ? "1" : "0"; vd.idepment = sdd.idepment; vd.logo = sdd.logo; vd.iproduction = sdd.iproduction == true ? "1" : "0"; } r = js.Serialize(vd); } else { r = iv.badstr; } return(r); }
public static string InitOrder(string sid, string zsid) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { B_SaleOrder bco = new B_SaleOrder(); if (sid != "") { bco = bsob.Query(" and sid='" + sid + "'"); r = js.Serialize(bco); } else { if (zsid != "") { B_Orders bo = bob.Query(" and sid='" + zsid + "'"); Sys_DepmentDpt sdd = sddb.Query(" and dcode='" + bo.dcode + "'"); bco.city = bo.city; bco.citycode = bo.citycode; bco.dname = bo.dname; bco.dcode = bo.dcode; bco.zsid = bo.sid; bco.customer = bo.customer; bco.telephone = bo.telephone; bco.address = bo.address; bco.community = bo.community; bco.zcode = bo.zcode; bco.stelephone = sdd != null ? sdd.dcontact : ""; bco.maker = iv.u.ename; } r = js.Serialize(bco); } } else { r = iv.badstr; } return(r); }