private void btnEntrar_Click(object sender, EventArgs e)
        {
            try
            {
                UsuarioNegocio usuarioNegocio = new UsuarioNegocio();
                Usuario        usuarioLogado  = new Usuario();
                usuarioLogado = usuarioNegocio.ConsultarPorUsuarioSenha(txtUsuario.Text, txtSenha.Text);

                if (usuarioLogado.IDStatus == 2)
                {
                    MessageBox.Show("Esse usuário foi desativado. Entre em contato com o administrador.");
                    this.Close();
                }

                PessoaFilial        filial        = new PessoaFilial();
                PessoaFilialNegocio filialNegocio = new PessoaFilialNegocio();

                filial = filialNegocio.ConsultarIdNomeLogon(usuarioLogado.IDFilial, null);

                ControleSistema.setFilialUsuario(filial, usuarioLogado);

                ControleSistema.atualizaCaixaAtual();

                //abre o formulario atual
                ControleFormulario.abreFrmMenu(usuarioLogado, filial);


                this.Visible = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                txtUsuario.Focus();
            }
        }
Exemplo n.º 2
0
 private void btnSelecionarCliente_Click(object sender, EventArgs e)
 {
     try
     {
         fornecedorSelecionado = ControleFormulario.abreFrmConsultaFornecedorCompra(AcaoTelaConsultaCadastros.FornecedorConsultaCompra, filialLogada);
         txtCliente.Text       = fornecedorSelecionado.Nome;
         btnProcurarProduto.Focus();
     }
     catch
     {
         MessageBox.Show("Não foi possível procurar um fornecedor.");
     }
 }
Exemplo n.º 3
0
 private void btnSelecionarCliente_Click_1(object sender, EventArgs e)
 {
     try
     {
         clienteSelecionado = ControleFormulario.abreFrmConsultaClienteVenda(AcaoTelaConsultaCadastros.ClienteConsultaVenda, filialLogada);
         txtCliente.Text    = clienteSelecionado.Nome;
         btnProcurarProduto.Focus();
     }
     catch
     {
         MessageBox.Show("Não foi possível procurar um cliente.");
     }
 }
Exemplo n.º 4
0
 private void btnProcurarProduto_Click(object sender, EventArgs e)
 {
     try
     {
         produtoSelecionado = ControleFormulario.abreFrmConsultaProdutoVenda(AcaoTelaConsultaCadastros.ProdutoConsultaVenda, filialLogada);
         txtproduto.Text    = produtoSelecionado.Nome;
         txtQuantidade.Focus();
     }
     catch
     {
         MessageBox.Show("Não foi possível procurar um produto.");
     }
 }
Exemplo n.º 5
0
        private void btnNovaVenda_Click(object sender, EventArgs e)
        {
            try
            {
                grbDadosVenda.Enabled        = true;
                grbListaProdutos.Enabled     = true;
                btnSelecionarCliente.Enabled = true;
                btnProcurarProduto.Enabled   = true;
                txtQuantidade.Enabled        = true;
                btnMais.Enabled         = true;
                btnMenos.Enabled        = true;
                btnOk.Enabled           = true;
                txtDescontoItem.Enabled = true;
                btnNovaVenda.Enabled    = false;
                txtDescontoItem.Text    = "0";
                txtValorTotal.Text      = "0";
                txtValorFinal.Text      = "0";
                txtDesconto.Text        = "0";

                //inicializa objetos
                pedido      = null;
                pedidoItens = null;
                pedidoItem  = null;

                try
                {
                    fornecedorSelecionado = ControleFormulario.abreFrmConsultaFornecedorCompra(AcaoTelaConsultaCadastros.FornecedorConsultaCompra, filialLogada);
                    txtCliente.Text       = fornecedorSelecionado.Nome;
                    txtDescontoItem.Focus();
                }
                catch
                {
                    MessageBox.Show("Não foi possível procurar um fornecedor.");
                }

                try
                {
                    produtoSelecionado = ControleFormulario.abreFrmConsultaProdutoVenda(AcaoTelaConsultaCadastros.ProdutoConsultaVenda, filialLogada);
                    txtproduto.Text    = produtoSelecionado.Nome;
                    txtQuantidade.Focus();
                }
                catch
                {
                    MessageBox.Show("Não foi possível procurar um produto.");
                }
            }
            catch
            {
                MessageBox.Show("Erro ao abrir uma nova venda. Entre em contato com o suporte.");
            }
        }
 private void IncreaseProgressBar(object sender, EventArgs e)
 {
     // Increment the value of the ProgressBar a value of one each time.
     pgbSplash.Increment();
     // Display the textual value of the ProgressBar in the StatusBar control's first panel.
     //statusBarPanel1.Text = progressBar1.Value.ToString() + "% Completed";
     // Determine if we have completed by comparing the value of the Value property to the Maximum value.
     if (pgbSplash.Value == pgbSplash.Maximum)
     {   // Stop the timer.
         timerSplash.Stop();
         this.Visible = false;
         ControleFormulario.abreFrmLogon();
     }
 }
Exemplo n.º 7
0
 private void Entrar()
 {
     try
     {
         UsuarioNegocio usuarioNegocio = new UsuarioNegocio();
         Usuario        usuarioLogado  = new Usuario();
         usuarioLogado = usuarioNegocio.ConsultarPorUsuarioSenha(txtUsuario.Text, txtSenha.Text);
         this.Visible  = false;
         ControleFormulario.abreFrmMenu();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Usuário ou senha não confere! Erro: " + ex.Message);
     }
 }
Exemplo n.º 8
0
 private void buttonAdv21_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmConsultaClienteCRUD(AcaoTelaConsultaCadastros.ClienteConsulta, filialLogada);
     controleIniciar();
 }
Exemplo n.º 9
0
 private void btnCalculadora_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmCalculadora();
 }
 private void médicosToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmCadastroMedicos();
 }
Exemplo n.º 11
0
 private void btnUsuarios_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmConsultaUsuariosCRUD(AcaoTelaConsultaCadastros.UsuarioConsulta, filialLogada);
     controleIniciar();
 }
Exemplo n.º 12
0
 private void btnCompras_Click(object sender, EventArgs e)
 {
     controleIniciar();
     ControleFormulario.abreFrmCompraWindows(filialLogada);
 }
 private void btnCadastrarUsuario_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmCadastrarUsu(AcaoTelaCRUD.Inserir, pessoaRecebida, null);
 }
Exemplo n.º 14
0
 private void btnJuridica_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmPessoaJuridicaCRUD(AcaoTelaConsultaCadastros.PessoaJuridicaConsulta, filialLogada);
     controleIniciar();
 }
Exemplo n.º 15
0
 private void fornecedorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmConsultaFornecedorCRUD(AcaoTelaConsultaCadastros.FornecedorConsulta, filialLogada);
 }
Exemplo n.º 16
0
 private void buttonAdv8_Click(object sender, EventArgs e)
 {
     controleIniciar();
     ControleFormulario.abreFrmVendaWindows(filialLogada);
 }
Exemplo n.º 17
0
 private void pessoaJurídicaToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmPessoaJuridicaCRUD(AcaoTelaConsultaCadastros.PessoaJuridicaConsulta, filialLogada);
 }
Exemplo n.º 18
0
 private void btnFecharCaixa_Click(object sender, EventArgs e)
 {
     controleIniciar();
     ControleFormulario.abreFrmFecharCaixa();
 }
Exemplo n.º 19
0
 private void produtoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmConsultaProdutoCRUD(AcaoTelaConsultaCadastros.ProdutoConsulta, filialLogada);
 }
Exemplo n.º 20
0
 private void btnFormaPagamento_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmConsultaFormaPagamentoCRUD(AcaoTelaConsultaCadastros.FormaPagamento, filialLogada);
     controleIniciar();
 }
 private void btnCadastrarMedico_Click(object sender, EventArgs e)
 {
     ControleFormulario.abreFrmCadastroMedicos();
 }