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