Licenses by Date
Name | Type | Length | Description |
---|---|---|---|
startDate | mmddyyyy | 8 | Start Date |
endDate | mmddyyyy | 8 | End Date. |
GET http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicensesByDate/{startDate}/{endDate}
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/LicensesByDate/07261994/05021996";
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/LicensesByDate/07261994/05021996', 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 GetLicensesByDate
{
// Add property for each input param in order to map a field to it
[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;}
[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 endDate{get; set;}
public GetLicensesByDate()
{
//Set any defaults here
startDate = DefaultData.Get("startDate");
endDate = DefaultData.Get("endDate");
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the GetLicensesByDate 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.GetLicensesByDate
@{
ViewBag.Title = "GetLicensesByDate";
string myUrl = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicensesByDate/" + Model.startDate + "/" + Model.endDate;
}
<h2>GetLicensesByDate</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>GetLicensesByDate</legend>
<div class="editor-label">Use the fields below to change the values and resubmit.</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>
<div class="editor-label">
@Html.LabelFor(model => model.endDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.endDate)
@Html.ValidationMessageFor(model => model.endDate)
</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/GetLicensesByDate
public ActionResult GetLicensesByDate()
{
// Create a new instance of the model to pick up any default values.
GetLicensesByDate model = new GetLicensesByDate();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/GetLicensesByDate.cshtml", model);
}
//
// POST: /MyController/GetLicensesByDate
[HttpPost]
public ActionResult GetLicensesByDate(FormCollection collection)
{
string url = "v2/Naviline/OccupationalLicense/LicensesByDate/{startDate}/{endDate}";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("startDate", collection["startDate"]);
inputParms.Add("endDate", collection["endDate"]);
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", "GetLicensesByDate");
return View("Error", info);
}
}