public PerfilJugadorShortViewModel GetPerfilJugadorShort() { var perfil = GetAuthData(); try { if (perfil.JugadorId.HasValue) { IBusquedaBusiness business = DependencyFactory.Resolve <IBusquedaBusiness>(); return(business.GetPerfilJugadorShort(perfil)); } else if (perfil.EntrenadorId.HasValue) { //TODO return(null); } else { return(null); } } catch (Exception) { throw new Exception("Error de servidor"); } }
public JsonResult TopJugador() { try { IBusquedaBusiness business = DependencyFactory.Resolve <IBusquedaBusiness>(); var result = business.TopJugador(); result.ForEach(o => o.Link = #if DEBUG "http://localhost:52771/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #else "http://allwiners.com/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #endif ); Response.StatusCode = 200; return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } catch (Exception) { Response.StatusCode = 500; return(new JsonResult { Data = "Error de servidor", JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } }
public List <JugadorBackOfficeViewModel> GetJugadoresAll() { IBusquedaBusiness business = DependencyFactory.Resolve <IBusquedaBusiness>(); try { return(business.SearchJugadorAll()); } catch (ExceptionBusiness) { throw; } catch (Exception ex) { throw new Exception("Error del servidor", ex); } }
public List <JugadorViewModel> TopJugador() { try { IBusquedaBusiness business = DependencyFactory.Resolve <IBusquedaBusiness>(); var result = business.TopJugador(); result.ForEach(o => o.Link = #if DEBUG "http://localhost:52771/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #else "http://allwiners.com/#!/ProfilePublic/JugadorPublic/" + o.Id.ToString() #endif ); return(result); } catch (Exception) { throw new Exception("Error de servidor"); } }
public JsonResult GetPerfilJugadorShort() { var perfil = GetAuthData(); try { if (perfil.JugadorId.HasValue) { IBusquedaBusiness business = DependencyFactory.Resolve <IBusquedaBusiness>(); var result = business.GetPerfilJugadorShort(perfil); Response.StatusCode = 200; return(new JsonResult { Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } else if (perfil.EntrenadorId.HasValue) { //TODO Response.StatusCode = 200; return(new JsonResult { Data = null, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } else { Response.StatusCode = 404; return(new JsonResult { Data = "Perfil no encontrado", JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } } catch (Exception) { Response.StatusCode = 500; return(new JsonResult { Data = "Error de servidor", JsonRequestBehavior = JsonRequestBehavior.AllowGet }); } }