protected void UpdateBtn_Click(object sender, EventArgs e) { var userManager = new UserManager(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString); var oldUserInfo = userManager.GetUserInformationById(new Guid(UserId.Value)); oldUserInfo.FirstName = Prenume.Text; oldUserInfo.LastName = Nume.Text; oldUserInfo.IsAsoc = Asociatie.Checked; oldUserInfo.UserCod = CodUser.SelectedValue; userManager.UpdateUser(oldUserInfo); var membership = Membership.Providers["PortalProvider"].GetUser(oldUserInfo.UserId,false); if (membership != null) { if (!Locked.Checked) membership.UnlockUser(); membership.Email = Email.Text; Membership.Providers["PortalProvider"].UpdateUser(membership); } Response.Redirect("~/EditareUseri.aspx"); }
protected void UpdateUser(object sender, EventArgs e) { var userManager = new UserManager(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString); var oldUserInfo = userManager.GetUserInformationById(new Guid(UserId.Value)); oldUserInfo.FirstName = Prenume.Text; oldUserInfo.LastName = Nume.Text; oldUserInfo.UserCod = UserCodLbl.Text; userManager.UpdateUser(oldUserInfo); var membership = Membership.Providers["PortalProvider"].GetUser(oldUserInfo.UserId, false); if (membership != null) { membership.Email = Email.Text; Membership.Providers["PortalProvider"].UpdateUser(membership); } Response.Redirect(string.Format("~/DetailsFerme.aspx?ID={0}", IdFerma.Text)); }