Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
            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));
        }
Exemple #5
0
 public static void ToCaseInsuranceMaxOutOfPocket(CaseInsuranceMaxOutOfPocketDTO dto, CaseInsuranceMaxOutOfPocket r)
 {
     r.EffectiveDate  = dto.EffectiveDate;
     r.MaxOutOfPocket = dto.MaxOutOfPocket;
 }