예제 #1
0
 public bool ValidCreateObject(EmployeeLoanDetail employeeLoanDetail, IEmployeeLoanService _employeeLoanService)
 {
     VHasEmployeeLoan(employeeLoanDetail, _employeeLoanService);
     if (!isValid(employeeLoanDetail))
     {
         return(false);
     }
     VIsValidAmount(employeeLoanDetail);
     if (!isValid(employeeLoanDetail))
     {
         return(false);
     }
     VIsValidAmountPaid(employeeLoanDetail);
     return(isValid(employeeLoanDetail));
 }
예제 #2
0
 public bool ValidUpdateObject(EmployeeLoanDetail employeeLoanDetail, IEmployeeLoanService _employeeLoanService)
 {
     employeeLoanDetail.Errors.Clear();
     ValidCreateObject(employeeLoanDetail, _employeeLoanService);
     return(isValid(employeeLoanDetail));
 }
예제 #3
0
 public EmployeeLoanDetail UpdateObject(EmployeeLoanDetail employeeLoanDetail, IEmployeeLoanService _employeeLoanService)
 {
     return(employeeLoanDetail = _validator.ValidUpdateObject(employeeLoanDetail, _employeeLoanService) ? _repository.UpdateObject(employeeLoanDetail) : employeeLoanDetail);
 }
예제 #4
0
        public EmployeeLoanDetail VHasEmployeeLoan(EmployeeLoanDetail employeeLoanDetail, IEmployeeLoanService _employeeLoanService)
        {
            EmployeeLoan employeeLoan = _employeeLoanService.GetObjectById(employeeLoanDetail.EmployeeLoanId);

            if (employeeLoan == null)
            {
                employeeLoanDetail.Errors.Add("EmployeeLoan", "Tidak ada");
            }
            return(employeeLoanDetail);
        }
예제 #5
0
 public EmployeeLoanDetail CreateObject(EmployeeLoanDetail employeeLoanDetail, IEmployeeLoanService _employeeLoanService)
 {
     employeeLoanDetail.Errors = new Dictionary <String, String>();
     return(_validator.ValidCreateObject(employeeLoanDetail, _employeeLoanService) ? _repository.CreateObject(employeeLoanDetail) : employeeLoanDetail);
 }