public JsonResult InitSectionCate(string scode) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_SectionPriceCate sal = new Sys_SectionPriceCate(); if (scode != "") { sal = sspcb.Query(" and scode='" + scode + "'"); } else { sal.scode = sspcb.CreateCode().ToString().PadLeft(4, '0'); sal.id = 0; } d.d = js.Serialize(sal); } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult SaveSectionCate(string qlid, string qccode, string qcname, string qtx) { JsonData d = new JsonData(); Sys_SectionPriceCate sb = new Sys_SectionPriceCate(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.sname = qcname; sb.scode = qccode; sb.pcode = qtx; Sys_PriceType spt = sptb.Query(" and ptcode='" + qtx + "'"); if (spt != null) { sb.pname = spt.ptname; } if (iv.u.rcode == "xtgl") { sb.dcode = ""; } else { sb.dcode = iv.u.dcode.Substring(0, 8); } sb.maker = iv.u.ename; sb.cdate = DateTime.Now.ToString(); if (qlid == "0") { if (sspcb.Add(sb) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (sspcb.Update(sb)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }