Project Search
Name | Type | Length | Description |
---|---|---|---|
SearchType | System.String | 1 | [Required] Search Type. A=Address Search, D=Description search, N=Name search, L=Land Parcel Key search |
SearchKind | System.String | 1 | Search Kind. S=Single, M=Multiple |
StreetName | System.String | 25 | Street name |
StreetNumber | numeric | 7 | Street number |
StreetDirection | System.String | 2 | Street direction. Ex. N, NW, S, SW, E, W |
StreetSuffix | System.String | 4 | Street suffix. Ex. St, Ln, Ave |
Description | System.String | 50 | Project description |
ProjectName | System.String | 40 | [Required] Project name |
Year | numeric | 4 | Project Year. 4 digit year |
Parcel | System.String | 70 | [Required] Parcel Number. Format: 111111-222222-333333 |
rows | numeric | 4 | Number of rows to return. Defaults to 10 rows. |
PageNumber | numeric | 5 | Page number. Used with paging |
ApplicationID | numeric | 9 | Application ID. Used with paging |
LocationID | numeric | 9 | Location ID. Used with paging |
POST http://localhost/FusionServices/v3/Naviline/PlanningEngineering/SearchProjects
Name | Description |
---|---|
ErrorCode | 0000=Success |
ErrorMessage | Message returned with error code |
AddressFormatted | Address |
StreetName | Street Name |
StreetNumber | Street Number |
StreetDirection | Street Direction |
StreetSuffix | Street Suffix |
ZipCode | ZipCode |
ParcelFormatted | formatted Parcel number |
ParcelNumber01 | Parcel Number section 01 |
ParcelNumber02 | Parcel Number section 02 |
ParcelNumber03 | Parcel Number section 03 |
ParcelNumber04 | Parcel Number section 04 |
ParcelNumber05 | Parcel Number section 05 |
ParcelNumber06 | Parcel Number section 06 |
ParcelNumber07 | Parcel Number section 07 |
ParcelNumber08 | Parcel Number section 08 |
ParcelNumber09 | Parcel Number section 09 |
ParcelNumber10 | Parcel Number section 10 |
Year | Year |
Name | Name |
Description | Description |
NameType | Name Type |
DescriptionType | Description Type |
LocationID | Location ID |
ApplicationID | Application ID |
ControlNumber | Control Number |
TAPLCK0 | |
TAPLCK2 | |
TAPLCK3 | |
TAPLCK6 | |
TAPLCK7 | |
TAPLCKC | |
TAPLCKF | |
LandKey01 | Land Key section 01 |
LandKey02 | Land Key section 02 |
LandKey03 | Land Key section 03 |
LandKey04 | Land Key section 04 |
LandKey05 | Land Key section 05 |
LandKey06 | Land Key section 06 |
LandKey07 | Land Key section 07 |
LandKey08 | Land Key section 08 |
LandKey09 | Land Key section 09 |
LandKey10 | Land Key section 10 |
PageNumber | Page Number |
Rows | Rows |
MoreYN | More rows available? Y/N |
LastLocationID | Last Location ID returned. Pass this in to the then next call for paging. |
LastApplicationID | Last Application ID returned. Pass this in to the next call for paging. |
TotalRows | Total Rows returned |
WErrorCode | |
WErrorMessage |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/PlanningEngineering/SearchProjects";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("SearchType",System.Web.HttpUtility.UrlEncode("A"));
postParms.Add("SearchKind",System.Web.HttpUtility.UrlEncode("S"));
postParms.Add("StreetName",System.Web.HttpUtility.UrlEncode("fair"));
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 AddressFormatted = row["AddressFormatted"].ToString();
string StreetName = row["StreetName"].ToString();
string StreetNumber = row["StreetNumber"].ToString();
string StreetDirection = row["StreetDirection"].ToString();
string StreetSuffix = row["StreetSuffix"].ToString();
string ZipCode = row["ZipCode"].ToString();
string ParcelFormatted = row["ParcelFormatted"].ToString();
string ParcelNumber01 = row["ParcelNumber01"].ToString();
string ParcelNumber02 = row["ParcelNumber02"].ToString();
string ParcelNumber03 = row["ParcelNumber03"].ToString();
string ParcelNumber04 = row["ParcelNumber04"].ToString();
string ParcelNumber05 = row["ParcelNumber05"].ToString();
string ParcelNumber06 = row["ParcelNumber06"].ToString();
string ParcelNumber07 = row["ParcelNumber07"].ToString();
string ParcelNumber08 = row["ParcelNumber08"].ToString();
string ParcelNumber09 = row["ParcelNumber09"].ToString();
string ParcelNumber10 = row["ParcelNumber10"].ToString();
string Year = row["Year"].ToString();
string Name = row["Name"].ToString();
string Description = row["Description"].ToString();
string NameType = row["NameType"].ToString();
string DescriptionType = row["DescriptionType"].ToString();
string LocationID = row["LocationID"].ToString();
string ApplicationID = row["ApplicationID"].ToString();
string ControlNumber = row["ControlNumber"].ToString();
string TAPLCK0 = row["TAPLCK0"].ToString();
string TAPLCK2 = row["TAPLCK2"].ToString();
string TAPLCK3 = row["TAPLCK3"].ToString();
string TAPLCK6 = row["TAPLCK6"].ToString();
string TAPLCK7 = row["TAPLCK7"].ToString();
string TAPLCKC = row["TAPLCKC"].ToString();
string TAPLCKF = row["TAPLCKF"].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 PostSearchProjects
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string SearchType{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string SearchKind{get; set;}
[RegularExpression("^(?=.{0,25}$).*", ErrorMessage = "Must be 25 characters or less. ")]
public string StreetName{get; set;}
[RegularExpression("[0-9]{0,7}", ErrorMessage = "Numeric values only. Must be 7 digits or less. ")]
public string StreetNumber{get; set;}
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string StreetDirection{get; set;}
[RegularExpression("^(?=.{0,4}$).*", ErrorMessage = "Must be 4 characters or less. ")]
public string StreetSuffix{get; set;}
[RegularExpression("^(?=.{0,50}$).*", ErrorMessage = "Must be 50 characters or less. ")]
public string Description{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,40}$).*", ErrorMessage = "Must be 40 characters or less. ")]
public string ProjectName{get; set;}
[RegularExpression("[0-9]{0,4}", ErrorMessage = "Numeric values only. Must be 4 digits or less. ")]
public string Year{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,70}$).*", ErrorMessage = "Must be 70 characters or less. ")]
public string Parcel{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,5}", ErrorMessage = "Numeric values only. Must be 5 digits or less. ")]
public string PageNumber{get; set;}
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string ApplicationID{get; set;}
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string LocationID{get; set;}
public PostSearchProjects()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostSearchProjects 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.PostSearchProjects
@{
ViewBag.Title = "PostSearchProjects";
}
<h2>PostSearchProjects</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostSearchProjects</legend>
<div class="editor-label">
@Html.LabelFor(model => model.SearchType)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.SearchType)
@Html.ValidationMessageFor(model => model.SearchType)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.SearchKind)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.SearchKind)
@Html.ValidationMessageFor(model => model.SearchKind)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.StreetName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.StreetName)
@Html.ValidationMessageFor(model => model.StreetName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.StreetNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.StreetNumber)
@Html.ValidationMessageFor(model => model.StreetNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.StreetDirection)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.StreetDirection)
@Html.ValidationMessageFor(model => model.StreetDirection)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.StreetSuffix)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.StreetSuffix)
@Html.ValidationMessageFor(model => model.StreetSuffix)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Description)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Description)
@Html.ValidationMessageFor(model => model.Description)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.ProjectName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ProjectName)
@Html.ValidationMessageFor(model => model.ProjectName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Year)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Year)
@Html.ValidationMessageFor(model => model.Year)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Parcel)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Parcel)
@Html.ValidationMessageFor(model => model.Parcel)
</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.PageNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.PageNumber)
@Html.ValidationMessageFor(model => model.PageNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.ApplicationID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ApplicationID)
@Html.ValidationMessageFor(model => model.ApplicationID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.LocationID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.LocationID)
@Html.ValidationMessageFor(model => model.LocationID)
</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/PostSearchProjects
public ActionResult PostSearchProjects()
{
// Create a new instance of the model to pick up any default values.
PostSearchProjects model = new PostSearchProjects();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostSearchProjects.cshtml", model);
}
//
// POST: /MyController/PostSearchProjects
[HttpPost]
public ActionResult PostSearchProjects(FormCollection collection)
{
string url = "v3/Naviline/PlanningEngineering/SearchProjects";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("SearchType", collection["SearchType"]);
inputParms.Add("SearchKind", collection["SearchKind"]);
inputParms.Add("StreetName", collection["StreetName"]);
inputParms.Add("StreetNumber", collection["StreetNumber"]);
inputParms.Add("StreetDirection", collection["StreetDirection"]);
inputParms.Add("StreetSuffix", collection["StreetSuffix"]);
inputParms.Add("Description", collection["Description"]);
inputParms.Add("ProjectName", collection["ProjectName"]);
inputParms.Add("Year", collection["Year"]);
inputParms.Add("Parcel", collection["Parcel"]);
inputParms.Add("rows", collection["rows"]);
inputParms.Add("PageNumber", collection["PageNumber"]);
inputParms.Add("ApplicationID", collection["ApplicationID"]);
inputParms.Add("LocationID", collection["LocationID"]);
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", "PostSearchProjects");
return View("Error", info);
}
}