Exemple #1
0
        public void Show(int id)
        {
            try
            {
                SystemUserGroupWrapper obj = SystemUserGroupWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtGroupNameCn.Text      = obj.GroupNameCn.ToString();
                    this.txtGroupNameEn.Text      = obj.GroupNameEn.ToString();
                    this.txtGroupDescription.Text = obj.GroupDescription.ToString();



                    hidSystemUserGroupID.Text = id.ToString();


                    winSystemUserGroupEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        private void InitStore1()
        {
            SystemUserGroupWrapper   systemUserGroupWrapper = SystemUserGroupWrapper.FindById(UserGroupID);
            List <SystemRoleWrapper> list1 = SystemRoleWrapper.FindAll();                                                //得到所有的角色
            List <string>            list2 = SystemUserGroupWrapper.GetUserGroupAssignedRoleIDs(systemUserGroupWrapper); //得到用户的所有角色编号
            List <SystemRoleWrapper> list3 = list1.FindAll(p => !list2.Contains(p.RoleID.ToString()));

            Store1.DataSource = list3;
            Store1.DataBind();
        }
Exemple #3
0
        protected void Store1_OnRefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            SystemUserGroupWrapper   systemUserGroupWrapper = SystemUserGroupWrapper.FindById(UserGroupID);
            List <SystemRoleWrapper> list1 = SystemRoleWrapper.FindAll();                                                //得到所有的角色
            List <string>            list2 = SystemUserGroupWrapper.GetUserGroupAssignedRoleIDs(systemUserGroupWrapper); //得到用户的所有角色编号
            List <SystemRoleWrapper> list3 = list1.FindAll(p => !list2.Contains(p.RoleID.ToString()));

            Store1.DataSource = list3;
            Store1.DataBind();
        }
        private void InitStore2()
        {
            SystemUserGroupWrapper   systemUserGroupWrapper = SystemUserGroupWrapper.FindById(UserGroupID);
            List <string>            list2 = SystemUserGroupWrapper.GetUserGroupAssignedRoleIDs(systemUserGroupWrapper);
            List <SystemRoleWrapper> list3 = new List <SystemRoleWrapper>();

            foreach (string s in list2)
            {
                list3.Add(SystemRoleWrapper.FindById(Int32.Parse(s)));
            }
            Store2.DataSource = list3;
            Store2.DataBind();
        }
Exemple #5
0
        protected void Store2_OnRefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            SystemUserWrapper             systemUserWrapper = SystemUserWrapper.FindById(UserID);
            List <string>                 list2             = SystemUserWrapper.GetUserAssignedGroupIDs(systemUserWrapper);
            List <SystemUserGroupWrapper> list3             = new List <SystemUserGroupWrapper>();

            foreach (string s in list2)
            {
                list3.Add(SystemUserGroupWrapper.FindById(Int32.Parse(s)));
            }
            Store2.DataSource = list3;
            Store2.DataBind();
        }
 public void Save_UserGroupRole(string json)
 {
     try
     {
         KeyValuePair <string, string>[] selectIDs = JSON.Deserialize <KeyValuePair <string, string>[]>(json);
         List <String> list = new List <string>();
         foreach (KeyValuePair <string, string> row in selectIDs)
         {
             list.Add(row.Key);
         }
         SystemUserGroupWrapper.PatchAssignUserGroupRoles(SystemUserGroupWrapper.FindById(UserGroupID), list);
     }
     catch (Exception ex)
     {
         ResourceManager.AjaxSuccess      = false;
         ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
     }
 }
Exemple #7
0
        public void Save_UserGroupRole(string json)
        {
            try
            {
                List <SystemRoleWrapper> selectIDs = JSON.Deserialize <List <SystemRoleWrapper> >(json);

                List <String> list = new List <string>();
                foreach (SystemRoleWrapper row in selectIDs)
                {
                    list.Add(row.RoleID.ToString());
                }
                SystemUserGroupWrapper.PatchAssignUserGroupRoles(SystemUserGroupWrapper.FindById(UserGroupID), list);
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(this.GetGlobalResourceObject("GlobalResource", "msgServerErrorMsg").ToString(), ex.Message);
            }
        }
Exemple #8
0
        protected void btnSaveSystemUserGroup_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemUserGroupWrapper obj = SystemUserGroupWrapper.FindById(int.Parse(hidSystemUserGroupID.Text.Trim()));
                obj.GroupNameCn      = this.txtGroupNameCn.Text.Trim();
                obj.GroupNameEn      = this.txtGroupNameEn.Text.Trim();
                obj.GroupDescription = this.txtGroupDescription.Text.Trim();

                SystemUserGroupWrapper.Update(obj);

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