public ActionResult DeleteConfirmed(int id) { HeatList heatList = db.HeatLists.Find(id); db.HeatLists.Remove(heatList); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "HeatListID,Status,Time,Name")] HeatList heatList) { if (ModelState.IsValid) { db.Entry(heatList).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(heatList)); }
public ActionResult Create([Bind(Include = "HeatListID,Status,Time,Name")] HeatList heatList) { if (ModelState.IsValid) { db.HeatLists.Add(heatList); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(heatList)); }
// GET: HeatLists/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HeatList heatList = db.HeatLists.Find(id); if (heatList == null) { return(HttpNotFound()); } return(View(heatList)); }
// GET: HeatLists/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HeatList heatList = db.HeatLists.Find(id); if (heatList == null) { return(HttpNotFound()); } var viewModel = new HeatCoupleViewModel { heatlist = heatList, couples = (from couple in db.Couples where couple.HeatList.Name.Contains(heatList.Name) select couple).ToList() }; return(View(viewModel)); }