private async Task <bool> ValidatePoint(CustomerPointHistory CustomerPointHistory) { if (CustomerPointHistory.ChangePoint <= 0) { CustomerPointHistory.AddError(nameof(CustomerPointHistoryValidator), nameof(CustomerPointHistory.ChangePoint), ErrorCode.ChangePointEmpty); } return(CustomerPointHistory.IsValidated); }
private async Task <bool> ValidateNote(CustomerPointHistory CustomerPointHistory) { if (string.IsNullOrWhiteSpace(CustomerPointHistory.Description)) { CustomerPointHistory.AddError(nameof(CustomerPointHistoryValidator), nameof(CustomerPointHistory.Description), ErrorCode.DescriptionEmpty); } return(CustomerPointHistory.IsValidated); }
public async Task <bool> ValidateId(CustomerPointHistory CustomerPointHistory) { CustomerPointHistoryFilter CustomerPointHistoryFilter = new CustomerPointHistoryFilter { Skip = 0, Take = 10, Id = new IdFilter { Equal = CustomerPointHistory.Id }, Selects = CustomerPointHistorySelect.Id }; int count = await UOW.CustomerPointHistoryRepository.Count(CustomerPointHistoryFilter); if (count == 0) { CustomerPointHistory.AddError(nameof(CustomerPointHistoryValidator), nameof(CustomerPointHistory.Id), ErrorCode.IdNotExisted); } return(count == 1); }