public ActionResult DeleteConfirmed(int id) { D_Phase d_Phase = db.D_Phase.Find(id); db.D_Phase.Remove(d_Phase); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Project_Id,Phase,Phase_Code")] D_Phase d_Phase) { if (ModelState.IsValid) { db.Entry(d_Phase).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(d_Phase)); }
// GET: Phase/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } D_Phase d_Phase = db.D_Phase.Find(id); if (d_Phase == null) { return(HttpNotFound()); } return(View(d_Phase)); }
public ActionResult Create(D_Phase d_Phase) { string status = "error"; if (ModelState.IsValid) { db.D_Phase.Add(d_Phase); if (db.SaveChanges() > 0) { status = "success"; } } return(Content(status)); }