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); }