protected void Page_Load(object sender, EventArgs e) { CPobj = CPobjGetControl(); //txtOldPassword.Text = String.Empty; //txtNewPassword.Text = String.Empty; //txtConfirmPassword.Text = String.Empty; }
//protected void btnReset_Click(object sender, EventArgs e) //{ // lblStatusMessage.Text = String.Empty; // txtOldPassword.Text = String.Empty; // txtNewPassword.Text = String.Empty; // txtConfirmPassword.Text = String.Empty; //} private ChangePasswordControl CPobjGetControl() { if (CPobj == null) { CPobj = new ChangePasswordControl(); } return(CPobj); }
public void ShowChangePasswordControl() { ChangePasswordControl newPasswordControl = new ChangePasswordControl(this) { Left = 50, Top = 50 }; panel3.Controls.Add(newPasswordControl); }
private void ChangePasswordBtnClick(object sender, RoutedEventArgs e) { ChangePasswordControl control = new ChangePasswordControl(); control.AcceptChanges += (sender, e) => { db.Users.Where(u => u.id == ((User)UserDataGrid.SelectedCells[0].Item).id).FirstOrDefault().Password = control.Password; db.SaveChanges(); UpdateDataGrid(); }; DialogHost.Show(control); }
public UIElement GetPasswordElement() { ChangePasswordControl control = new ChangePasswordControl(login); control.PasswordChanged += (s, e) => { ChangePasswordModel model = e.ChangePasswordModel; if (model.NewPassword == model.ConfirmPassword) { ChangePasswordDTO changePasswordDTO = new ChangePasswordDTO { Login = model.Login, OldPassword = model.OldPassword, NewPassword = model.NewPassword }; using (IAccountService service = factory.CreateAccountService()) { ServiceMessage serviceMessage = service.ChangePassword(changePasswordDTO); RaiseReceivedMessageEvent(serviceMessage.IsSuccessful, serviceMessage.Message); if (serviceMessage.IsSuccessful) { System.Diagnostics.Process.Start(Application.ResourceAssembly.Location); Application.Current.Shutdown(); } } } else { RaiseReceivedMessageEvent(false, "Passwords are not same"); } }; return(control); }
public AccountForm() { InitializeComponent(); newUserControl = new NewUserControl(this); changePasswordControl = new ChangePasswordControl(this); }