Пример #1
0
        public HttpResponseMessage Post([FromBody] Claim claim)
        {
            // add claim

            ClaimDBConnect claimDBConnect = new ClaimDBConnect();

            claimDBConnect.Claims.Add(claim);
            claimDBConnect.SaveChanges();

            string output = JsonConvert.SerializeObject(claim);

            return(new HttpResponseMessage()
            {
                Content = new StringContent(output, System.Text.Encoding.UTF8, "application/json"),
                StatusCode = HttpStatusCode.Created
            });
        }
Пример #2
0
        public ActionResult FileClaim(Claim claim)
        {
            // nav link check if signed in if not route to signon.
            var check = Session["CustomerID"];

            if (check == null)
            {
                return(RedirectToAction("CustomerReviewSignOn"));
            }

            if (!ModelState.IsValid)
            {
                return(View());
            }
            // edit date
            ViewBag.Message = "";
            DateTime valueDate;
            bool     validDate = DateTime.TryParse(claim.DateService.ToString(), out valueDate);

            if (!validDate)
            {
                ViewBag.Message = "Date is not valid or Missing";
                return(View());
            }



            claim.CustomerID = Session["CustomerID"].ToString();
            ClaimDBConnect claimDBConnect = new ClaimDBConnect();

            claimDBConnect.Claims.Add(claim);
            claimDBConnect.SaveChanges();

            // process file claim update.
            ViewBag.Message = "Claim Filed Successfully";
            return(RedirectToAction("CustomerReview"));
        }