public void ChangePoints(PointsDetailInputModel model) { var detail = _mapper.Map <PointsDetailInputModel, CHIS_Customer_PointsDetail>(model); var customer = _db.CHIS_Code_Customer.SingleOrDefault(x => x.CustomerID == model.CustomerId); customer.ChangePoints(detail); _db.SaveChanges(); }
public IActionResult ChangePoints(PointsDetailInputModel model) { try { _pointsService.ChangePoints(model); return(Ok(new { rlt = true, state = "success" })); } catch (Exception e) { if (!(e is ApplicationException)) { _logger.LogError(e, e.Message); } return(Ok(new { rlt = false, state = "fail", msg = e.Message })); } }