Esempio n. 1
0
        private BcRoleEntity PrepareFormData()
        {
            //校验参数的合法性
            txtRoleName.Text.InitValidation("角色名称").NotEmpty().ShorterThan(25);

            var entity = new BcRoleEntity();

            entity.RoleId   = int.Parse(hdRoleId.Value);
            entity.RoleName = txtRoleName.Text;
            return(entity);
        }
Esempio n. 2
0
        public ExcuteResultEnum DeleteBcRole(int roleId)
        {
            if (EntityExecution.Count <BcUserRoleEntity>(n => n.RoleId == roleId) > 0)
            {
                return(ExcuteResultEnum.IsOccupied);
            }

            BcRoleEntity entity = new BcRoleEntity()
            {
                RoleId = roleId
            };

            EntityExecution.Delete(entity);
            return(ExcuteResultEnum.Success);
        }
Esempio n. 3
0
 public void UpdateBcRole(BcRoleEntity entity)
 {
     entity.Update();
 }
Esempio n. 4
0
 public void AddNewBcRole(BcRoleEntity entity)
 {
     entity.RoleId = null;
     entity.Insert();
 }