public JsonResult ChangeDistrict(string cityid) { var dao = new DistrictDao(); var list = dao.FindByID(cityid); JsonResult result = new JsonResult(); result.Data = list; result.JsonRequestBehavior = JsonRequestBehavior.AllowGet; return(result); }
public void SetViewBagDistrict(string selectedId = null, string cityid = null) { var dao = new DistrictDao(); if (cityid != null) { ViewBag.DistrictID = new SelectList(dao.FindByID(cityid), "DistrictCode", "Name", selectedId); } else { ViewBag.DistrictID = new SelectList(dao.ToList(), "DistrictCode", "Name", selectedId); } }
// 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)); }