Ejemplo n.º 1
0
        private void btnVoltar_Click(object sender, EventArgs e)
        {
            frmMenuSecretaria menu = new frmMenuSecretaria(cod);

            this.Hide();
            menu.Show();
        }
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            func.Usuario = txtLogin.Text;
            func.Senha   = txtSenha.Text;

            DataTable dt = func.RealizarLogin();

            // saber se foram retornados registros do select
            if (dt.Rows.Count > 0)
            {
                //Como usar os dados desta tabela
                string login = dt.Rows[0]["usuario"].ToString();
                string cod   = dt.Rows[0]["codFuncionario"].ToString();

                frmMenuSecretaria menu = new frmMenuSecretaria(cod);
                this.Hide();
                menu.Show();
            }
            else
            {
                MessageBox.Show("Login e senha errados. Tente novamente.");
            }
        }