Searches permits by owner name and return type
Name | Type | Length | Description |
---|---|---|---|
OwnerName | System.String | 30 | [Required] Name to search on |
ReturnType | System.String | 1 | Default="O" BLANK(" ")=Both Open/Closed, O=Open Only, C=Closed |
rows | numberic | 3 | Number of rows to return |
POST http://localhost/FusionServices/v3/Naviline/Permit/Application/Search/ByName
Name | Description |
---|---|
ApplicationYear | Year permit application was submitted. This is the first part of the application number |
ApplicationNumber | Number assigned to the application. |
StreetNumber | Street address number |
StreetDirectionCode | 2 digit code indicating street direction: N,S,E,W,NE,NW,SE,SW |
StreetName | Street name portion of the address |
StreetSuffix | 4 character street suffix. I.e. Bay, Dr, Lane, Rd, Way |
Name | Name found for the application |
NameTypeCode | Indicates who's name was returned. AC=Alternate Contact AP=Applicant CT=Contractor OW=Owner PC=Primary Contact SC=Subcontractor. Other values may be defined. |
ParcelCrossRef | |
ParcelNo1-10 | Set of digits in the Parcel ID. I.e. 1111-222-33-444-5 up to 10 sets of numbers. |
ApplicationTypeDesc | Description for what type of permit application this is. |
UserStatusCodeDesc | Application status. Description is maintained by the city. |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms){
string uri = "http://localhost/FusionServices/v2/Naviline/Permit/Application/Search/ByName";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("ownerName",System.Web.HttpUtility.UrlEncode("A"));
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 PostSearchByName
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string OwnerName{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string ReturnType{get; set;}
[RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
public string rows{get; set;}
public PostSearchByName()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostSearchByName 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.PostSearchByName
@{
ViewBag.Title = "PostSearchByName";
}
<h2>PostSearchByName</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostSearchByName</legend>
<div class="editor-label">
@Html.LabelFor(model => model.OwnerName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.OwnerName)
@Html.ValidationMessageFor(model => model.OwnerName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.ReturnType)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ReturnType)
@Html.ValidationMessageFor(model => model.ReturnType)
</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>
<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/PostSearchByName
public ActionResult PostSearchByName()
{
// Create a new instance of the model to pick up any default values.
PostSearchByName model = new PostSearchByName();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostSearchByName.cshtml", model);
}
//
// POST: /MyController/PostSearchByName
[HttpPost]
public ActionResult PostSearchByName(FormCollection collection)
{
string url = "v3/Naviline/Permit/Application/Search/ByName";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("OwnerName", collection["OwnerName"]);
inputParms.Add("ReturnType", collection["ReturnType"]);
inputParms.Add("rows", collection["rows"]);
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", "PostSearchByName");
return View("Error", info);
}
}