示例#1
0
        /// <summary>
        /// 新增/删除/修改 sys_Module
        /// </summary>
        /// <param name="fam">sys_ModuleTable实体类</param>
        /// <returns>返回0操正常</returns>
        public override int sys_ModuleInsertUpdate(sys_ModuleTable fam)
        {
            int rInt = 0;

            using (SqlConnection Conn = GetSqlConnection())
            {
                SqlCommand cmd = new SqlCommand("sys_ModuleInsertUpdateDelete", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                //设置参数
                cmd.Parameters.Add("@DB_Option_Action_", SqlDbType.NVarChar).Value = fam.DB_Option_Action_; //操作方法 Insert:增加 Update:修改 Delete:删除 Disp:显示单笔记录
                cmd.Parameters.Add("@ModuleID", SqlDbType.Int).Value         = fam.ModuleID;                //功能模块ID号
                cmd.Parameters.Add("@M_ApplicationID", SqlDbType.Int).Value  = fam.M_ApplicationID;         //所属应用程序ID
                cmd.Parameters.Add("@M_ParentID", SqlDbType.Int).Value       = fam.M_ParentID;              //所属父级模块ID与ModuleID关联,0为顶级
                cmd.Parameters.Add("@M_PageCode", SqlDbType.VarChar).Value   = fam.M_PageCode;              //模块编码Parent为0,则为S00(xx),否则为S00M00(xx)
                cmd.Parameters.Add("@M_CName", SqlDbType.NVarChar).Value     = fam.M_CName;                 //模块/栏目名称当ParentID为0为模块名称
                cmd.Parameters.Add("@M_Directory", SqlDbType.NVarChar).Value = fam.M_Directory;             //模块/栏目目录名
                cmd.Parameters.Add("@M_OrderLevel", SqlDbType.VarChar).Value = fam.M_OrderLevel;            //当前所在排序级别支持双层99级菜单
                cmd.Parameters.Add("@M_IsSystem", SqlDbType.Int).Value       = fam.M_IsSystem;              //是否为系统模块1:是0:否如为系统则无法修改
                cmd.Parameters.Add("@M_Close", SqlDbType.Int).Value          = fam.M_Close;                 //是否关闭1:是0:否
                cmd.Parameters.Add("@M_Icon", SqlDbType.NVarChar).Value      = fam.M_Icon;                  //默认显示图标
                Conn.Open();
                rInt = Convert.ToInt32(cmd.ExecuteScalar());
                cmd.Dispose();
                Conn.Dispose();
                Conn.Close();
            }
            return(rInt);
        }
示例#2
0
        /// <summary>
        /// 获得所有叶节点实体类
        /// </summary>
        /// <param name="moduleid">模块id</param>
        /// <param name="lastIds">节点实体类集合</param>
        private static void GetLastIDs(int moduleid, List <sys_ModuleTable> lastIds)
        {
            sys_ModuleTable mt = new sys_ModuleTable();

            if (sys_Module_Cache.Sys_moduleCache.TryGetValue(moduleid, out mt))
            {
                /*
                 * QueryParam qp = new QueryParam();
                 * qp.Orderfld = " M_Applicationid,M_OrderLevel ";
                 * qp.OrderType = 0;
                 * qp.Where = string.Format("Where M_ParentID={0}", moduleid);
                 * int RecordCount = 0;
                 * ArrayList lst = BusinessFacade.sys_ModuleList(qp, out RecordCount);
                 */
                List <sys_ModuleTable> lst = sys_Module_Cache.Sys_moduleTreeCache[moduleid];
                if (lst.Count > 0)
                {
                    foreach (sys_ModuleTable var in lst)
                    {
                        GetLastIDs(var.ModuleID, lastIds);
                    }
                }
                else
                {
                    if (mt.M_ParentID != 0)
                    {
                        lastIds.Add(mt);
                    }
                }
            }
        }
        protected void Module_Sub_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            sys_ModuleTable s_Mt = (sys_ModuleTable)e.Item.DataItem;
            //获得当前设定角色权限
            sys_RolePermissionTable s_Rp = BusinessFacade.sys_RolePermissionDisp(RoleID, ApplicationID, s_Mt.M_PageCode);

            DataList dlist = (DataList)e.Item.FindControl("PermissionList");

            if (dlist != null)
            {
                List <sys_PermissionItem> lst = GetPermissionList(s_Mt.ModuleID);
                FormatPermission(lst, s_Mt.M_PageCode, s_Rp.P_Value);
                dlist.DataSource = lst;
                dlist.DataBind();
            }

            #region "原有代码"

            /*
             * string rightString = string.Format("<img src='{0}'>",ResolveClientUrl("~/Manager/images/right.gif"));
             * string wrongString = string.Format("<img src='{0}'>",ResolveClientUrl("~/Manager/images/wrong.gif"));
             * string dispString = "";
             * string SelectTxt = "";
             * string DisableCheckbox = "";
             * int TempStep = 1;
             * for (int i = 0; i < 8; i++)
             * {
             *  TempStep = TempStep + TempStep;
             *  Literal li = (Literal)e.Item.FindControl(string.Format("Lab{0}_Txt",TempStep));
             *  if (li != null)
             *  {
             *      //判断当前角色所属用户是否享有当前权限
             *      if (!UserData.CheckPageCode(Common.Get_UserID, ApplicationID, s_Mt.M_PageCode, TempStep))
             *      {
             *          DisableCheckbox = "disabled";
             *      }
             *      else
             *      {
             *          DisableCheckbox = "";
             *      }
             *      if ((s_Rp.P_Value & TempStep) == TempStep)
             *      {
             *          dispString = rightString;
             *          SelectTxt = "checked";
             *      }
             *      else
             *      {
             *          dispString = wrongString;
             *          SelectTxt = "";
             *      }
             *      if (CMD == "Edit")
             *      {
             *          dispString = string.Format("<input type=checkbox id='PageCode{0}' name='PageCode{0}' value='{1}'  {2} {3}>", s_Mt.M_PageCode, TempStep, SelectTxt, DisableCheckbox);
             *      }
             *      li.Text = dispString;
             *  }
             * }
             */
            #endregion
        }
