Ejemplo n.º 1
0
        public async Task <ActionResult> Index()
        {
            try
            {
                await GetCategoriesDropdown();
                await GetProvinceDropdown();
                await GetLocationsDropdown();

                //ViewData["locations"] = new List<LocationDto>();
                StoreViewModel model  = new StoreViewModel(new StoreDto());
                var            output = await _storeAppService.GetStoreByUser(AbpSession.UserId.Value);

                model = new StoreViewModel(output);
                LocationDto loc = new LocationDto();
                if (output.LocationId > 0)
                {
                    loc = await _locationAppService.GetLocation(Convert.ToInt32(output.LocationId));

                    model.ProvinceId = Convert.ToInt32(loc.ProvinceId);
                }
                return(View(model));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }