Exemple #1
0
        public async Task <IActionResult> Create(int?companyId, string companyName)
        {
            if (companyId == null)
            {
                var companies = await companyService.GetAllRentalCompaniesAsync();

                ViewData["Companies"] = new SelectList(companies, "Id", "Name");
            }
            else
            {
                ViewData["CompanyId"]   = companyId;
                ViewData["CompanyName"] = companyName;
            }

            var cities = await cityService.GetAllCitiesAsync();

            ViewData["Cities"] = new SelectList(cities, "Id", "Name");

            return(View());
        }
Exemple #2
0
        public async Task <IActionResult> Index()
        {
            var countries = await service.GetAllRentalCompaniesAsync();

            return(View(countries?.Adapt <IEnumerable <RentalCompanyVM> >()));
        }