public async Task <IActionResult> Index() { var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Benuter '{_userManager.GetUserId(User)}' konnte nicht gefunden werden."); } var customer = await _context.Customers.SingleAsync(cu => cu.UserId == user.Id); var model = new IndexViewModel { Username = user.UserName, Email = user.Email, PhoneNumber = user.PhoneNumber, IsEmailConfirmed = user.EmailConfirmed, StatusMessage = StatusMessage, CustomerNo = customer.CustomerNo, PostCode = customer.PostCode, AdditionalAddress = customer.AdditionalAddress, Address = customer.Address, City = customer.City, CompanyName = customer.CompanyName, FirstName = customer.FirstName, Name = customer.Name, CustomerID = customer.CustomerID, CountryID = customer.CountryId, CountryName = countryHelper.GetNameByID(customer.CountryId), Countries = countryHelper.GetCountries() }; return(View(model)); }
public IActionResult Register(string returnUrl = null) { var vm = new RegisterViewModel { Countries = countryHelper.GetCountries(), ShoppingCartId = HttpContext.Session.GetString("ShoppingCartId") }; ViewData["ReturnUrl"] = returnUrl; return(View(vm)); }
public void Execute(object parameter) { //registriation viewmodel RegistriationViewModel registriationViewModel = new RegistriationViewModel(); CountryHelper countryHelper = new CountryHelper(); registriationViewModel.RegionInfos = countryHelper.GetCountries(); registriationViewModel.CountryName = "Azerbaijan"; var phoneCode = countryHelper.GetCountryPhoneCode(registriationViewModel.CountryName); registriationViewModel.PhoneCode = phoneCode; registriationViewModel.VerifyStateContent = "PhoneNumber"; RegistriationUserControl registriationUserControl = new RegistriationUserControl(registriationViewModel); LoginViewModel.MyGrid.Children.Clear(); LoginViewModel.MyGrid.Children.Add(registriationUserControl); }
protected void Page_Load(object sender, EventArgs e) { if (Session["uid"] != null) { LblUid.Text = Session["uid"].ToString(); User user = new User().SelectById(LblUid.Text); string [] socialList = user.social.Split(','); string [] skillsList = user.skills.Split(','); if (!Page.IsPostBack) { CountryHelper helper = new CountryHelper(); List <string> countries = helper.GetCountries(); countries.Insert(0, "Not Set"); location.DataSource = countries; location.DataBind(); bio.Value = user.bio; if (user.website != "Not Set") { website.Value = user.website; } dob.Value = user.birthday; gender.Value = user.gender; location.Value = user.location; occupation.Value = user.occupation; jobpin.Value = user.jobPin; currUsername.InnerHtml = user.username; string userDirPath = "~/Content/uploads/profile/" + LblUid.Text + "/"; if (File.Exists(Server.MapPath(userDirPath) + "banner.png")) { bannerePic.ImageUrl = Page.ResolveUrl(userDirPath + "banner.png"); } if (File.Exists(Server.MapPath(userDirPath) + "profilePic.png")) { profilePic.ImageUrl = Page.ResolveUrl(userDirPath + "profilePic.png"); } if (socialList.Any()) { twitter.Value = socialList[0]; instagram.Value = socialList[1]; facebook.Value = socialList[2]; youtube.Value = socialList[3]; deviantart.Value = socialList[4]; } if (skillsList.Any()) { if (skillsList[0] != null) { skill1.Value = skillsList[0]; } if (skillsList.Length > 1) { if (skillsList[1] != null) { skill2.Value = skillsList[1]; } if (skillsList[2] != null) { skill3.Value = skillsList[2]; } if (skillsList[3] != null) { skill4.Value = skillsList[3]; } if (skillsList[4] != null) { skill5.Value = skillsList[4]; } } } if (user.type == "client") { usertype.InnerHtml = "Client"; } } } else { Session["error"] = "You need to be logged in to edit your profile"; Response.Redirect("~/Views/index.aspx"); } if (string.IsNullOrEmpty(jobpin.Value)) { removepinmodallaucher.Visible = false; } else { setPinModalLauncher.InnerHtml = "Change PIN"; } }