public IHttpActionResult PutDecision_Item(int id, Decision_Item decision_Item) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != decision_Item.DecisionItemID) { return(BadRequest()); } db.Entry(decision_Item).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Decision_ItemExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { Decision_Item decision_Item = db.Decision_Items.Find(id); db.Decision_Items.Remove(decision_Item); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DecisionItemID,DecisionItem_Title,project_Name,Description,DecisionDate,DecisionTime,DecisionAssignedTo,Priority,Status,MeetingID")] Decision_Item decision_Item) { if (ModelState.IsValid) { db.Entry(decision_Item).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MeetingID = new SelectList(db.Meetings, "MeetingID", "project_Name", decision_Item.MeetingID); return(View(decision_Item)); }
public IHttpActionResult GetDecision_Item(int id) { Decision_Item decision_Item = db.Decision_Items.Find(id); if (decision_Item == null) { return(NotFound()); } return(Ok(decision_Item)); }
public IHttpActionResult PostDecision_Item(Decision_Item decision_Item) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Decision_Items.Add(decision_Item); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = decision_Item.DecisionItemID }, decision_Item)); }
// GET: Decision_Item/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Decision_Item decision_Item = db.Decision_Items.Find(id); if (decision_Item == null) { return(HttpNotFound()); } return(View(decision_Item)); }
public IHttpActionResult DeleteDecision_Item(int id) { Decision_Item decision_Item = db.Decision_Items.Find(id); if (decision_Item == null) { return(NotFound()); } db.Decision_Items.Remove(decision_Item); db.SaveChanges(); return(Ok(decision_Item)); }
// GET: Decision_Item/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Decision_Item decision_Item = db.Decision_Items.Find(id); if (decision_Item == null) { return(HttpNotFound()); } ViewBag.MeetingID = new SelectList(db.Meetings, "MeetingID", "project_Name", decision_Item.MeetingID); return(View(decision_Item)); }