private List<string> TrataRua(string rua, List<string> list) { if (rua != null && !string.IsNullOrWhiteSpace(rua) && !rua.Contains("script")) { string[] aux; aux = rua.Replace("\r", "").Replace("\n", " ").Replace("\"", "").Replace("rua", "Rua").Split(new string[] { "-", ":" }, StringSplitOptions.None); bool bairro = false; for (int i = 0; i < aux.Count(); i++) { if (i != 0) { if (!bairro) { if (aux[i].Contains("Bairro")) { int index = aux[i].IndexOf("Bairro"); if (!string.IsNullOrWhiteSpace(aux[i])) { string aux2 = aux[i].Substring(0, index).Trim(); if (!string.IsNullOrWhiteSpace(aux2)) SaidaTerminalRuas.Add(aux2); } bairro = true; } else if (!string.IsNullOrWhiteSpace(aux[i])) SaidaTerminalRuas.Add(aux[i].Trim()); } else { if (!string.IsNullOrWhiteSpace(aux[i])) SaidaBairroRuas.Add(aux[i].Trim()); } } } } return list; }
private void ResetVariables() { SaidaTerminalDiasUteis = new List<string>(); SaidaTerminalSabado = new List<string>(); SaidaTerminalDomingo = new List<string>(); SaidaBairroDiasUteis = new List<string>(); SaidaBairroSabado = new List<string>(); SaidaBairroDomingo = new List<string>(); SaidaTerminalRuas = new List<string>(); SaidaBairroRuas = new List<string>(); Observacoes = new List<string>(); Horarios = string.Empty; NomeBairro = string.Empty; DataUltimaAtualizacao = string.Empty; Ruas = string.Empty; srcMapa = string.Empty; bairro = new Bairros(); horario = new Horarios(); obsDb = new Observacoes(); itinerario = new Itinerarios(); mapa = new Mapas(); }