public CaseInsuranceMaxOutOfPocketDTO InsertCaseInsuranceMaxOutOfPocket(CaseInsuranceMaxOutOfPocketDTO dto) { var caseInsuranceMaxOutOfPocket = _context.CaseInsurancesMaxOutOfPocket.Create(); caseInsuranceMaxOutOfPocket.CaseInsuranceId = dto.CaseInsuranceId; Mapper.ToCaseInsuranceMaxOutOfPocket(dto, caseInsuranceMaxOutOfPocket); _context.CaseInsurancesMaxOutOfPocket.Add(caseInsuranceMaxOutOfPocket); _context.SaveChanges(); return(Mapper.ToCaseInsuranceMaxOutOfPocketDTO(caseInsuranceMaxOutOfPocket)); }
public CaseInsuranceMaxOutOfPocketDTO SaveCaseInsuranceMaxOutOfPocket(CaseInsuranceMaxOutOfPocketDTO dto) { var caseInsuranceMaxOutOfPocket = _context.CaseInsurancesMaxOutOfPocket.SingleOrDefault(m => m.Id == dto.Id); if (caseInsuranceMaxOutOfPocket == null) { throw new Exception(); } Mapper.ToCaseInsuranceMaxOutOfPocket(dto, caseInsuranceMaxOutOfPocket); _context.SaveChanges(); return(Mapper.ToCaseInsuranceMaxOutOfPocketDTO(caseInsuranceMaxOutOfPocket)); }
public static CaseInsuranceMaxOutOfPocketDTO ToCaseInsuranceMaxOutOfPocketDTO(CaseInsuranceMaxOutOfPocket n) { var dto = new CaseInsuranceMaxOutOfPocketDTO { Id = n.Id, CaseInsuranceId = n.CaseInsuranceId, EffectiveDate = n.EffectiveDate, MaxOutOfPocket = n.MaxOutOfPocket }; return(dto); }
public ActionResult SaveCaseInsuranceMaxOutOfPocket(CaseInsuranceMaxOutOfPocketDTO insuranceMaxOutOfPocket) { object response; try { response = _service.SaveCaseInsuranceMaxOutOfPocket(insuranceMaxOutOfPocket); } catch (Exception e) { response = new { Error = e.Message }; } return(this.CamelCaseJson(response)); }
public static void ToCaseInsuranceMaxOutOfPocket(CaseInsuranceMaxOutOfPocketDTO dto, CaseInsuranceMaxOutOfPocket r) { r.EffectiveDate = dto.EffectiveDate; r.MaxOutOfPocket = dto.MaxOutOfPocket; }