Example #1
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            if (!FrameWorkMenuTree.CheckModuleLastLevel(ModuleID))
            {
                return;
            }
            string PermissionName_Value     = (string)Common.sink(PermissionName.UniqueID, MethodType.Post, 100, 1, DataType.Str);
            sys_ModuleExtPermissionTable st = new sys_ModuleExtPermissionTable();

            st.DB_Option_Action_ = "Insert";
            st.ModuleID          = ModuleID;
            st.PermissionName    = PermissionName_Value;
            st.PermissionValue   = BusinessFacade.sys_ModuleExtPermissionGetLastPermissionValue(ModuleID);
            if (st.PermissionValue == 0)
            {
                EventMessage.MessageBox(1, "操作失败", string.Format("增加自定义权限失败,权限值已经达到最大值,无法再增加!"), Icon_Type.Alert, Common.GetHomeBaseUrl(string.Format("ModuleManager.aspx?cmd=ExtPermission&S_ID={0}&ModuleID={1}", S_ID, ModuleID)));
            }
            int returnint = BusinessFacade.sys_ModuleExtPermissionInsertUpdate(st);

            if (returnint < 0)
            {
                EventMessage.MessageBox(1, "操作失败", string.Format("增加自定义权限失败!"), Icon_Type.Error, Common.GetHomeBaseUrl(string.Format("ModuleManager.aspx?cmd=ExtPermission&S_ID={0}&ModuleID={1}", S_ID, ModuleID)));
            }
            sys_ModuleExtPermission_Cache.ReLoadCache();
            TabOptionWebControls1.SelectIndex = 3;
            BindPermissionList();
        }
Example #2
0
 /// <summary>
 /// 设置扩展模块缓存
 /// </summary>
 /// <param name="sm"></param>
 static void set_ModuleExtCache(sys_ModuleExtPermissionTable sm)
 {
     sys_ModuleExtCache.Add(sm.ExtPermissionID, sm);
     if (sys_ModuleExtListCache.ContainsKey(sm.ModuleID))
     {
         sys_ModuleExtListCache[sm.ModuleID].Add(sm);
     }
     else
     {
         List <sys_ModuleExtPermissionTable> lst = new List <sys_ModuleExtPermissionTable>();
         lst.Add(sm);
         sys_ModuleExtListCache.Add(sm.ModuleID, lst);
     }
 }
Example #3
0
        protected void DeleteExtPermissionID(int extPermissionID)
        {
            if (!FrameWorkMenuTree.CheckModuleLastLevel(ModuleID))
            {
                return;
            }
            sys_ModuleExtPermissionTable se = new sys_ModuleExtPermissionTable();

            se.DB_Option_Action_ = "Delete";
            se.ExtPermissionID   = extPermissionID;
            BusinessFacade.sys_ModuleExtPermissionInsertUpdate(se);
            sys_ModuleExtPermission_Cache.ReLoadCache();
            EventMessage.MessageBox(1, "操作成功", "删除扩展权限成功!", Icon_Type.OK, Common.GetHomeBaseUrl(string.Format("ModuleManager.aspx?cmd=ExtPermission&S_ID={0}&ModuleID={1}", S_ID, ModuleID)));
        }
Example #4
0
        /// <summary>
        /// 将记录集转为sys_ModuleExtPermissionTable实体类
        /// </summary>
        /// <param name="dr">记录集</param>
        /// <returns>sys_ModuleExtPermissionTable</returns>
        protected object Populatesys_ModuleExtPermission(IDataReader dr)
        {
            sys_ModuleExtPermissionTable nc = new sys_ModuleExtPermissionTable();

            if (!Convert.IsDBNull(dr["ExtPermissionID"]))
            {
                nc.ExtPermissionID = Convert.ToInt32(dr["ExtPermissionID"]);                                           // 扩展权限ID
            }
            if (!Convert.IsDBNull(dr["ModuleID"]))
            {
                nc.ModuleID = Convert.ToInt32(dr["ModuleID"]);                                    // 模块ID
            }
            if (!Convert.IsDBNull(dr["PermissionName"]))
            {
                nc.PermissionName = Convert.ToString(dr["PermissionName"]).Trim();                                          // 权限名称
            }
            if (!Convert.IsDBNull(dr["PermissionValue"]))
            {
                nc.PermissionValue = Convert.ToInt32(dr["PermissionValue"]);                                           // 权限值
            }
            return(nc);
        }
Example #5
0
        /// <summary>
        /// 新增/删除/修改 sys_ModuleExtPermission
        /// </summary>
        /// <param name="fam">sys_ModuleExtPermissionTable实体类</param>
        /// <returns>返回0操正常</returns>
        public override int sys_ModuleExtPermissionInsertUpdate(sys_ModuleExtPermissionTable fam)
        {
            int rInt = 0;

            using (SqlConnection Conn = GetSqlConnection())
            {
                SqlCommand cmd = new SqlCommand("sys_ModuleExtPermissionInsertUpdateDelete", 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("@ExtPermissionID", SqlDbType.Int).Value        = fam.ExtPermissionID;   //扩展权限ID
                cmd.Parameters.Add("@ModuleID", SqlDbType.Int).Value            = fam.ModuleID;             //模块ID
                cmd.Parameters.Add("@PermissionName", SqlDbType.NVarChar).Value = fam.PermissionName;       //权限名称
                cmd.Parameters.Add("@PermissionValue", SqlDbType.Int).Value     = fam.PermissionValue;      //权限值
                Conn.Open();
                rInt = Convert.ToInt32(cmd.ExecuteScalar());
                cmd.Dispose();
                Conn.Dispose();
                Conn.Close();
            }
            return(rInt);
        }
Example #6
0
 /// <summary>
 /// 新增/删除/修改 sys_ModuleExtPermission
 /// </summary>
 /// <param name="fam">sys_ModuleExtPermissionTable实体类</param>
 /// <returns>返回0操正常</returns>
 public abstract int sys_ModuleExtPermissionInsertUpdate(sys_ModuleExtPermissionTable fam);