// GET: Supplier/Edit/5 public ActionResult Edit(long id) { SupplierDao bdDao = new SupplierDao(); var sp = bdDao.FindByID(id); SetViewBag(sp.CityID); SetViewBagDistrict(sp.DistrictID, sp.CityID); return(View(sp)); }
// GET: Supplier/Details/5 public ActionResult Details(long id) { SupplierDao bdDao = new SupplierDao(); var sl = bdDao.FindByID(id); if (sl.Status == true) { ViewBag.Status = "Kích hoạt"; } else { ViewBag.Status = "Khóa"; } var dao = new CityDao(); var ct = dao.FindByID(sl.CityID); ViewBag.CityName = ct[0].Name; var disDao = new DistrictDao(); var dist = disDao.FindByID(sl.CityID, sl.DistrictID); ViewBag.DistName = dist.Name; return(View(sl)); }