示例#4
0
 /// <summary>
 /// 更新模块子模块数
 /// </summary>
 /// <param name="m">模块实体类</param>
 static void setModuleTreeCache(sys_ModuleTable m)
 {
     if (m.M_ParentID != 0)
     {
         if (Sys_moduleTreeCache.ContainsKey(m.M_ParentID))
         {
             Sys_moduleTreeCache[m.M_ParentID].Add(m);
         }
     }
 }
示例#5
0
        /// <summary>
        /// 获得模块所在级别
        /// </summary>
        /// <param name="moduleid">模块id</param>
        /// <param name="level">级别</param>
        private static void GetLevel(int moduleid, ref int level)
        {
            //BusinessFacade.sys_ModuleDisp(moduleid);
            sys_ModuleTable mt = new sys_ModuleTable();

            if (sys_Module_Cache.Sys_moduleCache.TryGetValue(moduleid, out mt))
            {
                level++;
                GetLevel(mt.M_ParentID, ref level);
            }
        }
示例#6
0
        /// <summary>
        /// 根据模块id,获得所有子类值
        /// </summary>
        /// <param name="moduleid">模块id</param>
        /// <returns>模块集合</returns>
        public static List <sys_ModuleTable> GetAllSubModule(int moduleid)
        {
            List <sys_ModuleTable> lst = new List <sys_ModuleTable>();

            GetModule(moduleid, lst);
            sys_ModuleTable mt = sys_Module_Cache.Sys_moduleCache[moduleid]; //BusinessFacade.sys_ModuleDisp(moduleid);

            if (mt.ModuleID != 0)
            {
                lst.Add(mt);
            }
            return(lst);
        }
示例#7
0
        /// <summary>
        /// 将记录集转为sys_ModuleTable实体类
        /// </summary>
        /// <param name="dr">记录集</param>
        /// <returns>sys_ModuleTable</returns>
        protected object Populatesys_Module(IDataReader dr)
        {
            sys_ModuleTable nc = new sys_ModuleTable();

            if (!Convert.IsDBNull(dr["ModuleID"]))
            {
                nc.ModuleID = Convert.ToInt32(dr["ModuleID"]);                                    // 功能模块ID号
            }
            if (!Convert.IsDBNull(dr["M_ApplicationID"]))
            {
                nc.M_ApplicationID = Convert.ToInt32(dr["M_ApplicationID"]);                                           // 所属应用程序ID
            }
            if (!Convert.IsDBNull(dr["M_ParentID"]))
            {
                nc.M_ParentID = Convert.ToInt32(dr["M_ParentID"]);                                      // 所属父级模块ID与ModuleID关联,0为顶级
            }
            if (!Convert.IsDBNull(dr["M_PageCode"]))
            {
                nc.M_PageCode = Convert.ToString(dr["M_PageCode"]).Trim();                                      // 模块编码Parent为0,则为S00(xx),否则为S00M00(xx)
            }
            if (!Convert.IsDBNull(dr["M_CName"]))
            {
                nc.M_CName = Convert.ToString(dr["M_CName"]).Trim();                                   // 模块/栏目名称当ParentID为0为模块名称
            }
            if (!Convert.IsDBNull(dr["M_Directory"]))
            {
                nc.M_Directory = Convert.ToString(dr["M_Directory"]).Trim();                                       // 模块/栏目目录名
            }
            if (!Convert.IsDBNull(dr["M_OrderLevel"]))
            {
                nc.M_OrderLevel = Convert.ToString(dr["M_OrderLevel"]).Trim();                                        // 当前所在排序级别支持双层99级菜单
            }
            if (!Convert.IsDBNull(dr["M_IsSystem"]))
            {
                nc.M_IsSystem = Convert.ToInt32(dr["M_IsSystem"]);                                      // 是否为系统模块1:是0:否如为系统则无法修改
            }
            if (!Convert.IsDBNull(dr["M_Close"]))
            {
                nc.M_Close = Convert.ToInt32(dr["M_Close"]);                                   // 是否关闭1:是0:否
            }
            if (!Convert.IsDBNull(dr["M_Icon"]))
            {
                nc.M_Icon = Convert.ToString(dr["M_Icon"]).Trim();                                  // 模块Icon
            }
            if (!Convert.IsDBNull(dr["M_Info"]))
            {
                nc.M_Info = Convert.ToString(dr["M_Info"]).Trim();                                  // 模块说明
            }
            return(nc);
        }
示例#8
0
        /// <summary>
        /// 根据模块ID,获取模块ID的全路径id集合
        /// </summary>
        /// <param name="ModuleID">模块ID</param>
        /// <param name="lst">路径id集合</param>
        /// <returns></returns>
        private static void GetSubModuleIds(int ModuleID, List <int> lst)
        {
            //sys_ModuleTable mt = BusinessFacade.sys_ModuleDisp(ModuleID);
            //if (mt.ModuleID > 0)
            sys_ModuleTable mt = new sys_ModuleTable();

            if (sys_Module_Cache.Sys_moduleCache.TryGetValue(ModuleID, out mt))
            {
                lst.Add(mt.ModuleID);
                if (mt.M_ParentID != 0)
                {
                    GetSubModuleIds(mt.M_ParentID, lst);
                }
            }
        }
示例#9
0
 /// <summary>
 /// 设置一级模块缓存
 /// </summary>
 /// <param name="m"></param>
 static void setTopModuleCache(sys_ModuleTable m)
 {
     //更新一级菜单
     if (m.M_ParentID == 0)
     {
         if (Sys_moduletopCache.ContainsKey(m.M_ApplicationID))
         {
             Sys_moduletopCache[m.M_ApplicationID].Add(m);
         }
         //else
         //{
         //    List<sys_ModuleTable> mod = new List<sys_ModuleTable>();
         //    mod.Add(m);
         //    Sys_moduletopCache.Add(m.M_ApplicationID, mod);
         //}
     }
 }
        protected void Module_Main_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            sys_ModuleTable s_Mt = (sys_ModuleTable)e.Item.DataItem;
            //QueryParam qp = new QueryParam();
            //qp.Orderfld = " M_OrderLevel ";
            //qp.OrderType = 0;
            //qp.Where = string.Format("Where M_Close=0 and M_ParentID ={0}", s_Mt.ModuleID);
            //int RecordCount = 0;
            //ArrayList lst = BusinessFacade.sys_ModuleList(qp, out RecordCount);
            List <sys_ModuleTable> lst = FrameWorkMenuTree.GetModuleAllLastIDs(s_Mt.ModuleID);

            if (lst.Count > 0)
            {
                Repeater Module_Sub = (Repeater)e.Item.FindControl("Module_Sub");
                Module_Sub.DataSource = lst;
                Module_Sub.DataBind();
            }
        }
示例#11
0
        /// <summary>
        /// 绑定子菜单事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ModuleListMain_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            sys_ModuleTable s_Mt = (sys_ModuleTable)e.Item.DataItem;

            QueryParam qp = new QueryParam();

            qp.Orderfld  = " M_OrderLevel ";
            qp.OrderType = 0;
            qp.Where     = string.Format("Where M_ParentID ={0}", s_Mt.ModuleID);
            int       RecordCount = 0;
            ArrayList lst         = BusinessFacade.sys_ModuleList(qp, out RecordCount);

            if (lst.Count > 0)
            {
                Repeater LeftSubID = (Repeater)e.Item.FindControl("ModuleListMain_Sub");
                LeftSubID.DataSource = lst;
                LeftSubID.DataBind();
            }
        }
示例#12
0
        /// <summary>
        /// 获取模块标题路径
        /// </summary>
        /// <param name="ModuleID">模块ID</param>
        /// <returns></returns>
        public static string GetModuleTitle(int ModuleID)
        {
            /*
             * int TotalRecord = 0;
             * QueryParam qp = new QueryParam();
             * qp.Where = " where ModuleID =  " + ModuleID;
             * qp.PageIndex = 1;
             * qp.PageSize = 1;
             * ArrayList lst = BusinessFacade.sys_ModuleList(qp, out TotalRecord);
             * if (TotalRecord == 1)
             * {
             *  foreach (sys_ModuleTable x in lst)
             *  {
             *      if (x.M_ParentID != 0)
             *          return GetModuleTitle(x.M_ParentID) + ">" + x.M_CName;
             *      else
             *          return GetModuleTitle(x.M_ParentID);
             *  }
             * }
             * return "";
             */

            sys_ModuleTable x = new sys_ModuleTable();

            if (sys_Module_Cache.Sys_moduleCache.TryGetValue(ModuleID, out x))
            {
                if (x.M_ParentID != 0)
                {
                    return(GetModuleTitle(x.M_ParentID) + ">" + x.M_CName);
                }
                else
                {
                    return("");
                }
            }
            else
            {
                return("");
            }
        }
示例#13
0
        /// <summary>
        /// 获得子分类html
        /// </summary>
        /// <param name="parentid">父级ID</param>
        /// <param name="sb">字符串</param>
        /// <param name="allowkey">允许的模块id</param>
        private static void GetTree(int parentid, StringBuilder sb, SortedList <int, string> allowkey)
        {
            if (allowkey.ContainsKey(parentid))
            {
                sys_ModuleTable mt = sys_Module_Cache.Sys_moduleCache[parentid]; //BusinessFacade.sys_ModuleDisp(parentid);
                if (mt.ModuleID != 0)
                {
                    //sb.AppendFormat("<dt><a href=\"{0}\" target=\"mainFrame\">{1}</a></dt>", mt.M_Directory, mt.M_CName);

                    /*
                     * QueryParam qp = new QueryParam();
                     * qp.Orderfld = " M_Applicationid,M_OrderLevel ";
                     * qp.OrderType = 0;
                     * qp.Where = string.Format("Where M_Close=0 and M_ParentID={0}", parentid);
                     * int RecordCount = 0;
                     * ArrayList lst = BusinessFacade.sys_ModuleList(qp, out RecordCount);
                     */
                    List <sys_ModuleTable> lst = sys_Module_Cache.Sys_moduleTreeCache[parentid];
                    int RecordCount            = lst.Count;
                    if (RecordCount > 0)
                    {
                        sb.AppendFormat("<dd>{0}", mt.M_CName);
                        sb.Append("<dl>");
                        foreach (sys_ModuleTable var in lst)
                        {
                            GetTree(var.ModuleID, sb, allowkey);
                        }
                        sb.Append("</dl>");
                        sb.Append("</dd>");
                    }
                    else
                    {
                        //sb.AppendFormat("<dt><a href=\"{0}\" target=\"mainFrame\">{1}</a></dt>", mt.M_Directory, mt.M_CName);
                        sb.AppendFormat("<dt onclick=\"javascript:window.parent.frames['mainFrame'].location='{1}';\">{0}</dt>", mt.M_CName, mt.M_Directory);
                    }
                }
            }
        }
示例#14
0
        /// <summary>
        /// 绑定子菜单事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void LeftMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            sys_ModuleTable s_Mt = (sys_ModuleTable)e.Item.DataItem;

            QueryParam qp = new QueryParam();

            qp.Orderfld  = " M_OrderLevel ";
            qp.OrderType = 0;
            qp.Where     = string.Format("Where M_Close=0 and M_ParentID ={0}", s_Mt.ModuleID);
            int       RecordCount = 0;
            ArrayList lst         = BusinessFacade.sys_ModuleList(qp, out RecordCount);

            BusinessFacade.Remove_MenuNoPermission(lst);
            if (lst.Count > 0)
            {
                Repeater LeftSubID = (Repeater)e.Item.FindControl("LeftMenu_Sub");
                LeftSubID.DataSource = lst;
                LeftSubID.DataBind();
            }
            else
            {
                e.Item.Visible = false;
            }
        }
示例#15
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            sys_ModuleTable smt = new sys_ModuleTable();

            smt = BusinessFacade.sys_ModuleDisp(ModuleID);
            string OldPageCode = smt.M_PageCode;

            smt.M_ApplicationID = S_ID;
            smt.M_Close         = (int)Common.sink(this.M_Close.UniqueID, MethodType.Post, 255, 1, DataType.Int);
            smt.M_CName         = (string)Common.sink(this.M_CName.UniqueID, MethodType.Post, 50, 1, DataType.Str);
            smt.M_Directory     = (string)Common.sink(this.M_Directory.UniqueID, MethodType.Post, 255, 0, DataType.Str);
            smt.M_Icon          = (string)Common.sink(this.M_Icon.UniqueID, MethodType.Post, 255, 0, DataType.Str);
            //smt.M_IsSystem = (int) Common.sink(this.M_IsSystem.UniqueID,MethodType.Post,255,1,DataType.Int);
            smt.M_PageCode = (string)Common.sink(this.M_PageCode.UniqueID, MethodType.Post, 6, 1, DataType.CharAndNum);
            if (CMD == "New")
            {
                if (BusinessFacade.sys_Module_CheckPK(smt.M_ApplicationID, smt.M_PageCode, 0))
                {
                    EventMessage.MessageBox(1, "数据输入出错", string.Format("存在相同的模块编码({0})", smt.M_PageCode)
                                            , Icon_Type.Error, "history.back()", UrlType.JavaScript);
                }

                QueryParam qp = new QueryParam();
                qp.Orderfld  = "M_OrderLevel";
                qp.PageIndex = 1;
                qp.PageSize  = 1;
                qp.Where     = string.Format("Where M_ParentID={0} and M_Applicationid={1}", ModuleID, S_ID);
                int       RecordCount = 0;
                ArrayList lst         = BusinessFacade.sys_ModuleList(qp, out RecordCount);
                if (ModuleID == 0)
                {
                    if (RecordCount != 0)
                    {
                        RecordCount = Convert.ToInt32(((sys_ModuleTable)lst[0]).M_OrderLevel.Substring(0, 2)) + 1;
                    }
                    smt.M_OrderLevel = Common.FillZero(RecordCount.ToString(), 2) + "00";
                }
                else
                {
                    if (RecordCount != 0)
                    {
                        RecordCount = Convert.ToInt32(((sys_ModuleTable)lst[0]).M_OrderLevel.Substring(2, 2));
                    }
                    RecordCount++;
                    smt.M_OrderLevel = smt.M_OrderLevel.Substring(0, 2) + Common.FillZero(RecordCount.ToString(), 2);
                }
                smt.M_ParentID        = ModuleID;
                smt.DB_Option_Action_ = "Insert";
            }
            else if (CMD == "Edit")
            {
                if (BusinessFacade.sys_Module_CheckPK(smt.M_ApplicationID, smt.M_PageCode, ModuleID))
                {
                    EventMessage.MessageBox(1, "数据输入出错", string.Format("存在相同的模块编码({0})", smt.M_PageCode)
                                            , Icon_Type.Error, "history.back()", UrlType.JavaScript);
                }
                smt.DB_Option_Action_ = "Update";
            }
            smt.ModuleID = ModuleID;
            if (smt.M_IsSystem != 1)
            {
                BusinessFacade.sys_ModuleInsertUpdate(smt);
            }
            if (!string.IsNullOrEmpty(OldPageCode) && OldPageCode != smt.M_PageCode)
            {
                //清除旧有PageCode所在用户的权限.
                BusinessFacade.sys_RolePermission_DeleteForm(smt.M_ApplicationID, OldPageCode);
            }
            sys_Module_Cache.ReLoadCache(); //重新加载模块缓存
            EventMessage.MessageBox(1, "操作成功", string.Format("增加/修改模块ID({0})成功!", ModuleID), Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("ModuleManager.aspx?ModuleID={0}&S_ID={1}", ModuleID, S_ID)));
        }
示例#16
0
 /// <summary>
 /// 新增/删除/修改 sys_Module
 /// </summary>
 /// <param name="fam">sys_ModuleTable实体类</param>
 /// <returns>返回0操正常</returns>
 public abstract int sys_ModuleInsertUpdate(sys_ModuleTable fam);
示例#17
0
        private void OnStart()
        {
            if (FrameWorkMenuTree.GetModuleLevel(ModuleID) >= 3)
            {
                MessageLit.Text = "<font color=red>以下模块超过3层,只有当菜单样式为\"多级菜单\"才能正常显示出来!</font>";
            }

            if (CMD == string.Empty)
            {
                //TabOptionWebControls1.SelectIndex = 1;
                TabOptionItem3.Visible = true;
            }

            //填充数据
            sys_ModuleTable SMT = new sys_ModuleTable();

            SMT = BusinessFacade.sys_ModuleDisp(ModuleID);
            this.M_ApplicationID_Txt.Text = S_ID_Name;
            if (ModuleID == 0)
            {
                this.M_PageCode.Text = SMT.M_PageCode;
            }
            if (CMD == "New" && ModuleID != 0)
            {
                this.M_ParentID_Txt.Text = SMT.M_CName + "(" + SMT.M_PageCode + ")";
            }
            else
            {
                this.M_ParentID_Txt.Text = SMT.M_ParentID == 0 ? "无" : BusinessFacade.sys_ModuleDisp(SMT.M_ParentID).M_CName;
            }
            this.M_PageCode_Txt.Text  = SMT.M_PageCode;
            this.M_CName_Txt.Text     = SMT.M_CName;
            this.M_Directory_Txt.Text = SMT.M_Directory;
            this.M_IsSystem_Txt.Text  = SMT.M_IsSystem == 0 ? "否" : "是";
            this.M_Close_Txt.Text     = SMT.M_Close == 0 ? "否" : "是";
            this.M_Icon_Txt.Text      = SMT.M_Icon;

            if (CMD == "Edit")
            {
                this.M_PageCode.Text  = SMT.M_PageCode;
                this.M_CName.Text     = SMT.M_CName;
                this.M_Directory.Text = SMT.M_Directory;
                this.M_Icon.Text      = SMT.M_Icon;
                ListItem ditem1 = this.M_IsSystem.Items.FindByValue(SMT.M_IsSystem.ToString());
                if (ditem1 != null)
                {
                    ditem1.Selected = true;
                }
                ListItem ditem2 = this.M_Close.Items.FindByValue(SMT.M_Close.ToString());
                if (ditem2 != null)
                {
                    ditem2.Selected = true;
                }
            }

            //绑定子模块
            QueryParam qp = new QueryParam();

            qp.Orderfld  = " M_Applicationid,M_OrderLevel ";
            qp.OrderType = 0;
            qp.Where     = string.Format("Where M_ParentID={0} and M_Applicationid={1}", ModuleID, S_ID);
            int       RecordCount = 0;
            ArrayList lst         = BusinessFacade.sys_ModuleList(qp, out RecordCount);

            GridView1.DataSource = lst;
            GridView1.DataBind();

            //绑定排序
            OrderByListItems.DataSource     = lst;
            OrderByListItems.DataTextField  = "M_CName";
            OrderByListItems.DataValueField = "ModuleID";
            OrderByListItems.DataBind();
            if (lst.Count > 0)
            {
                OrderByListItems.Rows = lst.Count;
            }

            //判断是否隐藏数据
            if (CMD == "New" || CMD == "Edit")
            {
                HiddenDisp();
            }
            else
            {
                HiddenInput();
                SubmitTr.Visible = false;
            }



            //if (ModuleID !=0 && SMT.M_OrderLevel.Substring(2, 2) != "00")
            //{
            //    TabOptionWebControls1.SelectIndex = 0;
            //    TabOptionItem2.Visible = false;
            //    TabOptionItem3.Visible = false;

            //    if (CMD!="New" && CMD!="Edit")
            //        TabOptionItem4.Visible = true;

            //    BindPermissionList();
            //    if (CMD == "Edit")
            //    {
            //        HeadMenuButtonItem m5 = new HeadMenuButtonItem();
            //        m5.ButtonIcon = "back.gif";
            //        m5.ButtonName = "返回";
            //        m5.ButtonPopedom = PopedomType.List;
            //        m5.ButtonUrl = string.Format("?ModuleID={0}&S_ID={1}", ModuleID, S_ID);
            //        HeadMenuWebControls1.ButtonList.Add(m5);
            //    }
            //}



            //生成修改按钮
            if (ModuleID != 0 && CMD == "")
            {
                HeadMenuButtonItem m3 = new HeadMenuButtonItem();
                m3.ButtonName    = "模块";
                m3.ButtonPopedom = PopedomType.Edit;
                m3.ButtonUrl     = string.Format("?CMD=Edit&ModuleID={0}&S_ID={1}", ModuleID, S_ID);
                HeadMenuWebControls1.ButtonList.Add(m3);


                //if (FrameWorkMenuTree.CheckModuleLastLevel(ModuleID))
                if (BusinessFacade.GetSuBCount(ModuleID) == 0)
                {
                    HeadMenuButtonItem m6 = new HeadMenuButtonItem();
                    m6.ButtonName    = "设定模块扩展权限";
                    m6.ButtonIcon    = "b.gif";
                    m6.ButtonPopedom = PopedomType.Edit;
                    m6.ButtonUrl     = string.Format("?CMD=ExtPermission&ModuleID={0}&S_ID={1}", ModuleID, S_ID);
                    HeadMenuWebControls1.ButtonList.Add(m6);
                }
            }

            //生成删除按钮
            if (CMD == "Edit")
            {
                HeadMenuButtonItem m4 = new HeadMenuButtonItem();
                m4.ButtonPopedom = PopedomType.Delete;
                m4.ButtonUrl     = string.Format("DelData('?CMD=Delete&S_ID={0}&ModuleID={1}')", S_ID, ModuleID);
                m4.ButtonUrlType = UrlType.JavaScript;
                HeadMenuWebControls1.ButtonList.Add(m4);
            }

            //判断是否执行删除
            if (CMD == "Delete")
            {
                SMT.DB_Option_Action_ = "Delete";
                if (SMT.M_IsSystem != 1)
                {
                    BusinessFacade.DeleteModule(ModuleID);
                }
                sys_Module_Cache.ReLoadCache(); //重新加载模块缓存
                EventMessage.MessageBox(1, "操作成功", "删除记录ID:(" + ModuleID + ")成功!", Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("ModuleList.aspx?S_ID={0}&AppName={1}", S_ID, S_ID_Name)));
            }

            //Button1.Attributes.Add("Onclick", "javascript:return checkForm(aspnetForm);");



            if (CMD == "ExtPermission")
            {
                TabOptionItem2.Visible            = false;
                TabOptionItem4.Visible            = true;
                TabOptionWebControls1.SelectIndex = 3;
                BindPermissionList();
            }
        }
示例#18
0
 /// <summary>
 /// 设置模块缓存
 /// </summary>
 /// <param name="m">设置模块</param>
 static void setModuleCache(sys_ModuleTable m)
 {
     Sys_moduleCache.Add(m.ModuleID, m);                                //初始化模块缓存
     Sys_moduleTreeCache.Add(m.ModuleID, new List <sys_ModuleTable>()); //初始化树状模块缓存
 }