Exemple #1
0
        /// <summary>
        /// Cria o token sem fazer referência ao usuário, ele só trará os dados do usuário ao ser buscado no banco.
        /// </summary>
        /// <param name="usuarioEmail">Email utilizado no login do usuário.</param>
        /// <param name="validadeToken">Validade do token em dias, será contado a partir da data de criação.</param>
        public TokenSenha(string usuarioEmail, int validadeToken)
        {
            DataCadastro = DateTime.Now;

            UsuarioEmail = usuarioEmail.ToLower();
            Token        = Guid.NewGuid().ToString().ToLower();
            Ativo        = true;
            Validade     = DataCadastro.AddDays(validadeToken);
        }
Exemple #2
0
        public bool AlterarValor(double newValor)
        {
            if ((DataCadastro.Add(TimeSpan.FromDays(2)) - DateTime.UtcNow) > TimeSpan.FromDays(-1))
            {
                Valor         = newValor;
                DataAlteracao = DateTime.UtcNow;

                return(true);
            }

            return(false);
        }
 public Cliente MapToEntity()
 {
     return(new Cliente
     {
         ClienteId = ClienteId,
         Nome = Nome,
         Sobrenome = Sobrenome,
         Vendedor = Vendedor,
         DataCadastro = DataCadastro.Equals(DateTime.MinValue) ? DateTime.Now : DataCadastro,
         DataAlteracao = DataAlteracao
     });
 }
        private void FillDataParametersToExecuteUpdateModify()
        {
            ckBxAtiva.Checked     = (Ativo == "S" ? true : false);
            ckBxStatusDBA.Checked = (StatusDBA == "S" ? true : false);

            txtBxUsuario.Text = Usuario.ToString();
            txtBxNome.Text    = Nome.ToString();
            cmbBxEmpresaRegGeral.SelectedValue = CodigoEmpresa.ToString();
            cmbBxRegGeral.SelectedValue        = CodigoRG.ToString();
            txtBxDataCadastro.Text             = DataCadastro.ToString();
            txtBxSenhaAtual.Text    = "";
            txtBxNovaSenha.Text     = "";
            txtBxConfirmaSenha.Text = "";
            txtBxRamal.Text         = Ramal.ToString();
        }
Exemple #5
0
 public DateTime CalcularDataEstimada()
 {
     if (Complexidade == Complexidade.Baixa)
     {
         return(DataCadastro.AddDays(3));
     }
     else if (Complexidade == Complexidade.Media)
     {
         return(DataCadastro.AddDays(10));
     }
     else
     {
         return(DataCadastro.AddDays(20));
     }
 }
        /// <summary>
        /// Método responsável por calcular a data prevista de conclusão da meta, de acordo com as atualizações do usuário
        /// </summary>
        /// <param name="meta"></param>
        public void SetDataPrevista(MetasPorLivros meta, Livros livro)
        {
            var diferencaEntreDatas = DateTime.Now.Subtract(DataCadastro);
            var leituraEsperada     = diferencaEntreDatas.Days * PaginasDiarias;


            if (PaginasDiarias > 0)
            {
                if (PaginasOuCapitulosLidos < leituraEsperada)
                {
                    var diasEsperados = livro.QuantidadePaginas / PaginasDiarias;

                    var diasAtrasados = diasEsperados - ((livro.QuantidadePaginas - PaginasOuCapitulosLidos) / PaginasDiarias);

                    var dias = Math.Ceiling((double)diasAtrasados);

                    if (DataFim != null)
                    {
                        DataPrevista = DataFim.Value.AddDays(dias);
                    }
                }
                else
                {
                    var diasAdiantados = (livro.QuantidadePaginas - PaginasOuCapitulosLidos) / PaginasDiarias;
                    DataPrevista = DataCadastro.AddDays(diasAdiantados);
                }
            }
            else if (CapitulosDiarios > 0)
            {
                if (PaginasOuCapitulosLidos < leituraEsperada)
                {
                    var diasEsperados = livro.QuantidadeCapitulos / CapitulosDiarios;

                    var diasAtrasados = diasEsperados - ((livro.QuantidadeCapitulos - PaginasOuCapitulosLidos) / CapitulosDiarios);

                    var dias = Math.Ceiling((double)diasAtrasados);
                    if (DataFim != null)
                    {
                        DataPrevista = DataFim.Value.AddDays(dias);
                    }
                }
                else
                {
                    var diasAdiantados = (livro.QuantidadeCapitulos - PaginasOuCapitulosLidos) / CapitulosDiarios;
                    DataPrevista = DataCadastro.AddDays(diasAdiantados);
                }
            }
        }
 public EntityBase()
 {
     DataCadastro.ToString("d");
 }
Exemple #8
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);
        }
Exemple #9
0
        /// <summary>
        /// Método responsável por cadastrar o fornecedor
        /// </summary>
        public static void CadastrarFornecedor()
        {
            string comando = null, _dataCadastro = "", _dataNascimento = "";

            try
            {
                _dataCadastro = DataCadastro.Substring(6, 4) + "-" + DataCadastro.Substring(3, 2) + "-" + DataCadastro.Substring(0, 2);

                if (!string.IsNullOrEmpty(DataNascimento))
                {
                    if (DataNascimento.Length > 8)
                    {
                        _dataNascimento = DataNascimento.Substring(6, 4) + "-" + DataNascimento.Substring(3, 2) + "-" + DataNascimento.Substring(0, 2);
                    }
                    else
                    {
                        _dataNascimento = DataNascimento.Substring(4, 4) + "-" + DataNascimento.Substring(2, 2) + "-" + DataNascimento.Substring(0, 2);
                    }
                }

                comando = "insert into tbl_fornecedor values (0," + Tipo + ", '" + _dataCadastro + "',if('" + _dataNascimento + "' = '',NULL,'" + _dataNascimento + "'),'" + Documento + "','" + Nome + "','" + Apelido + "','" + CEP + "','"
                          + Endereco + "','" + Numero + "','" + Complemento + "','" + Bairro + "','" + Cidade + "','" + Estado + "','" + Pais + "','" + Telefone + "','" + Contato + "','"
                          + TelefoneComercial + "','" + ContatoComercial + "','" + Celular + "','" + ContatoCelular + "','" + Email + "','" + Site + "','" + InscricaoEstadual + "','" + InscricaoEstadual + "','"
                          + Obs + "','S'); ";
                Sistema.ExecutaComando(comando);
            }
            catch (Exception)
            {
                ListaErro.RetornaErro(51);
                throw;
            }

            try
            {
                comando = "Select ID from tbl_fornecedor where Tipo = '" + Tipo + "'" +
                          " AND Nome = '" + Nome + "'" +
                          " AND datacadastro = '" + _dataCadastro + "';";

                ID = int.Parse(Sistema.ConsultaSimples(comando));
            }
            catch (Exception)
            {
                ListaErro.RetornaErro(51);
                throw;
            }

            if (ID != 0)
            {
                //Backup
                _id                = ID;
                _tipo              = Tipo;
                _dataCadastro      = DataCadastro;
                _dataNascimento    = DataNascimento;
                _documento         = Documento;
                _nome              = Nome;
                _apelido           = Apelido;
                _cep               = CEP;
                _endereco          = Endereco;
                _numero            = Numero;
                _complemento       = Complemento;
                _bairro            = Bairro;
                _cidade            = Cidade;
                _estado            = Estado;
                _pais              = Pais;
                _telefone          = Telefone;
                _contato           = Contato;
                _telefoneComercial = TelefoneComercial;
                _contatoComercial  = ContatoComercial;
                _celular           = Celular;
                _contatoCelular    = ContatoCelular;
                _email             = Email;
                _site              = Site;
                _inscricaoEstadual = InscricaoEstadual;
                _inscricaoEstadual = InscricaoEstadual;
                _obs               = Obs;
            }
        }
Exemple #10
0
 public override string ToString()
 {
     return($"Id: {Id} \nCadastro{DataCadastro.ToString("dd/MM/yyyy")} \nNome: {Nome} \nEndereço: {Endereco}");
 }
Exemple #11
0
        public void GravarDados()
        {
            string    sSQL     = "";
            ArrayList Nm_param = new ArrayList();
            ArrayList Vr_param = new ArrayList();

            if (IdPessoa > 0)
            {
                sSQL = "UPDATE Pessoas SET Id_Pessoa=@Id,RazaoSocial=@RazaoSocial,Fantasia=@Fantasia,Cnpj=@Cnpj,Insc_Uf=@InscUF,Endereco=@Endereco," +
                       "Numero=@Numero,Complemento=@Complemento,Cep=@Cep,Bairro=@Bairro,Cidade=@Cidade,Id_UF=@UF,Fone=@Fone,Fax=@Fax,Email=@Email,Contato=@Contato,Celular=@Celular," +
                       "Id_Custo=@IdCusto,Id_Departamento=@IdDepartamento,Id_Atividade=@IdAtividade,Id_Transportadora=@IdTransportadora,Id_Cfop=@IdCfop,Ativo=@Ativo,Tipo=@Tipo," +
                       "Id_FormaPgto=@IdFormaPgto,Observacao=@Observacao,Id_Rota=@IdRota,CepCobranca=@CepCobranca,EndCobranca=@EndCobranca,NumCobranca=@NumCobranca,ComplCobranca=@ComplCobranca," +
                       "BairroCobranca=@BairroCobranca,CidadeCobranca=@CidadeCobranca,Id_UFCobranca=@IdUFCobranca,LimiteCredito=@LimiteCredito,DataCadastro=Convert(DateTime,@DataCadastro,103),Clie_Forn=@ClieForn," +
                       "Id_Filial=@IdFilial,Frete=@Frete,ComissaoFixa=@ComissaoFixa,Id_Vendedor=@IdVendedor,BloqFormaPgto=@BloqFormaPgto,Obs_Serasa=@ObsSerasa,Senha=@Psw,IdServidor=@IdServidor,MargemNegocio=@MargemNegocio," +
                       "Pais=@Pais,EmailNFE=@EmailNFE,Id_Vinculo=@IdVinculo,NotificaAltPrc=@NotificaAltPrc,Obs_Entrega=@ObsEntrega,PrazoPgto=@PrazoPgto,PDescNFGrpTalimpo=@PDescNFGrpTalimpo,PDescNFGrpOutros=@PDescNFGrpOutros," +
                       "ForaMediaCom=@ForaMediaCom,NaoVerifQtdeCx=@NaoVerifQtdeCx,Comodato=@Comodato,KitNfe=@KitNfe,NaoVerPrazoPg=@NaoVerPrazoPg,CodMun=@CodMun,LiberaPrc=@LiberaPrc,Serasa=@Serasa Where Id_Pessoa=@Chave";
                Nm_param.Add("@Chave"); Vr_param.Add(IdPessoa);
            }
            else
            {
                IdPessoa = Controle.ProximoID("Pessoas");
                sSQL     = "INSERT INTO Pessoas (Id_Pessoa,RazaoSocial,Fantasia,Cnpj,Insc_Uf,Endereco,Numero,Complemento,Cep,Bairro,Cidade,Id_UF,Fone,Fax,Email,Contato,Celular,Id_Custo,Id_Departamento,Id_Atividade," +
                           "Id_Transportadora,Id_Cfop,Ativo,Tipo,Id_FormaPgto,Observacao,Id_Rota,EndCobranca,NumCobranca,ComplCobranca,CepCobranca,BairroCobranca,CidadeCobranca,Id_UFCobranca,LimiteCredito,DataCadastro,Clie_Forn,Id_Filial,Frete,ComissaoFixa,Id_Vendedor,Credito,BloqFormaPgto,Obs_Serasa,Senha,IdServidor,MargemNegocio,Pais,EmailNFE," +
                           "Id_Vinculo,NotificaAltPrc,Obs_Entrega,PrazoPgto,PDescNFGrpTalimpo,PDescNFGrpOutros,ForaMediaCom,NaoVerifQtdeCx,Comodato,KitNfe,NaoVerPrazoPg,CodMun,LiberaPrc,Serasa)" +
                           " Values (@Id,@RazaoSocial,@Fantasia,@Cnpj,@InscUF,@Endereco,@Numero,@Complemento,@Cep,@Bairro,@Cidade,@UF,@Fone,@Fax,@Email,@Contato,@Celular,@IdCusto,@IdDepartamento,@IdAtividade,@IdTransportadora,@IdCfop,@Ativo,@Tipo,@IdFormaPgto,@Observacao,@IdRota,@EndCobranca,@NumCobranca,@ComplCobranca,@CepCobranca," +
                           "@BairroCobranca,@CidadeCobranca,@IdUFCobranca,@LimiteCredito,convert(DateTime,@DataCadastro,103),@ClieForn,@IdFilial,@Frete,@ComissaoFixa,@IdVendedor,0,@BloqFormaPgto,@ObsSerasa,@Psw,@IdServidor,@MargemNegocio,@Pais,@EmailNFE,@IdVinculo,@NotificaAltPrc,@ObsEntrega,@PrazoPgto,@PDescNFGrpTalimpo,@PDescNFGrpOutros,@ForaMediaCom,@NaoVerifQtdeCx,@Comodato,@KitNfe,@NaoVerPrazoPg,@CodMun,@LiberaPrc,@Serasa)";
            }
            if (sSQL != "")
            {
                Nm_param.Add("@Id"); Vr_param.Add(IdPessoa);
                Nm_param.Add("@RazaoSocial"); Vr_param.Add(RazaoSocial);
                Nm_param.Add("@Fantasia"); Vr_param.Add(Fantasia);
                Nm_param.Add("@Cnpj"); Vr_param.Add(Cnpj);
                Nm_param.Add("@InscUF"); Vr_param.Add(InscUF);
                Nm_param.Add("@Cep"); Vr_param.Add(Cep);
                Nm_param.Add("@Endereco"); Vr_param.Add(Endereco);
                Nm_param.Add("@Numero"); Vr_param.Add(Numero);
                Nm_param.Add("@Complemento"); Vr_param.Add(Complemento);
                Nm_param.Add("@Bairro"); Vr_param.Add(Bairro);
                Nm_param.Add("@Cidade"); Vr_param.Add(Cidade);
                Nm_param.Add("@UF"); Vr_param.Add(IdUF);
                Nm_param.Add("@Fone"); Vr_param.Add(Fone);
                Nm_param.Add("@Fax"); Vr_param.Add(Fax);
                Nm_param.Add("@Email"); Vr_param.Add(Email);
                Nm_param.Add("@Contato"); Vr_param.Add(Contato);
                Nm_param.Add("@Celular"); Vr_param.Add(Celular);
                Nm_param.Add("@IdCusto"); Vr_param.Add(IdCusto);
                Nm_param.Add("@IdDepartamento"); Vr_param.Add(IdDepartamento);
                Nm_param.Add("@IdAtividade"); Vr_param.Add(IdAtividade);
                Nm_param.Add("@IdTransportadora"); Vr_param.Add(IdTransportadora);
                Nm_param.Add("@IdCfop"); Vr_param.Add(IdCfop);
                Nm_param.Add("@Ativo"); Vr_param.Add(Ativo);
                Nm_param.Add("@Tipo"); Vr_param.Add(Tipo);
                Nm_param.Add("@IdFormaPgto"); Vr_param.Add(IdFormaPgto);
                Nm_param.Add("@Observacao"); Vr_param.Add(Observacao);
                Nm_param.Add("@CepCobranca"); Vr_param.Add(CepCobranca);
                Nm_param.Add("@IdRota"); Vr_param.Add(IdRota);
                Nm_param.Add("@EndCobranca"); Vr_param.Add(EndCobranca);
                Nm_param.Add("@NumCobranca"); Vr_param.Add(NumCobranca);
                Nm_param.Add("@ComplCobranca"); Vr_param.Add(ComplCobranca);
                Nm_param.Add("@BairroCobranca"); Vr_param.Add(BairroCobranca);
                Nm_param.Add("@CidadeCobranca"); Vr_param.Add(CidadeCobranca);
                Nm_param.Add("@IdUFCobranca"); Vr_param.Add(IdUfCobranca);
                Nm_param.Add("@LimiteCredito"); Vr_param.Add(Controle.FloatToStr(LimiteCredito, 2));
                Nm_param.Add("@DataCadastro"); Vr_param.Add(DataCadastro.ToShortDateString());
                Nm_param.Add("@ClieForn"); Vr_param.Add(Clie_Forn);
                Nm_param.Add("@IdFilial"); Vr_param.Add(IdFilial);
                Nm_param.Add("@Frete"); Vr_param.Add(Frete);
                Nm_param.Add("@ComissaoFixa"); Vr_param.Add(ComissaoFixa);
                Nm_param.Add("@IdVendedor"); Vr_param.Add(IdVendedor);
                Nm_param.Add("@BloqFormaPgto"); Vr_param.Add(BloqFormaPgto);
                Nm_param.Add("@ObsSerasa"); Vr_param.Add(ObsSerasa);
                Nm_param.Add("@Psw"); Vr_param.Add(Senha);
                Nm_param.Add("@IdServidor"); Vr_param.Add(IdServidor);
                Nm_param.Add("@MargemNegocio"); Vr_param.Add(MargemNegocio);
                Nm_param.Add("@Pais"); Vr_param.Add(Pais);
                Nm_param.Add("@EmailNFE"); Vr_param.Add(EmailNFE);
                Nm_param.Add("@IdVinculo"); Vr_param.Add(IdVinculo);
                Nm_param.Add("@NotificaAltPrc"); Vr_param.Add(NotificaAltPrc);
                Nm_param.Add("@ObsEntrega"); Vr_param.Add(ObsEntrega);
                Nm_param.Add("@PrazoPgto"); Vr_param.Add(PrazoPgto);
                Nm_param.Add("@PDescNFGrpTalimpo"); Vr_param.Add(PDescNFGrpTalimpo);
                Nm_param.Add("@PDescNFGrpOutros"); Vr_param.Add(PDescNFGrpOutros);
                Nm_param.Add("@ForaMediaCom"); Vr_param.Add(ForaMediaCom);
                Nm_param.Add("@NaoVerifQtdeCx"); Vr_param.Add(NaoVerifQtdeCx);
                Nm_param.Add("@Comodato"); Vr_param.Add(Comodato);
                Nm_param.Add("@KitNfe"); Vr_param.Add(KitNfe);
                Nm_param.Add("@NaoVerPrazoPg"); Vr_param.Add(NaoVerPrazoPg);
                Nm_param.Add("@CodMun"); Vr_param.Add(CodMun);
                Nm_param.Add("@LiberaPrc"); Vr_param.Add(LiberaPrc);
                Nm_param.Add("@Serasa"); Vr_param.Add(Serasa);
                Controle.ExecutaSQL(sSQL, Nm_param, Vr_param);
            }
        }
Exemple #12
0
 public string EscreverArquivo()
 {
     return(ID + ";" + Categoria + ";" + Nome + ";" + Preco.ToString("F2") + ";" + Quantidade + ";" + QuantidadeVendida + ";" + DataCadastro.ToString() + ";" + Descricao);
 }
 public override string ToString()
 {
     return($"Nome:{this.Conta.Cliente.Nome} " +
            $"{DataCadastro.ToString("dd/MM/yyyy")} - {Valor}");
 }
Exemple #14
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);
        }