Beispiel #1
0
        public void AddCustomerWallet(CustomerWalletDTO customerWalletDTO)
        {
            CustomerWallet customerWallet = new CustomerWallet();

            CustomerWalletConvertor.ConvertToCustomerWalletEntity(ref customerWallet, customerWalletDTO, false);
            unitOfWork.CustomerWalletRepository.Add(customerWallet);
        }
        public static CustomerWalletDTO ConvertToCustomerWalletDto(CustomerWallet customerWallet)
        {
            CustomerWalletDTO customerWalletDTO = new CustomerWalletDTO();

            customerWalletDTO.WalletId      = customerWallet.WalletId;
            customerWalletDTO.CustomerId    = customerWallet.CustomerId;
            customerWalletDTO.WalletBalance = customerWallet.WalletBalance;
            customerWalletDTO.AmountDueDate = customerWallet.AmountDueDate;
            return(customerWalletDTO);
        }
        public IHttpActionResult Put(int id, [FromBody] CustomerWalletDTO customerWalletDTO)
        {
            try
            {
                customerWalletDTO.WalletId = id;
                if (customerWalletDTO == null)
                {
                    return(BadRequest("Argument Null"));
                }

                _customerWalletService.UpdateCustomerWallet(customerWalletDTO);

                return(Ok());
            }
            catch (PlatformModuleException ex)
            {
                return(BadRequest(ex.Message));
            }
        }
        public IHttpActionResult Post([FromBody] CustomerWalletDTO customerWalletDTO)
        {
            try
            {
                if (customerWalletDTO == null)
                {
                    return(BadRequest("Argument Null"));
                }

                _customerWalletService.AddCustomerWallet(customerWalletDTO);

                return(Ok());
            }
            catch (PlatformModuleException ex)
            {
                //Write Log Here
                return(BadRequest(ex.Message));
            }
        }
 public static void ConvertToCustomerWalletEntity(ref CustomerWallet customerWallet, CustomerWalletDTO customerWalletDTO, bool isUpdate)
 {
     if (isUpdate)
     {
         customerWallet.WalletId = customerWalletDTO.WalletId;
     }
     customerWallet.CustomerId    = customerWalletDTO.CustomerId;
     customerWallet.WalletBalance = customerWalletDTO.WalletBalance;
     customerWallet.AmountDueDate = customerWalletDTO.AmountDueDate;
 }
Beispiel #6
0
 public void UpdateCustomerWallet(CustomerWalletDTO customerDto)
 {
     throw new NotImplementedException();
 }