public static string CustSaveComputeMethod(string fcode, string fgs, string fid, string flx, string fname, string ftx) { string r = ""; Sys_ComputeFunctionBll srb = new Sys_ComputeFunctionBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ComputeFunction sr = new Sys_ComputeFunction(); sr.fname = fname; sr.fcode = fcode; sr.fattr = flx; sr.fstr = fgs; sr.ftx = ""; sr.dcode = iv.u.dcode.Substring(0, 8); sr.cdate = DateTime.Now.ToString(); sr.maker = iv.u.ename; if (fid == "0") { if (!srb.Exists(" and fname='" + fname + "'")) { if (srb.Add(sr) > 0) { r = "S"; } else { r = "F"; } } else { r = "T"; } } else { if (!srb.Exists(" and fname='" + fname + "' and fcode<>'" + fcode + "'")) { if (srb.Update(sr)) { r = "S"; } else { r = "F"; } } else { r = "T"; } } } else { r = iv.badstr; } return(r); }
public static string InitComputeMethod(string fcode) { string r = ""; Sys_ComputeFunction sr = new Sys_ComputeFunction(); Sys_ComputeFunctionBll srb = new Sys_ComputeFunctionBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ComputeFunction csr = srb.Query(" and fcode='" + fcode + "'"); if (csr != null) { r = js.Serialize(csr); } else { sr.fname = ""; sr.fcode = srb.CreateCode().ToString().PadLeft(4, '0'); sr.id = 0; r = js.Serialize(sr); } } else { r = iv.badstr; } return(r); }