public static string InitWjBom(string bcode) { string r = ""; Sys_WjBom sr = new Sys_WjBom(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (bcode != "") { sr = swbb.Query(" and bcode='" + bcode + "'"); } else { sr.id = 0; sr.bcode = swbb.CreateCode().ToString().PadLeft(4, '0'); } r = js.Serialize(sr); } else { r = iv.badstr; } return(r); }
public static string SaveWjBom(string bcode, string bid, string bname, string bnum, string bprice, string bunit, string ebcode, string icode) { string r = ""; SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_WjBom sr = new Sys_WjBom(); sr.bcode = bcode; sr.bname = bname; sr.becode = ebcode; sr.bnum = Convert.ToDecimal(bnum); sr.bprice = Convert.ToDecimal(bprice); sr.cdate = DateTime.Now.ToString(); sr.bunit = bunit; sr.icode = icode; if (bid == "0") { if (swbb.Add(sr) > 0) { r = "S"; } else { r = "F"; } } else { if (swbb.Update(sr)) { r = "S"; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }