예제 #1
0
        public static List <string> DadosImpressao()
        {
            List <string> lista = new List <string>
            {
                "ID: " + ID
            };

            if (Tipo == 0)
            {
                // 1
                lista.Add("Razão Social: " + Nome);
                // 2
                lista.Add("Nome Fantasia: " + Apelido);
                // 3
                if (!string.IsNullOrEmpty(Documento))
                {
                    if (Documento.Contains(".") && Documento.Contains("/") && Documento.Contains("-"))
                    {
                        lista.Add("CNPJ: " + Documento);
                    }
                    else
                    {
                        lista.Add("CNPJ: " + Documento.FormataCNPJ());
                    }
                }
                else
                {
                    lista.Add("CNPJ: ");
                }
                // 4
                if (!string.IsNullOrEmpty(DataNascimento))
                {
                    if (DataNascimento.Contains("/"))
                    {
                        lista.Add("Fundação: " + DataNascimento);
                    }
                    else
                    {
                        lista.Add("Fundação: " + DataNascimento.FormataData());
                    }
                }
                else
                {
                    lista.Add("Fundação: ");
                }
            }
            else
            {
                // 1
                lista.Add("Nome: " + Nome);
                // 2
                lista.Add("Apelido: " + Apelido);
                // 3
                if (!string.IsNullOrEmpty(Documento))
                {
                    if (Documento.Contains(".") && Documento.Contains("-"))
                    {
                        lista.Add("CPF: " + Documento);
                    }
                    else
                    {
                        lista.Add("CPF: " + Documento.FormataCPF());
                    }
                }
                else
                {
                    lista.Add("CPF: ");
                }
                if (!string.IsNullOrEmpty(DataNascimento))
                {
                    if (DataNascimento.Contains("/"))
                    {
                        lista.Add("Aniversário: " + DataNascimento);
                    }
                    else
                    {
                        lista.Add("Aniversário: " + DataNascimento.FormataData());
                    }
                }
                else
                {
                    lista.Add("Aniversário: ");
                }
            }

            // 5
            if (DataCadastro.Contains("/"))
            {
                lista.Add("Cadastrado em: " + DataCadastro);
            }
            else
            {
                lista.Add("Cadastrado em: " + DataCadastro.FormataData());
            }
            // 6
            string textoEndereco = "Endereço: ";

            if (!string.IsNullOrEmpty(Endereco))
            {
                textoEndereco += Endereco;
            }
            if (!string.IsNullOrEmpty(Numero))
            {
                textoEndereco += ", " + Numero;
            }
            if (!string.IsNullOrEmpty(Bairro))
            {
                textoEndereco += " - " + Bairro;
            }
            if (!string.IsNullOrEmpty(Cidade))
            {
                textoEndereco += " - " + Cidade;
            }
            if (!string.IsNullOrEmpty(Estado))
            {
                textoEndereco += " / " + Estado;
            }
            if (!string.IsNullOrEmpty(CEP))
            {
                if (CEP.Contains("-"))
                {
                    textoEndereco += " - " + CEP;
                }
                else
                {
                    textoEndereco += " - " + CEP.FormataCEP();
                }
            }
            lista.Add(textoEndereco);

            // 7
            if (!string.IsNullOrEmpty(Telefone) && !string.IsNullOrEmpty(Contato))
            {
                if (Telefone.Length > 11)
                {
                    lista.Add(Telefone.FormataNumeroCelular() + " - " + Contato);
                }
                else
                {
                    lista.Add(Telefone.FormataNumeroTelefone() + " - " + Contato);
                }
            }
            else if (!string.IsNullOrEmpty(Telefone) && string.IsNullOrEmpty(Contato))
            {
                if (Telefone.Length > 11)
                {
                    lista.Add(Telefone.FormataNumeroCelular());
                }
                else
                {
                    lista.Add(Telefone.FormataNumeroTelefone());
                }
            }
            else if (string.IsNullOrEmpty(Telefone) && !string.IsNullOrEmpty(Contato))
            {
                lista.Add("Contato Principal:" + Contato);
            }
            else
            {
                lista.Add("");
            }

            // 8
            if (!string.IsNullOrEmpty(TelefoneComercial) && !string.IsNullOrEmpty(ContatoComercial))
            {
                if (TelefoneComercial.Length > 11)
                {
                    lista.Add(TelefoneComercial.FormataNumeroCelular() + " - " + ContatoComercial);
                }
                else
                {
                    lista.Add(TelefoneComercial.FormataNumeroTelefone() + " - " + ContatoComercial);
                }
            }
            else if (!string.IsNullOrEmpty(TelefoneComercial) && string.IsNullOrEmpty(ContatoComercial))
            {
                if (TelefoneComercial.Length > 11)
                {
                    lista.Add(TelefoneComercial.FormataNumeroCelular());
                }
                else
                {
                    lista.Add(TelefoneComercial.FormataNumeroTelefone());
                }
            }
            else if (string.IsNullOrEmpty(TelefoneComercial) && !string.IsNullOrEmpty(ContatoComercial))
            {
                if (lista[7].Contains("Contato"))
                {
                    lista.Add("Contato 2:" + ContatoComercial);
                }
                else
                {
                    lista.Add("Contato:" + ContatoComercial);
                }
            }
            else
            {
                lista.Add("");
            }

            // 9
            if (!string.IsNullOrEmpty(Celular) && !string.IsNullOrEmpty(ContatoCelular))
            {
                if (Celular.Length > 11)
                {
                    lista.Add(Celular.FormataNumeroCelular() + " - " + ContatoCelular);
                }
                else
                {
                    lista.Add(Celular.FormataNumeroTelefone() + " - " + ContatoCelular);
                }
            }
            else if (!string.IsNullOrEmpty(Celular) && string.IsNullOrEmpty(ContatoCelular))
            {
                if (Celular.Length > 11)
                {
                    lista.Add(Celular.FormataNumeroCelular());
                }
                else
                {
                    lista.Add(Celular.FormataNumeroTelefone());
                }
            }
            else if (string.IsNullOrEmpty(Celular) && !string.IsNullOrEmpty(ContatoCelular))
            {
                if (lista[7].Contains("Contato") && lista[8].Contains("Contato 2"))
                {
                    lista.Add("Contato 3:" + ContatoCelular);
                }
                else if (lista[7].Contains("Contato") || lista[8].Contains("Contato"))
                {
                    lista.Add("Contato 2:" + ContatoCelular);
                }
                else
                {
                    lista.Add("Contato:" + ContatoCelular);
                }
            }
            else
            {
                lista.Add("");
            }

            // 10
            lista.Add("E-mail Principal: " + Email);
            // 11
            lista.Add("Site: " + Site);
            // 12
            lista.Add("Inscrição Estadual: " + InscricaoEstadual);

            /*string ID = "", Nome = "", Apelido = "", Documento = "", cadastro = "", DataNascimento = "",
             * CEP = "", Endereco = "", Numero = "", Complemento = "", Bairro = "", Cidade = "", Estado = "",
             * Pais = "", Telefone = "", Contato = "", TelefoneComercial = "", ContatoComercial = "", Celular = "",
             * ContatoCelular = "", Email = "", Site = "", InscricaoEstadual = "", InscricaoMunicipal = "", Obs = "";*/

            return(lista);
        }
예제 #2
0
        public static List <string> DadosImpressao()
        {
            List <string> lista = new List <string>
            {
                "ID: " + ID
            };

            if (!string.IsNullOrEmpty(CNPJ))
            {
                // 1
                if (!string.IsNullOrEmpty(RazaoSocial))
                {
                    lista.Add("Razão Social: " + RazaoSocial);
                }
                else
                {
                    lista.Add("");
                }
                // 2
                lista.Add("Nome Fantasia: " + Nome);
                // 3
                if (CNPJ.Contains(".") && CNPJ.Contains("/") && CNPJ.Contains("-"))
                {
                    lista.Add("CNPJ: " + CNPJ);
                }
                else
                {
                    lista.Add("CNPJ: " + CNPJ.FormataCNPJ());
                }
            }
            else if (!string.IsNullOrEmpty(CPF))
            {
                // 1
                lista.Add("Nome: " + Nome);
                // 2
                lista.Add("RG: " + RG);
                // 3
                if (CPF.Contains(".") && CPF.Contains("-"))
                {
                    lista.Add("CPF: " + CPF);
                }
                else
                {
                    lista.Add("CPF: " + CPF.FormataCPF());
                }
            }
            else
            {
                // 1
                lista.Add("Nome: " + Nome);
                // 2
                lista.Add("");
                // 3
                lista.Add("");
            }
            //4
            string consulta = "Select nome from tbl_contrato where id = " + (Contrato + 1).ToString() + ";";

            lista.Add("Tipo de cliente: " + Sistema.ConsultaSimples(consulta));
            //5
            if (DataCadastro.Contains("/"))
            {
                lista.Add("Cadastrado em: " + DataCadastro);
            }
            else
            {
                lista.Add("Cadastrado em: " + DataCadastro.FormataData());
            }
            // 6
            string textoEndereco = "Endereço: ";

            if (!string.IsNullOrEmpty(Endereco))
            {
                textoEndereco += Endereco;
            }
            if (!string.IsNullOrEmpty(Numero))
            {
                textoEndereco += ", " + Numero;
            }
            if (!string.IsNullOrEmpty(Bairro))
            {
                textoEndereco += " - " + Bairro;
            }
            if (!string.IsNullOrEmpty(Cidade))
            {
                textoEndereco += " - " + Cidade;
            }
            if (!string.IsNullOrEmpty(Estado))
            {
                textoEndereco += " / " + Estado;
            }
            if (!string.IsNullOrEmpty(CEP))
            {
                if (CEP.Contains("-"))
                {
                    textoEndereco += " - " + CEP;
                }
                else
                {
                    textoEndereco += " - " + CEP.FormataCEP();
                }
            }
            if (!string.IsNullOrEmpty(PontoReferencia))
            {
                textoEndereco += ", " + PontoReferencia;
            }
            lista.Add(textoEndereco);

            // 7
            if (!string.IsNullOrEmpty(Telefone) && !string.IsNullOrEmpty(Contato))
            {
                if (Telefone.Length > 11)
                {
                    lista.Add(Telefone.FormataNumeroCelular() + " - " + Contato);
                }
                else
                {
                    lista.Add(Telefone.FormataNumeroTelefone() + " - " + Contato);
                }
            }
            else if (!string.IsNullOrEmpty(Telefone) && string.IsNullOrEmpty(Contato))
            {
                if (Telefone.Length > 11)
                {
                    lista.Add(Telefone.FormataNumeroCelular());
                }
                else
                {
                    lista.Add(Telefone.FormataNumeroTelefone());
                }
            }
            else if (string.IsNullOrEmpty(Telefone) && !string.IsNullOrEmpty(Contato))
            {
                lista.Add("Contato Principal:" + Contato);
            }
            else
            {
                lista.Add("");
            }

            // 8
            if (!string.IsNullOrEmpty(Setor))
            {
                lista.Add("Setor: " + Setor);
            }
            else
            {
                lista.Add("");
            }

            // 9
            if (!string.IsNullOrEmpty(Email))
            {
                lista.Add("E-mail Principal: " + Email);
            }
            else
            {
                lista.Add("");
            }

            // 10
            lista.Add("");
            // 11
            lista.Add("Site: " + Site);
            // 12
            lista.Add("Inscrição Estadual: " + InscricaoEstadual);

            return(lista);
        }