예제 #1
0
 private void btnExcluir_Click(object sender, EventArgs e)
 {
     saida = (Saida)saidaBindingSource.Current;
     saida = GerenciadorSaida.GetInstance(null).Obter(saida.CodSaida);
     if (saida.TipoSaida == Saida.TIPO_VENDA)
     {
         if (MessageBox.Show("Houve Cancelamento do Cupom Fiscal? Confirma transformar VENDA em ORÇAMENTO?", "Confirmar Transformar Venda em Orçamento", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             GerenciadorSaida.GetInstance(null).Remover(saida);
             codSaidaTextBox_TextChanged(sender, e);
         }
     }
     else if (saida.TipoSaida == Saida.TIPO_PRE_VENDA)
     {
         if (MessageBox.Show("Confirma transformar PRÉ-VENDA em ORÇAMENTO?", "Confirmar Transformar Venda em Orçamento", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             GerenciadorSaida.GetInstance(null).Remover(saida);
             codSaidaTextBox_TextChanged(sender, e);
         }
     }
     else if (MessageBox.Show("Confirma EXCLUSÃO?", "Confirmar Exclusão", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         GerenciadorSaida.GetInstance(null).Remover(saida);
         saidaBindingSource.RemoveCurrent();
     }
     estado = EstadoFormulario.ESPERA;
     btnNovo.Focus();
 }
예제 #2
0
 private void btnEditar_Click(object sender, EventArgs e)
 {
     qtdEstoqueTextBox.Focus();
     habilitaBotoes(false);
     codLojaComboBox.Enabled = false;
     estado = EstadoFormulario.ATUALIZAR;
 }
예제 #3
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     cfopBindingSource.AddNew();
     cfopTextBox.Focus();
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #4
0
 protected virtual void setEstadoFormulario(EstadoFormulario value)
 {
     m_Estado            = value;
     sbuGuardar.Enabled  = value == EstadoFormulario.esEditando;
     sbuCancelar.Enabled = value == EstadoFormulario.esEditando;
     sbuEliminar.Enabled = value == EstadoFormulario.esEditando;
 }
예제 #5
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            nomeFantasiaTextBox.Focus();

            habilitaBotoes(false);
            estado = EstadoFormulario.ATUALIZAR;
        }
예제 #6
0
        private void btnExcluir_Click(object sender, EventArgs e)
        {
            saida = (Saida)saidaBindingSource.Current;
            saida = GerenciadorSaida.GetInstance(null).Obter(saida.CodSaida);
            if (saida.TipoSaida == Saida.TIPO_VENDA)
            {
                throw new TelaException("Pedido possui Nota Fiscal AUTORIZADA. Para ele ser editado é necessário CANCELAR a nota.");
            }

            else if (saida.TipoSaida == Saida.TIPO_PRE_VENDA)
            {
                if (MessageBox.Show("Confirma transformar PRÉ-VENDA em ORÇAMENTO?", "Confirmar Transformar Venda em Orçamento", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    GerenciadorSaida.GetInstance(null).Remover(saida);
                    codSaidaTextBox_TextChanged(sender, e);
                }
            }
            else if (MessageBox.Show("Confirma EXCLUSÃO?", "Confirmar Exclusão", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                GerenciadorSaida.GetInstance(null).Remover(saida);
                saidaBindingSource.RemoveCurrent();
            }
            estado = EstadoFormulario.ESPERA;
            btnNovo.Focus();
        }
예제 #7
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     grupoContaBindingSource.AddNew();
     codGrupoContaTextBox.Enabled = false;
     descricaoTextBox.Focus();
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #8
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     bancoBindingSource.AddNew();
     codBancoTextBox.Enabled = false;
     nomeTextBox.Focus();
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #9
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     contaBindingSource.AddNew();
     codSituacaoComboBox.SelectedIndex   = 0;
     codPessoaComboBox.SelectedIndex     = 0;
     codPlanoContaComboBox.SelectedIndex = 0;
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #10
0
        public ucProceso()
        {
            InitializeComponent();
            m_Estado = EstadoFormulario.esClave;

            /*asignamos un evento a la coleccion de tablas, de modo que
             * cada vez que se cree una nueva tabla dispare un evento*/
            datos.Tables.CollectionChanged += tablasCambiadas;
        }
예제 #11
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     planoContaBindingSource.AddNew();
     codPlanoContaTextBox.Enabled = false;
     rbPagar.Checked = true;
     codGrupoContaComboBox.SelectedIndex = 0;
     descricaoTextBox.Focus();
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #12
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            contaBancoBindingSource.AddNew();
            numerocontaTextBox.Focus();
            habilitaBotoes(false);
            codBancoComboBox.SelectedIndex = 0;
            ContaBanco contaBanco = (ContaBanco)contaBancoBindingSource.Current;

            contaBanco.CodBanco = ((Banco)bancoBindingSource.Current).CodBanco;
            estado = EstadoFormulario.INSERIR;
        }
예제 #13
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            subgrupoBindingSource.AddNew();
            descricaoTextBox.Focus();
            habilitaBotoes(false);
            codGrupoComboBox.SelectedIndex = 0;
            Subgrupo subgrupo = (Subgrupo)subgrupoBindingSource.Current;

            subgrupo.CodGrupo = ((Grupo)grupoBindingSource.Current).CodGrupo;  // grupo padrão
            estado            = EstadoFormulario.INSERIR;
        }
예제 #14
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            codPessoaComboBox.Focus();
            usuarioBindingSource.AddNew();

            estado = EstadoFormulario.INSERIR;
            codPessoaComboBox.SelectedIndex = 0;
            codPessoaComboBox.SelectAll();
            perfilComboBox.SelectedIndex = 0;
            habilitaBotoes(false);
        }
예제 #15
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            lojaBindingSource.AddNew();
            codPessoaComboBox.SelectedIndex = 1;
            Loja loja = (Loja)lojaBindingSource.Current;

            loja.CodPessoa = ((Pessoa)pessoaBindingSource.Current).CodPessoa;
            nomeTextBox.Focus();
            habilitaBotoes(false);
            estado = EstadoFormulario.INSERIR;
        }
예제 #16
0
 private void btnProdutos_Click(object sender, EventArgs e)
 {
     entradaProdutoBindingSource.AddNew();
     codProdutoComboBox.SelectedIndex = 0;
     produtoBindingSource.Position    = 0;
     ProdutosGroupBox.Enabled         = true;
     codProdutoComboBox.Focus();
     simplesTextBox.Text = Global.SIMPLES.ToString();
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR_DETALHE;
 }
예제 #17
0
 private void habilitaBotoes(Boolean habilita)
 {
     btnSalvar.Enabled   = !(habilita);
     btnCancelar.Enabled = !(habilita);
     btnBuscar.Enabled   = habilita;
     btnNovo.Enabled     = habilita;
     if (habilita)
     {
         estado = EstadoFormulario.ESPERA;
     }
 }
 private void cancelarButton_Click(object sender, EventArgs e)
 {
     if (this.IsChildForm)
     {
         this.HayCambios = false;
         this.Close();
         return;
     }
     this.rutTextBox.Text = string.Empty;
     this.EstadoForm      = EstadoFormulario.Buscar;
     this.activarControles();
 }
예제 #19
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     totalContasTextBox.Text     = "0,00";
     totalPagamentosTextBox.Text = "0,00";
     faltaReceberTextBox.Text    = "0,00";
     descontoTextBox.Text        = "0,00";
     totalAVistaTextBox.Text     = "0,00";
     valorPagamentoTextBox.Text  = "0,00";
     codClienteComboBox.Focus();
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #20
0
        private void btnEncerrar_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            saida          = (Saida)saidaBindingSource.Current;
            if (estado.Equals(EstadoFormulario.INSERIR_DETALHE))
            {
                habilitaBotoes(true);
                estado = EstadoFormulario.ESPERA;

                saida.EntregaRealizada = entregaRealizadaCheckBox.Checked;

                if (Saida.LISTA_TIPOS_REMESSA_DEPOSITO.Contains(saida.TipoSaida))
                {
                    FrmSaidaDeposito frmSaidaDeposito = new FrmSaidaDeposito(saida);
                    frmSaidaDeposito.ShowDialog();
                    frmSaidaDeposito.Dispose();
                }
                if (Saida.LISTA_TIPOS_RETORNO_DEPOSITO.Contains(saida.TipoSaida))
                {
                    FrmSaidaDeposito frmSaidaDeposito = new FrmSaidaDeposito(saida);
                    frmSaidaDeposito.ShowDialog();
                    frmSaidaDeposito.Dispose();
                }
                else if (Saida.LISTA_TIPOS_DEVOLUCAO_FORNECEDOR.Contains(saida.TipoSaida))
                {
                    FrmSaidaDevolucao frmSaidaDevolucao = new FrmSaidaDevolucao(saida);
                    frmSaidaDevolucao.ShowDialog();
                    frmSaidaDevolucao.Dispose();
                }
                else if (Saida.LISTA_TIPOS_REMESSA_CONSERTO.Contains(saida.TipoSaida))
                {
                    FrmSaidaDevolucao frmSaidaDevolucao = new FrmSaidaDevolucao(saida);
                    frmSaidaDevolucao.ShowDialog();
                    frmSaidaDevolucao.Dispose();
                }
                else if (Saida.LISTA_TIPOS_DEVOLUCAO_CONSUMIDOR.Contains(saida.TipoSaida))
                {
                    FrmSaidaDevolucaoConsumidor frmSaidaDevolucaoConsumidor = new FrmSaidaDevolucaoConsumidor(saida);
                    frmSaidaDevolucaoConsumidor.ShowDialog();
                    frmSaidaDevolucaoConsumidor.Dispose();
                }
                else if (Saida.LISTA_TIPOS_VENDA.Contains(saida.TipoSaida))
                {
                    FrmSaidaPagamento frmSaidaPagamento = new FrmSaidaPagamento(saida);
                    frmSaidaPagamento.ShowDialog();
                    frmSaidaPagamento.Dispose();
                }
                produtoBindingSource.MoveFirst();
                codSaidaTextBox_TextChanged(sender, e);
                btnNovo.Focus();
            }
            Cursor.Current = Cursors.Default;
        }
