public void CargarTextosPrimerPantalla() { // Mapeo la DB this.db = new dbEntities(); // Cargo el primer Texto var textoaux1 = from txt in db.Textos where txt.IdTextos == 1 select txt.Texto; LblTexto1.Text = textoaux1.First(); // Cargo el segundo texto var textoaux2 = from txt in db.Textos where txt.IdTextos == 2 select txt.Texto; LblTexto2.Text = textoaux2.First(); // Cargo el tercer Texto var textoaux3 = from txt in db.Textos where txt.IdTextos == 3 select txt.Texto; LblTexto3.Text = textoaux3.First(); // Cargo el Cuarto Texto var textoaux4 = from txt in db.Textos where txt.IdTextos == 4 select txt.Texto; LblTexto4.Text = textoaux4.First(); }
public void CargarJuegosDelDia() { int DiaDeLaSemana = Convert.ToInt32(DateTime.Today.DayOfWeek); this.db = new dbEntities(); // Selecciono todos los juegos para este dia var juegos = from j in this.db.Juego join d in this.db.Dias on j.IdJuego equals d.Juego.IdJuego where d.Dia == DiaDeLaSemana select j; foreach (var juego in juegos) { ListaDeJuegos.Add(juego); } // Cantidad de juegos cargados CantJuegos = (from j in db.Juego join d in db.Dias on j.IdJuego equals d.Juego.IdJuego where d.Dia == DiaDeLaSemana select j).Count(); }