Exemple #1
0
        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);
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        // 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));
        }