License Class by Date
Name | Type | Length | Description |
---|---|---|---|
licenseClass | System.String | 7 | License Class. License classification code. |
startDate | mmddyyyy | 8 | Start Date |
GET http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicenseClassByDate/{licenseClass}/{startDate}
Name | Description |
---|---|
ErrorCode | 0000=Success |
ErrorMessage | Message returned with error code |
SNLCB | |
LicenseYear | License Year |
LicenseNumber | License Number |
ClassCode | License classification code |
ClassDescription | Classification description |
LicenseRenewThruDate | License renew Thru date. Format=MMddyyyy |
LicenseOpenPeriodFlag | License Open Period Flag |
InternetUseFlag | Internet Use Flag |
MOREYN | More Rows available Y/N |
ROWS | Row count returned |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicenseClassByDate/501/07262014";
WebClient wc = new WebClient();
wc.Headers.Set("X-APPID", "YOURID");
wc.Headers.Set("X-APPKEY", "YOURKEY");
string stringResult = wc.DownloadString(new Uri(uri));
JObject response = JObject.Parse(stringResult);
string error = response["OutputParms"]["ErrorCode"].ToString();
if (error == "0000")
{
JArray jRows = (JArray)response["Rows"];
foreach (JObject row in jRows)
{
string SNLCB = row["SNLCB"].ToString();
string LicenseYear = row["LicenseYear"].ToString();
string LicenseNumber = row["LicenseNumber"].ToString();
string ClassCode = row["ClassCode"].ToString();
string ClassDescription = row["ClassDescription"].ToString();
string IssueDate = row["IssueDate"].ToString();
string LicenseStatusCode = row["LicenseStatusCode"].ToString();
string LicenseStatusDescription = row["LicenseStatusDescription"].ToString();
string LicenseRenewThruDate = row["LicenseRenewThruDate"].ToString();
string LicenseOpenPeriodFlag = row["LicenseOpenPeriodFlag"].ToString();
string InternetUseFlag = row["InternetUseFlag"].ToString();
// TODO - YOUR CODE HERE
}
}
}
$.get('http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicenseClassByDate/501/07262014', function(response) {
$('#resultDiv).html(response);
});
using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;
// NOTE: Use the namespace generated when you add the class, so that it is correct.
namespace FusionRazor.Models
{
public class GetLicenseClassByDate
{
// Add property for each input param in order to map a field to it
[RegularExpression("^(?=.{0,7}$).*", ErrorMessage = "Must be 7 characters or less. ")]
public string licenseClass{get; set;}
[RegularExpression("^(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])(19|20)\\d\\d$", ErrorMessage = "Date values only. Format: MMDDYYYY")]
public string startDate{get; set;}
public GetLicenseClassByDate()
{
//Set any defaults here
licenseClass = DefaultData.Get("licenseClass");
startDate = DefaultData.Get("startDate");
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the GetLicenseClassByDate class. *@
@* NOTE: Select Edit as the Scaffold template. *@
@* NOTE: Use the @model line that is generated at the top. Replace the rest with the lines below.
@model FusionRazor.Models.GetLicenseClassByDate
@{
ViewBag.Title = "GetLicenseClassByDate";
string myUrl = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicenseClassByDate/" + Model.licenseClass + "/" + Model.startDate;
}
<h2>GetLicenseClassByDate</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>GetLicenseClassByDate</legend>
<div class="editor-label">Use the fields below to change the values and resubmit.</div>
<div class="editor-label">
@Html.LabelFor(model => model.licenseClass)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.licenseClass)
@Html.ValidationMessageFor(model => model.licenseClass)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.startDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.startDate)
@Html.ValidationMessageFor(model => model.startDate)
</div>
<p>
<input type="submit" value="Submit"/>
</p>
</fieldset>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FusionServiceHelper.Models;
// NOTE: Replace 'MyController' with the name of your controller.
//
// GET: /MyController/GetLicenseClassByDate
public ActionResult GetLicenseClassByDate()
{
// Create a new instance of the model to pick up any default values.
GetLicenseClassByDate model = new GetLicenseClassByDate();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/GetLicenseClassByDate.cshtml", model);
}
//
// POST: /MyController/GetLicenseClassByDate
[HttpPost]
public ActionResult GetLicenseClassByDate(FormCollection collection)
{
string url = "v2/Naviline/OccupationalLicense/LicenseClassByDate/{licenseClass}/{startDate}";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("licenseClass", collection["licenseClass"]);
inputParms.Add("startDate", collection["startDate"]);
try
{
// Send the request
FusionServiceRequest request = new FusionServiceRequest();
FusionServiceResult result = request.Get(url, inputParms);
return View("Result", result);
}
catch(Exception e)
{
HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "GetLicenseClassByDate");
return View("Error", info);
}
}