Esempio n. 1
0
        public DataTable LoadDefaultOpenTab(long userid)
        {
            StringBuilder strbuilder = new StringBuilder();
            DataTable     menudt     = new DataTable();

            strbuilder.Append("select * from ");
            strbuilder.Append("(select fg3_defaultopen_tab.phid,fg3_defaultopen_tab.userid,fg3_defaultopen_tab.id,fg3_defaultopen_tab.pid,fg3_defaultopen_tab.originalcode,fg3_defaultopen_tab.seq,fg3_defaultopen_tab.name,fg3_menu.url,fg3_menu.managername,fg3_menu.rightname,fg3_menu.suite,fg3_menu.moduleno,fg3_defaultopen_tab.urlparm");
            strbuilder.Append(" from fg3_defaultopen_tab,fg3_menu");
            strbuilder.Append(" where fg3_menu.code = fg3_defaultopen_tab.originalcode and (originalcode <> '' or originalcode is not null) and fg3_defaultopen_tab.usertype = 0 and userid = " + userid);
            strbuilder.Append(" union ");
            strbuilder.Append(" select  phid,userid,id,pid,originalcode,seq,name,url,null,null,null,null,urlparm");
            strbuilder.Append(" from fg3_defaultopen_tab");
            strbuilder.Append(" where (originalcode = '' or originalcode is null) and userid = " + userid + " and usertype = 0 ) t1");
            strbuilder.Append(" order by seq");
            menudt = DbHelper.GetDataTable(strbuilder.ToString());
            if (menudt.Rows.Count < 1)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select * from ");
                strbuilder.Append("(select fg3_defaultopen_tab.phid,fg3_defaultopen_tab.userid,fg3_defaultopen_tab.id,fg3_defaultopen_tab.pid,fg3_defaultopen_tab.originalcode,fg3_defaultopen_tab.seq,fg3_defaultopen_tab.name,fg3_menu.url,fg3_menu.managername,fg3_menu.rightname,fg3_menu.suite,fg3_menu.moduleno,fg3_defaultopen_tab.urlparm");
                strbuilder.Append(" from fg3_defaultopen_tab,fg3_menu");
                strbuilder.Append(" where fg3_menu.code = fg3_defaultopen_tab.originalcode and (originalcode <> '' or originalcode is not null) and fg3_defaultopen_tab.usertype = 1 and userid = " + userid);
                strbuilder.Append(" union ");
                strbuilder.Append(" select  phid,userid,id,pid,originalcode,seq,name,url,null,null,null,null,urlparm");
                strbuilder.Append(" from fg3_defaultopen_tab");
                strbuilder.Append(" where (originalcode = '' or originalcode is null) and userid = " + userid + " and usertype = 1 ) t1");
                strbuilder.Append(" order by seq");
                menudt = DbHelper.GetDataTable(strbuilder.ToString());
            }
            return(menudt);
        }
Esempio n. 2
0
        public string Load(string text)
        {
            long          userid     = AppInfoBase.UserID;
            StringBuilder strbuilder = new StringBuilder();

            if (text == "默认功能导航图")
            {
                strbuilder.Append("select svgconfig from fg3_function_navigation where userid =" + userid + " and usertype = 0 " + " and text is null");
            }
            else
            {
                strbuilder.Append("select svgconfig from fg3_function_navigation where userid =" + userid + " and usertype = 0 " + " and text = '" + text + "'");
            }
            string svgConfig = DbHelper.GetString(strbuilder.ToString());

            if (svgConfig == null || svgConfig == "")
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                if (text == "默认功能导航图")
                {
                    strbuilder.Append("select svgconfig from fg3_function_navigation where userid =" + userid + " and usertype = 1 " + " and text is null");
                }
                else
                {
                    strbuilder.Append("select svgconfig from fg3_function_navigation where userid =" + userid + " and usertype = 1 " + " and text = '" + text + "'");
                }
                svgConfig = DbHelper.GetString(strbuilder.ToString());
            }
            return(svgConfig);
        }
Esempio n. 3
0
        //i8web版主页取默认打开tab页
        public DataTable LoadDefaultOpenTabForMainFrame()
        {
            long      userid = AppInfoBase.UserID;
            DataTable menudt = new DataTable();
            string    sql    = string.Format(@"select * from 
                                (select fg3_defaultopen_tab.originalcode,fg3_defaultopen_tab.name,fg3_menu.url,fg3_menu.managername,fg3_menu.rightname,fg3_menu.functionname,fg3_menu.suite,fg3_menu.moduleno,fg3_menu.rightkey,fg3_defaultopen_tab.urlparm 
                                from fg3_defaultopen_tab,fg3_menu 
                                where fg3_menu.code = fg3_defaultopen_tab.originalcode and (originalcode <> '' or originalcode is not null) and fg3_defaultopen_tab.usertype = 0 and userid = {0} 
                                union  
                                select originalcode,fg3_defaultopen_tab.name,fg3_defaultopen_tab.url,null,null,null,null,null,null,urlparm 
                                from fg3_defaultopen_tab 
                                where (originalcode = '' or originalcode is null) and userid = {0} and usertype = 0 
                                ) t1 ", userid);

            menudt = DbHelper.GetDataTable(sql);
            if (menudt.Rows.Count < 1)
            {
                userid = UserConfigDac.ActorGet(userid);
                sql    = string.Format(@"select * from 
                                (select fg3_defaultopen_tab.originalcode,fg3_defaultopen_tab.name,fg3_menu.url,fg3_menu.managername,fg3_menu.rightname,fg3_menu.functionname,fg3_menu.suite,fg3_menu.moduleno,fg3_menu.rightkey,fg3_defaultopen_tab.urlparm 
                                from fg3_defaultopen_tab,fg3_menu 
                                where fg3_menu.code = fg3_defaultopen_tab.originalcode and (originalcode <> '' or originalcode is not null) and fg3_defaultopen_tab.usertype = 0 and userid = {0} 
                                union  
                                select originalcode,fg3_defaultopen_tab.name,fg3_defaultopen_tab.url,null,null,null,null,null,null,urlparm 
                                from fg3_defaultopen_tab 
                                where (originalcode = '' or originalcode is null) and userid = {0} and usertype = 0 
                                ) t1 ", userid);
                menudt = DbHelper.GetDataTable(sql);
            }
            return(menudt);
        }
Esempio n. 4
0
        public bool SaveAPPLogo(long phid, string APPlogo, string attachid, int isSys)
        {
            long   userid   = AppInfoBase.UserID;
            string dateflag = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string sql      = "select count(*) from fg3_mainframe_individual where userid =" + userid + " and usertype = 0 ";
            string obj      = DbHelper.GetString(sql).ToString();

            if (obj == "0")
            {
                sql = "insert into fg3_mainframe_individual (phid,userid,usertype,applogoname,applogoattachid,applogodateflg,issys) values ( "
                      + phid + "," + userid + ",0,'" + APPlogo + "','" + attachid + "','" + dateflag + "'," + isSys + ")";
            }
            else
            {
                sql = "update fg3_mainframe_individual set applogoname = '" + APPlogo + "', applogoattachid = '" + attachid +
                      "', applogodateflg = '" + dateflag + "', isSys = " + isSys + " where userid =" + userid + " and usertype = 0 ";
            }
            try
            {
                DbHelper.ExecuteScalar(sql);
                UserConfigDac.UserConfigSave(userid, 0, dateflag);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw new Exception(ex.Message);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 我的功能分类
        /// </summary>
        /// <param name="rows"></param>
        /// <returns></returns>
        public DataTable LoadMyMenuType()
        {
            long          userid     = NG3.AppInfoBase.UserID;
            string        logid      = NG3.AppInfoBase.LoginID;
            StringBuilder strbuilder = new StringBuilder();
            DataTable     menudt     = new DataTable();

            if (String.Compare(AppInfoBase.UserType, UserType.System, true) == 0)
            {
                strbuilder.Append("select code,lineid,name from");
                strbuilder.Append(" my_menu_type");
                strbuilder.Append(" where logid = '" + logid + "'");
                menudt = DbHelper.GetDataTable(strbuilder.ToString());
                return(menudt);
            }

            strbuilder.Append("select code,lineid,name from");
            strbuilder.Append(" my_menu_type");
            strbuilder.Append(" where userid = '" + userid + "' and usertype = 0 order by lineid");
            menudt = DbHelper.GetDataTable(strbuilder.ToString());
            if (menudt.Rows.Count < 1)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select code,lineid,name from");
                strbuilder.Append(" my_menu_type");
                strbuilder.Append(" where userid = '" + userid + "' and usertype = 1 order by lineid");
                menudt = DbHelper.GetDataTable(strbuilder.ToString());
            }

            return(menudt);
        }
Esempio n. 6
0
        /// <summary>
        /// 保存用户自定义添加的管理对象
        /// </summary>
        /// <param name="treetabconfig"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public bool Save(string treetabconfig, long userid, long phid)
        {
            string sql = "select count(*) from fg3_mainframe_individual where userid =" + userid + " and usertype = 0 ";
            string obj = DbHelper.GetString(sql).ToString();

            if (obj == "0")
            {
                //Int64 masterid = this.GetMaxID("fg3_mainframe_individual") + 1;
                sql = "insert into fg3_mainframe_individual (phid,userid,treetabconfig,usertype) values ( " + phid + "," + userid + ",'" + treetabconfig + "',0)";
            }
            else
            {
                sql = "update fg3_mainframe_individual set treetabconfig = '" + treetabconfig + "' where userid =" + userid + " and usertype = 0 ";
            }
            try
            {
                DbHelper.ExecuteScalar(sql);
                string dateflag = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                UserConfigDac.UserConfigSave(userid, 0, dateflag);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw new Exception(ex.Message);
            }
        }
Esempio n. 7
0
        public string Save(string svgConfig, string text, string saveType, long phid)
        {
            long userid = AppInfoBase.UserID;
            //Int64 masterid = this.GetMaxID("fg3_function_navigation") + 1;
            string sql;

            if (saveType == "add")
            {
                sql = String.Format(@"select count(*) from fg3_function_navigation where userid ={0} and usertype = 0 and text ='{1}'", userid, text);
                string obj = DbHelper.GetString(sql).ToString();
                int    i   = 1;
                if (obj != "0")
                {
                    return("rename");
                }
                sql = String.Format(@"insert into fg3_function_navigation (phid,userid,svgconfig,usertype,text) values ({0},{1},'{2}',0,'{3}')", phid, userid, svgConfig, text);
            }
            else
            {
                if (text == "默认功能导航图")
                {
                    //sql = "update fg3_function_navigation set svgconfig = '" + svgConfig + "',text = '默认功能导航图' where userid =" + userid + " and usertype = 0 and  and text is null";
                    sql = String.Format(@"update fg3_function_navigation set svgconfig = '{0}',text = '默认功能导航图' where userid ={1} and usertype = 0 and  and text is null", svgConfig, userid);
                }
                else
                {
                    //sql = "update fg3_function_navigation set svgconfig = '" + svgConfig + "' where userid =" + userid + " and usertype = 0 and text =" + text;
                    sql = String.Format(@"update fg3_function_navigation set svgconfig = '{0}' where userid ={1} and usertype = 0 and text ='{2}'", svgConfig, userid, text);
                }
            }

            //string sql = "select count(*) from fg3_function_navigation where userid =" + userid + " and usertype = 0 ";
            //string obj = DbHelper.GetString(sql).ToString();
            //if (obj == "0")
            //{
            //    Int64 masterid = this.GetMaxID("fg3_function_navigation") + 1;
            //    sql = "insert into fg3_function_navigation (phid,userid,svgconfig,usertype) values ( " + masterid + "," + userid + ",'" + svgConfig + "',0)";
            //}
            //else
            //{
            //    sql = "update fg3_function_navigation set svgconfig = '" + svgConfig + "' where userid =" + userid + " and usertype = 0 ";
            //}
            try
            {
                DbHelper.ExecuteScalar(sql);
                string dateflag = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                UserConfigDac.UserConfigSave(userid, 0, dateflag);
                return("true");
            }
            catch (Exception ex)
            {
                return("false");

                throw new Exception(ex.Message);
            }
        }
Esempio n. 8
0
        public DataTable LoadTree()
        {
            long          userid     = AppInfoBase.UserID;
            StringBuilder strbuilder = new StringBuilder();

            strbuilder.Append("select text from fg3_function_navigation where userid =" + userid + " and usertype = 0 ");
            DataTable text = DbHelper.GetDataTable(strbuilder.ToString());

            if (text == null || text.Rows.Count == 0)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select text from fg3_function_navigation where userid =" + userid + " and usertype = 1 ");
                text = DbHelper.GetDataTable(strbuilder.ToString());
            }
            return(text);
        }
Esempio n. 9
0
        public object GetMyDesktopIdByUserID(long userid)
        {
            object phid = DbHelper.ExecuteScalar("select phid from fg3_mydesktop where userid = '" + userid + "' and usertype = '0'");

            if (phid == null)
            {
                long desktopactor = UserConfigDac.ActorGet(userid);
                if (desktopactor == 0)
                {
                    return(null);
                }
                else
                {
                    phid = DbHelper.ExecuteScalar("select phid from fg3_mydesktop where userid = '" + desktopactor + "' and usertype = '1'");
                }
            }
            return(phid);
        }
Esempio n. 10
0
        //    #region 日志相关
        //    private static ILogger _logger = null;
        //    internal static ILogger Logger
        //    {
        //        get
        //        {
        //            if (_logger == null)
        //            {
        //                _logger = Log4NetLoggerFactory.Instance.CreateLogger(typeof(MyFuncTreeDac), LogType.logdac);
        //            }
        //            return _logger;
        //        }
        //    }
        //    #endregion
        //   使用:
        //_logger.Info(logInfo);

        /// <summary>
        /// 加载我的功能树
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public DataTable LoadMenuData(long userid)
        {
            StringBuilder strbuilder = new StringBuilder();
            DataTable     menudt     = new DataTable();

            strbuilder.Append("select * from ");
            strbuilder.Append("(select fg3_myfunctree.phid,fg3_myfunctree.userid,fg3_myfunctree.id,fg3_myfunctree.pid,fg3_myfunctree.originalcode,fg3_myfunctree.seq,fg3_myfunctree.name,fg3_menu.url,fg3_menu.managername,fg3_menu.rightname,fg3_menu.suite,fg3_menu.moduleno,fg3_menu.rightkey,fg3_menu.functionname,fg3_myfunctree.urlparm,fg3_menu.norightcontrol,fg3_menu.busphid");
            strbuilder.Append(" from fg3_myfunctree,fg3_menu");
            strbuilder.Append(" where fg3_menu.code = fg3_myfunctree.originalcode and (originalcode <> '' or originalcode is not null) and fg3_myfunctree.usertype = 0 and userid = " + userid + "");
            strbuilder.Append(" union ");
            strbuilder.Append(" select  phid,userid,id,pid,originalcode,seq,name,url,null,null,null,null,null,null,urlparm,null,null");
            strbuilder.Append(" from fg3_myfunctree");
            strbuilder.Append(" where (originalcode = '' or originalcode is null) and userid = " + userid + " and usertype = 0 ");
            strbuilder.Append(" union ");
            strbuilder.Append(" select fg3_myfunctree.phid,fg3_myfunctree.userid,fg3_myfunctree.id,fg3_myfunctree.pid,fg3_myfunctree.originalcode,fg3_myfunctree.seq,fg3_myfunctree.name,fg3_myfunctree.url,null,null,null,null,null,null,fg3_myfunctree.urlparm,null,null");
            strbuilder.Append(" from rw_report_main,fg3_myfunctree");
            strbuilder.Append(" where (rw_report_main.rep_code = fg3_myfunctree.originalcode and fg3_myfunctree.usertype = 0 and userid = " + userid + ") or (fg3_myfunctree.originalcode = 'ReportListRoot' and fg3_myfunctree.usertype = 0 and userid = " + userid + ")) t1");
            strbuilder.Append(" order by seq");

            menudt = DbHelper.GetDataTable(strbuilder.ToString());
            if (menudt.Rows.Count < 1)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select * from ");
                strbuilder.Append("(select fg3_myfunctree.phid,fg3_myfunctree.userid,fg3_myfunctree.id,fg3_myfunctree.pid,fg3_myfunctree.originalcode,fg3_myfunctree.seq,fg3_myfunctree.name,fg3_menu.url,fg3_menu.managername,fg3_menu.rightname,fg3_menu.suite,fg3_menu.moduleno,fg3_menu.rightkey,fg3_menu.functionname,fg3_myfunctree.urlparm,fg3_menu.norightcontrol,fg3_menu.busphid");
                strbuilder.Append(" from fg3_myfunctree,fg3_menu");
                strbuilder.Append(" where fg3_menu.code = fg3_myfunctree.originalcode and (originalcode <> '' or originalcode is not null) and fg3_myfunctree.usertype = 1 and userid = " + userid);
                strbuilder.Append(" union ");
                strbuilder.Append(" select  phid,userid,id,pid,originalcode,seq,name,url,null,null,null,null,null,null,urlparm,null,null");
                strbuilder.Append(" from fg3_myfunctree");
                strbuilder.Append(" where (originalcode = '' or originalcode is null) and userid = " + userid + " and usertype = 1 ");
                strbuilder.Append(" union ");
                strbuilder.Append(" select fg3_myfunctree.phid,fg3_myfunctree.userid,fg3_myfunctree.id,fg3_myfunctree.pid,fg3_myfunctree.originalcode,fg3_myfunctree.seq,fg3_myfunctree.name,fg3_myfunctree.url,null,null,null,null,null,null,fg3_myfunctree.urlparm,null,null");
                strbuilder.Append(" from rw_report_main,fg3_myfunctree");
                strbuilder.Append(" where (rw_report_main.rep_code = fg3_myfunctree.originalcode and fg3_myfunctree.usertype = 1 and userid = " + userid + ") or (fg3_myfunctree.originalcode = 'ReportListRoot' and fg3_myfunctree.usertype = 1 and userid = " + userid + ")) t1");
                strbuilder.Append(" order by seq");

                menudt = DbHelper.GetDataTable(strbuilder.ToString());
            }
            return(menudt);
        }
Esempio n. 11
0
        public string Load(long userid)
        {
            StringBuilder strbuilder = new StringBuilder();

            strbuilder.Append("select treetabconfig");
            strbuilder.Append(" from fg3_mainframe_individual");
            strbuilder.Append(" where userid = " + userid + " and usertype = 0 ");
            string treetabconfig = DbHelper.GetString(strbuilder.ToString());

            if (treetabconfig == "" || treetabconfig == null)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select treetabconfig");
                strbuilder.Append(" from fg3_mainframe_individual");
                strbuilder.Append(" where userid = " + userid + " and usertype = 1 ");
                treetabconfig = DbHelper.GetString(strbuilder.ToString());
            }
            return(treetabconfig);
        }
