Showing posts with label QB Rating. Show all posts
Showing posts with label QB Rating. 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.


Sunday, October 20, 2013

Silverlight 5 - QB Passer Rating App


Silverlight QB Rating is a Silverlight 5 XAP application package (and source code) that calculates a QB's NFL and NCAA passing efficiency ratings. 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 XAP (152K) or Source (31K)
View Live Demo, CodePlex Project or MSDN Sample

Features

  • Silverlight 5 (C# in Visual Studio 2012)
  • Calculates both NFL and NCAA ratings
  • Shows detailed calculation formula & steps
  • Deployable XAP & source code included

Screenshots

The Silverlight 5 XAP hosted in Internet Explorer:    IE Hosted XAP
The XAML design surface in Visual Studio 2012:Design
The C# source view in Visual Studio 2012:Source Code

Example Usage

The following is a quick and simple example of embedding the XAP as an object in a web page.  Since this is Silverlight 5-based, you will need to ensure you have the correct version of Silverlight installed.
<div id="silverlightControlHost">
    <object data="data:application/x-silverlight-2," 
       type="application/x-silverlight-2" width="100%" height="100%">
        <param name="source" value="QBRatingSL.xap" />
        <param name="onError" value="onSilverlightError" />
        <param name="background" value="white" />
        <param name="minRuntimeVersion" value="5.0.61118.0" />
        <param name="autoUpgrade" value="true" />
        <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" 
           style="text-decoration:none">
            <img src="http://go.microsoft.com/fwlink/?LinkId=161376" 
                 alt="Get Microsoft Silverlight" style="border-style:none"/>
        </a>
    </object>
    <iframe id="_sl_historyFrame" style="visibility:hidden; height:0px; 
       width:0px; border:0px"></iframe>
</div>
EZFDYMGT5JFS

Tuesday, October 15, 2013

InfoPath 2013 - QB Passer Rating Form


Continuing my series of QB Rating apps, a colleague challenged me to create a no-code InfoPath form to calculate a QB's NFL and NCAA passing efficiency ratings.  Here is the resulting form, which uses only declarative validation and action rules.  This form can be published to a shared network drive or SharePoint form library.  The SharePoint 2013 QB Rating App and Excel QB Rating Spreadsheet are also available.
Download QBRatingForm.xsn (16K)
View MSDN Sample

Features

  • InfoPath 2013 no-code form (rules-based)
  • SharePoint 2013 form library compatible
  • Publishable to full client, filler and browser 
  • Calculates both NFL and NCAA ratings
  • Shows detailed calculation formula & steps

Screenshots

The following screenshots show the final form, design mode in InfoPath Designer, declarative rules and the form's fields schema:





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.