Esempio n. 1
0
        private void filtrar()
        {
            try
            {
                PessoaBean pessoa = new PessoaBean();

                pessoa.idPessoa   = Uteis.stringToInt(txtId.Text);
                pessoa.nome       = txtNome.Text;
                pessoa.apelido    = txtApelido.Text;
                pessoa.logradouro = txtLogradouro.Text;
                pessoa.numDoc     = txtDocumento.Text;
                GrupoPessoaBean grupo = new GrupoPessoaBean();
                grupo.descr        = txtGrupo.Text;
                pessoa.grupoPessoa = grupo;


                List <PessoaBean> list = PessoaDAO.getRecords(pessoa);

                dgvDados.DataSource = list;

                dgvDados.Select();
            }
            catch (InvalidPropertyValueException e)
            {
                MessageBox.Show(e.Message);
                txtId.Select();
            }
        }
Esempio n. 2
0
        private void setTextBoxIntoBean()
        {
            try
            {
                if (bean.idPessoa == 0)
                {
                    bean.idPessoa = Uteis.stringToInt(txtIdPessoa.Text);
                }
                GrupoPessoaBean g = (GrupoPessoaBean)cmbGrupoPressoa.SelectedItem;
                bean.grupoPessoa = g;

                bean.nome        = txtNome.Text;
                bean.apelido     = txtApelido.Text;
                bean.numDoc      = txtDocumento.Text;
                bean.tipoDoc     = txtTipoDoc.Text;
                bean.tel1        = txtTel1.Text;
                bean.tel2        = txtTel2.Text;
                bean.tel3        = txtTel3.Text;
                bean.logradouro  = txtLogradouro.Text;
                bean.numero      = txtNumero.Text;
                bean.complemento = txtComplemento.Text;
                bean.bairro      = txtBairro.Text;
                bean.cep         = txtCep.Text;
                bean.pontoRef    = txtPontoRefer.Text;
                bean.obs         = txtObs.Text;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Esempio n. 3
0
        private void setTextBoxIntoBean()
        {
            try
            {
                if (bean.idUsuario == 0)
                {
                    bean.idUsuario = Uteis.stringToInt(txtIdUsuario.Text);
                }
                bean.login = txtLogin.Text;
                int id = Uteis.stringToInt(txtIdPessoa.Text);
                bean.pessoa = PessoaDAO.getRecord(id);

                if ((txtSenha1.Text != "") && (txtSenha2.Text != ""))
                {
                    if (txtSenha1.Text.Trim() == txtSenha2.Text)
                    {
                        bean.senha = REFHash.getMD5Hash(txtSenha1.Text);
                    }
                    else
                    {
                        throw new InvalidPassworldException("Senha não diferente de sua confirmação.");
                    }
                }
            }
            catch (InvalidPassworldException i)
            {
                throw i;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
        private void DownloadJogos()
        {
            Uteis.Log("", Log);
            Uteis.Log($"[{NomeBase}] Iniciando Download dos jogos...", Log);
            Uteis.Log("", Log);

            Uteis.ValidaDiretorio(UrlSaveDownloads + lista[0]);

            for (int i = 2; i < lista.Count; i++)
            {
                foreach (var jo in linkJogos)
                {
                    if (jo.Nome.Contains(lista[i]))
                    {
                        encontrou = true;
                        using (WebClient client = new WebClient())
                        {
                            client.DownloadFile(jo.Url, $"{UrlSaveDownloads}{lista[0]}/{lista[i]}.7z");

                            Uteis.Log($"{lista[i] + ".7z"}... ", Log);
                        }
                        break;
                    }
                }

                if (!encontrou)
                {
                    erros.Add(lista[i]);
                }
                encontrou = false;
            }
        }
Esempio n. 5
0
        protected override void filtrar()
        {
            try
            {
                ProdutoBean prod = new ProdutoBean();

                prod.idProduto = Uteis.stringToInt(txtId.Text);
                prod.descr     = txtDescr.Text;
                prod.codBarras = txtCodBarras.Text;
                GrupoProdutoBean grupo = new GrupoProdutoBean();
                grupo.descr       = txtGrupo.Text;
                prod.grupoProduto = grupo;


                List <ProdutoBean> list = ProdutoDAO.getRecords(prod);

                dgvDados.DataSource = list;

                dgvDados.Select();
            }
            catch (InvalidPropertyValueException e)
            {
                MessageBox.Show(e.Message);
                txtId.Select();
            }
        }
Esempio n. 6
0
        public override string ToString()
        {
            string carta = Carta.NumberToCardNumber((int)this.Numero);

            carta += Uteis.GetFirstDisplayNameEnum(Naipe);
            return(carta);
        }
Esempio n. 7
0
        public int Execute_ReturnID(ConnectionString connString, DbCommandGeneric dbCmd)
        {
            MySqlCommand cmd = new MySqlCommand();

            try
            {
                cmd.Connection = new MySqlConnection(connString.ConnString);
                cmd.Connection.Open();

                cmd.CommandText = dbCmd.DbCommand.CommandText;

                int rowsAffected = cmd.ExecuteNonQuery();

                if (rowsAffected > 0)
                {
                    return(Convert.ToInt32(cmd.LastInsertedId));
                }
                else
                {
                    return(-1);
                }
            }
            catch (Exception ex)
            {
                Uteis.GravarLogErro(ex.TargetSite.Name, ex.Message);
                return(-1);
            }
            finally {
                cmd.Connection.Close();
            }
        }
        public IHttpActionResult PostUsuario(UsuarioSenha usuarioSenha)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var usuario = new Usuario
            {
                Endereco  = usuarioSenha.Endereco,
                Professor = false,
                Estudante = true,
                Sobrenome = usuarioSenha.Sobrenome,
                Telefone  = usuarioSenha.Telefone,
                UserName  = usuarioSenha.UserName
            };


            try
            {
                db.Usuarios.Add(usuarioSenha);
                db.SaveChanges();
                Uteis.CreateUserASP(usuarioSenha.UserName, usuarioSenha.Senha);
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(string.Empty, ex.Message);
            }

            usuarioSenha.UserId    = usuario.UserId;
            usuarioSenha.Professor = false;
            usuarioSenha.Estudante = true;

            return(this.Ok(usuarioSenha));
        }
Esempio n. 9
0
        private void CarregaStatusBar()
        {
            try
            {
                if (UtilConexion.CarregarConfiguracaoSistema() == true)
                {
                    var vrs = new Version(Application.ProductVersion);
                    Globais.VersaoPrograma = String.Format("{0}.{1}.{2}", vrs.Major, vrs.Minor, vrs.Revision);

                    string teste;

                    teste = string.Format("Servidor: {0}    Database : {1}    Usuário Banco: {2}  Versão:{3}",
                                          Globais.NomeServidor,
                                          Globais.BancoDados,
                                          Globais.UsuarioBd,
                                          Globais.VersaoPrograma).ToString();
                    txtSistema.Text = teste.ToString();

                    Refresh();
                }
            }
            catch (Exception ex)
            {
                Uteis.ExibirMensagem(ex.Message, titulo, TipoMensagem.Erro);
            }
        }
Esempio n. 10
0
        private void setTextBoxIntoBean()
        {
            try
            {
                if (bean.idProduto == 0)
                {
                    bean.idProduto = Uteis.stringToInt(txtIdProduto.Text);
                }
                GrupoProdutoBean g = (GrupoProdutoBean)cmbGrupoProduto.SelectedItem;
                bean.grupoProduto = g;

                bean.descr            = txtDescr.Text;
                bean.unidade          = txtUnidade.Text;
                bean.qtdEstoqueMin    = Uteis.stringToDouble(txtEstoqueMin.Text);
                bean.qtdEstoqueIdeal  = Uteis.stringToDouble(txtEstoqueIdeal.Text);
                bean.vlrUnitario      = Uteis.stringToDouble(txtVlrUnitario.Text);
                bean.vlrUnitarioMedio = Uteis.stringToDouble(txtVlrMedio.Text);
                bean.pctLucro         = Uteis.stringToDouble(txtPctLucro.Text);
                bean.codBarras        = txtCodBarras.Text;
                bean.obs = txtObs.Text;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Esempio n. 11
0
 private void txtIdPessoa_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (txtIdPessoa.Text != "")
     {
         try
         {
             int        id  = Uteis.stringToInt(txtIdPessoa.Text.Trim());
             PessoaBean pes = PessoaDAO.getRecord(id);
             if (pes.idPessoa == 0)
             {
                 throw new Exception("Pessoa não encontrada.");
             }
             txtNomePessoa.Text = pes.ToString();
             bean.pessoa        = pes;
             txtSenha1.Select();
         }
         catch (Exception ex)
         {
             MessageBox.Show("ID de Pessoa inválido. (" + ex.Message + ")");
             txtIdPessoa.Select();
             txtNomePessoa.Text = "";
         }
     }
     else
     {
         txtNomePessoa.Text = "";
     }
 }
Esempio n. 12
0
        /// <summary>
        /// Método busca por um produto a partir do EAN informado
        /// </summary>
        /// <param name="EAN">EAN sendo verificado dígito verificado, permitido somente com 13 dígitos</param>
        /// <returns>Produto localizado a partir do EAN informado</returns>
        public NetProduto BuscaProduto(String EAN)
        {
            ///Validação dos dados.
            if (EAN.Trim().Equals(""))
            {
                throw new Exception("EAN não informado.");
            }

            Ean13Barcode2005.Ean13 ean = new Ean13Barcode2005.Ean13();
            if (EAN.Length > 13)
            {
                throw new Exception("EAN só pode conter 13 dígitos.");
            }

            if (EAN.Length < 13)
            {
                EAN = "0000000000000" + EAN;
                EAN = new Uteis().direita(EAN, 13);
            }

            if (!ean.chekDigitoEAN(EAN))
            {
                throw new Exception("Código EAN inválido.");
            }
            //Busca
            NetProduto resporta = _daoProduto.BuscaEAN(EAN);

            if (resporta == null)
            {
                throw new Exception("Não foi localizado nenhum produto com o EAN informado.");
            }

            return(resporta);
        }
Esempio n. 13
0
        private void btnBuscarMenorCaminho_Click(object sender, RoutedEventArgs e)
        {
            Vertice v1 = new Vertice();
            Vertice v2 = new Vertice();

            v1.Nome = Convert.ToInt32(txtVerticeOrigem.Text);
            v2.Nome = Convert.ToInt32(txtVerticeDestino.Text);

            try
            {
                Uteis.startAguarde();

                //Vamos identificar qual client será utilizado
                int nClient = Uteis.GetServidor(v1.Nome.ToString());

                Retorno retornoMenorCaminho = new Retorno();

                switch (nClient)
                {
                case 0:
                    retornoMenorCaminho = VariaveisGlobais.client_servidor1.menorCaminho(v1, v2);
                    break;

                case 1:
                    retornoMenorCaminho = VariaveisGlobais.client_servidor2.menorCaminho(v1, v2);
                    break;

                case 2:
                    retornoMenorCaminho = VariaveisGlobais.client_servidor3.menorCaminho(v1, v2);
                    break;
                }

                if (retornoMenorCaminho.Sucesso)
                {
                    List <Vertice> caminho = JsonConvert.DeserializeObject <List <Vertice> >(retornoMenorCaminho.Retorno_);

                    string caminhoString = "Menor Caminho: ";

                    foreach (Vertice item in caminho)
                    {
                        caminhoString += item.Nome + " - ";
                    }

                    txtCaminho.Content = caminhoString.Substring(0, caminhoString.Length - 3);
                }
                else
                {
                    MessageBox.Show(retornoMenorCaminho.Mensagem);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Uteis.stopAguarde();
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Trilhas.Utilities.Connection"/> class.
        /// </summary>
        void Awake()
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
            string strJsonConfig = Uteis.LoadJson("config");

            _objConfig = JsonUtility.FromJson <Config>(strJsonConfig);
        }
Esempio n. 15
0
    public static void SaveUser(User user)
    {
        string userAsJson = JsonUtility.ToJson(user);

        PlayerPrefs.SetString("User", userAsJson);
        PlayerPrefs.Save();
        Uteis.SaveJson("usuario", userAsJson);
    }
Esempio n. 16
0
        public Frm_Principal()
        {
            CarregaNomeInstancia();
            InitializeComponent();

            Uteis.CriarDiretorios();
            new Frm_BOX_Login().ShowDialog();
            SetComponents();
        }
Esempio n. 17
0
        private void btnBuscarVerticesAresta_Click(object sender, RoutedEventArgs e)
        {
            if (txtDescricaoArestaBuscar.Text == "")
            {
                MessageBox.Show("Por favor informe a descrição da aresta a ser utilizada!");
                return;
            }

            Aresta a = new Aresta();

            a.Descricao = txtDescricaoArestaBuscar.Text;

            try
            {
                Uteis.startAguarde();

                //Verificar de forma ordenada em qual servidor está a aresta
                Retorno r = VariaveisGlobais.client_servidor1.listarVerticesAresta(a);

                if (!r.Sucesso)
                {
                    r = VariaveisGlobais.client_servidor2.listarVerticesAresta(a);

                    if (!r.Sucesso)
                    {
                        r = VariaveisGlobais.client_servidor3.listarVerticesAresta(a);

                        if (!r.Sucesso)
                        {
                            MessageBox.Show("A aresta informa não existe");
                            return;
                        }
                    }
                }

                List <Vertice> vertices = JsonConvert.DeserializeObject <List <Vertice> >(r.Retorno_);

                txtNomeVertice1.Text      = vertices[0].Nome.ToString();
                txtCorVertice1.Text       = vertices[0].Cor.ToString();
                txtDescricaoVertice1.Text = vertices[0].Descricao;
                txtPesoVertice1.Text      = vertices[0].Peso.ToString();

                txtNomeVertice2.Text      = vertices[1].Nome.ToString();
                txtCorVertice2.Text       = vertices[1].Cor.ToString();
                txtDescricaoVertice2.Text = vertices[1].Descricao;
                txtPesoVertice2.Text      = vertices[1].Peso.ToString();
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }finally
            {
                Uteis.stopAguarde();
            }
        }
        private void LerArquivos()
        {
            Uteis.Log($"[{NomeBase}] Lendo lista...", Log);

            using (var file = new StreamReader(URL))
            {
                lista = file.ReadToEnd().Split(';').ToList();
            }

            Uteis.Log($"[{NomeBase}] Nome: {lista[0]} URL: {lista[1]} - {lista.Count} Nomes lidos...", Log);
        }
Esempio n. 19
0
        private void LimparFormulario()
        {
            lblProdCodigo.Text         = String.Empty;
            this.txtProdCodigo.Visible = false;
            this.lblProdCodigo.Visible = false;


            cmbProCategoria.SelectedIndex = -1;
            cmbProUni.SelectedIndex       = -1;
            Uteis.LimparFormulario(txtProdNome);
            Uteis.LimparMascara(txtProdPreco);
        }
        public void Executar()
        {
            Uteis.Log("-- -----------------------------------------------------------------", Log);

            LerArquivos();
            RasparLisnksNomes();
            DownloadJogos();
            CriarRelatorioErrosTxt();
            MostrarRelatorioFinal(CriarRelatorioFinal);

            Uteis.Log("-- -----------------------------------------------------------------", Log);
        }
Esempio n. 21
0
        private void Aresta_Update_LostFocus(object sender, RoutedEventArgs e)
        {
            if (txtVerticeOrigemUpdateAresta.Text == "" || txtVerticeDestinoUpdateAresta.Text == "")
            {
                return;
            }

            //Vamos identificar qual client será utilizado
            int nClient = Uteis.GetServidor(txtVerticeOrigemUpdateAresta.Text);

            Retorno r = new Retorno();

            switch (nClient)
            {
            case 0:
                r = VariaveisGlobais.client_servidor1.getGrafo();
                break;

            case 1:
                r = VariaveisGlobais.client_servidor2.getGrafo();
                break;

            case 2:
                r = VariaveisGlobais.client_servidor3.getGrafo();
                break;
            }

            GrafoAtributo grafo = JsonConvert.DeserializeObject <GrafoAtributo>(r.Retorno_);

            Aresta a = null;

            a = grafo.Arestas.Where(p => p.VerticeInicio == Convert.ToInt32(txtVerticeOrigemUpdateAresta.Text) && p.VerticeFim == Convert.ToInt32(txtVerticeDestinoUpdateAresta.Text)).FirstOrDefault();

            if (a == null)
            {
                txtDescricaoArestaUpdate.Text = "";
                MessageBox.Show("A aresta informado não existe!!!");
            }
            else
            {
                txtVerticeOrigemUpdateAresta.IsEnabled  = false;
                txtVerticeDestinoUpdateAresta.IsEnabled = false;

                txtVerticeOrigemUpdateAresta.Text        = a.VerticeInicio.ToString();
                txtVerticeDestinoUpdateAresta.Text       = a.VerticeFim.ToString();
                txtDescricaoArestaUpdate.Text            = a.Descricao;
                txtPesoArestaUpdate.Text                 = a.Peso.ToString();
                cbBidirecionalArestaUpdate.SelectedIndex = (a.FlagBidirecional == true ? 0 : 1);

                arestaCorrente = a;
            }
        }
Esempio n. 22
0
        private void inserirProduto()
        {
            try
            {
                if (txtQtdProd.Text == "" || Uteis.stringToDouble(txtQtdProd.Text) <= 0)
                {
                    throw new ValueRequiredException("Informe um valor numérico válido para a quantidade do produto.");
                }

                ProdutoBean pro = null;

                if (txtCodBarras.Text != "")
                {
                    pro = ProdutoDAO.getRecord(txtCodBarras.Text);
                }
                else if (Uteis.stringToInt(txtIdProduto.Text) > 0)
                {
                    pro = ProdutoDAO.getRecord(Uteis.stringToInt(txtIdProduto.Text));
                }
                else
                {
                    throw new ValueRequiredException("Para adicionar um produto, informe seu ID ou seu Código de Barras!");
                }

                if (pro.idProduto <= 0)
                {
                    MessageBox.Show("Produto não encontrado. Confirme o ID ou o Código de Barras.");
                }
                else
                {
                    dgvItens.Refresh();
                    ItemVendaBean item = new ItemVendaBean();
                    item.venda      = bean;
                    item.produto    = pro;
                    item.qtdProduto = Uteis.stringToDouble(txtQtdProd.Text);
                    if (bean.itens.Contains(item))
                    {
                        bean.itens[bean.itens.IndexOf(item)].qtdProduto += Uteis.stringToDouble(txtQtdProd.Text);
                        //bean.itens[bean.itens.IndexOf(item)].produto = pro;
                    }
                    else
                    {
                        bean.itens.Add(item);
                    }
                    trocaDataSource(bean.itens);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 23
0
        private void btnExecutarCommand_Click(object sender, RoutedEventArgs e)
        {
            string comando = txtCommandLine.Text;

            if (comando != "")
            {
                if (comando.ToLower() == "listar vertices")
                {
                    //listar vértices
                    GrafoCB grafo    = new GrafoCB();
                    string  mensagem = "";

                    if (Uteis.lerGrafoArquivo(grafo))
                    {
                        mensagem = "Vértices: ";
                        foreach (Vertice item in grafo.Vertices)
                        {
                            mensagem += item.Nome + " - ";
                        }

                        mensagem = mensagem.Substring(0, mensagem.Length - 3);

                        AtualizarLog(mensagem);
                    }
                }
                else if (comando.ToLower() == "listar arestas")
                {
                    //Listas arestas
                    GrafoCB grafo    = new GrafoCB();
                    string  mensagem = "";

                    if (Uteis.lerGrafoArquivo(grafo))
                    {
                        mensagem = "Arestas: ";
                        foreach (Aresta item in grafo.Arestas)
                        {
                            mensagem += item.Descricao + " - ";
                        }

                        mensagem = mensagem.Substring(0, mensagem.Length - 3);

                        AtualizarLog(mensagem);
                    }
                }
                else
                {
                    AtualizarLog("Comando não identificado!");
                }
            }

            txtCommandLine.Text = "";
        }
Esempio n. 24
0
        //INSERIR DADOS DA TABELA CIDADES
        public void Inserir()
        {
            Banco oBanco = new Banco();
            Uteis oUteis = new Uteis();

            oBanco.ComandoSQL(
                @"INSERT INTO CIDADES ([Cidades_Nome],[Cidades_Codigo],[Cidades_UF],[Cidades_DtCadastro],[Cidades_DtAtualizacao]) VALUES("
                + @"'" + oUteis.GetRegexRemAssentuacao(this.Cidades_Nome) + @"',"
                + @"'" + this.Cidades_Codigo + @"',"
                + @"'" + oUteis.GetRegexRemAssentuacao(this.Cidades_UF) + @"',"
                + @"'" + this.DtCadastro + @"',"
                + @"'" + this.DtAtualizacao + @"')");
        }
Esempio n. 25
0
        private void btnIniciar_Click(object sender, RoutedEventArgs e)
        {
            string mensagemErro;

            Servidor servidor1 = new Servidor();
            Servidor servidor2 = new Servidor();
            Servidor servidor3 = new Servidor();

            if (txtPortaServidor1.Text != "")
            {
                servidor1.Identificador    = Convert.ToInt32(txtIdServidor1.Text);
                servidor1.Nome             = txtNomeServidor1.Text;
                servidor1.IP               = txtIpServidor1.Text;
                servidor1.Porta            = txtPortaServidor1.Text;
                VariaveisGlobais.servidor1 = servidor1;
            }

            if (txtPortaServidor2.Text != "")
            {
                servidor2.Identificador    = Convert.ToInt32(txtIdServidor2.Text);
                servidor2.Nome             = txtNomeServidor2.Text;
                servidor2.IP               = txtIpServidor2.Text;
                servidor2.Porta            = txtPortaServidor2.Text;
                VariaveisGlobais.servidor2 = servidor2;
            }

            if (txtPortaServidor3.Text != "")
            {
                servidor3.Identificador    = Convert.ToInt32(txtIdServidor3.Text);
                servidor3.Nome             = txtNomeServidor3.Text;
                servidor3.IP               = txtIpServidor3.Text;
                servidor3.Porta            = txtPortaServidor3.Text;
                VariaveisGlobais.servidor3 = servidor3;
            }

            //Iniciar servidores
            if (Uteis.IniciarServidores(out mensagemErro))
            {
                MessageBox.Show(mensagemErro);

                Principal p = new Principal();
                p.Show();

                this.Close();
            }
            else
            {
                MessageBox.Show(mensagemErro);
                this.Close();
            }
        }
Esempio n. 26
0
    public void Loadptions()
    {
        string optionsAsJson;

        if (PlayerPrefs.HasKey("GameOptions"))
        {
            optionsAsJson = PlayerPrefs.GetString("GameOptions");
        }
        else
        {
            optionsAsJson = Uteis.LoadJson("options");
        }
        _options = JsonUtility.FromJson <GameOptions>(optionsAsJson);
    }
Esempio n. 27
0
    private void LoadUser()
    {
        string userAsJson;

        if (PlayerPrefs.HasKey("User"))
        {
            userAsJson = PlayerPrefs.GetString("User");
        }
        else
        {
            userAsJson = Uteis.LoadJson("usuario");
        }
        _user = JsonUtility.FromJson <User>(userAsJson);
    }
Esempio n. 28
0
        public string ToJson()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("{");
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.AppendFormat("\t\"Numero\":\"{0}\"", this.Numero);
            stringBuilder.Append("," + Environment.NewLine);
            stringBuilder.AppendFormat("\t\"Naipe\":\"{0}\"", Uteis.GetFirstDisplayNameEnum(this.Naipe));
            stringBuilder.Append(Environment.NewLine);
            stringBuilder.Append("}");

            return(stringBuilder.ToString());
        }
Esempio n. 29
0
    public static void LoadUser(out User user)
    {
        string userAsJson;

        if (PlayerPrefs.HasKey("User"))
        {
            userAsJson = PlayerPrefs.GetString("User");
        }
        else
        {
            userAsJson = Uteis.LoadJson("usuario");
        }
        user = JsonUtility.FromJson <User>(userAsJson);
    }
        private void CriarRelatorioErrosTxt()
        {
            Uteis.Log("", Log);
            Uteis.Log($"[{NomeBase}] Gerando logs...", Log);

            Uteis.ValidaDiretorio($"{UrlSaveDownloads}log/");

            using (var file = new StreamWriter($"{UrlSaveDownloads}log/{lista[0]}-erros.txt"))
            {
                foreach (var err in erros)
                {
                    file.WriteLine(err);
                }
            }
        }