public static string CopyTree(string tcode) { string r = ""; Sys_ViewTableBll svb = new Sys_ViewTableBll(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { Sys_ViewTable sv = svb.Query(" and tcode='" + tcode + "'"); sv.id = 0; sv.cols = sv.cols.Replace("\n", ""); sv.sqlcols = sv.sqlcols.Replace("\n", ""); sv.sqlcondition = sv.sqlcondition.Replace("\n", ""); sv.cdate = DateTime.Now.ToString(); sv.maker = iv.u.ename; sv.ecols = sv.ecols.Replace("\n", ""); sv.esqlcols = sv.esqlcols.Replace("\n", ""); sv.tcode = svb.CreateCode().ToString().PadLeft(4, '0'); if (svb.Add(sv) > 0) { r = "S"; } else { r = "F"; } } else { r = iv.badstr; } return(r); }
public static string SaveTree(string dcsql, string dctitle, string lbemcode, string lbemname, string lbid, string lbrole, string lbsql, string lbtable, string lbtcode, string lbtitle, string lbtj, string lbyq, string lbyqname) { string r = ""; Sys_ViewTableBll svb = new Sys_ViewTableBll(); Sys_ViewTable sv = new Sys_ViewTable(); SessionUserValidate iv = SysValidateBll.ValidateSession(); if (iv.f) { sv.emname = lbemname; sv.emcode = lbemcode; sv.tcode = lbtcode; sv.cols = lbtitle.Replace("\n", ""); sv.sqlcols = lbsql.Replace("\n", ""); sv.sqlcondition = lbtj.Replace("\n", ""); sv.tabcode = lbyq; sv.tabname = lbyqname; sv.tname = lbtable; sv.rcode = lbrole; sv.cdate = DateTime.Now.ToString(); sv.maker = iv.u.ename; sv.ecols = dctitle.Replace("\n", ""); sv.esqlcols = dcsql.Replace("\n", ""); if (lbid == "0") { if (svb.Add(sv) > 0) { r = "S"; } else { r = "F"; } } else { if (svb.Update(sv)) { r = "S"; } else { r = "F"; } } } else { r = iv.badstr; } return(r); }