public IHttpActionResult PutDrugFacilitatedAssault(int id, DrugFacilitatedAssault drugFacilitatedAssault)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != drugFacilitatedAssault.DrugFacilitatedAssaultId)
            {
                return BadRequest();
            }

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

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

            return StatusCode(HttpStatusCode.NoContent);
        }
        public IHttpActionResult PutDrugFacilitatedAssault(int id, DrugFacilitatedAssault drugFacilitatedAssault)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != drugFacilitatedAssault.DrugFacilitatedAssaultId)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            DrugFacilitatedAssault drugFacilitatedAssault = db.DrugFacilitatedAssaults.Find(id);

            db.DrugFacilitatedAssaults.Remove(drugFacilitatedAssault);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
 public ActionResult Edit([Bind(Include = "DrugFacilitatedAssaultId,DrugFacilitatedAssaultValue")] DrugFacilitatedAssault drugFacilitatedAssault)
 {
     if (ModelState.IsValid)
     {
         db.Entry(drugFacilitatedAssault).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(drugFacilitatedAssault));
 }
Esempio n. 5
0
        public ActionResult Create([Bind(Include = "DrugFacilitatedAssaultId,DrugFacilitatedAssaultValue")] DrugFacilitatedAssault drugFacilitatedAssault)
        {
            if (ModelState.IsValid)
            {
                db.DrugFacilitatedAssaults.Add(drugFacilitatedAssault);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(drugFacilitatedAssault));
        }
        public IHttpActionResult GetDrugFacilitatedAssault(int id)
        {
            DrugFacilitatedAssault drugFacilitatedAssault = db.DrugFacilitatedAssaults.Find(id);

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

            return(Ok(drugFacilitatedAssault));
        }
        public IHttpActionResult PostDrugFacilitatedAssault(DrugFacilitatedAssault drugFacilitatedAssault)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.DrugFacilitatedAssaults.Add(drugFacilitatedAssault);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = drugFacilitatedAssault.DrugFacilitatedAssaultId }, drugFacilitatedAssault);
        }
        public IHttpActionResult PostDrugFacilitatedAssault(DrugFacilitatedAssault drugFacilitatedAssault)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.DrugFacilitatedAssaults.Add(drugFacilitatedAssault);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = drugFacilitatedAssault.DrugFacilitatedAssaultId }, drugFacilitatedAssault));
        }
Esempio n. 9
0
        // GET: DrugFacilitatedAssaults/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DrugFacilitatedAssault drugFacilitatedAssault = db.DrugFacilitatedAssaults.Find(id);

            if (drugFacilitatedAssault == null)
            {
                return(HttpNotFound());
            }
            return(View(drugFacilitatedAssault));
        }
        public IHttpActionResult DeleteDrugFacilitatedAssault(int id)
        {
            DrugFacilitatedAssault drugFacilitatedAssault = db.DrugFacilitatedAssaults.Find(id);

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

            db.DrugFacilitatedAssaults.Remove(drugFacilitatedAssault);
            db.SaveChanges();

            return(Ok(drugFacilitatedAssault));
        }