public JsonResult InitSectionPrice(string scode, string jcode) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_SectionPrice sal = new Sys_SectionPrice(); if (jcode != "") { sal = sspb.Query(" and jcode='" + jcode + "'"); } else { Sys_SectionPriceCate ss = sspcb.Query(" and scode='" + scode + "'"); if (ss != null) { sal.scode = ss.scode; sal.sname = ss.sname; } sal.jcode = sspb.CreateCode().ToString().PadLeft(4, '0'); sal.id = 0; } d.d = js.Serialize(sal); } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult SaveSectionPrice(string isfri, string pattr, string qid, string qlcode, string qlname, string qjcode, string qjname, string qmaxv, string qminv, string qmoney) { JsonData d = new JsonData(); Sys_SectionPrice sb = new Sys_SectionPrice(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.sname = qlname; sb.scode = qlcode; sb.jcode = qjcode; sb.jname = qjname; sb.jattr = pattr; sb.isfrist = isfri == "0" ? false : true; sb.minv = Convert.ToInt32(qminv); sb.maxv = Convert.ToInt32(qmaxv); sb.price = Convert.ToDecimal(qmoney); sb.maker = iv.u.ename; sb.cdate = DateTime.Now.ToString(); if (qid == "0") { if (sspb.Add(sb) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (sspb.Update(sb)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }