Showing posts with label Football. Show all posts
Showing posts with label Football. Show all posts

Tuesday, November 12, 2013

QB Rating Calculator Web Service


QB Rating Web Service is a WCF service that calculates a QB's NFL and NCAA ratings.  It supports REST, SOAP, XML and JSON. It is a Visual Studio 2012 project written in C# and is another in my series of QB Ratings app samples - InfoPath 2013 QB Rating, Excel 2013 QB Rating and SharePoint 2013 QB Rating (App & App Part).
Download Web Service Source (22K) or ASP.NET QB Rating Sample (8.8M)
View CodePlex Project or MSDN Sample

Features

  • Web Service (WCF)
  • REST and SOAP
  • XML and JSON
  • Calculates both NFL and NCAA ratings
  • Shows detailed calculation formula & steps
  • Source code included

Screenshots

The web service interface in the Visual Studio Object Browser:

Sample XML response from the service

The GetRating service call in the WCF Test Client:

Quick Usage Example

In order to use this service via SOAP, you'll need to create a client and use it to call the service.  Additionally, you can use the REST configuration with a ServiceContract and UriTemplate similar to http://localhost:62370/QBRatingService.svc/calc?formula=NFL&c=10&a=16&y=212&t=3&i=1&fmt=XML. You can quickly create a configuration file and simple client class using the svcutil.exe tool from the command line with the following syntax:

svcutil.exe http://localhost:62370/QBRatingService.svc?wsdl
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:
C#
class Test
{
    static void Main()
    {
        QBRatingServiceClient client = new QBRatingServiceClient();

        // Use the 'client' variable to call operations on the service.

        // Always close the client.
        client.Close();
    }
}
Visual Basic
Class Test
    Shared Sub Main()
        Dim client As QBRatingServiceClient = New QBRatingServiceClient()
        ' Use the 'client' variable to call operations on the service.

        ' Always close the client.
        client.Close()
    End Sub
End Class

Detailed ASP.NET Usage Example

In addition to the quick usage in the previous section, I developed a working ASP.NET QB Rating Calculator that uses this web service to perform the actual calculations. The complete Visual Studio 2012 project is available on CodePlex and MSDN.


Friday, October 11, 2013

Excel Spreadsheet - QB Passer Rating


After I posted the SharePoint 2013 QB Rating App, several people requested a stand-alone Excel spreadsheet to calculate a QB's NFL and NCAA passing efficiency ratings.  As a side note, this spreadsheet can also be used with SharePoint Excel Services.
Download QB_Rating-Calculator.xlsx (33K)



Thursday, October 10, 2013

SharePoint 2013 - QB Passer Rating App


QB Rating App is a SharePoint 2013 App and associated App Part that calculates a QB's NFL and NCAA passing efficiency ratings.  This project contains a fully functioning App and can also serve as a template for creating SharePoint Apps and App Parts. Check out the project on CodePlex.
Download App (194K) or Source (762K)
View CodePlex Project or MSDN Sample

Features

  • SharePoint 2013 App (HTML5, JQuery & CSS3)
  • SharePoint 2013 App Part
  • Calculates both NFL and NCAA ratings
  • Shows detailed calculation formula & steps
  • Deployable App & source code included

Screenshots

The App hosted in a SharePoint 2013 development site:
Add the SharePoint 2013 App to your site:
The App Part on a SharePoint 2013 site content page:
Add the App Part to a site content page:

Source Code

You can browse the source code on CodePlex via the web or use git to clone the repository.  For development purposes, make sure to create an isolated app domain.