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)); } }
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)); } }
public GolesController() { GoleadaDBEntities contexto = new GoleadaDBEntities(); GolesService = new GolesService(contexto); JugadoresService = new JugadoresService(contexto); }
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()); } }
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)); } }
public GolesController() { golesService = new GolesService <GolesPorJugadorEquipo>(context); jugadorService = new JugadoresService <Jugador>(context); }
public JugadoresController() { jugadoresService = new JugadoresService <Jugador>(context); }