public static string InitUnit(string ucode) { string r = ""; Sys_UnitBll sdb = new Sys_UnitBll(); Sys_Unit su = new Sys_Unit(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (ucode == "") { su.ucode = sdb.CreateCode().ToString().PadLeft(2, '0'); su.uname = ""; su.id = 0; } else { su = sdb.Query(" and ucode='" + ucode + "'"); } r = js.Serialize(su); } else { r = iv.badstr; } return(r); }
public static string CustDelUnit(string ucode) { string r = ""; Sys_UnitBll sdb = new Sys_UnitBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_Unit su = sdb.Query("and ucode='" + ucode + "'"); if (su != null) { if (su.uread) { r = "R"; } else { if (sdb.Delete(" and ucode='" + ucode + "'")) { r = "S"; } else { r = "F"; } } } else { r = "F"; } } else { r = iv.badstr; } return(r); }