private void Redefinir_Btn_Click(object sender, EventArgs e) { if (TxTBox_SenhaAntiga.Text != "" && TxTBox_NovaSenha.Text != "" && TxTBox_ConfirmaNovaSenha.Text != "") { if (TxTBox_NovaSenha.Text == TxTBox_ConfirmaNovaSenha.Text && TxTBox_SenhaAntiga.Text == Senha_VindoDaPrincial) { Usuario = FeedUsuario(Usuario_VindoDaPrincial); Console.WriteLine("Redefinição de Senha, ID Usuario: " + Usuario.ID_Usuario); Console.WriteLine("Redefinição de Senha, UserName: "******"Redefinição de Senha, Senha: " + Usuario.Senha); Usuario.Senha = TxTBox_NovaSenha.Text; Alterar Altera = new Alterar(); if (Altera.Usuario(Usuario, 1)) { Repoisicionamento_Label(Sucesso_Label); } else { Error_Label.Text = "Ocorreu um erro durante a alteração"; Repoisicionamento_Label(Error_Label); } } else { Error_Label.Text = "As Senhas não correspondem"; Repoisicionamento_Label(Error_Label); } } else { Error_Label.Text = "As Senhas não podem ser vazias"; Repoisicionamento_Label(Error_Label); } }
private void alterarToolStripMenuItem_Click(object sender, EventArgs e) { var Alt = new Alterar(); Alt.MdiParent = this; // o if verifica se o form ja foi aberto assim nao criando mais de um ao mesmo tempo if (Application.OpenForms.OfType <Alterar>().Count() > 0) { Application.OpenForms.OfType <Alterar>().First().Focus(); } else { Alt.Show(); } }
private void Alterar(object sender, RoutedEventArgs e) { Alterar alterar = new Alterar(Convert.ToInt32((sender as TextBlock).Tag.ToString())); alterar.Show(); }