private void timer1_Tick(object sender, EventArgs e) { if (pg_carregando.Value >= 100) { timer1.Enabled = false; TelaDeLogin tl_login = new TelaDeLogin(); tl_login.Show(); this.Hide(); } else { pg_carregando.Value += 10; } }
private void button1_Click(object sender, EventArgs e) { if (Controlar.VisualizadoresBooleanos("Select * from tbl_login where senha = '" + Encriptografar.EncriptografarString(tbsenhaAntiga.Text) + "';") == true) { if (tb_novaSenha.Text == tb_novaSenha2.Text) { Controlar.Visualizadores("Select * from tbl_login where login = '******';", 1); int codigo = int.Parse(Controlar._VisualizadorMOD1); Controlar.Modificadores("Update tbl_login set senha = '" + Encriptografar.EncriptografarString(tb_novaSenha.Text) + "' where codigo = " + codigo + ";", true, "Senha alterada com sucesso!", "Atenção!"); TelaDeLogin tl_login = new TelaDeLogin(); tl_login.Show(); Application.Restart(); } else { MessageBox.Show("As novas senhas não coincidem. Por favor corrija as senha.", "Atenção!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }