public JsonResult SaveFixProduction(string sid, List <String[]> prow) { JsonData d = new JsonData(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { List <B_FixProduction> lb = new List <B_FixProduction>(); if (prow != null) { foreach (String[] s in prow) { B_FixProduction b = new B_FixProduction(); if (Convert.ToDecimal(s[2]) > 0) { Sys_FixProduction bf = sfpb.Query(" and apcode='" + s[1].ToString() + "'"); if (bf != null) { b.sid = sid; b.psid = CommonBll.GetSid(); b.pname = bf.apname; b.pcode = bf.apcode; b.pmoney = bf.apprice; b.pnum = Convert.ToDecimal(s[2]); b.maker = iv.u.ename; b.cdate = DateTime.Now.ToString(); lb.Add(b); } } } } if (lb.Count > 0) { if (bfpb.SaveFixProductionList(sid, lb)) { d.d = "S"; } else { d.d = "F"; } } else { d.d = "F"; } } else { d.d = iv.badstr; } return(Json(d)); }
public JsonResult InitFixProduction(string sid) { JsonData d = new JsonData(); ArrayList r = new ArrayList(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { r.Add(iv.badstr); List <Sys_FixProduction> lsfp = sfpb.QueryList(" order by id asc"); if (lsfp != null) { foreach (Sys_FixProduction m in lsfp) { B_FixProduction bf = bfpb.Query(" and sid='" + sid + "' and pcode='" + m.apcode + "'"); ArrayList al = new ArrayList(); al.Add(m.apname); al.Add(m.apcode); if (bf != null) { al.Add(bf.pnum); } else { al.Add(0); } r.Add(al); } } d.d = js.Serialize(r); } else { d.d = iv.badstr; } return(Json(d)); }