Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Usuario novoUsuario = new Usuario();

            novoUsuario.Login = textBox1.Text;
            novoUsuario.Senha = textBox2.Text;

            _usuarioDao = new UsuarioDao();
            _usuarioDao.BuscarNivel(novoUsuario);

            var resultado = (_usuarioDao.BuscarNivel(novoUsuario));

            if (resultado == 0)
            {
                TelaAdmin frm = new TelaAdmin();
                frm.Show();
                this.Visible = false;
            }
            else if (resultado == 1)
            {
                TelaUsuario frm = new TelaUsuario();
                frm.Show();
                this.Visible = false;
            }
            else if (textBox1.Text == "root" && textBox2.Text == "abc123")
            {
                TelaUsuario frm = new TelaUsuario();
                frm.Show();
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("Login ou senha inválidos!");
            }
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            TelaAdmin frm = new TelaAdmin();

            frm.Show();
            this.Visible = false;
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Item novoItem = new Item();

            novoItem.Nome      = textBox1.Text;
            novoItem.Descricao = textBox2.Text;

            _itemDao = new ItemDao();
            _itemDao.Adicionar(novoItem);

            TelaAdmin frm = new TelaAdmin();

            frm.Show();
            this.Visible = false;
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Usuario novoUsuario = new Usuario();

            novoUsuario.Nome  = textBox1.Text;
            novoUsuario.Login = textBox2.Text;
            novoUsuario.Setor = textBox4.Text;
            novoUsuario.Senha = textBox3.Text;
            novoUsuario.Nivel = comboBox1.SelectedIndex;

            _usuarioDao = new UsuarioDao();
            _usuarioDao.Adicionar(novoUsuario);

            TelaAdmin frm = new TelaAdmin();

            frm.Show();
            this.Visible = false;
        }