Exemplo n.º 1
0
        protected override object GetEditObject()
        {
            if (facade == null)
            {
                facade = new SystemSettingFacadeFactory(base.DataProvider).Create();
            }
            UserGroup2Module relation = facade.CreateNewUserGroup2Module();

            relation.ModuleCode    = this.txtModuleCodeEdit.Text;
            relation.UserGroupCode = this.txtUserGroupCodeQuery.Text;

            if (securityFacade == null)
            {
                securityFacade = new SystemSettingFacadeFactory(base.DataProvider).CreateSecurityFacade();
            }
            relation.ViewValue = securityFacade.SpellViewValueFromRights(new bool[] {
                this.chbRight.Items[0].Selected,
                this.chbRight.Items[1].Selected,
                this.chbRight.Items[2].Selected,
                this.chbRight.Items[3].Selected
            });

            relation.MaintainUser = this.GetUserCode();

            return(relation);
        }
Exemplo n.º 2
0
        protected override object GetEditObject(UltraGridRow row)
        {
            string userGroupCode = this.txtUserGroupCodeQuery.Text.Trim();

            if (facade == null)
            {
                facade = new SystemSettingFacadeFactory(base.DataProvider).Create();
            }
            UserGroup2Module relation = facade.CreateNewUserGroup2Module();

            relation.UserGroupCode = userGroupCode;
            relation.ModuleCode    = row.Cells[2].Text;
            if (securityFacade == null)
            {
                securityFacade = new SystemSettingFacadeFactory(base.DataProvider).CreateSecurityFacade();
            }
            relation.ViewValue = securityFacade.SpellViewValueFromRights(new bool[] {
                row.Cells.FromKey("Export").Text == "true",
                row.Cells.FromKey("Read").Text == "true",
                row.Cells.FromKey("Write").Text == "true",
                row.Cells.FromKey("Delete").Text == "true"
            });
            relation.MaintainUser = this.GetUserCode();

            return(relation);
        }