User Defined Info Inquiry
Name | Type | Length | Description |
---|---|---|---|
function | System.String | 1 | Function Blank=Chain by Location ID, E=Read by Location ID, P=Chain by Parcel ID, Q=Chain by Parcel ID |
order | System.String | 1 | Order by: Blank=Parcel, L=Location |
locationID | numeric | 9 | [Required] Location ID |
userDefCode | System.String | 4 | User defined code |
masterParcelCode | System.String | 10 | M=Master, P=Parcel |
POST http://localhost/FusionServices/v3/Naviline/Land/UserDefInfoInq
Name | Description |
---|---|
ErrorCode | |
UserDefinedText | |
ApplicationCode | |
SubCode | |
LastChangedUser |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/Land/UserDefInfoInq";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("order",System.Web.HttpUtility.UrlEncode("L"));
postParms.Add("locationID",System.Web.HttpUtility.UrlEncode("49310"));
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 PostUserDefInfoInq
{
// Add property for each input param in order to map a field to it
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string function{get; set;}
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string order{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
public string locationID{get; set;}
[RegularExpression("^(?=.{0,4}$).*", ErrorMessage = "Must be 4 characters or less. ")]
public string userDefCode{get; set;}
[RegularExpression("^(?=.{0,10}$).*", ErrorMessage = "Must be 10 characters or less. ")]
public string masterParcelCode{get; set;}
public PostUserDefInfoInq()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostUserDefInfoInq 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.PostUserDefInfoInq
@{
ViewBag.Title = "PostUserDefInfoInq";
}
<h2>PostUserDefInfoInq</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostUserDefInfoInq</legend>
<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.order)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.order)
@Html.ValidationMessageFor(model => model.order)
</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>
<div class="editor-label">
@Html.LabelFor(model => model.userDefCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.userDefCode)
@Html.ValidationMessageFor(model => model.userDefCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.masterParcelCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.masterParcelCode)
@Html.ValidationMessageFor(model => model.masterParcelCode)
</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/PostUserDefInfoInq
public ActionResult PostUserDefInfoInq()
{
// Create a new instance of the model to pick up any default values.
PostUserDefInfoInq model = new PostUserDefInfoInq();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostUserDefInfoInq.cshtml", model);
}
//
// POST: /MyController/PostUserDefInfoInq
[HttpPost]
public ActionResult PostUserDefInfoInq(FormCollection collection)
{
string url = "v3/Naviline/Land/UserDefInfoInq";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("function", collection["function"]);
inputParms.Add("order", collection["order"]);
inputParms.Add("locationID", collection["locationID"]);
inputParms.Add("userDefCode", collection["userDefCode"]);
inputParms.Add("masterParcelCode", collection["masterParcelCode"]);
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", "PostUserDefInfoInq");
return View("Error", info);
}
}