Exemple #1
0
        public void Update()
        {
            BusinessMapping.Role bo = new BusinessMapping.Role();
            bo.SessionInstance = new Wicresoft.Session.Session();

            BusinessFilter filter = new BusinessFilter("Role");

            filter.AddFilterItem("PKID", this.PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);

            bo.AddFilter(filter);
            bo.Load();

            if (bo.HaveRecord)
            {
                bo.RoleCode.Value = this.tbxRoleCode.Text.Trim();
                bo.RoleName.Value = this.tbxRoleName.Text.Trim();
                bo.Memo.Value     = this.tbxMemo.Text.Trim();

                bo.ModifyTime.Value = DateTime.Now;
                bo.ModifyUser.Value = GlobalFacade.SystemContext.GetContext().UserID;
                bo.Update();

                //BusinessRule.SystemManage.OperationLog rule = new BusinessRule.SystemManage.OperationLog();
                //rule.WriteOperationLog("用户组管理", "编辑用户组");
            }
        }
Exemple #2
0
        private void btnDel_Click(object sender, ImageClickEventArgs e)
        {
            string PKID;
            int    selectedIndex = -1;

            foreach (DataGridItem item in this.dgRole.Items)
            {
                if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                {
                    if (((System.Web.UI.WebControls.RadioButton)item.Cells[0].Controls[1]).Checked)
                    {
                        selectedIndex = item.ItemIndex;
                        break;
                    }
                }
            }

            if (selectedIndex != -1)
            {
                PKID = this.dgRole.Items[selectedIndex].Cells[1].Text;
                Wicresoft.Session.Session session = new Wicresoft.Session.Session();
                BusinessMapping.Role      bo      = new BusinessMapping.Role();
                bo.SessionInstance = session;

                BusinessFilter filter = new BusinessFilter("Role");
                filter.AddFilterItem("PKID", PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
                bo.AddFilter(filter);
                bo.Load();

                if (bo.IsReserved.Value)
                {
                    GlobalFacade.Utils.ShowMessage(Enums.Constants.RecordReserved);
                }
                else
                {
                    bo.ModifyUser.Value = this.MyContext.UserID;
                    bo.ModifyTime.Value = DateTime.Now;
                    bo.IsValid.Value    = false;
                    bo.Update();

                    //BusinessRule.SystemManage.OperationLog rule = new BusinessRule.SystemManage.OperationLog();
                    //rule.WriteOperationLog("用户组管理", "删除用户组");

                    // Reload Data
                    ucCustomPaging.LoadData(ucCustomPaging.CurrentPage);
                }
            }
        }
Exemple #3
0
        public void LoadBaseInfo(int pkid)
        {
            BusinessMapping.Role bo = new BusinessMapping.Role();
            bo.SessionInstance = new Wicresoft.Session.Session();

            BusinessFilter filter = new BusinessFilter("Role");

            filter.AddFilterItem("PKID", pkid.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND);
            bo.AddFilter(filter);
            bo.Load();

            if (bo.HaveRecord)
            {
                this.tbxRoleCode.Text = bo.RoleCode.Value;
                this.tbxRoleName.Text = bo.RoleName.Value;
                this.tbxMemo.Text     = bo.Memo.Value;
            }
        }
Exemple #4
0
        public string GetRoleName(string roleID)
        {
            string rolename = string.Empty;

            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessMapping.Role      bo      = new BusinessMapping.Role();
            bo.SessionInstance = session;

            BusinessFilter filter = new BusinessFilter("Role");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddFilterItem("PKID", roleID, Operation.Equal, FilterType.StringType, AndOr.AND);
            bo.AddFilter(filter);
            bo.Load();

            if (bo.HaveRecord)
            {
                rolename = bo.RoleName.Value;
            }

            return(rolename);
        }
Exemple #5
0
        /* 根据名称获取用户组ID */
        public int GetRoleID(string rolename)
        {
            int roleid = -1;

            Wicresoft.Session.Session session = new Wicresoft.Session.Session();
            BusinessMapping.Role      bo      = new BusinessMapping.Role();
            bo.SessionInstance = session;

            BusinessFilter filter = new BusinessFilter("Role");

            filter.AddFilterItem("IsValid", "1", Operation.Equal, FilterType.NumberType, AndOr.AND);
            filter.AddFilterItem("RoleName", rolename, Operation.Equal, FilterType.StringType, AndOr.AND);
            bo.AddFilter(filter);
            bo.Load();

            if (bo.HaveRecord)
            {
                roleid = bo.PKID.Value;
            }

            return(roleid);
        }