Esempio n. 12
0
        public DataTable LoadSysSetting(long userid)
        {
            StringBuilder strbuilder = new StringBuilder();

            strbuilder.Append("select individualsetting,applogoname");
            strbuilder.Append(" from fg3_mainframe_individual");
            strbuilder.Append(" where userid = " + userid + " and usertype = 0 ");
            DataTable treetabconfig = DbHelper.GetDataTable(strbuilder.ToString());

            if (treetabconfig == null || treetabconfig.Rows.Count == 0)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select individualsetting");
                strbuilder.Append(" from fg3_mainframe_individual");
                strbuilder.Append(" where userid = " + userid + " and usertype = 1 ");
                treetabconfig = DbHelper.GetDataTable(strbuilder.ToString());
            }
            return(treetabconfig);
        }
Esempio n. 13
0
        //小铃铛设置存取
        public string LoadAlertItem()
        {
            long          userid     = AppInfoBase.UserID;
            StringBuilder strbuilder = new StringBuilder();

            strbuilder.Append("select alertconfig");
            strbuilder.Append(" from fg3_mainframe_individual");
            strbuilder.Append(" where userid = " + userid + " and usertype = 0 ");
            string alertconfig = DbHelper.GetString(strbuilder.ToString());

            if (alertconfig == "" || alertconfig == null)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select alertconfig");
                strbuilder.Append(" from fg3_mainframe_individual");
                strbuilder.Append(" where userid = " + userid + " and usertype = 1 ");
                alertconfig = DbHelper.GetString(strbuilder.ToString());
            }
            return(alertconfig);
        }
Esempio n. 14
0
        public string GetUITheme(long userid)
        {
            StringBuilder strbuilder = new StringBuilder();

            strbuilder.Append("select uitheme");
            strbuilder.Append(" from fg3_mainframe_individual");
            strbuilder.Append(" where userid = " + userid + " and usertype = 0 ");

            string uitheme = DbHelper.GetString(strbuilder.ToString());

            if (uitheme == "" || uitheme == null)
            {
                strbuilder.Remove(0, strbuilder.Length);
                userid = UserConfigDac.ActorGet(userid);
                strbuilder.Append("select uitheme");
                strbuilder.Append(" from fg3_mainframe_individual");
                strbuilder.Append(" where userid = " + userid + " and usertype = 1 ");

                uitheme = DbHelper.GetString(strbuilder.ToString());
            }
            return(uitheme);
        }
Esempio n. 15
0
        /// <summary>
        /// 保存功能分类
        /// </summary>
        /// <param name="rows"></param>
        public int SaveMyMenuType(string rows)
        {
            JArray ja     = (JArray)JsonConvert.DeserializeObject(rows);
            long   userid = NG3.AppInfoBase.UserID;
            string logid  = NG3.AppInfoBase.LoginID;
            string sql    = string.Format("delete from my_menu_type where (userid={0} and usertype = 0) or logid = '{1}'", userid, logid);
            int    iret   = DbHelper.ExecuteNonQuery(sql);

            if (ja.Count < 1)//删除用户我的功能树所有节点
            {
                return(1);
            }

            string    sqlText  = string.Format("select * from my_menu_type where (userid={0} and usertype = 0)", userid);
            DataTable dt       = DbHelper.GetDataTable(sqlText);
            DataTable newTable = dt.Clone();

            for (int i = 0; i < ja.Count; i++)
            {
                DataRow newRow = newTable.NewRow();
                newRow.BeginEdit();
                newRow["code"]     = string.IsNullOrEmpty(ja[i]["code"].ToString())?Guid.NewGuid().ToString(): ja[i]["code"].ToString();
                newRow["userid"]   = userid;
                newRow["name"]     = ja[i]["name"].ToString();
                newRow["usertype"] = 0;
                //newRow["lineid"] = ja[i]["lineid"].ToString();
                newRow["lineid"] = (i + 1).ToString();
                newRow["logid"]  = logid;
                newRow["def1"]   = null;
                newRow.EndEdit();
                newTable.Rows.Add(newRow);
            }

            string dateflag = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            UserConfigDac.UserConfigSave(userid, 0, dateflag);
            return(DbHelper.Update(newTable, "select * from my_menu_type"));
        }
