private void Btm_Salvar_Click(object sender, EventArgs e) { string saida = ""; saida = ControllerUsuario.Criar(Txt_Login.Text, Txt_Senha.Text, VerificarTipo()); Txt_Login.Clear(); Txt_Senha.Clear(); MessageBox.Show(String.Format("{0}", saida), "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void Btm_Salvar_Click(object sender, EventArgs e) { string saida = ""; if (!String.IsNullOrEmpty(Txt_Login.Text)) { //Salvando e passando o resulado para a saida. saida = ControllerUsuario.Editar(IDtec, Txt_Login.Text, Txt_Senha.Text, VerificarTipo()); Txt_Login.Clear(); Txt_Senha.Clear(); Txt_Tipo.Text = " "; MessageBox.Show(String.Format("{0}", saida), "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void Btn_Login_Click(object sender, EventArgs e) { if ((Txt_Pwd.Text != "") && (Txt_Pwd.Text != "")) { if (Fonctions.IsAuthenticated(Txt_Login.Text, Txt_Pwd.Text)) { this.Hide(); Form1 form1 = new Form1(); form1.Show(); logger.Info("identification en tant que " + Txt_Login.Text); } } else { MessageBox.Show("Veuillez renseigner un nom d'utilisateur et/ou un mot de passe !", "Erreur de saisie !", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } Txt_Login.Clear(); Txt_Pwd.Clear(); }
void Button1Click(object sender, EventArgs e) { if (Txt_Login.Text == "Admin" && Txt_Senha.Text == "Admin") { Lbl_Login.Text = "logado!"; Lbl_Login.ForeColor = Color.Green; Frm_Principal principal = new Frm_Principal(); principal.Show(); this.Visible = false; } else { MessageBox.Show("Erro tente novamente!"); Lbl_Login.Text = "Erro Login ou Senha Invalidos!"; Txt_Senha.Clear(); Txt_Login.Clear(); } }
private void PTB_Logar_Click(object sender, EventArgs e) { if (Txt_Login.Text.Trim() == "") { MessageBox.Show("Preencha o Login", "Enigma", MessageBoxButtons.OK, MessageBoxIcon.Error); processar = false; } if (Txt_Senha.Text.Trim() == "") { MessageBox.Show("Preencha a Senha", "Enigma", MessageBoxButtons.OK, MessageBoxIcon.Error); processar = false; } if (processar) { Form frm = new Form_Load(); frm.Show(); frm.Refresh(); try { UsuarioDAL dal = new UsuarioDAL(); if (dal.Logar(Txt_Login.Text.Trim(), Txt_Senha.Text.Trim())) { Usuario atual = dal.Consultar(Txt_Login.Text.Trim()); if (atual.TipoConta != "B") { Form menu = new Form_Menu(); this.Visible = false; Program.Email = ""; UsuarioAtual.ID = atual.ID; UsuarioAtual.Nome = atual.Nome; UsuarioAtual.Email = atual.Email; UsuarioAtual.Foto = atual.Foto; UsuarioAtual.TipoConta = atual.TipoConta; UsuarioAtual.Senha = ""; Program.Login = this; frm.Close(); menu.ShowDialog(); Txt_Login.Clear(); Txt_Senha.Clear(); Program.Email = ""; Txt_Login.Focus(); } else { MessageBox.Show("Essa conta foi banida", "Enigma", MessageBoxButtons.OK, MessageBoxIcon.Error); frm.Close(); } } else { MessageBox.Show("Login e/ou Senha estão incorretos", "Enigma", MessageBoxButtons.OK, MessageBoxIcon.Error); frm.Close(); } } catch { MessageBox.Show("Erro de conexão, tente novamente", "Enigma", MessageBoxButtons.OK, MessageBoxIcon.Error); frm.Close(); } } processar = true; }
private void Txt_Login_Enter(object sender, EventArgs e) { Txt_Login.Clear(); }