Пример #1
0
        public void Carregar(string linha)
        {
            using (var context = new DBDenunciaContext(App.connectionString))
            {
                List<Estacao> _estacao = new List<Estacao>();
                try
                {
                    IQueryable<Estacao> _query = context.Estacao;
                    if (!string.IsNullOrWhiteSpace(linha))
                    {
                        _estacao = _query.Where(e => (e.Linha == linha)).ToList();
                    }

                    this.ItensEstacao.Clear();
                    foreach (var item in _estacao)
                    {
                        this.ItensEstacao.Add(item);
                    }
                }
                catch (Exception ce)
                {
                    Console.WriteLine(ce.Message);
                    _estacao = null;
                }

            }
        }
Пример #2
0
        public void Carregar(string transporte)
        {
            using(var context = new DBDenunciaContext(App.connectionString))
            {
                List<Linha> _linhas = new List<Linha>();
                try
                {
                    IQueryable<Linha> _query = context.Linha;
                    if (string.IsNullOrWhiteSpace(transporte))
                    {
                        _linhas = _query.ToList();
                    }
                    else
                    {
                        _linhas = _query.Where(l => (l.Transporte.ToUpper() == transporte.ToUpper())).ToList();
                    }

                    this.ItensLinha.Clear();
                    foreach (var item in _linhas)
                    {
                        this.ItensLinha.Add(item);
                    }
                }
                catch (Exception ce)
                {
                    Console.WriteLine(ce.Message);
                    _linhas = null;
                }

            }
        }
Пример #3
0
        public static void RealizarCargaInicial(DBDenunciaContext context)
        {
            try
            {

                #region Opções de linhas em branco (default) para o Metrô e a CPTM

                Linha l = new Linha()
                {
                    Cor = "Black",
                    Nome = "",
                    Transporte = Constantes.TRANSPORTE_METRO,
                    Inicio = "",
                    Fim = ""
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                l = new Linha()
                {
                    Cor = "Black",
                    Nome = "",
                    Transporte = Constantes.TRANSPORTE_CPTM,
                    Inicio = "",
                    Fim = ""
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                #endregion

                #region Linha 1 - Azul
                l = new Linha()
                {
                    Cor = "Blue",
                    Nome = "1 - Azul",
                    Transporte = Constantes.TRANSPORTE_METRO,
                    Inicio = "Jabaquara",
                    Fim = "Tucuruvi"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                Estacao e = new Estacao()
                {
                    Nome = "Jabaquara",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Conceição",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "São Judas",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "São Judas",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Saúde",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Praça da Árvore",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santa Cruz",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila Mariana",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Ana Rosa",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Paraíso",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vergueiro",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "São Joaquim",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Liberdade",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Sé",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "São Bento",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Luz",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tiradentes",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Armênia",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Portuguesa-Tietê",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Carandiru",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santana",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jardim São Paulo-Ayrton Senna",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Parada Inglesa",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tucuruvi",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 2 - Verde
                l = new Linha()
                {
                    Cor = "Green",
                    Nome = "2 - Verde",
                    Transporte = Constantes.TRANSPORTE_METRO,
                    Inicio = "Vila Prudente",
                    Fim = "Vila Madalena"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila Prudente",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tamanduateí",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Sacomã",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Alto do Ipiranga",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santos-Imigrantes",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Chácara Klabin",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Ana Rosa",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Paraíso",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Brigadeiro",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Trianon-Masp",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Consolação",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tamanduateí",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Clínicas",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Sumaré",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila Madalena",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 3 - Vermelha

                l = new Linha()
                {
                    Cor = "Red",
                    Nome = "3 - Vermelha",
                    Transporte = Constantes.TRANSPORTE_METRO,
                    Inicio = "Palmeiras-Barra Funda",
                    Fim = "Corinthians-Itaquera"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Palmeiras-Barra Funda",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Marechal Deodoro",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santa Cecília",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "República",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Anhangabaú",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Sé",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Pedro II",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Brás",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Bresser-Mooca",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Belém",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tatuapé",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Carrão",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Penha",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila Matilde",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Guilhermina-Esperança",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Patriarca",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Artur Alvim",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Corinthians-Itaquera",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 4 - Amarela

                l = new Linha()
                {
                    Cor = "Goldenrod",
                    Nome = "4 - Amarela",
                    Transporte = Constantes.TRANSPORTE_METRO,
                    Inicio = "Butantã",
                    Fim = "Luz"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Butantã",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Pinheiros",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Faria Lima",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Fradique Coutinho",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Paulista",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "República",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Luz",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 5 - Lilás

                l = new Linha()
                {
                    Cor = "Magenta",
                    Nome = "5 - Lilás",
                    Transporte = Constantes.TRANSPORTE_METRO,
                    Inicio = "Capão Redondo",
                    Fim = "Adolfo Pinheiro"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Capão Redondo",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Campo Limpo",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila das Belezas",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Giovanni Gronchi",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santo Amaro",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Largo Treze",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Adolfo Pinheiro",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 7 - Rubi

                l = new Linha()
                {
                    Cor = "Purple",
                    Nome = "7 - Rubi",
                    Transporte = Constantes.TRANSPORTE_CPTM,
                    Inicio = "Luz",
                    Fim = "Jundiaí"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Luz",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Palmeiras-Barra Funda",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Água Branca",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Lapa",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Piqueri",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Pirituba",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila Clarice",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jaraguá",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila Aurora",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Perus",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Caieras",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Franco da Rocha",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Baltazar Fidélis",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Francisco Morato",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Botujuru",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Campo Limpo Paulista",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Várzea Paulista",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jundiaí",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 8 - Diamante

                l = new Linha()
                {
                    Cor = "LightSlateGray",
                    Nome = "8 - Diamante",
                    Transporte = Constantes.TRANSPORTE_CPTM,
                    Inicio = "Júlio Prestes",
                    Fim = "Amador Bueno"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Júlio Prestes",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Palmeiras-Barra Funda",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Lapa",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Domingos de Moraes",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Imperatriz Leopoldina",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Presidente Altino",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Osasco",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Comandante Sampaio",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Quitaúna",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "General Miguel Costa",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Carapicuíba",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santa Teresinha",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Antônio João",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Barueri",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jardim Belval",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jardim Silveira",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jandira",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Sagrado Coração",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Engenheiro Cardoso",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Itapevi",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santa Rita",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Amador Bueno",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 9 - Esmeralda

                l = new Linha()
                {
                    Cor = "Teal",
                    Nome = "9 - Esmeralda",
                    Transporte = Constantes.TRANSPORTE_CPTM,
                    Inicio = "Osasco",
                    Fim = "Grajaú"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Osasco",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Presidente Altino",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Ceasa",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Villa Lobos-Jaguaré",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Cidade Universitária",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Pinheiros",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Hebraica-Rebouças",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Cidade Jardim",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Vila Olímpia",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Berrini",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Morumbi",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Granja Julieta",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santo Amaro",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Socorro",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jurubatuba",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Autódromo",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Primavera-Interlagos",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 10 - Turquesa

                l = new Linha()
                {
                    Cor = "LightSeaGreen",
                    Nome = "10 - Turquesa",
                    Transporte = Constantes.TRANSPORTE_CPTM,
                    Inicio = "Brás",
                    Fim = "Rio Grande da Serra"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Brás",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Mooca",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Ipiranga",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tamanduateí",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "São Caetano",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Utinga",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Prefeito Saladino",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Santo André-Prefeito Celso Daniel",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Capuava",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Mauá",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Guapituba",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Ribeirão Pires",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Rio Grande da Serra",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 11 - Coral

                l = new Linha()
                {
                    Cor = "Coral",
                    Nome = "11 - Coral",
                    Transporte = Constantes.TRANSPORTE_CPTM,
                    Inicio = "Luz",
                    Fim = "Estudantes"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Luz",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Brás",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tatuapé",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Corinthians-Itaquera",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Dom Bosco",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "José Bonifácio",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Guianases",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Antônio Gianetti Neto",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Ferraz de Vasconcelos",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Poá",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Calmon Viana",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Suzano",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jundiapeba",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Brás Cubas",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Mogi das Cruzes",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Estudantes",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion

                #region Linha 12 - Safira

                l = new Linha()
                {
                    Cor = "RoyalBlue",
                    Nome = "12 - Safira",
                    Transporte = Constantes.TRANSPORTE_CPTM,
                    Inicio = "Luz",
                    Fim = "Estudantes"
                };

                context.Linha.InsertOnSubmit(l);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Brás",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Tatuapé",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Engenheiro Goulart",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "USP Leste",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Comendador Ermelino",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "São Miguel Paulista",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jardim Helena-Vila Maria",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Itaim Paulista",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Jardim Romano",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Engenheiro Manoel Feio",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Itaquaquecetuba",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Aracaré",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                e = new Estacao()
                {
                    Nome = "Calmon Viana",
                    Linha = l.Id.ToString()
                };
                context.Estacao.InsertOnSubmit(e);
                context.SubmitChanges();

                #endregion
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }