public JsonResult InitProduceCate(string lcode) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ProduceCate sal = new Sys_ProduceCate(); if (lcode != "") { sal = spcb.Query(" and lcode='" + lcode + "'"); d.d = js.Serialize(sal); } else { sal.lcode = spcb.CreateCode().ToString().PadLeft(4, '0'); sal.id = 0; d.d = js.Serialize(sal); } } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult SaveProduce(string cccode, string cid, string plcode, string pdcode, string pdname, string pnum) { JsonData d = new JsonData(); Sys_ProductionCapacity sb = new Sys_ProductionCapacity(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ProduceCate sal = spcb.Query(" and lcode='" + plcode + "'"); sb.cccode = cccode; sb.ccname = ""; sb.dname = pdname; sb.dcode = pdcode; sb.cnum = Convert.ToInt32(pnum); sb.lcode = plcode; sb.lname = sal.lname; sb.cdate = DateTime.Now.ToString(); if (cid == "0") { if (spscb.Add(sb) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (spscb.Update(sb)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult SaveProduceCate(string lcode, string lname, string lid) { JsonData d = new JsonData(); Sys_ProduceCate sb = new Sys_ProduceCate(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.lcode = lcode; sb.lname = lname; sb.cdate = DateTime.Now.ToString(); if (lid == "0") { if (spcb.Add(sb) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (spcb.Update(sb)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }