Example #1
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                Cfop cfop = new Cfop();
                cfop.Descricao = descricaoTextBox.Text;
                cfop.CodCfop   = Int32.Parse(cfopTextBox.Text);
                cfop.Icms      = 0;

                GerenciadorCfop gCfop = GerenciadorCfop.GetInstance();
                if (estado.Equals(EstadoFormulario.INSERIR))
                {
                    gCfop.Inserir(cfop);
                }
                else
                {
                    gCfop.Atualizar(cfop);
                }
                cfopBindingSource.EndEdit();
            }
            catch (DadosException de)
            {
                cfopBindingSource.CancelEdit();
                throw de;
            }
            finally
            {
                habilitaBotoes(true);
                btnBuscar.Focus();
            }
        }
Example #2
0
 private void btnExcluir_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Confirma exclusão?", "Confirmar Exclusão", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         GerenciadorCfop.GetInstance().Remover(Int32.Parse(cfopTextBox.Text));
         cfopBindingSource.RemoveCurrent();
     }
     btnBuscar.Focus();
 }
 private void txtTexto_TextChanged(object sender, EventArgs e)
 {
     if ((cmbBusca.SelectedIndex == 1) && !txtTexto.Text.Equals(""))
     {
         cfopBindingSource.DataSource = GerenciadorCfop.GetInstance().Obter(Convert.ToInt32(txtTexto.Text));
     }
     else
     {
         cfopBindingSource.DataSource = GerenciadorCfop.GetInstance().ObterPorDescricao(txtTexto.Text);
     }
 }
Example #4
0
        private void FrmEntrada_Load(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            GerenciadorSeguranca.getInstance().verificaPermissao(this, Global.ENTRADA_PRODUTOS, Principal.Autenticacao.CodUsuario);
            produtoBindingSource.DataSource            = GerenciadorProduto.GetInstance().ObterTodos();
            fornecedorBindingSource.DataSource         = GerenciadorPessoa.GetInstance().ObterTodos();
            empresaFreteBindingSource.DataSource       = GerenciadorPessoa.GetInstance().ObterTodos();
            cfopBindingSource.DataSource               = GerenciadorCfop.GetInstance().ObterTodos();
            cstBindingSource.DataSource                = GerenciadorCst.GetInstance().ObterTodos();
            entradaBindingSource.DataSource            = GerenciadorEntrada.GetInstance().ObterTodos();
            situacaoPagamentosBindingSource.DataSource = GerenciadorEntrada.GetInstance().ObterTodosSituacoesPagamentos();
            entradaBindingSource.MoveLast();
            entrada        = new Entrada();
            entradaProduto = new EntradaProduto();
            tipoEntrada    = Entrada.TIPO_ENTRADA;
            habilitaBotoes(true);

            Cursor.Current = Cursors.Default;
        }
Example #5
0
 private void FrmCfop_Load(object sender, EventArgs e)
 {
     cfopBindingSource.DataSource = GerenciadorCfop.GetInstance().ObterTodos();
     habilitaBotoes(true);
 }
 private void FrmCfopPesquisa_Load(object sender, EventArgs e)
 {
     cfopBindingSource.DataSource = GerenciadorCfop.GetInstance().ObterTodos();
     cmbBusca.SelectedIndex       = 0;
 }