public static string SavePartType(string pabc, string pcname, string pcode, string pctype, string pid, string pname) { string r = ""; Sys_PartTypeBll srb = new Sys_PartTypeBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_PartType sr = new Sys_PartType(); sr.pcode = pcode; sr.pname = pname; sr.ptype = pabc; sr.pcname = pcname; sr.pctype = pctype; sr.cdate = DateTime.Now.ToString(); sr.maker = iv.u.ename; if (pid == "0") { if (!srb.Exists(" and ptype='" + pabc + "'")) { if (srb.Add(sr) > 0) { r = "S"; } else { r = "F"; } } else { r = "T"; } } else { if (!srb.Exists(" and ptype='" + pabc + "'")) { if (srb.Update(sr)) { r = "S"; } else { r = "F"; } } else { r = "T"; } } } else { r = iv.badstr; } return(r); }
public static string DelPartType(string pcode) { string r = ""; Sys_PartTypeBll srb = new Sys_PartTypeBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (srb.Exists(" and pcode='" + pcode + "' and pread='false'")) { if (srb.Delete(" and pcode='" + pcode + "'")) { r = "S"; } else { r = "F"; } } else { r = "T"; } } else { r = iv.badstr; } return(r); }