예제 #1
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            if (textboxUsuario.Text.Length > 0 && maskedSenha.Text.Length > 0)
            {
                dto_user.login = textboxUsuario.Text.Trim().ToUpper();
                dto_user.senha = func.Encryptor(maskedSenha.Text.Trim());

                if (bll_user.bll_ver_users(dto_user))
                {
                    MessageBox.Show("Seja bem-vindo(a) " + dto_user.login);
                    this.Hide();
                    Form produtos = new frmListagem(dto_user);
                    produtos.Show();
                }
                else
                {
                    MessageBox.Show("Usuário ou senha incorretos!!!");
                }
            }
            else
            {
                if (textboxUsuario.Text.Length == 0)
                {
                    MessageBox.Show("Campo de usuário não preenchido!!!");
                }
                else if (maskedSenha.Text.Length == 0)
                {
                    MessageBox.Show("Campo de senha não preenchido!!!");
                }

                return;
            }
        }
        private void listarProdutosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form lista = new frmListagem(usuario);

            lista.ShowDialog();
        }