Method PostMaintainUserDefInfo

Summary

Maintain User Defined Info

Requires

Input Parameters

NameTypeLengthDescription
function System.String 1 Function U=Update Record by Location, D=Delete Record by Location, P=Update Parcel User Defined, Q=Delete Parcel User Defined
locationID numeric 9 [Required] Location ID
userDefCode System.String 4 [Required] User defined code
userDefText System.String 40 User defined text. 40 chars max.
userDefDate mmddyy 6 User defined date. Format=MMddyy.
applCode System.String 2 Application code
subCode System.String 6 Sub code for user defined code
userDefNumber numeric 13 User defined number

Example

POST http://localhost/FusionServices/v3/Naviline/Land/MaintainUserDefInfo

Return Values

NameDescription
ErrorCode
NotUsed
LastChangedMonth
LastChangedDay
LastChangedYear
LastChangedUser

Sample Responses

Sample Code

using System.Net;

string uri = "http://localhost/FusionServices/v3/Naviline/Land/MaintainUserDefInfo";
System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 

postParms.Add("function",System.Web.HttpUtility.UrlEncode("P"));
postParms.Add("locationID",System.Web.HttpUtility.UrlEncode("49320"));
postParms.Add("userDefCode",System.Web.HttpUtility.UrlEncode("PCST"));
postParms.Add("userDefMonth",System.Web.HttpUtility.UrlEncode("4"));
postParms.Add("userDefDay",System.Web.HttpUtility.UrlEncode("1"));
postParms.Add("userDefYear",System.Web.HttpUtility.UrlEncode("17"));
postParms.Add("subCode",System.Web.HttpUtility.UrlEncode("0"));
postParms.Add("userDefNumber",System.Web.HttpUtility.UrlEncode("1899"));
using (WebClient req = new WebClient())
{
    byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
    string stringResult = Encoding.UTF8.GetString(responseBytes); 
    // TODO
}

C# Razor MVC Sample Code

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 PostMaintainUserDefInfo
   {
       // 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;}

       [Required(ErrorMessage = "Required")]
       [RegularExpression("[0-9]{0,9}", ErrorMessage = "Numeric values only. Must be 9 digits or less. ")]
       public string locationID{get; set;}

       [Required(ErrorMessage = "Required")]
       [RegularExpression("^(?=.{0,4}$).*", ErrorMessage = "Must be 4 characters or less. ")]
       public string userDefCode{get; set;}

       [RegularExpression("^(?=.{0,40}$).*", ErrorMessage = "Must be 40 characters or less. ")]
       public string userDefText{get; set;}

       [RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
       public string userDefDate{get; set;}

       [RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
       public string applCode{get; set;}

       [RegularExpression("^(?=.{0,6}$).*", ErrorMessage = "Must be 6 characters or less. ")]
       public string subCode{get; set;}

       [RegularExpression("[0-9]{0,13}", ErrorMessage = "Numeric values only. Must be 13 digits or less. ")]
       public string userDefNumber{get; set;}

       public PostMaintainUserDefInfo()
       {
           //Set any defaults here
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostMaintainUserDefInfo 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.PostMaintainUserDefInfo

@{
   ViewBag.Title = "PostMaintainUserDefInfo";
}

<h2>PostMaintainUserDefInfo</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>PostMaintainUserDefInfo</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.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.userDefText)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.userDefText)
           @Html.ValidationMessageFor(model => model.userDefText)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.userDefDate)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.userDefDate)
           @Html.ValidationMessageFor(model => model.userDefDate)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.applCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.applCode)
           @Html.ValidationMessageFor(model => model.applCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.subCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.subCode)
           @Html.ValidationMessageFor(model => model.subCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.userDefNumber)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.userDefNumber)
           @Html.ValidationMessageFor(model => model.userDefNumber)
       </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/PostMaintainUserDefInfo
public ActionResult PostMaintainUserDefInfo()
{
   // Create a new instance of the model to pick up any default values.
   PostMaintainUserDefInfo model =  new PostMaintainUserDefInfo();

   // pass model to set to default values
   // NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
   return View("~/Views/MyFolderPath/PostMaintainUserDefInfo.cshtml", model);
}

// 
// POST: /MyController/PostMaintainUserDefInfo
[HttpPost]
public ActionResult PostMaintainUserDefInfo(FormCollection collection)
{
   string url = "v3/Naviline/Land/MaintainUserDefInfo";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("function", collection["function"]);
   inputParms.Add("locationID", collection["locationID"]);
   inputParms.Add("userDefCode", collection["userDefCode"]);
   inputParms.Add("userDefText", collection["userDefText"]);
   inputParms.Add("userDefDate", collection["userDefDate"]);
   inputParms.Add("applCode", collection["applCode"]);
   inputParms.Add("subCode", collection["subCode"]);
   inputParms.Add("userDefNumber", collection["userDefNumber"]);

   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", "PostMaintainUserDefInfo");
       return View("Error", info);
   }
}