public ActionResult Standings(string sport, string fed, string tour, int?fedSeason) { try { List <Standings> standings = new ServiceDatabase().CreateModelStandings(sport, fed, tour, fedSeason); List <Standings> SortedList = standings.OrderByDescending(o => o.Point).ToList(); return(View(SortedList.ToList())); } catch (Exception e) { ViewBag.Error = myException.Message + " " + e.Message; return(View("Error")); } }
public ActionResult Standings(FormCollection collection) { try { int fedSeason = Convert.ToInt32(collection[1]); string season = collection[0]; List <Standings> standings = new ServiceDatabase().CreateModelStandings(null, null, season, fedSeason); List <Standings> SortedList = standings.OrderByDescending(o => o.Point).ToList(); return(View(SortedList.ToList())); } catch (Exception e) { ViewBag.Error = e.Message; return(View("Error")); } }