public static string InitBackEvent(string bcode, string ecode) { string r = ""; Sys_BackEventBll sbeb = new Sys_BackEventBll(); Sys_BackEvent sbe = new Sys_BackEvent(); Sys_ButtonBll sbb = new Sys_ButtonBll(); Sys_Button sb = new Sys_Button(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { if (ecode == "" || ecode == null) { sb = sbb.Query(" and bcode='" + bcode + "'"); sbe.id = 0; sbe.ename = ""; sbe.ecode = sbeb.CreateCode().ToString().PadLeft(4, '0'); sbe.bname = sb.bname == null ? "" : sb.bname; sbe.bcode = sb.bcode == null ? "" : sb.bcode; } else { sbe = sbeb.Query(" and ecode='" + ecode + "'"); } r = js.Serialize(sbe); } else { r = iv.badstr; } return(r); }
public static string SaveTBackEvent(string htbcode, string htbname, string htcode, string thid, string htname, string htsort, string htsource, string htsql, string htstate) { string r = ""; Sys_BackEventBll sbb = new Sys_BackEventBll(); Sys_BackEvent sb = new Sys_BackEvent(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.bcode = htbcode; sb.bname = htbname; sb.ename = htname; sb.ecode = htcode; sb.esort = htsort; sb.source = htsource; sb.ebody = htsql; sb.estate = htstate; if (thid == "0") { if (sbb.Add(sb) > 0) { r = "S"; } else { r = "F"; } } else { if (sbb.Update(sb)) { r = "S"; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }
public static string SaveBackEvent(string hbcode, string hbname, string hbstate, string hcode, string hid, string hname, string hsql, string hsort, string hsoure) { string r = ""; Sys_BackEventBll sbb = new Sys_BackEventBll(); Sys_BackEvent sb = new Sys_BackEvent(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sb.bcode = hcode; sb.bname = hname; sb.ename = hbname; sb.ecode = hbcode; sb.esort = hsort; sb.source = hsoure; sb.ebody = hsql.Replace("\n", " "); sb.estate = hbstate; if (hid == "0") { if (sbb.Add(sb) > 0) { r = "S"; } else { r = "F"; } } else { if (sbb.Update(sb)) { r = "S"; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }