protected void btnSaveSystemPrivilege_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemPrivilegeWrapper obj = SystemPrivilegeWrapper.FindById(int.Parse(hidPrivilegeID.Text.Trim()));
                obj.OperationID     = SystemOperationWrapper.FindById(Convert.ToInt32(this.cmbOperationID.SelectedItem.Value));
                obj.PrivilegeCnName = this.txtPrivilegeCnName.Text.Trim();
                obj.PrivilegeEnName = this.txtPrivilegeEnName.Text.Trim();

                obj.Description    = this.txtDescription.Text.Trim();
                obj.PrivilegeOrder = Convert.ToInt32(this.txtPrivilegeOrder.Text.Trim());
                //obj.PrivilegeCategory = this.txtPrivilegeCategory.Text.Trim();



                SystemPrivilegeWrapper.Update(obj);

                winSystemPrivilegeEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
        protected void Store2_OnRefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            int selectResourceID = 0;

            if (e.Parameters["SelectResourceID"] != null)
            {
                selectResourceID = Convert.ToInt32(e.Parameters["SelectResourceID"]);
            }

            if (selectResourceID == 0)
            {
                Store2.DataSource = new List <SystemPrivilegeWrapper>();
                Store2.DataBind();
                return;
            }

            SystemResourcesWrapper resourcesWrapper = SystemResourcesWrapper.FindById(selectResourceID);

            SystemRoleWrapper             systemRoleWrapper = SystemRoleWrapper.FindById(RoleID);
            List <string>                 list2             = SystemRoleWrapper.GetRoleAssignedPermissionsByResources(systemRoleWrapper, resourcesWrapper);
            List <SystemPrivilegeWrapper> list3             = new List <SystemPrivilegeWrapper>();

            foreach (string s in list2)
            {
                list3.Add(SystemPrivilegeWrapper.FindById(Int32.Parse(s)));
            }
            Store2.DataSource = list3;
            Store2.DataBind();
        }
        public void Show(int id)
        {
            try
            {
                SystemPrivilegeWrapper obj = SystemPrivilegeWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtPrivilegeCnName.Text   = obj.PrivilegeCnName.ToString();
                    this.txtPrivilegeEnName.Text   = obj.PrivilegeEnName.ToString();
                    this.txtDescription.Text       = obj.Description.ToString();
                    this.txtPrivilegeCategory.Text = obj.PrivilegeCategory.ToString();



                    hidSystemPrivilegeID.Text = id.ToString();


                    winSystemPrivilegeEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void Store2_OnRefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            SystemRoleWrapper             systemRoleWrapper = SystemRoleWrapper.FindById(RoleID);
            List <string>                 list2             = SystemRoleWrapper.GetRoleAssignedPermissions(systemRoleWrapper);
            List <SystemPrivilegeWrapper> list3             = new List <SystemPrivilegeWrapper>();

            foreach (string s in list2)
            {
                list3.Add(SystemPrivilegeWrapper.FindById(Int32.Parse(s)));
            }
            Store2.DataSource = list3;
            Store2.DataBind();
        }
        private void InitStore2()
        {
            SystemRoleWrapper             systemRoleWrapper = SystemRoleWrapper.FindById(RoleID);
            List <string>                 list2             = SystemRoleWrapper.GetRoleAssignedPermissions(systemRoleWrapper);
            List <SystemPrivilegeWrapper> list3             = new List <SystemPrivilegeWrapper>();

            foreach (string s in list2)
            {
                list3.Add(SystemPrivilegeWrapper.FindById(Int32.Parse(s)));
            }
            Store2.DataSource = list3;
            Store2.DataBind();
        }
        public void Show(int id)
        {
            try
            {
                SystemPrivilegeWrapper obj = SystemPrivilegeWrapper.FindById(id);

                if (obj != null)
                {
                    this.radnumOperationID.Value   = obj.OperationID.ToString();
                    this.radnumResourcesID.Value   = obj.ResourcesID.ToString();
                    this.txtPrivilegeCnName.Text   = obj.PrivilegeCnName.ToString();
                    this.txtPrivilegeEnName.Text   = obj.PrivilegeEnName.ToString();
                    this.txtDefaultValue.Text      = obj.DefaultValue.ToString();
                    this.txtDescription.Text       = obj.Description.ToString();
                    this.txtPrivilegeOrder.Text    = obj.PrivilegeOrder.ToString();
                    this.txtPrivilegeCategory.Text = obj.PrivilegeCategory.ToString();
                    this.txtPrivilegeType.Text     = obj.PrivilegeType.ToString();



                    hidPrivilegeID.Text = id.ToString();


                    winSystemPrivilegeEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSystemPrivilege_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemPrivilegeWrapper obj = SystemPrivilegeWrapper.FindById(int.Parse(hidSystemPrivilegeID.Text.Trim()));
                obj.PrivilegeCnName   = this.txtPrivilegeCnName.Text.Trim();
                obj.PrivilegeEnName   = this.txtPrivilegeEnName.Text.Trim();
                obj.Description       = this.txtDescription.Text.Trim();
                obj.PrivilegeCategory = this.txtPrivilegeCategory.Text.Trim();

                SystemPrivilegeWrapper.Update(obj);

                winSystemPrivilegeEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }