private void btnSave_Click(object sender, EventArgs e) { if (txtPassword.Text == txtConfirmPass.Text && txtPassword.Text != "") { FormCustomPopup confirmPass = new FormCustomPopup(); confirmPass.ShowDialog(); if (confirmPass.correct == true) { var userModel = new UserModel( idUser: UserCache.IdUser, loginName: txtUsername.Text, password: txtPassword.Text, firstName: txtFirstName.Text, lastName: txtLastName.Text, position: "", email: txtEmail.Text ); var result = userModel.editUserProfile(); MessageBox.Show(result); reset(); //redefine tudo. Para carregar os novos dados. } } else { MessageBox.Show("As senhas não coincidem. Quer tentar novamente?"); txtPassword.Focus(); } }
private void btnSave_Click(object sender, EventArgs e) { if (txtPassword.Text == txtConfirmPass.Text && txtPassword.Text != "") { FormCustomPopup confirmPass = new FormCustomPopup(); confirmPass.ShowDialog(); if (confirmPass.correct == true) { var userModel = new UserModel( idUser: UserCache.IdUser, loginName: txtUsername.Text, password: txtPassword.Text, firstName: txtFirstName.Text, lastName: txtLastName.Text, position: "", email: txtEmail.Text ); var result = userModel.editUserProfile(); MessageBox.Show(result); reset(); //reiniciamos todo. Para cargar los nuevos datos // all reset, to load the new data } } else { MessageBox.Show("Las contraseñas no coinciden, ¿quieres intentarlo de nuevo?"); txtPassword.Focus(); } }