public ActionResult DeleteConfirmed(string id) { NotDay notDay = db.NotDays.Find(id); db.NotDays.Remove(notDay); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "NhatKySo,NoiDung")] NotDay notDay) { if (ModelState.IsValid) { db.Entry(notDay).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(notDay)); }
public ActionResult Create([Bind(Include = "NhatKySo,NoiDung")] NotDay notDay) { if (ModelState.IsValid) { db.NotDays.Add(notDay); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(notDay)); }
// GET: NotDays/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NotDay notDay = db.NotDays.Find(id); if (notDay == null) { return(HttpNotFound()); } return(View(notDay)); }