public ActionResult DeleteConfirmed(int id) { Danhmuchang danhmuchang = db.Danhmuchangs.Find(id); db.Danhmuchangs.Remove(danhmuchang); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Mathang,Tenhang,Donvitinh,Dongia")] Danhmuchang danhmuchang) { if (ModelState.IsValid) { db.Entry(danhmuchang).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(danhmuchang)); }
public ActionResult Create([Bind(Include = "Mathang,Tenhang,Donvitinh,Dongia")] Danhmuchang danhmuchang) { if (ModelState.IsValid) { db.Danhmuchangs.Add(danhmuchang); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(danhmuchang)); }
// GET: Danhmuchangs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Danhmuchang danhmuchang = db.Danhmuchangs.Find(id); if (danhmuchang == null) { return(HttpNotFound()); } return(View(danhmuchang)); }