public ActionResult DeleteConfirmed(int id) { HeadLineThree headLineThree = db.HeadLineThrees.Find(id); db.HeadLineThrees.Remove(headLineThree); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Message")] HeadLineThree headLineThree) { if (ModelState.IsValid) { db.Entry(headLineThree).State = EntityState.Modified; db.SaveChanges(); this.AddToastMessage("Congratulations", "You have successfully edited third news!", ToastType.Success); return(RedirectToAction("Index", "Home")); } return(View(headLineThree)); }
public ActionResult Create([Bind(Include = "Id,Message")] HeadLineThree headLineThree) { if (ModelState.IsValid) { db.HeadLineThrees.Add(headLineThree); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(headLineThree)); }
// GET: HeadLineThrees/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } HeadLineThree headLineThree = db.HeadLineThrees.Find(id); if (headLineThree == null) { return(HttpNotFound()); } return(View(headLineThree)); }