public override void HandleRequest(MvcRoute Route)
{
// Try and Fetch Player ID
Int32.TryParse(Route.Action, out Pid);
// NOTE: The HttpServer will handle the DbConnectException
using (Database = new StatsDatabase())
{
// Fetch Player
Rows = Database.Query("SELECT * FROM player WHERE id=@P0", Pid);
if (Rows.Count == 0)
{
Client.Response.Redirect("/bf2stats/search");
return;
}
// Load our page based on the param passed
if (Route.Params.Length > 0)
{
if (Route.Params[0] == "rankings")
ShowRankings();
else if (Route.Params[0] == "history")
ShowHistory();
else
Client.Response.StatusCode = 404;
}
else
{
ShowStats();
}
}
}