Exemple #1
0
        public ActionResult UserOrder()
        {
            if (currentUser != null)
            {
                VMOrderAddressDetail newUserOrder = new VMOrderAddressDetail();
                newUserOrder.UserDetail    = userDetailDAL.Get(x => x.IsActive == true && x.UserID == currentUser.UserID);
                newUserOrder.UserAddresses = userAddressDAL.GetList(x => x.IsActive == true && x.UserID == currentUser.UserID).ToList();
                ViewBag.District           = districtDAL.GetList(x => x.CityID == 34).OrderBy(x => x.DistrictName).ToList();
                ViewBag.City = cityDAL.GetList().OrderBy(x => x.CityName).ToList();

                return(View(newUserOrder));
            }
            else
            {
                return(View("Index", "Login"));
            }
        }
        public ActionResult addressModal(string id)
        {
            ETicaret.Model.Models.Entity.UserAddress userAddress;
            if (id == "new")
            {
                userAddress      = new Model.Models.Entity.UserAddress();
                ViewBag.District = districtDAL.GetList(x => x.CityID == 34).OrderBy(x => x.DistrictName).ToList();
            }
            else
            {
                userAddress           = userAddressDAL.Get(x => x.UserAddressID == new Guid(id));
                ViewBag.District      = districtDAL.GetList(x => x.CityID == userAddress.District.City.CityID).OrderBy(x => x.DistrictName).ToList();
                TempData["addressID"] = id;
            }

            ViewBag.City = cityDAL.GetList().OrderBy(x => x.CityName).ToList();

            return(PartialView("addressModal", userAddress));
        }