public List <torneo> Recuperar_Torneo_Completo(futbolEntities ctx)
 {
     try
     {
         return(ctx.torneo.ToList());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #2
0
 public List <equipo> Recuperar_Equipo_Completo(futbolEntities ctx)
 {
     try
     {
         return(ctx.equipo.ToList());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
 public void Actualizar_Torneo(futbolEntities ctx)
 {
     try
     {
         ctx.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #4
0
 public void Eliminar_JugadorEquipo(futbolEntities ctx, jugador ju)
 {
     try
     {
         ctx.jugador.Remove(ju);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #5
0
 public List <genero> Recuperar_Genero(futbolEntities ctx)
 {
     try
     {
         return(ctx.genero.ToList());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #6
0
 public List <jugador> Recuperar_Jugador_Completo(futbolEntities ctx)
 {
     try
     {
         return(ctx.jugador.ToList());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #7
0
 public void Insertar_Jugador(futbolEntities ctx, jugador ju)
 {
     try
     {
         ctx.jugador.Add(ju);
         ctx.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #8
0
 public void Insertar_Equipo(futbolEntities ctx, equipo eq)
 {
     try
     {
         ctx.equipo.Add(eq);
         ctx.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #9
0
 public void Eliminar_Equipo(futbolEntities ctx, equipo eq)
 {
     try
     {
         ctx.equipo.Remove(eq);
         ctx.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #10
0
 public void Eliminar_Torneo(futbolEntities ctx, torneo to)
 {
     try
     {
         ctx.torneo.Remove(to);
         ctx.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #11
0
 public void Insertar_Torneo(futbolEntities ctx, torneo to)
 {
     try
     {
         ctx.torneo.Add(to);
         ctx.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #12
0
        public equipo Recuperar_Equipo_Busqueda(futbolEntities ctx, int selEquipo)
        {
            try
            {
                var eliEquipo = (from t in ctx.equipo
                                 where t.id == selEquipo
                                 select t).First();

                return(eliEquipo);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #13
0
        public List <equipo> Recuperar_Torneo_Equipo(futbolEntities ctx, int seltorneo)
        {
            try
            {
                var selEquipo = (from eq in ctx.equipo
                                 where eq.torneo_id == seltorneo
                                 select eq).ToList();

                return(selEquipo);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #14
0
        public torneo Recuperar_Torneo_Busqueda(futbolEntities ctx, int seltorneo)
        {
            try
            {
                var elitorneo = (from t in ctx.torneo
                                 where t.id == seltorneo
                                 select t).First();

                return(elitorneo);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #15
0
        public List <jugador> Recuperar_Equipo_Jugador(futbolEntities ctx, int selEquipo)
        {
            try
            {
                var eliJugador = (from ju in ctx.jugador
                                  where ju.equipo_id == selEquipo
                                  select ju).ToList();

                return(eliJugador);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #16
0
        public usuario Recuperar_Usuario(futbolEntities ctx, String user, String pass)
        {
            try
            {
                var usua = (from u in ctx.usuario
                            where u.contraseƱa == pass && u.usuario1 == user
                            select u).FirstOrDefault();

                return(usua);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #17
0
        public jugador Recuperar_Jugador_Busqueda(futbolEntities ctx, int selJugador)
        {
            try
            {
                var eliJugador = (from t in ctx.jugador
                                  where t.id == selJugador
                                  select t).First();

                return(eliJugador);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
 public List <EquipoTorneo> Listar_Equipo(futbolEntities ctx)
 {
     try
     {
         return((from eq in ctx.equipo
                 join t in ctx.torneo on eq.torneo_id equals t.id into equi
                 from equiLeft in equi.DefaultIfEmpty()
                 orderby eq.nombre
                 select new EquipoTorneo
         {
             Equipos = eq.nombre,
             Torneos = equiLeft.nombre,
             Estado = equiLeft.flag_activo ? "Activo" : "Inactivo"
         }
                 ).ToList());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
 public List <EquipoTorneo> Listar_Equipo_Busqueda(futbolEntities ctx, string equipoB, bool activos)
 {
     try
     {
         return((from eq in ctx.equipo
                 join t in ctx.torneo on eq.torneo_id equals t.id into equi
                 from equiLeft in equi.DefaultIfEmpty()
                 where (eq.nombre.Contains(equipoB) && (equiLeft.flag_activo.Equals(activos)))
                 orderby eq.nombre
                 select new EquipoTorneo
         {
             Equipos = eq.nombre,
             Torneos = equiLeft.nombre,
             Estado = equiLeft.flag_activo ? "Activo" : "Inactivo"
         }
                 ).ToList());
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }