public IActionResult Put(string id, [FromBody] BusinessProductDTO accountDTO)
        {
            var account = _mapper.Map <BusinessProduct>(accountDTO);

            try
            {
                _bProductService.Update(account, id);
                return(Ok());
            }
            catch (AppException ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }
        public IActionResult Create([FromBody] BusinessProductDTO accountDTO)
        {
            var account = _mapper.Map <BusinessProduct>(accountDTO);

            try
            {
                // save
                _bProductService.Create(account);
                return(Ok());
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }
Пример #3
0
        private BusinessProductDTO GetBusinessProductDTO()
        {
            BusinessProductDTO businessProductObj = new BusinessProductDTO
            {
                UserId              = "9999",
                PaccountId          = "53126231237",
                BproductName        = "Gold Loan",
                BproductTypeId      = 6,
                Balance             = 36000,
                CanBeModified       = true,
                MinimumPayment      = 30000,
                MonthlyCyclePayment = 10000,
                PaymentCycleTypeId  = 1,
                TotalPayment        = 50000
            };

            return(businessProductObj);
        }