public void UpdateCustomerPayment(CustomerPaymentDTO customerPaymentDTO) { CustomerPaymentTransaction customerPaymentTransaction = null; CustomerPaymentConvertor.ConvertToCustomerPaymentEntity(ref customerPaymentTransaction, customerPaymentDTO, true); unitOfWork.CustomerPaymentRepository.Update(customerPaymentTransaction); unitOfWork.SaveChanges(); }
public void AddCustomerPayment(CustomerPaymentDTO customerPaymentDTO) { CustomerPaymentTransaction customerPaymentTransaction = new CustomerPaymentTransaction(); customerPaymentTransaction.CustomerPaymentId = unitOfWork.DashboardRepository.NextNumberGenerator("CustomerPaymentTransaction"); CustomerPaymentConvertor.ConvertToCustomerPaymentEntity(ref customerPaymentTransaction, customerPaymentDTO, false); unitOfWork.CustomerPaymentRepository.Add(customerPaymentTransaction); this.UpdateCustomerWallet(customerPaymentDTO); unitOfWork.SaveChanges(); }
public CustomerPaymentDTO GetCustomerPaymentById(int customerPaymentId) { CustomerPaymentDTO customerPaymentDTO = null; var customerPayment = unitOfWork.CustomerPaymentRepository.GetById(customerPaymentId); if (customerPayment != null) { customerPaymentDTO = CustomerPaymentConvertor.ConvertToCustomerPaymentDto(customerPayment); } return(customerPaymentDTO); }
public List <CustomerPaymentDTO> GetAllCustomerPayments() { List <CustomerPaymentDTO> customerPaymentsList = new List <CustomerPaymentDTO>(); var customerPayments = unitOfWork.CustomerPaymentRepository.GetAll(); if (customerPayments != null) { foreach (var customerPayment in customerPayments) { customerPaymentsList.Add(CustomerPaymentConvertor.ConvertToCustomerPaymentDto(customerPayment)); } } return(customerPaymentsList); }
public List <CustomerPaymentDTO> GetAllCustomerOrders() { List <CustomerPaymentDTO> customerPaymentsList = new List <CustomerPaymentDTO>(); var productOrders = unitOfWork.ProductOrderRepository.GetAll(); if (productOrders != null) { foreach (var productOrder in productOrders) { if (productOrder.InActive == false || productOrder.InActive == null) { List <CustomerPaymentTransaction> customerPaymentTransactions = productOrder.Customer.CustomerPaymentTransactions.Where(x => x.OrderId == productOrder.OrderId).ToList <CustomerPaymentTransaction>(); if (customerPaymentTransactions.Where(x => x.OrderId == productOrder.OrderId).Count() > 0) { customerPaymentsList.Add(CustomerPaymentConvertor.ConvertToCustomerPaymentDto(productOrder, customerPaymentTransactions)); } } } } return(customerPaymentsList); }