private void BindAccountInfo() { BLL.Member member = new BLL.Member(); MembershipUser user = Membership.GetUser(MemberUserName); if (user != null) { member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString())); //drpAccountType.SelectedValue = member.s_MemberTypeID; } }
private void BindAccountInfo() { BLL.Member member = new BLL.Member(); MembershipUser user = Membership.GetUser(MemberUserName); if (user != null) { if (member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString()))) { drpAccountStatus.SelectedValue = member.s_RowStatusID; } } }
protected void btnUpdateAccountStatus_Click(object sender, EventArgs e) { BLL.Member member = new BLL.Member(); MembershipUser user = Membership.GetUser(MemberUserName); if (user != null) { member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString())); if (drpAccountStatus.SelectedValue != member.s_RowStatusID) { member.RowStatusID = Convert.ToByte(drpAccountStatus.SelectedValue); member.Save(); } } }
protected void btnChangeQuestion_Click(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(MemberUserName); if (user != null) { BLL.Member member = new BLL.Member(); member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString())); if (user.ChangePasswordQuestionAndAnswer(user.GetPassword(member.Answer), drpQuestions.SelectedValue, txtQuestionAnswer.Text)) { member.Answer = txtQuestionAnswer.Text; member.Save(); BindAccountInfo(); } } }
protected void btnChangePassword_Click(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(MemberUserName); if (user != null) { BLL.Member member = new BLL.Member(); member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString())); string oldPassowrd=user.GetPassword(member.Answer); // user.ChangePassword(oldPassowrd, txtPassword.Text); BLL.MemberLog log = new BLL.MemberLog(); log.AddNew(BLL.Member.CurrentMemberID, new BLL.Log.ChangePassword() { OldPassword = oldPassowrd, NewPassword = txtPassword.Text,MemberName=member.Name }, member.MemberID,null); BindAccountInfo(); } }
protected void btnUpdateAccountType_Click(object sender, EventArgs e) { BLL.Member member = new BLL.Member(); MembershipUser user = Membership.GetUser(MemberUserName); if (user != null) { member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString())); //if (drpAccountType.SelectedValue != member.s_MemberTypeID) //{ // if (!String.IsNullOrEmpty(drpAccountType.SelectedValue)) // member.MemberTypeID = Convert.ToInt32(drpAccountType.SelectedValue); // else // member.SetColumnNull(BLL.Member.ColumnNames.MemberTypeID); // member.Save(); //} } }
protected void btnUpdateRoles_Click(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(MemberUserName); if (user != null) { BLL.Member member = new BLL.Member(); member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString())); foreach (GridViewRow row in grdAdminRoles.Rows) { if (row.RowType == DataControlRowType.DataRow) { TextBox txtRoleName = (TextBox)row.FindControl("txtRoleName"); CheckBox chkInclude = (CheckBox)row.FindControl("chkInclude"); if (!Roles.RoleExists(txtRoleName.Text)) { Roles.CreateRole(txtRoleName.Text); } if (chkInclude.Checked) { if (!Roles.IsUserInRole(user.UserName, txtRoleName.Text)) { Roles.AddUserToRole(user.UserName, txtRoleName.Text); if (String.Equals(txtRoleName.Text, Helper.Enums.AdminRoles.Admin_SiteHelper.ToString())) { NotifyNewHelpMember(member); } } } else { if (Roles.IsUserInRole(user.UserName, txtRoleName.Text)) { Roles.RemoveUserFromRole(user.UserName, txtRoleName.Text); if (String.Equals(txtRoleName.Text, Helper.Enums.AdminRoles.Admin_SiteHelper.ToString())) { NotifyRemoveHelpMember(member); } } } } } } }