private List <SelectListItem> GetCountries() { var countries = countriesService.GetCountries(CultureInfo.CurrentCulture.TwoLetterISOLanguageName.ToLower()).Result .Select(c => new SelectListItem(c.Name, c.Estatcode)).ToList(); return(countries); }
public override Task PreRender() { // load countries on first page load if (!Context.IsPostBack) { Countries = countriesService.GetCountries(); States = new List <StateDTO>(); } return(base.PreRender()); }
public IActionResult Get() { try { var results = _countriesService.GetCountries(); return(Ok(results)); } catch { return(BadRequest()); } }
public IActionResult Join() { var model = new JoinUniversityModel { Countries = _countriesService.GetCountries() .Select(c => new SelectListItem { Value = c.Id, Text = c.Name }).ToList() }; return(PartialView("_JoinPartial", model)); }
public IActionResult OnGet() { Countries = MyCountriesService.GetCountries(); Cases = MyCasesService.GetCases(); Users = MyUsersService.GetUsers(); foreach (var user in Users) { if (TempData.Peek("logged_in") != null) // checks if someone is logged in { if (TempData.Peek("logged_in").ToString() == user.email) // if the user page belongs to the person currently logged in, redirect to the dashboard { return(RedirectToPage("Dashboard")); } } } return(null); }
public void OnGet() { Countries = MyCountriesService.GetCountries(); Cases = MyCasesService.GetCases(); }