Update Renewal Information
Name | Type | Length | Description |
---|---|---|---|
licenseYear | System.String | 2 | [Required] License year |
licenseNumber | System.String | 8 | [Required] License number |
function | System.String | 1 | [Required] What function the API will perform: X=Clears holding files, G=Stores general license info, C=Stores additional charge, R=Stores additional requirement, T=Stores calculation totals, W=Writes renewal from holding files to NaviLine Business Licenses |
grossReceipts | System.String | 11 | Gross receipts |
renewDate | System.String | 8 | [Required] Renewal Date (format MMDDYYYY) |
renewPeriod | System.String | 1 | [Required] Renewal Period: Y or L=Yearly, H=Half-Year, Q=Quarterly, M=Monthly |
outCode | System.String | 10 | Additional Charge or Additional Requirement Code, Input for “C” and “R” function, so it can write an additional charge record |
unitCharge | System.String | 10 | Unit Charge: Input for “C” function, so it can write an additional charge record |
unitMeasure | System.String | 2 | Unit of Measure:Input for “C” function, so it can write an additional charge record |
quantity | System.String | 9 | CHG Quantity Input for “C” function, so it can write an additional charge record |
docName | System.String | 15 | Document name:Input for “R” function, so it can write an additional requirement record |
docExpDate | System.String | 8 | Expiration Date (format MMDDYYYY) |
renewPeriod | System.String | 1 | Renewal Period: Y or L=Yearly, H=Half-Year, Q=Quarterly, M=Monthly |
applName | System.String | 30 | Applicant name |
applAddress1 | System.String | 30 | Applicant address 1 |
applAddress2 | System.String | 30 | Applicant address 2 |
applAddress3 | System.String | 30 | Applicant address 3 |
applZip | System.String | 9 | Applicant zip code |
applAreaCode | System.String | 3 | Applicant area code |
applPhone | System.String | 7 | Applicant phone number |
applEmail | System.String | 50 | Applicant eMail address |
POST http://localhost/FusionServices/v3/Naviline/OccupationalLicense/UpdateRenewalInformation
Name | Description |
---|---|
ErrorCode | 0000 |
ErrorMessage | |
LicenseYear | 21 |
LicenseNumber | 00001149 |
BaseFee | 000000000 |
Exemption | 000000000 |
Penalty | 000000000 |
Interest | 000000000 |
AdditionalCharge | 000000000 |
Total | 000000000 |
MinimumCharge | |
FeePercent | 000 |
ChargePercent | 00000 |
OverDuePeriodFlag | N |
ChangeGrossReceiptsFlag |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/OccupationalLicense/UpdateRenewalInformation";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("licenseYear",System.Web.HttpUtility.UrlEncode("21"));
postParms.Add("licenseNumber",System.Web.HttpUtility.UrlEncode("00001149"));
postParms.Add("function",System.Web.HttpUtility.UrlEncode("X"));
postParms.Add("grossReceipts",System.Web.HttpUtility.UrlEncode("1000"));
postParms.Add("renewDate",System.Web.HttpUtility.UrlEncode("12202021"));
postParms.Add("renewPeriod",System.Web.HttpUtility.UrlEncode("Y"));
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")
{
// 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 PostUpdateRenewalInformation
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string licenseYear{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,8}$).*", ErrorMessage = "Must be 8 characters or less. ")]
public string licenseNumber{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string function{get; set;}
[RegularExpression("^(?=.{0,11}$).*", ErrorMessage = "Must be 11 characters or less. ")]
public string grossReceipts{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,8}$).*", ErrorMessage = "Must be 8 characters or less. ")]
public string renewDate{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string renewPeriod{get; set;}
[RegularExpression("^(?=.{0,10}$).*", ErrorMessage = "Must be 10 characters or less. ")]
public string outCode{get; set;}
[RegularExpression("^(?=.{0,10}$).*", ErrorMessage = "Must be 10 characters or less. ")]
public string unitCharge{get; set;}
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string unitMeasure{get; set;}
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string quantity{get; set;}
[RegularExpression("^(?=.{0,15}$).*", ErrorMessage = "Must be 15 characters or less. ")]
public string docName{get; set;}
[RegularExpression("^(?=.{0,8}$).*", ErrorMessage = "Must be 8 characters or less. ")]
public string docExpDate{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string renewPeriod{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string applName{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string applAddress1{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string applAddress2{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string applAddress3{get; set;}
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string applZip{get; set;}
[RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
public string applAreaCode{get; set;}
[RegularExpression("^(?=.{0,7}$).*", ErrorMessage = "Must be 7 characters or less. ")]
public string applPhone{get; set;}
[RegularExpression("^(?=.{0,50}$).*", ErrorMessage = "Must be 50 characters or less. ")]
public string applEmail{get; set;}
public PostUpdateRenewalInformation()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostUpdateRenewalInformation 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.PostUpdateRenewalInformation
@{
ViewBag.Title = "PostUpdateRenewalInformation";
}
<h2>PostUpdateRenewalInformation</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostUpdateRenewalInformation</legend>
<div class="editor-label">
@Html.LabelFor(model => model.licenseYear)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.licenseYear)
@Html.ValidationMessageFor(model => model.licenseYear)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.licenseNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.licenseNumber)
@Html.ValidationMessageFor(model => model.licenseNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.function)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.function)
@Html.ValidationMessageFor(model => model.function)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.grossReceipts)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.grossReceipts)
@Html.ValidationMessageFor(model => model.grossReceipts)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.renewDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.renewDate)
@Html.ValidationMessageFor(model => model.renewDate)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.renewPeriod)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.renewPeriod)
@Html.ValidationMessageFor(model => model.renewPeriod)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.outCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.outCode)
@Html.ValidationMessageFor(model => model.outCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.unitCharge)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.unitCharge)
@Html.ValidationMessageFor(model => model.unitCharge)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.unitMeasure)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.unitMeasure)
@Html.ValidationMessageFor(model => model.unitMeasure)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.quantity)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.quantity)
@Html.ValidationMessageFor(model => model.quantity)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.docName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.docName)
@Html.ValidationMessageFor(model => model.docName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.docExpDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.docExpDate)
@Html.ValidationMessageFor(model => model.docExpDate)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.renewPeriod)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.renewPeriod)
@Html.ValidationMessageFor(model => model.renewPeriod)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applName)
@Html.ValidationMessageFor(model => model.applName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applAddress1)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applAddress1)
@Html.ValidationMessageFor(model => model.applAddress1)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applAddress2)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applAddress2)
@Html.ValidationMessageFor(model => model.applAddress2)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applAddress3)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applAddress3)
@Html.ValidationMessageFor(model => model.applAddress3)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applZip)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applZip)
@Html.ValidationMessageFor(model => model.applZip)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applAreaCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applAreaCode)
@Html.ValidationMessageFor(model => model.applAreaCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applPhone)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applPhone)
@Html.ValidationMessageFor(model => model.applPhone)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applEmail)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applEmail)
@Html.ValidationMessageFor(model => model.applEmail)
</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/PostUpdateRenewalInformation
public ActionResult PostUpdateRenewalInformation()
{
// Create a new instance of the model to pick up any default values.
PostUpdateRenewalInformation model = new PostUpdateRenewalInformation();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostUpdateRenewalInformation.cshtml", model);
}
//
// POST: /MyController/PostUpdateRenewalInformation
[HttpPost]
public ActionResult PostUpdateRenewalInformation(FormCollection collection)
{
string url = "v3/Naviline/OccupationalLicense/UpdateRenewalInformation";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("licenseYear", collection["licenseYear"]);
inputParms.Add("licenseNumber", collection["licenseNumber"]);
inputParms.Add("function", collection["function"]);
inputParms.Add("grossReceipts", collection["grossReceipts"]);
inputParms.Add("renewDate", collection["renewDate"]);
inputParms.Add("renewPeriod", collection["renewPeriod"]);
inputParms.Add("outCode", collection["outCode"]);
inputParms.Add("unitCharge", collection["unitCharge"]);
inputParms.Add("unitMeasure", collection["unitMeasure"]);
inputParms.Add("quantity", collection["quantity"]);
inputParms.Add("docName", collection["docName"]);
inputParms.Add("docExpDate", collection["docExpDate"]);
inputParms.Add("renewPeriod", collection["renewPeriod"]);
inputParms.Add("applName", collection["applName"]);
inputParms.Add("applAddress1", collection["applAddress1"]);
inputParms.Add("applAddress2", collection["applAddress2"]);
inputParms.Add("applAddress3", collection["applAddress3"]);
inputParms.Add("applZip", collection["applZip"]);
inputParms.Add("applAreaCode", collection["applAreaCode"]);
inputParms.Add("applPhone", collection["applPhone"]);
inputParms.Add("applEmail", collection["applEmail"]);
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", "PostUpdateRenewalInformation");
return View("Error", info);
}
}