public static string InitComClass(string cccode) { string r = ""; Sys_ComponentCate scc = new Sys_ComponentCate(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (cccode != "") { scc = sccb.Query(" and cccode='" + cccode + "'"); } else { scc.ccname = ""; scc.cccode = sccb.CreateCode("").ToString().PadLeft(4, '0'); scc.id = 0; } r = js.Serialize(scc); } else { r = iv.badstr; } return(r); }
public static string CheckInvCom(string icode) { string r = ""; string ccode = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { ccode = sccb.GetInvComCate(icode); if (ccode != "") { Sys_ComponentCate scc = sccb.Query(" and cccode='" + ccode + "'"); if (scc != null) { r = scc.ctype; } else { r = ""; } } else { r = ""; } } else { r = iv.badstr; } return(r); }
public static string SaveComClass(string lbcode, string lbid, string lbname, string lbtype) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ComponentCate sr = new Sys_ComponentCate(); sr.cccode = lbcode; sr.ccname = lbname; sr.ctype = lbtype; sr.cdate = DateTime.Now.ToString(); sr.maker = iv.u.ename; if (lbid == "0") { if (!sccb.Exists(" and ccname='" + lbname + "'")) { if (sccb.Add(sr) > 0) { r = "S"; } else { r = "F"; } } else { r = "T"; } } else { if (!sccb.Exists(" and ccname='" + lbname + "' and cccode<>'" + lbcode + "'")) { if (sccb.Update(sr)) { r = "S"; } else { r = "F"; } } else { r = "T"; } } } else { r = iv.badstr; } return(r); }