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); }
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); }
public void UpdateBcRole(BcRoleEntity entity) { entity.Update(); }
public void AddNewBcRole(BcRoleEntity entity) { entity.RoleId = null; entity.Insert(); }