Exemplo n.º 1
0
            public static int getIdEstacion(string nombre)
            {
                int id = 0;

                if (Application.Current.Properties.ContainsKey("Usuario_Estacion"))
                {
                    ListaElementos  elemento = new ListaElementos();
                    List <Estacion> temp     = elemento.elementos;
                    id = temp[0].id_Estaciones;
                }
                else
                {
                    ListaElementos         elemento   = new ListaElementos();
                    List <Models.Estacion> estaciones = elemento.elementos;
                    for (int i = 0; i < estaciones.Count; i++)
                    {
                        Models.Estacion xp = estaciones[i];
                        if (xp.Nombre_Estacion.Equals(nombre))
                        {
                            id = xp.id_Estaciones;
                            break;
                        }
                    }
                }

                return(id);
            }
Exemplo n.º 2
0
            public static int getIdEstacion(string nombre)
            {
                int                    id         = 0;
                ListaElementos         elemento   = new ListaElementos();
                List <Models.Estacion> estaciones = elemento.elementos;

                for (int i = 0; i < estaciones.Count; i++)
                {
                    Models.Estacion xp = estaciones[i];
                    if (xp.Nombre_Estacion.Equals(nombre))
                    {
                        id = xp.id_Estaciones;
                        break;
                    }
                }
                return(id);
            }