protected void Button1_Click(object sender, EventArgs e) { try { List <Datosx> datos = new List <Datosx>(); List <DatosEntity> leer = new List <DatosEntity>(); datos = Datosx.GetDatosUsuario(TextBox1.Text, TextBox2.Text); if (datos.Count() > 0) { foreach (Datosx x in datos) { Session["usr"] = x.NombreUsuario; Session["login"] = true; Session["nombre"] = x.Nombre; } Response.Redirect("~/Paginas/Inicio.aspx"); } else { Label1.Visible = true; Label1.Text = "Usuario y/o Contraseña incorrectos..."; } } catch (Exception ex) { } finally { } }
protected void estacionDatos(int est) { try { List <Datosx> dt = Datosx.GetDatosEstacion(est); foreach (Datosx row in dt) { nameLabel.Text = row.Nombre; LatLabel.Text = "Latitud: " + row.Latitud; LongLabel.Text = "Longitud: " + row.Longitud; } } catch (Exception ex) { } }