public JsonResult Create(RechargeRecord rechargeRecord)
        {
            var customer = customerService.GetCustomer(rechargeRecord.CustomerID);

            if (customer == null)
            {
                return(JsonResult(new APIBaseResponse(false, "CM_002")));
            }

            if (rechargeRecord.Amount <= 0)
            {
                return(JsonResult(new APIBaseResponse(false, "CM_003")));
            }

            var customerAmount = new CustomerAmount
            {
                CustomerID = rechargeRecord.CustomerID,
                Amount     = rechargeRecord.Amount,
                InUser     = rechargeRecord.InUser
            };

            customerAmountService.CreateCustomerAmount(customerAmount);
            rechargeRecordService.CreateRechargeRecord(rechargeRecord);

            return(SuccessJsonResult());
        }
 public void UpdateCustomerAmount(CustomerAmount customerAmount)
 {
     customerAmountRepository.Update(customerAmount);
     unitOfWork.Commit();
 }
 public void CreateCustomerAmount(CustomerAmount customerAmount)
 {
     customerAmountRepository.CreateCustomerAmount(customerAmount);
     unitOfWork.Commit();
 }