예제 #1
0
        private void CarregarComboEmpresas()
        {
            List <Empresa> lstEmpresas = new List <Empresa>();
            BIZEmpresa     bizEmpresa  = new BIZEmpresa();

            this.Cursor = Cursors.WaitCursor;

            try
            {
                lstEmpresas.Add(new Empresa()
                {
                    idEmpresa = 0, razaoSocial = "--Selecione--"
                });
                lstEmpresas.AddRange(bizEmpresa.PesquisarEmpresa(new Empresa()).OrderBy(x => x.razaoSocial).ToList());

                cbEmpresa.DataSource    = lstEmpresas;
                cbEmpresa.DisplayMember = "razaoSocial";
                cbEmpresa.ValueMember   = "idEmpresa";
            }
            catch (SqlException)
            {
                MessageBox.Show(helper.RetornarMensagemPadraoErroAcessoBD(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception)
            {
                MessageBox.Show(helper.RetornarMensagemPadraoErroGenerico(), "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            this.Cursor = Cursors.Default;
        }
예제 #2
0
        private NotaFiscal PreencherDadosObrigatoriosNotaFiscal()
        {
            NotaFiscal notaFiscal = new NotaFiscal();
            BIZEmpresa bizEmpresa = new BIZEmpresa();

            notaFiscal.numeroNota        = 999;
            notaFiscal.tipoNota          = 9;
            notaFiscal.codigoVerificacao = "XXXXXXXXX";
            notaFiscal.tipoOperacao      = 8;
            notaFiscal.Contrato          = "ABC 123";
            notaFiscal.idEmpresa         = bizEmpresa.PesquisarEmpresa(new Empresa())[0].idEmpresa;
            notaFiscal.idCliente         = new BIZCliente().PesquisarCliente(new Cliente())[0].idCliente;
            notaFiscal.idPrazoPagamento  = 1;
            notaFiscal.numeroProcesso    = string.Empty;
            notaFiscal.Empenho           = string.Empty;
            notaFiscal.dataEmissao       = DateTime.Now;
            notaFiscal.dataPagamento     = DateTime.Now;
            notaFiscal.possuiDataAtes    = 0;
            notaFiscal.dataAtes          = DateTime.Now;
            notaFiscal.possuiDataCAT     = 0;
            notaFiscal.dataCAT           = DateTime.Now;
            notaFiscal.descricaoServico  = "Descrição teste";
            notaFiscal.CNPJ = "59.587.264/0001-36";
            notaFiscal.pagamentoEfetuado   = 0;
            notaFiscal.valorPago           = decimal.Zero;
            notaFiscal.Cancelado           = 0;
            notaFiscal.lstItens            = new List <NotaFiscalItem>();
            notaFiscal.observacaoCancelado = string.Empty;
            notaFiscal.IRPJ   = 11;
            notaFiscal.CSLL   = 22;
            notaFiscal.INSS   = 33;
            notaFiscal.PIS    = 44;
            notaFiscal.COFINS = 55;
            notaFiscal.ISSQN  = 66;

            notaFiscal.lstItens.Add(new NotaFiscalItem()
            {
                idNota        = 999,
                Descricao     = "Teste Item",
                precoUnitario = decimal.Parse("99,99"),
                Unidade       = "Un",
                Quantidade    = 9,
                UnitTest      = 1
            });

            notaFiscal.UnitTest = 1;

            return(notaFiscal);
        }
예제 #3
0
        private NFServico PreencherDadosObrigatoriosNFServico()
        {
            NFServico  nfServico  = new NFServico();
            BIZEmpresa bizEmpresa = new BIZEmpresa();

            nfServico.numeroNota          = 999;
            nfServico.idEmpresa           = bizEmpresa.PesquisarEmpresa(new Empresa())[0].idEmpresa;
            nfServico.idCliente           = new BIZCliente().PesquisarCliente(new Cliente())[0].idCliente;
            nfServico.numeroProcesso      = string.Empty;
            nfServico.Empenho             = string.Empty;
            nfServico.dataEmissao         = DateTime.Now;
            nfServico.dataPagamento       = DateTime.Now;
            nfServico.possuiDataAtes      = 0;
            nfServico.dataAtes            = DateTime.Now;
            nfServico.possuiDataCAT       = 0;
            nfServico.dataCAT             = DateTime.Now;
            nfServico.descricaoServico    = "Descrição teste";
            nfServico.CNPJ                = "59.587.264/0001-36";
            nfServico.pagamentoEfetuado   = 0;
            nfServico.valorPago           = decimal.Zero;
            nfServico.Cancelado           = 0;
            nfServico.lstItens            = new List <NFServicoItem>();
            nfServico.observacaoCancelado = string.Empty;
            nfServico.IRPJ                = 11;
            nfServico.CSLL                = 22;
            nfServico.INSS                = 33;
            nfServico.PIS    = 44;
            nfServico.COFINS = 55;
            nfServico.ISSQN  = 66;

            nfServico.lstItens.Add(new NFServicoItem()
            {
                idNota        = 999,
                Descricao     = "Teste Item",
                precoUnitario = decimal.Parse("99,99"),
                Unidade       = "Un",
                Quantidade    = 9,
                UnitTest      = 1
            });


            nfServico.UnitTest = 1;

            return(nfServico);
        }