示例#1
0
        /*public void LoadCountryList()
         * {
         *  List<string> CountryList = new List<string>();
         *  CultureInfo[] CInfoList = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
         *  foreach (CultureInfo CInfo in CInfoList)
         *  {
         *      RegionInfo R = new RegionInfo(CInfo.LCID);
         *      if (!(CountryList.Contains(R.EnglishName)))
         *      {
         *          CountryList.Add(R.EnglishName);
         *          Console.WriteLine("Loaded countries: ", CountryList);
         *      }
         *  }
         *
         *  CountryList.Sort();
         *  ViewData["CountryList"] = CountryList;
         * }*/

        public void OnGet(string returnUrl = null)
        {
            ReturnUrl = returnUrl;
            //LoadCountryList();
            ViewData["CountryList"] = _countryData.LoadCountryList().OrderBy(a => a.Value).ToList();
            ViewData["GenderList"]  = _genderData.LoadGenderList().ToList();
        }
示例#2
0
        public async Task <IActionResult> OnGetAsync()
        {
            ViewData["CountryList"] = _countryData.LoadCountryList().OrderBy(a => a.Value).ToList();
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'."));
            }

            var userName = await _userManager.GetUserNameAsync(user);

            var email = await _userManager.GetEmailAsync(user);

            var phoneNumber = await _userManager.GetPhoneNumberAsync(user);

            var address    = user.Address;
            var city       = user.City;
            var postalcode = user.PostalCode;
            var country    = user.Country;

            Username = userName;

            Input = new InputModel
            {
                Email       = email,
                PhoneNumber = phoneNumber,
                Address     = address,
                City        = city,
                PostalCode  = postalcode,
                Country     = country
            };

            IsEmailConfirmed = await _userManager.IsEmailConfirmedAsync(user);

            return(Page());
        }