예제 #21
0
        private void codProdutoComboBox_Leave(object sender, EventArgs e)
        {
            EstadoFormulario estado           = EstadoFormulario.INSERIR;
            ProdutoPesquisa  _produtoPesquisa = ComponentesLeave.ProdutoComboBox_Leave(sender, e, codProdutoComboBox, estado, produtoBindingSource, true);

            if (_produtoPesquisa != null)
            {
                preencherDadosEstatisticos(_produtoPesquisa);
                codProdutoComboBox.Focus();
                codProdutoComboBox.SelectAll();
            }
        }
예제 #22
0
 private void btnCancelar_Click(object sender, EventArgs e)
 {
     estado = EstadoFormulario.ESPERA;
     entradaBindingSource.CancelEdit();
     entradaBindingSource.EndEdit();
     entradaProdutoBindingSource.CancelEdit();
     entradaProdutoBindingSource.EndEdit();
     ProdutosGroupBox.Enabled = false;
     habilitaBotoes(true);
     codEntradaTextBox_TextChanged(sender, e);
     btnBuscar.Focus();
 }
예제 #23
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     entradaBindingSource.AddNew();
     entradaProdutoBindingSource.DataSource = new List <EntradaProduto>();
     codEntradaTextBox.Enabled = false;
     numeroNotaFiscalTextBox.Focus();
     codEmpresaFreteComboBox.SelectedIndex = 0;
     codFornecedorComboBox.SelectedIndex   = 0;
     fretePagoEmitenteCheckBox.Checked     = true;
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #24
0
 private void btnPagamentos_Click(object sender, EventArgs e)
 {
     if (Convert.ToInt64(codEntradaTextBox.Text) > 0)
     {
         habilitaBotoes(true);
         estado  = EstadoFormulario.ESPERA;
         entrada = GerenciadorEntrada.GetInstance().Obter(Convert.ToInt64(codEntradaTextBox.Text)).GetEnumerator().Current;
         //FrmEntradaPagamento frmEntradaPagamento = new FrmEntradaPagamento(entrada);
         //frmEntradaPagamento.ShowDialog();
         //frmEntradaPagamento.Dispose();
         btnNovo.Focus();
     }
 }
