private void WebClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { Thread.Sleep(10000); if (e.ProgressPercentage.ToString().Length != 1 && e.ProgressPercentage.ToString().EndsWith("0")) { if (this._valorPercentual.ToList().Any(a => a == e.ProgressPercentage)) { return; } this._valorPercentual.Add(e.ProgressPercentage); var logPedidoImportacao = new LogPedidoImportacao { Descricao = $"Progresso do Download: {e.ProgressPercentage}", IndicadorStatus = "I", PedidoImportacao = this._importacaoWebClient }; this._identityWebClient.LogPedidoImportacao.Add(logPedidoImportacao); this._identityWebClient.SaveChanges(); } }
public static string TraduzirEstado(this LogPedidoImportacao logPedidoImportacao) { switch (logPedidoImportacao.IndicadorStatus) { case "A": return "Aguardando"; case "C": return "Concluido"; case "I": return "Informativo"; default: return "Status não encontrado"; } }