private void btnSalvarAdm_Click(object sender, EventArgs e) { string resposta, senha, senha2, pergunta; pergunta = escolherPergunta.Text; resposta = EdtResposta.Text; senha = txtSenha.Text; senha2 = txtSenha2.Text; ControllerAdm CAdm = new ControllerAdm(); if (CAdm.RecuperarSenha(pergunta, resposta, senha, senha2)) { Close(); } }
private void EntrarBttn(object sender, EventArgs e) { string login; string senha; login = LoginUsuario.Text; senha = SenhaUsuario.Text; ControllerAdm adm = new ControllerAdm(); if (Convert.ToBoolean(adm.LogarAdm(login.Trim(), senha.Trim())) == true) { Close(); MessageBox.Show("Bem vindo!"); } else { MessageBox.Show("Login ou senha inválido(a)."); } }
private void BtnSalvar(object sender, EventArgs e) { string usuario, senha, senha2, pergunta, resposta, resposta2; usuario = EdtUsuario.Text; senha = EdtSenha.Text; senha2 = EdtSenha2.Text; pergunta = comboBox1.Text; resposta = EdtResposta.Text; resposta2 = EdtResposta2.Text; ControllerAdm CAdm = new ControllerAdm(); if (CAdm.SalvarAdm(usuario, senha, senha2, pergunta, resposta, resposta2)) { Hide(); PainelLogin childForm = new PainelLogin(); childForm.MdiParent = MDISingleton.InstanciaMDI(); childForm.Show(); } }
public MDIParentPrincipal() { InitializeComponent(); timer1.Enabled = false; ControllerAdm CAdm = new ControllerAdm(); if (CAdm.ExisteAdm() == false) { PainelInicio childForm = new PainelInicio(); childForm.MdiParent = this; childForm.Show(); } else { PainelLogin childForm = new PainelLogin(); childForm.MdiParent = this; childForm.Show(); } }