Exemplo n.º 1
0
 public ActionResult AddressBook()
 {
     AccountManager accManager = new AccountManager();
     User user = (User)Session["User"];
     List<BAddress> addresses = accManager.GetAddresses(user.ID);
     List<Common_district> provinces = accManager.GetCommonDistricts();
     ViewData["province"] = provinces;
     return View(addresses);
 }
Exemplo n.º 2
0
 public ActionResult Pay()
 {
     AccountManager accManager = new AccountManager();
     User user = (User)Session["User"];
     List<BAddress> addresses = accManager.GetAddresses(user.ID);
     List<Common_district> provinces = accManager.GetCommonDistricts();
     ViewData["province"] = provinces;
     ViewData["address"] = addresses;
     List<Product> products = (List<Product>)Session["cart"];
     return View(products);
 }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            User user = (User)Session["User"];
            AccountManager manager = new AccountManager();
            List<Common_district> provinces = manager.GetCommonDistricts(0);
            List<Common_district> cities = null;
            List<Common_district> districts = null;
            if (user.ProvinceID > 0)
            {
                //direct city
                if (user.CityID == user.ProvinceID)
                {
                    districts = manager.GetCommonDistricts((int)user.ProvinceID);
                }
                else
                {
                    cities = manager.GetCommonDistricts((int)user.ProvinceID);
                }
            }

            if (user.CityID > 0 && user.CityID!=user.ProvinceID)
            {
                districts = manager.GetCommonDistricts((int)user.CityID);
            }

            ViewData["province"] = provinces;
            ViewData["city"] = cities;
            ViewData["district"] = districts;

            return View();
        }
Exemplo n.º 4
0
        public JsonResult GetCommonDistrict()
        {
            JsonResult res = new JsonResult();
            JsonMessage message = new JsonMessage();
            res.Data = message;
            AccountManager manager = new AccountManager();

            int pid = 0;
            int.TryParse(Request["pid"],out pid);

            List<Common_district> diss = manager.GetCommonDistricts(pid);
            message.Status = "ok";
            message.Item = diss;
            return res;
        }