public JsonResult CustDelOrderTemp(string tcode) { JsonData d = new JsonData(); string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ProductionOrderTemp sal = smotb.Query(" and tcode='" + tcode + "'"); if (sal.tread) { r = "R"; } else { if (smotb.Delete(" and tcode='" + tcode + "'")) { r = "S"; } else { r = "F"; } } } else { r = iv.badstr; } d.d = r; return(Json(d)); }
public JsonResult InitOrderTemp(string tcode) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ProductionOrderTemp sal = new Sys_ProductionOrderTemp(); if (tcode != "") { sal = smotb.Query(" and tcode='" + tcode + "'"); } else { sal.id = 0; sal.tcode = smotb.CreateCode().ToString().PadLeft(4, '0'); } d.d = js.Serialize(sal); } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult SaveOrderTemp(string bpf, string bpt, string gpf, string gpt, string id, string scf, string sct, string spf, string spt, string tcode, string tname, string xqf, string xqt) { JsonData d = new JsonData(); Sys_ProductionOrderTemp smt = new Sys_ProductionOrderTemp(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { smt.tcode = tcode; smt.tname = tname; smt.bpt = bpt; //smt.dcode = iv.u.dcode.Substring(0, 8); smt.dcode = ""; smt.tread = true; smt.ttype = "a"; smt.gpt = gpt; smt.sct = sct; smt.spt = spt; smt.xqt = xqt; smt.bpf = bpf; smt.gpf = gpf; smt.scf = scf; smt.spf = spf; smt.xqf = xqf; smt.maker = iv.u.ename; smt.cdate = DateTime.Now.ToString(); if (id == "0") { smotb.Delete(" and dcode='" + smt.dcode + "'"); if (smotb.Add(smt) > 0) { d.d = "S"; } else { d.d = "F"; } } else { if (smotb.Update(smt)) { d.d = "S"; } else { d.d = "F"; } } } else { d.d = iv.badstr; } return(Json(d)); }