コード例 #1
0
        public void UpdateCustomerPayment(CustomerPaymentDTO customerPaymentDTO)
        {
            CustomerPaymentTransaction customerPaymentTransaction = null;

            CustomerPaymentConvertor.ConvertToCustomerPaymentEntity(ref customerPaymentTransaction, customerPaymentDTO, true);
            unitOfWork.CustomerPaymentRepository.Update(customerPaymentTransaction);
            unitOfWork.SaveChanges();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        public CustomerPaymentDTO GetCustomerPaymentById(int customerPaymentId)
        {
            CustomerPaymentDTO customerPaymentDTO = null;
            var customerPayment = unitOfWork.CustomerPaymentRepository.GetById(customerPaymentId);

            if (customerPayment != null)
            {
                customerPaymentDTO = CustomerPaymentConvertor.ConvertToCustomerPaymentDto(customerPayment);
            }
            return(customerPaymentDTO);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }