public ActionResult DeleteConfirmed(int id) { Tamung tamung = db.Tamungs.Find(id); db.Tamungs.Remove(tamung); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MaNV,NgayTU,Sotien")] Tamung tamung) { if (ModelState.IsValid) { db.Entry(tamung).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tamung)); }
public ActionResult Create([Bind(Include = "MaNV,NgayTU,Sotien")] Tamung tamung) { if (ModelState.IsValid) { db.Tamungs.Add(tamung); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tamung)); }
// GET: Tamungs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Tamung tamung = db.Tamungs.Find(id); if (tamung == null) { return(HttpNotFound()); } return(View(tamung)); }