public ActionResult Create(Kho entity) { var dao = new KhoDao(); dao.Insert(entity); return(RedirectToAction("Index")); }
// GET: Admin/Khoes/Edit/5 public ActionResult Edit(int id) { var dao = new KhoDao(); var model = dao.GetByID(id); return(View(model)); }
// GET: Admin/Kho public ActionResult Index() { var dao = new KhoDao(); var model = dao.ListAll(); return(View(model)); }
public ActionResult Delete(int id) { var dao = new KhoDao(); var model = dao.GetByID(id); if (model != null) { dao.Delete(model); } return(RedirectToAction("Index")); }
public ActionResult Edit(Kho entity) { var dao = new KhoDao(); if (dao.Update(entity)) { return(RedirectToAction("Index")); } else { return(View(entity)); } }