Пример #1
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            string usuario1, senha;

            usuario1 = txtNome.Text;
            senha    = txtSenha.Text;
            Login usuario = new Login();

            Login userLogado = new Login();

            userLogado = usuario.Autentica(usuario1, senha);

            if (userLogado != null)
            {
                if (userLogado.nivel == "0")
                {
                    Program.globalString = txtNome.Text;
                    this.Hide();
                    var inicio = new frmIncio();
                    inicio.Closed += (s, args) => this.Close();
                    inicio.Show();
                }

                /*else
                 * {
                 *  DialogResult = DialogResult.None;
                 *  wfaMainAdministrador.wfaMainAdm frm2 = new wfaMainAdministrador.wfaMainAdm();
                 *  frm2.Show();
                 *  txtLogin.Enabled = false;
                 *  txtSenha.Enabled = false;
                 *  btnLogin.Enabled = false;
                 *
                 * }*/
            }
            else
            {
                lblErro.Visible = true;
                txtNome.Text    = "";
                txtSenha.Text   = "";
                txtNome.Focus();
            }

            /*
             * if (txtNome.Text == "admin" && txtSenha.Text == "admin")
             * {
             *  Program.globalString = txtNome.Text;
             *  this.Hide();
             *  var inicio = new frmIncio();
             *  inicio.Closed += (s, args) => this.Close();
             *  inicio.Show();
             * }
             * else
             * {
             *  lblErro.Visible = true;
             *  txtNome.Text = "";
             *  txtSenha.Text = "";
             *  txtNome.Focus();
             * }*/
        }
Пример #2
0
        private void btnInicio_Click(object sender, EventArgs e)
        {
            this.Hide();
            var inicio = new frmIncio();

            inicio.Closed += (s, args) => this.Close();
            inicio.Show();
        }
Пример #3
0
        private void btnVoltar_Click(object sender, EventArgs e)
        {
            this.Hide();
            var menu = new frmIncio();

            menu.Closed += (s, args) => this.Close();
            menu.Show();
        }
Пример #4
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            string usuario1, senha;

            usuario1 = txtNome.Text;
            senha    = txtSenha.Text;
            Login usuario = new Login();

            Login userLogado = new Login();

            userLogado = usuario.Autentica(usuario1, senha);

            if (userLogado != null)
            {
                if (userLogado.nivel == "0")
                {
                    Program.globalString = txtNome.Text;
                    this.Hide();
                    frmIncio func = new frmIncio();
                    func.Show();
                }
                else
                {
                    Program.globalString = txtNome.Text;
                    this.Hide();
                    frmIncioFunc func = new frmIncioFunc();
                    func.Show();
                }
            }
            else
            {
                lblErro.Visible = true;
                txtNome.Text    = "";
                txtSenha.Text   = "";
                txtNome.Focus();
            }

            /*
             * if (txtNome.Text == "admin" && txtSenha.Text == "admin")
             * {
             *  Program.globalString = txtNome.Text;
             *  this.Hide();
             *  var inicio = new frmIncio();
             *  inicio.Closed += (s, args) => this.Close();
             *  inicio.Show();
             * }
             * else
             * {
             *  lblErro.Visible = true;
             *  txtNome.Text = "";
             *  txtSenha.Text = "";
             *  txtNome.Focus();
             * }*/
        }