示例#1
0
        private PdfPTable Parte14()
        {
            Tabela table = new Tabela(1);
            Celula cell;
            Chunk  chunk;

            chunk = new Chunk(NOM_PARCEIRO, FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);

            chunk = new Chunk(DES_LOGRADOURO + "," + NRO_ENDERECO + " - " + NOM_CIDADE + " - " + COD_ESTADO, FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);

            chunk = new Chunk("Fone: " + FONE.PoeEdicao(NRO_FONE1) + " - Fax: " + FONE.PoeEdicao(NRO_FAX), FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);

            chunk = new Chunk("CEP: " + CEP.PoeEdicao(NRO_CEP) + " - " + DES_EMAIL, FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Celula(new Phrase(chunk));
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            table.AddCell(cell);
            return(table);
        }
示例#2
0
        public static string Concatena(string fone1, string fone2, string celular,
                                       string fone1Parceiro, string fone2Parceiro, string celularParceiro)
        {
            string fones = "";

            if ((fone1 != null) && (fone1.Trim().Length > 0) && !fone1.Equals("0000000000"))
            {
                fones += FONE.PoeEdicao(fone1);
            }
            if ((fone2 != null) && (fone2.Trim().Length > 0) && !fone2.Equals("0000000000"))
            {
                if (!fones.Equals(""))
                {
                    fones += " - ";
                }
                fones += FONE.PoeEdicao(fone2);
            }
            if ((celular != null) && (celular.Trim().Length > 0) && !celular.Equals("0000000000"))
            {
                if (!fones.Equals(""))
                {
                    fones += " - ";
                }
                fones += CELULAR.PoeEdicao(celular);
            }
            if (fones.Equals(""))
            {
                if ((fone1Parceiro != null) && (fone1Parceiro.Trim().Length > 0) && !fone1Parceiro.Equals("0000000000"))
                {
                    fones += FONE.PoeEdicao(fone1Parceiro);
                }
                if ((fone2Parceiro != null) && (fone2Parceiro.Trim().Length > 0) && !fone2Parceiro.Equals("0000000000"))
                {
                    if (!fones.Equals(""))
                    {
                        fones += " - ";
                    }
                    fones += FONE.PoeEdicao(fone2Parceiro);
                }
                if ((celularParceiro != null) && (celularParceiro.Trim().Length > 0) && !celularParceiro.Equals("0000000000"))
                {
                    if (!fones.Equals(""))
                    {
                        fones += " - ";
                    }
                    fones += CELULAR.PoeEdicao(celularParceiro);
                }
            }
            return(fones);
        }
示例#3
0
        public static string Concatena(object objFixo, object objCelular)
        {
            string fones   = "";
            string fixo    = null;
            string celular = null;

            if (objFixo != null)
            {
                fixo = objFixo.ToString().Trim();
                if (fixo.Replace("0", "").Equals(""))
                {
                    fixo = null;
                }
            }
            if (objCelular != null)
            {
                celular = objCelular.ToString().Trim();
                if (celular.Equals("") || celular.Replace("0", "").Equals(""))
                {
                    celular = null;
                }
            }
            if (fixo != null)
            {
                if (celular != null)
                {
                    fones = FONE.PoeEdicao(fixo) + "/" + CELULAR.PoeEdicao(celular);
                }
                else
                {
                    fones = FONE.PoeEdicao(fixo);
                }
            }
            else if (celular != null)
            {
                fones = CELULAR.PoeEdicao(celular);
            }
            return(fones);
        }
示例#4
0
        private void Parte2(Cabecalho2_Pedido cab2)
        {
            Tabela table = new Tabela(31);
            Celula cell;

            // linha1
            cell         = new Celula(Frase("CLIENTE: ", cab2.cliente, 10));
            cell.Colspan = 22;
            table.AddCell(cell);

            cell         = new Celula(Frase("CONTATO: ", cab2.contato, 10));
            cell.Colspan = 22;
            table.AddCell(cell);

            // linha2
            cell         = new Celula(Frase("ENDEREÇO: ", cab2.endereco + "," + cab2.numero, 10));
            cell.Colspan = 22;
            table.AddCell(cell);

            cell         = new Celula(Frase("E-mail: ", cab2.email, 10));
            cell.Colspan = 9;
            table.AddCell(cell);

            // linha3
            cell         = new Celula(Frase("BAIRRO: ", cab2.bairro, 10));
            cell.Colspan = 11;
            table.AddCell(cell);

            cell         = new Celula(Frase("CIDADE: ", cab2.cidade, 10));
            cell.Colspan = 11;
            table.AddCell(cell);

            cell         = new Celula(Frase("UF: ", cab2.estado, 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            cell         = new Celula(Frase("CEP: ", CEP.PoeEdicao(cab2.cep), 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            // linha4
            cell         = new Celula(Frase("CNPJ: ", cab2.cnpj, 10));
            cell.Colspan = 11;
            table.AddCell(cell);

            cell         = new Celula(Frase("INCRIÇÃO ESTADUAL: ", cab2.ie, 10));
            cell.Colspan = 16;
            table.AddCell(cell);

            cell         = new Celula(Frase("FONE: ", FONE.PoeEdicao(cab2.fone), 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            // linha4
            if (cab2.entrega.Trim().Length > 0)
            {
                cell = new Celula(Frase("LOCAL DE ENTREGA: ",
                                        cab2.entrega.Trim() + "," + cab2.numero_entrega.Trim() + " - " +
                                        cab2.compl_entrega.Trim() + " - " +
                                        cab2.bairro_entrega.Trim() + " - " + cab2.cidade_entrega.Trim() +
                                        cab2.estado_entrega.Trim() + " - " +
                                        CEP.PoeEdicao(cab2.cep_entrega), 10));
            }
            else
            {
                cell = new Celula(Frase("LOCAL DE ENTREGA: ", "IDEM", 10));
            }
            cell.Colspan = 31;
            table.AddCell(cell);

            // linha5
            if (cab2.cobranca.Trim().Length > 0)
            {
                cell = new Celula(Frase("LOCAL DE COBRANÇA: ",
                                        cab2.cobranca.Trim() + "," + cab2.numero_cobranca.Trim() + " - " +
                                        cab2.compl_cobranca.Trim() + " - " +
                                        cab2.bairro_cobranca.Trim() + " - " + cab2.cidade_cobranca.Trim() +
                                        cab2.estado_cobranca.Trim() + " - " +
                                        CEP.PoeEdicao(cab2.cep_cobranca), 10));
            }
            else
            {
                cell = new Celula(Frase("LOCAL DE COBRANÇA: ", "IDEM", 10));
            }
            cell.Colspan = 31;
            table.AddCell(cell);

            // linha6
            cell         = new Celula(Frase("FRETE: % ", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            if (IDT_FRETE == 'C')
            {
                cell = new Celula(new Phrase(""));
            }
            else
            {
                Chunk chunk = new Chunk("X", FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 16));
                cell = new Celula(new Phrase(chunk));
            }
            cell.Colspan     = 1;
            cell.BorderWidth = 1;
            table.AddCell(cell);

            cell         = new Celula(Frase("FORNECEDOR", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            if (IDT_FRETE == 'C')
            {
                Chunk chunk = new Chunk("X", FontFactory.GetFont(BaseFont.HELVETICA_BOLD, 16));
                cell = new Celula(new Phrase(chunk));
            }
            else
            {
                cell = new Celula(new Phrase(""));
            }
            cell.Colspan     = 1;
            cell.BorderWidth = 1;
            table.AddCell(cell);

            cell         = new Celula(Frase("CLIENTE", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            cell         = new Celula(Frase("TRANSPORTADORA: ", "", 10));
            cell.Colspan = 12;
            table.AddCell(cell);

            cell         = new Celula(Frase("FONE: ", "", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            // linha7
            cell         = new Celula(Frase("CONDIÇÕES DE PAGAMENTO: ", "", 10));
            cell.Colspan = 8;
            table.AddCell(cell);

            cell         = new Celula(Frase("SINAL-R$ ", "", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            cell         = new Celula(Frase("PARCELAS 1-R$ ", "", 10));
            cell.Colspan = 6;
            table.AddCell(cell);

            cell         = new Celula(Frase("2-R$ ", "", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            cell         = new Celula(Frase("3-R$ ", "", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            cell         = new Celula(Frase("4-R$ ", "", 10));
            cell.Colspan = 4;
            table.AddCell(cell);

            // linha8
            cell         = new Celula(Frase("SAÍDA DA FÁBRICA: ", "", 10));
            cell.Colspan = 19;
            table.AddCell(cell);

            cell         = new Celula(Frase("DESCONTO: ", "", 10));
            cell.Colspan = 5;
            table.AddCell(cell);

            cell         = new Celula(Frase("ENC FINANCEIRO: ", "", 10));
            cell.Colspan = 7;
            table.AddCell(cell);
            doc.Add(table);
        }
示例#5
0
        private void GeraCabecalho2()
        {
            Table table = new Table(10);

            table.TableFitsPage   = true;
            table.BorderWidth     = 0;
            table.Padding         = 1;
            table.WidthPercentage = 100;
            table.Alignment       = Element.ALIGN_LEFT;
            table.AddCell(Celula2("Fornecedor", 1));
            table.AddCell(Celula2(cab2.fornecedor, 9));
            table.AddCell(Celula2("Cliente", 1));
            table.AddCell(Celula2(cab2.cliente, 4));
            table.AddCell(Celula2("Contato", 1));
            table.AddCell(Celula2(cab2.nom_contato.Trim() + " / " + cab2.email_contato.Trim() + " / " + FONE.PoeEdicao(cab2.fone_contato), 4));
            table.AddCell(Celula2("Consultor", 1));
            table.AddCell(Celula2(cab2.nom_consultor.Trim() + " / " + cab2.email_consultor.Trim() + " / " + FONE.PoeEdicao(cab2.fone_consultor), 4));
            table.AddCell(Celula2("Vendedor", 1));
            table.AddCell(Celula2(cab2.nom_vendedor.Trim() + " / " + cab2.email_vendedor.Trim() + " / " + FONE.PoeEdicao(cab2.fone_vendedor), 4));
            doc.Add(table);
        }
示例#6
0
        private void GeraCabecalho1()
        {
            Table table = new Table(4);

            table.TableFitsPage   = true;
            table.WidthPercentage = 100;
            table.BorderWidth     = 0;
            table.Padding         = 1;
            Chunk chunk;
            Cell  cell;

            // coluna1 - logo
            Image img;
            float largura = 1000F;
            float altura  = 1000F;

            try
            {
                img = Image.GetInstance(cab1.logo);
                float w = img.Width;
                float h = img.Height;
                while ((w > largura) || (h > altura))
                {
                    w *= 0.9F;
                    h *= 0.9F;
                }
                img.ScaleAbsolute(w, h);
                chunk = new Chunk(img, 0, 0);
            }
            catch
            {
                chunk = new Chunk("");
            }
            cell             = new Cell(chunk);
            cell.BorderWidth = 0;
            table.AddCell(cell);

            // coluna2 - orcamento
            Paragraph par = new Paragraph();

            par.Add(new Chunk(" orçamento:", FontFactory.GetFont(BaseFont.HELVETICA, 18)));
            par.Add(new Chunk(cab1.orcamento.ToString() + "\n\n", FontFactory.GetFont(BaseFont.HELVETICA, 22)));
            par.Add(new Chunk(" " + cab1.data.ToString("d/M/yyyy"), FontFactory.GetFont(BaseFont.HELVETICA, 18)));
            cell = new Cell(par);
            cell.BorderWidthTop      = 1;
            cell.BorderWidthBottom   = 1;
            cell.BorderWidthLeft     = 1;
            cell.BorderWidthRight    = 0;
            cell.HorizontalAlignment = Element.ALIGN_LEFT;
            cell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            table.AddCell(cell);

            // coluna3 - dados empresa
            string dados_empresa =
                cab1.filial + " \n" +
                cab1.rua + "," + cab1.nro + " " + cab1.complemento + " \n" +
                "CEP: " + CEP.PoeEdicao(cab1.cep) +
                " - Fone: " + FONE.PoeEdicao(cab1.fone) +
                " - Fax: " + FONE.PoeEdicao(cab1.fax) + " \n" +
                cab1.email + " ";

            chunk = new Chunk(dados_empresa, FontFactory.GetFont(BaseFont.HELVETICA, 10));
            cell  = new Cell(chunk);
            cell.BorderWidthTop      = 1;
            cell.BorderWidthBottom   = 1;
            cell.BorderWidthLeft     = 0;
            cell.BorderWidthRight    = 1;
            cell.HorizontalAlignment = Element.ALIGN_RIGHT;
            cell.VerticalAlignment   = Element.ALIGN_MIDDLE;
            cell.Colspan             = 2;
            table.AddCell(cell);

            doc.Add(table);
        }