Example #1
0
 private async Task <bool> ValidatePoint(CustomerPointHistory CustomerPointHistory)
 {
     if (CustomerPointHistory.ChangePoint <= 0)
     {
         CustomerPointHistory.AddError(nameof(CustomerPointHistoryValidator), nameof(CustomerPointHistory.ChangePoint), ErrorCode.ChangePointEmpty);
     }
     return(CustomerPointHistory.IsValidated);
 }
Example #2
0
 private async Task <bool> ValidateNote(CustomerPointHistory CustomerPointHistory)
 {
     if (string.IsNullOrWhiteSpace(CustomerPointHistory.Description))
     {
         CustomerPointHistory.AddError(nameof(CustomerPointHistoryValidator), nameof(CustomerPointHistory.Description), ErrorCode.DescriptionEmpty);
     }
     return(CustomerPointHistory.IsValidated);
 }
Example #3
0
        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);
        }