Esempio n. 16
0
        public int Save(DataTable masterdt, long userid, List <long> phid)
        {
            string sql = string.Format("delete from fg3_myfunctree where userid={0} and usertype = 0", userid);
            //string sql = "delete from fg3_myfunctree where userid=" + userid + "";
            int iret = DbHelper.ExecuteNonQuery(sql);

            if (masterdt.Rows.Count == 0)//删除用户我的功能树所有节点
            {
                return(1);
            }
            //Int64 masterid = this.GetMaxID("fg3_myfunctree");
            int i = 0;

            //处理主表的主键
            foreach (DataRow dr in masterdt.Rows)
            {
                if (dr.RowState == DataRowState.Deleted)
                {
                    continue;
                }

                if (dr.RowState == DataRowState.Added)
                {
                    //Guid.NewGuid().ToString();//主表的主键
                    //dr["phid"] = ++masterid;
                    dr["phid"]     = phid[i++];
                    dr["userid"]   = userid;
                    dr["usertype"] = 0;
                }
            }
            string dateflag = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            UserConfigDac.UserConfigSave(userid, 0, dateflag);
            int m = DbHelper.Update(masterdt, "select * from fg3_myfunctree");

            return(m);
        }
Esempio n. 17
0
        /// <summary>
        /// 批量保存数据到选项明细表
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="logid"></param>
        /// <returns></returns>
        public DataTable SaveShortcutMenu(DataTable dt)
        {
            try
            {
                long      userid     = NG3.AppInfoBase.UserID;
                DataTable dtShortcut = new DataTable();
                string    dateflag   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

                int affectrows = DbHelper.ExecuteNonQuery("delete from fg3_shortcutmenu where userid=" + userid + "");
                if (dt.Rows.Count > 0)
                {
                    IList <long> phidList = this.GetPhidList(dt.Rows.Count, "phid", 1, "fg3_shortcutmenu");
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dt.Rows[i]["phid"]   = phidList[i];
                        dt.Rows[i]["seq"]    = i + 1;
                        dt.Rows[i]["userid"] = NG3.AppInfoBase.UserID;
                    }
                    int rows = DbHelper.Update(dt, "select * from fg3_shortcutmenu");
                    if (rows > 0)
                    {
                        UserConfigDac.UserConfigSave(userid, 0, dateflag);
                        StringBuilder strbuilder = new StringBuilder();
                        strbuilder.Append("select a.displayname,a.shortcutkey,a.url,a.urlparam,a.name as str,b.managername,b.moduleno,b.code as id,b.suite,b.rightkey,b.norightcontrol");
                        strbuilder.Append(" from fg3_shortcutmenu a left join fg3_menu b on a.busphid = b.busphid and a.originalcode = b.code where a.userid=" + userid + " order by a.seq asc");
                        dtShortcut = DbHelper.GetDataTable(strbuilder.ToString());
                        dtShortcut = this.RightkeyController(dtShortcut);
                    }
                }
                return(dtShortcut);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }