コード例 #1
0
        public JsonResult AlmacenarJugador(RegistroModel model)
        {
            ErrorModel response = new ErrorModel();

            try
            {
                jugadoresService = new JugadoresService();
                string dbConn = _config.GetSection("General").GetSection("PathDB").Value;
                jugadoresService.InsertarJugador(model, dbConn);
                response.CodigoError      = 1;
                response.DescripcionError = "OK";

                return(Json(response));
            }
            catch (BusinessException ex)
            {
                response.CodigoError      = 2;
                response.DescripcionError = ex.Message;
                return(Json(response));
            }
            catch (Exception ex)
            {
                response.CodigoError      = 2;
                response.DescripcionError = ex.Message;
                return(Json(response));
            }
        }
コード例 #2
0
        public JsonResult ActualizarDisponibles(string registrosActualizar)
        {
            ErrorModel response = new ErrorModel();

            try
            {
                jugadoresService = new JugadoresService();
                string dbConn = _config.GetSection("General").GetSection("PathDB").Value;
                jugadoresService.ActualizarDisponible(registrosActualizar, dbConn);
                response.CodigoError      = 1;
                response.DescripcionError = "OK";

                return(Json(response));
            }
            catch (BusinessException ex)
            {
                response.CodigoError      = 2;
                response.DescripcionError = ex.Message;
                return(Json(response));
            }
            catch (Exception ex)
            {
                response.CodigoError      = 2;
                response.DescripcionError = ex.Message;
                return(Json(response));
            }
        }
コード例 #3
0
        public GolesController()
        {
            GoleadaDBEntities contexto = new GoleadaDBEntities();

            GolesService     = new GolesService(contexto);
            JugadoresService = new JugadoresService(contexto);
        }
コード例 #4
0
        public IActionResult Jugadores()
        {
            try
            {
                RegistroModel modelo = new RegistroModel();
                jugadoresService = new JugadoresService();
                string dbConn = _config.GetSection("General").GetSection("PathDB").Value;

                //Se consulta los jugadores del sistema
                modelo.lstJugadores = jugadoresService.ConsultarJugadores(dbConn);

                ViewData["Message"] = Constantes.TituloJugadores;
                return(View(modelo));
            }
            catch (BusinessException ex)
            {
                return(View());
            }
            catch (Exception ex)
            {
                return(View());
            }
        }
コード例 #5
0
        public JsonResult ConsultarJugador(RegistroModel model)
        {
            ErrorModel response = new ErrorModel();

            try
            {
                jugadoresService = new JugadoresService();
                string         dbConn  = _config.GetSection("General").GetSection("PathDB").Value;
                JugadoresModel jugador = jugadoresService.ConsultarJugadoresPorIdentificacion(model, dbConn);
                return(Json(jugador));
            }
            catch (BusinessException ex)
            {
                response.CodigoError      = 2;
                response.DescripcionError = ex.Message;
                return(Json(response));
            }
            catch (Exception ex)
            {
                response.CodigoError      = 2;
                response.DescripcionError = ex.Message;
                return(Json(response));
            }
        }
コード例 #6
0
 public GolesController()
 {
     golesService   = new GolesService <GolesPorJugadorEquipo>(context);
     jugadorService = new JugadoresService <Jugador>(context);
 }
 public JugadoresController()
 {
     jugadoresService = new JugadoresService <Jugador>(context);
 }