예제 #25
0
 private void btnProdutos_Click(object sender, EventArgs e)
 {
     entradaProdutoBindingSource.AddNew();
     if (tb_entrada_produtoDataGridView.RowCount == 0)
     {
         codProdutoComboBox.SelectedIndex = 0;
         cfopComboBox.SelectedIndex       = 0;
     }
     ProdutosGroupBox.Enabled = true;
     codProdutoComboBox.Focus();
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR_DETALHE;
 }
예제 #26
0
 private void habilitaBotoes(Boolean habilita)
 {
     btnSalvar.Enabled   = !(habilita);
     btnCancelar.Enabled = !(habilita);
     btnBuscar.Enabled   = habilita;
     btnEditar.Enabled   = habilita;
     btnNovo.Enabled     = habilita;
     btnExcluir.Enabled  = habilita;
     tb_usuarioBindingNavigator.Enabled = habilita;
     if (habilita)
     {
         estado = EstadoFormulario.ESPERA;
     }
 }
예제 #27
0
 private void btnNovo_Click(object sender, EventArgs e)
 {
     entradaBindingSource.AddNew();
     codEntradaTextBox.Enabled = false;
     codFornecedorComboBox.Focus();
     codFornecedorComboBox.SelectedIndex = 0;
     codFornecedorComboBox.SelectAll();
     codEmpresaFreteComboBox.SelectedIndex = 0;
     dataEntradaDateTimePicker.Text        = DateTime.Now.ToShortDateString();
     //codSituacaoPagamentosComboBox.SelectedIndex = 0;
     fretePagoEmitenteCheckBox.Checked = true;
     habilitaBotoes(false);
     estado = EstadoFormulario.INSERIR;
 }
예제 #28
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            cartaoCreditoBindingSource.AddNew();
            codCartaoTextBox.Enabled = false;
            habilitaBotoes(false);
            codContaBancoComboBox.SelectedIndex = 0;
            codPessoaComboBox.SelectedIndex     = 0;
            CartaoCredito cartaoCredito = (CartaoCredito)cartaoCreditoBindingSource.Current;

            cartaoCredito.CodContaBanco = ((ContaBanco)contaBancoBindingSource.Current).CodContaBanco;
            cartaoCredito.CodPessoa     = ((Pessoa)pessoaBindingSource.Current).CodPessoa;
            estado = EstadoFormulario.INSERIR;
            nomeTextBox.Focus();
        }
예제 #29
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            PontaEstoque pontaEstoque = new PontaEstoque();

            pontaEstoque.CodProduto  = ProdutoSelected.CodProduto;
            pontaEstoque.NomeProduto = ProdutoSelected.Nome;
            pontaEstoque.Quantidade  = 1;

            pontaEstoqueBindingSource.Position = pontaEstoqueBindingSource.Add(pontaEstoque);
            quantidadeTextBox.Focus();
            habilitaBotoes(false);
            pontaEstoqueBindingSource.ResumeBinding();
            estado = EstadoFormulario.INSERIR;
        }
예제 #30
0
        private void habilitaBotoes(Boolean habilita)
        {
            btnSalvar.Enabled   = !(habilita);
            btnCancelar.Enabled = !(habilita);
            btnNovo.Enabled     = habilita;

            btnImprimir.Enabled = contasPessoaDataGridView.RowCount > 0;
            btnCFNfe.Enabled    = contasPessoaDataGridView.RowCount > 0;

            if (habilita)
            {
                estado = EstadoFormulario.ESPERA;
            }
        }