public IHttpActionResult PutThirdPartyReport(int id, ThirdPartyReport thirdPartyReport)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != thirdPartyReport.ThirdPartyReportId)
            {
                return(BadRequest());
            }

            db.Entry(thirdPartyReport).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ThirdPartyReportExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutThirdPartyReport(int id, ThirdPartyReport thirdPartyReport)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != thirdPartyReport.ThirdPartyReportId)
            {
                return BadRequest();
            }

            db.Entry(thirdPartyReport).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ThirdPartyReportExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            ThirdPartyReport thirdPartyReport = db.ThirdPartyReports.Find(id);

            db.ThirdPartyReports.Remove(thirdPartyReport);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "ThirdPartyReportId,YesNoNA")] ThirdPartyReport thirdPartyReport)
 {
     if (ModelState.IsValid)
     {
         db.Entry(thirdPartyReport).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(thirdPartyReport));
 }
Example #5
0
        public ActionResult Create([Bind(Include = "ThirdPartyReportId,YesNoNA")] ThirdPartyReport thirdPartyReport)
        {
            if (ModelState.IsValid)
            {
                db.ThirdPartyReports.Add(thirdPartyReport);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(thirdPartyReport));
        }
        public IHttpActionResult GetThirdPartyReport(int id)
        {
            ThirdPartyReport thirdPartyReport = db.ThirdPartyReports.Find(id);

            if (thirdPartyReport == null)
            {
                return(NotFound());
            }

            return(Ok(thirdPartyReport));
        }
        public IHttpActionResult PostThirdPartyReport(ThirdPartyReport thirdPartyReport)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ThirdPartyReports.Add(thirdPartyReport);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = thirdPartyReport.ThirdPartyReportId }, thirdPartyReport));
        }
        public IHttpActionResult PostThirdPartyReport(ThirdPartyReport thirdPartyReport)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.ThirdPartyReports.Add(thirdPartyReport);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = thirdPartyReport.ThirdPartyReportId }, thirdPartyReport);
        }
Example #9
0
        // GET: ThirdPartyReports/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ThirdPartyReport thirdPartyReport = db.ThirdPartyReports.Find(id);

            if (thirdPartyReport == null)
            {
                return(HttpNotFound());
            }
            return(View(thirdPartyReport));
        }
        public IHttpActionResult DeleteThirdPartyReport(int id)
        {
            ThirdPartyReport thirdPartyReport = db.ThirdPartyReports.Find(id);

            if (thirdPartyReport == null)
            {
                return(NotFound());
            }

            db.ThirdPartyReports.Remove(thirdPartyReport);
            db.SaveChanges();

            return(Ok(thirdPartyReport));
        }