Exemplo n.º 1
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;
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
 public void UpdateBcRole(BcRoleEntity entity)
 {
     entity.Update();
 }
Exemplo n.º 4
0
 public void AddNewBcRole(BcRoleEntity entity)
 {
     entity.RoleId = null;
     entity.Insert();
 }