Search Licenses by Additional Requirements
Name | Type | Length | Description |
---|---|---|---|
TagCode | System.String | 2 | Tag Code |
TagNumber | System.String | 9 | Tag number |
Classification | System.String | 7 | License classification code |
rows | numeric | 4 | Number of rows to return by the search. Default is 8. |
lastLicYear | numeric | 2 | License Year of last record returned. Used with paging. |
lastLicNum | numeric | 8 | License Number of last record returned. Used with paging. |
lastDocNum | System.String | 15 | Document Number of last record returned. Used with paging. |
POST http://localhost/FusionServices/v2/Naviline/OccupationalLicense/LicenseTag
Name | Description |
---|---|
ErrorCode | 0000=Success |
ErrorMessage | Message returned with error code |
ControlNumber | |
LicenseYear | License Year |
LicenseNumber | License Number |
LicenseClassCode | License classification code |
LicenseClassDescription | Classification description |
IssueDate | Issue date. Format=MMddyyyy |
LicenseStatus | License status |
LicenseStatusDescription | Status description |
RenewThruDate | License renew Thru date. Format=MMddyyyy |
LicenseOpenPeriodFlag | License Open Period Flag |
AdditionalReqmtCode | Requirement code |
AdditionalReqmtDocNumber | Document number |
AdditionalReqmtDescription | Requirement description |
TagCode | Tag code |
TagNumber | Title number |
TagText | Tag Text |
TagDescription | Tag description |
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/LicenseTag";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("TagCode",System.Web.HttpUtility.UrlEncode("CI"));
WebClient req = new WebClient();
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
wc.Headers.Set("X-APPID", "YOURID");
wc.Headers.Set("X-APPKEY", "YOURKEY");
byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
string stringResult = Encoding.UTF8.GetString(responseBytes);
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 ControlNumber = row["ControlNumber"].ToString();
string LicenseYear = row["LicenseYear"].ToString();
string LicenseNumber = row["LicenseNumber"].ToString();
string LicenseClassCode = row["LicenseClassCode"].ToString();
string LicenseClassDescription = row["LicenseClassDescription"].ToString();
string IssueDate = row["IssueDate"].ToString();
string LicenseStatus = row["LicenseStatus"].ToString();
string LicenseStatusDescription = row["LicenseStatusDescription"].ToString();
string RenewThruDate = row["RenewThruDate"].ToString();
string LicenseOpenPeriodFlag = row["LicenseOpenPeriodFlag"].ToString();
string AdditionalReqmtCode = row["AdditionalReqmtCode"].ToString();
string AdditionalReqmtDocNumber = row["AdditionalReqmtDocNumber"].ToString();
string AdditionalReqmtDescription = row["AdditionalReqmtDescription"].ToString();
string TagCode = row["TagCode"].ToString();
string TagNumber = row["TagNumber"].ToString();
string TagText = row["TagText"].ToString();
string TagDescription = row["TagDescription"].ToString();
string InternetUseFlag = row["InternetUseFlag"].ToString();
// TODO - YOUR CODE HERE
}
}
}
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 PostSearchLicenseByTag
{
// Add property for each input param in order to map a field to it
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string TagCode{get; set;}
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string TagNumber{get; set;}
[RegularExpression("^(?=.{0,7}$).*", ErrorMessage = "Must be 7 characters or less. ")]
public string Classification{get; set;}
[RegularExpression("[0-9]{0,4}", ErrorMessage = "Numeric values only. Must be 4 digits or less. ")]
public string rows{get; set;}
[RegularExpression("[0-9]{0,2}", ErrorMessage = "Numeric values only. Must be 2 digits or less. ")]
public string lastLicYear{get; set;}
[RegularExpression("[0-9]{0,8}", ErrorMessage = "Numeric values only. Must be 8 digits or less. ")]
public string lastLicNum{get; set;}
[RegularExpression("^(?=.{0,15}$).*", ErrorMessage = "Must be 15 characters or less. ")]
public string lastDocNum{get; set;}
public PostSearchLicenseByTag()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostSearchLicenseByTag 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.PostSearchLicenseByTag
@{
ViewBag.Title = "PostSearchLicenseByTag";
}
<h2>PostSearchLicenseByTag</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostSearchLicenseByTag</legend>
<div class="editor-label">
@Html.LabelFor(model => model.TagCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.TagCode)
@Html.ValidationMessageFor(model => model.TagCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.TagNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.TagNumber)
@Html.ValidationMessageFor(model => model.TagNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Classification)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Classification)
@Html.ValidationMessageFor(model => model.Classification)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.rows)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.rows)
@Html.ValidationMessageFor(model => model.rows)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.lastLicYear)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.lastLicYear)
@Html.ValidationMessageFor(model => model.lastLicYear)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.lastLicNum)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.lastLicNum)
@Html.ValidationMessageFor(model => model.lastLicNum)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.lastDocNum)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.lastDocNum)
@Html.ValidationMessageFor(model => model.lastDocNum)
</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/PostSearchLicenseByTag
public ActionResult PostSearchLicenseByTag()
{
// Create a new instance of the model to pick up any default values.
PostSearchLicenseByTag model = new PostSearchLicenseByTag();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostSearchLicenseByTag.cshtml", model);
}
//
// POST: /MyController/PostSearchLicenseByTag
[HttpPost]
public ActionResult PostSearchLicenseByTag(FormCollection collection)
{
string url = "v2/Naviline/OccupationalLicense/LicenseTag";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("TagCode", collection["TagCode"]);
inputParms.Add("TagNumber", collection["TagNumber"]);
inputParms.Add("Classification", collection["Classification"]);
inputParms.Add("rows", collection["rows"]);
inputParms.Add("lastLicYear", collection["lastLicYear"]);
inputParms.Add("lastLicNum", collection["lastLicNum"]);
inputParms.Add("lastDocNum", collection["lastDocNum"]);
try
{
// Send the request
FusionServiceRequest request = new FusionServiceRequest();
FusionServiceResult result = request.Post(url, inputParms);
return View("Result", result);
}
catch(Exception e)
{
HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "PostSearchLicenseByTag");
return View("Error", info);
}
}