예제 #1
0
        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);
        }
예제 #2
0
        public static string InitTree(string emcode, string tcode)
        {
            string              r   = "";
            Sys_ViewTableBll    svb = new Sys_ViewTableBll();
            Sys_ViewTable       st  = new Sys_ViewTable();
            Sys_EventMenuBll    seb = new Sys_EventMenuBll();
            Sys_EventMenu       sem = new Sys_EventMenu();
            SessionUserValidate iv  = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (emcode != "")
                {
                    st.tcode  = svb.CreateCode().ToString().PadLeft(4, '0');
                    st.tname  = "";
                    st.emcode = emcode;
                    st.emname = seb.Query(" and emcode='" + emcode + "'").emname;
                    st.id     = 0;
                }
                else
                {
                    st = svb.Query(" and tcode='" + tcode + "'");
                }
                r = js.Serialize(st);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }