Ejemplo n.º 1
0
 public ActionResult Jugadores(string equipo, int year)
 {
     ServicioEquipos.SrvEquiposClient equipos = new ServicioEquipos.SrvEquiposClient();
     List<Player> jugadores = equipos.GetJugadoresEquipoAño(equipo, year).ToList();
     ViewBag.jugadores = jugadores; 
     return PartialView("_ListaJugadores", jugadores);
 }
Ejemplo n.º 2
0
        public ActionResult Jugador(string id)
        {
            ServicioEquipos.SrvEquiposClient cliente = new ServicioEquipos.SrvEquiposClient();
            Player jugador = cliente.GetJugador(id);
            return PartialView("_Jugador", jugador);

        }
Ejemplo n.º 3
0
        public ActionResult Asignar()
        {
            List <string> jugadoresOut = new List <string>();
            List <string> jugadoresIn  = new List <string>();

            foreach (var key in HttpContext.Request.Params.AllKeys)
            {
                if (key.StartsWith("Out.") && HttpContext.Request.Params[key] != "false")
                {
                    jugadoresOut.Add(key.Substring(4));
                }
            }
            //TODO Servicio para borrar de la tabla da apariciones estos jugadores

            foreach (var key in HttpContext.Request.Params.AllKeys)
            {
                if (key.StartsWith("In.") && HttpContext.Request.Params[key] != "false")
                {
                    jugadoresIn.Add(key.Substring(3));
                }
            }

            //TODO Servicio para insertar en la tabla da apariciones estos jugadores al equipo año correspondientes

            Equipo eq = new Equipo()
            {
                teamID = "ARI", YearId = 2014
            };

            ServicioEquipos.SrvEquiposClient equipos = new ServicioEquipos.SrvEquiposClient();
            ViewBag.JugadoresEquipo = equipos.GetJugadoresEquipoAño("ARI", 2014).ToList();
            //ViewBag.JugadoresLibres = equipos.GetJugadoresLibresAño(2014).ToList();

            return(View(eq));
        }
Ejemplo n.º 4
0
        // GET: api/Ejemplo
        public IEnumerable <Player> Get(string equipo, int year)
        {
            ServicioEquipos.SrvEquiposClient equipos = new ServicioEquipos.SrvEquiposClient();
            List <Player> jugadores = equipos.GetJugadoresEquipoAño(equipo, year).ToList();

            return(jugadores);
        }
Ejemplo n.º 5
0
        public ActionResult Index(int year)
        {
            ViewBag.Year = year.ToString();

            ServicioEquipos.SrvEquiposClient Equipos = new ServicioEquipos.SrvEquiposClient();

            return View(Equipos.GetEquiposByYear(year));
        }
Ejemplo n.º 6
0
        public ActionResult Year(int id)
        {
            ViewBag.Year = id.ToString();

            ServicioEquipos.SrvEquiposClient Equipos = new ServicioEquipos.SrvEquiposClient();

            return View("Index",Equipos.GetEquiposByYear(id));
        }
Ejemplo n.º 7
0
        public ActionResult Year(string equipo, int year)
        {
            ServicioEquipos.SrvEquiposClient Equipos = new ServicioEquipos.SrvEquiposClient();

            ViewBag.Players = Equipos.GetJugadoresEquipoAño(equipo, year);

            return(View("Index", Equipos.GetEquiposByYear(year)));
        }
Ejemplo n.º 8
0
        public ActionResult Index(int year)
        {
            ViewBag.Year = year.ToString();

            ServicioEquipos.SrvEquiposClient Equipos = new ServicioEquipos.SrvEquiposClient();

            return(View(Equipos.GetEquiposByYear(year)));
        }
Ejemplo n.º 9
0
        public ActionResult Modificar(string id, int year, string equipo)
        {
            ServicioEquipos.SrvEquiposClient servicio = new ServicioEquipos.SrvEquiposClient();

            ViewBag.Year   = year;
            ViewBag.Equipo = equipo;

            return(View(servicio.GetJugador(id)));
        }
Ejemplo n.º 10
0
        public ActionResult Modificar(Player jugador)
        {
            HttpContext.Request.Params["year"].ToString();

            ServicioEquipos.SrvEquiposClient servicio = new ServicioEquipos.SrvEquiposClient();
            servicio.ModificarJugador(jugador);

            return(RedirectToAction("index", "Equipo"));
        }
Ejemplo n.º 11
0
        public ActionResult Jugadores(string equipo, int year)
        {
            ServicioEquipos.SrvEquiposClient equipos = new ServicioEquipos.SrvEquiposClient();
            List <Player> jugadores = equipos.GetJugadoresEquipoAño(equipo, year).ToList();

            ViewBag.Year     = year;
            ViewBag.IdEquipo = equipo;

            return(PartialView("ListaJugadores", jugadores));
        }
Ejemplo n.º 12
0
        public ActionResult Modificar(Player jugador,int year, string team)
        {
            //HttpContext.Request.Params
            ServicioEquipos.SrvEquiposClient cliente = new ServicioEquipos.SrvEquiposClient();
            cliente.RellenarJugador(jugador);

            RouteValueDictionary routeData = new RouteValueDictionary();
            routeData.Add("year", year);
            routeData.Add("team", team);
            ViewBag.error = true;
            //return RedirectToAction("Index", "Equipo",routeData);
            return View("JugadorForm",jugador);
        }
Ejemplo n.º 13
0
        public ActionResult Asignar(int year, string equipo)
        {
            Equipo eq = new Equipo()
            {
                teamID = "ARI", YearId = 2014
            };

            ServicioEquipos.SrvEquiposClient equipos = new ServicioEquipos.SrvEquiposClient();
            ViewBag.JugadoresEquipo = equipos.GetJugadoresEquipoAño("ARI", 2014).ToList();

            //ViewBag.JugadoresLibres = equipos.GetJugadoresLibresAño(2014).ToList(); Cambio sin importancia

            return(View(eq));
        }
Ejemplo n.º 14
0
        private Equipo[] ObtenerEquipos(int year)
        {
            string clave = "Team" + year.ToString();

            Equipo[] equipos = null;

            if (HttpContext.Cache[clave] == null)
            {
                ServicioEquipos.SrvEquiposClient Equipos = new ServicioEquipos.SrvEquiposClient();
                equipos = Equipos.GetEquiposByYear(year);
                HttpContext.Cache.Insert(clave, equipos, null, DateTime.UtcNow.AddSeconds(5), System.Web.Caching.Cache.NoSlidingExpiration);
            }


            return((Equipo[])HttpContext.Cache[clave]);
        }
Ejemplo n.º 15
0
        // GET: Equipo
        
        public ActionResult Index()
        {
            ViewBag.jugadores=null;
            int year = 2014;
            if(HttpContext.Request.Params["year"]==null)
            { 
               ViewBag.Year = "2014";
                
            }
            else
            {
                string team = HttpContext.Request.Params["team"];
                year = Convert.ToInt32(HttpContext.Request.Params["year"]);
                ServicioEquipos.SrvEquiposClient Equiposs = new ServicioEquipos.SrvEquiposClient();
                ViewBag.jugadores = Equiposs.GetJugadoresEquipoAño(team, year);
                ViewBag.Year = year;
            }

            ServicioEquipos.SrvEquiposClient Equipos = new ServicioEquipos.SrvEquiposClient();
            
            return View(Equipos.GetEquiposByYear(year));
           
            
        }
Ejemplo n.º 16
0
 public ActionResult Modificar(string id, int year, string team)
 {
     ServicioEquipos.SrvEquiposClient cliente = new ServicioEquipos.SrvEquiposClient();
     Player jugador = cliente.GetJugador(id);
     return View("JugadorForm", jugador);
 }
Ejemplo n.º 17
0
 // GET: api/Ejemplo
 public IEnumerable<Player> Get(string equipo, int year)
 {
     ServicioEquipos.SrvEquiposClient equipos = new ServicioEquipos.SrvEquiposClient();
     List<Player> jugadores = equipos.GetJugadoresEquipoAño(equipo, year).ToList();
     return jugadores;
 }
Ejemplo n.º 18
0
 public ActionResult UpDate(Player jugador)
 {
     ServicioEquipos.SrvEquiposClient cliente = new ServicioEquipos.SrvEquiposClient();
     cliente.RellenarJugador(jugador);
     return View("Index");
 }
Ejemplo n.º 19
0
        // GET: Jugador
        public ActionResult Index(string id)
        {
            ServicioEquipos.SrvEquiposClient servicio = new ServicioEquipos.SrvEquiposClient();

            return(View(servicio.GetJugador(id)));
        }