public ActionResult DeleteConfirmed(int id) { MsgModels msgmodels = db.MsgModels.Find(id); db.MsgModels.Remove(msgmodels); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Msg/Delete/5 public ActionResult Delete(int id = 0) { MsgModels msgmodels = db.MsgModels.Find(id); if (msgmodels == null) { return(HttpNotFound()); } return(View(msgmodels)); }
public ActionResult Edit(MsgModels msgmodels) { if (ModelState.IsValid) { db.Entry(msgmodels).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(msgmodels)); }
public ActionResult Create(MsgModels msgmodels) { if (ModelState.IsValid) { msgmodels.Date = DateTime.Today.Date; db.MsgModels.Add(msgmodels); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(msgmodels)); }