public IActionResult Create()
        {
            var countries  = _addressService.GetCountries();
            var placeTypes = _placesService.GetTypes();
            var user       = _userManager.GetUserId(User);
            var facilities = _facilitiesServices.GetFacilities();

            ViewBag.UserId     = user;
            ViewBag.Countries  = countries;
            ViewBag.Types      = placeTypes;
            ViewBag.Facilities = facilities;

            return(View());
        }
예제 #2
0
        public IActionResult Index()
        {
            var topPlaces  = _placesService.GetTopPlaces(3).ToList();
            var placeTypes = _placesService.GetTypes();
            var places     = Mapper.Map <List <PlaceViewModel> >(topPlaces);

            for (int i = 0; i < topPlaces.Count; i++)
            {
                if (topPlaces[i].Images.Count != 0)
                {
                    places[i].Image = _imageServices.ConvertImage(topPlaces[i].Images[0].PlaceImage);
                }
            }
            ViewData["TopPlaces"]        = places;
            ViewData["PlaceTypes"]       = Mapper.Map <List <LookupViewModel> >(placeTypes);
            ViewData["CurrentCulture"]   = System.Threading.Thread.CurrentThread.CurrentCulture;
            ViewData["CurrentUICulture"] = System.Threading.Thread.CurrentThread.CurrentUICulture;

            return(View());
        }