public ActionResult Edit(int id)
        {
            CustomerViewModel model = CustomerDataAccess.GetById(id);

            ViewBag.ProvinceList = new SelectList(ProvinceDataAccess.GetAll(), "Code", "Name");
            ViewBag.CityList     = new SelectList(CityDataAccess.GetByProvince(model.Province_Code), "Code", "Name");
            return(View(model));
        }
        public ActionResult NewSupplier()
        {
            ViewBag.ProvinceList = new SelectList(ProvinceDataAccess.GetAll(), "Code", "Name");
            ViewBag.CityList     = new SelectList(CityDataAccess.GetByProvince(""), "Code", "Name");
            SupplierViewModel model = new SupplierViewModel();

            return(PartialView("_SupplierForm", model));
        }
 public ActionResult Create()
 {
     ViewBag.ProvinceList = new SelectList(ProvinceDataAccess.GetAll(), "Code", "Name");
     ViewBag.CityList     = new SelectList(CityDataAccess.GetByProvince(""), "Code", "Name");
     return(View());
 }
Exemplo n.º 4
0
 public ActionResult GetByProvince(string provinceCode) // get from CityDataAccess
 {
     return(View(CityDataAccess.GetByProvince(provinceCode)));
 }