Method PostUpdateBusinessOwner

Summary

Update Business Owner

Remarks

Update the Business Owner information.

Get the current info from GetBusinessOwner.

Pass in the current values for any field that isn't changing.

Input Parameters

NameTypeLengthDescription
controlNumber numeric 7 [Required] Business control number.
locationNumber numeric 9 [Required] Location number
changeDate mmddyy 6 Change date in MMddyy format. Defaults to current date.
changeTime hhmmss 8 Change time in HHmmss format. Defaults to current time.
businessAddress System.String 48 Business address
businessCitySTZip System.String 40 Business city, ST Zip line. Leave blank to have it format based on zip code.
mailAddressLine1 System.String 30 [Required] Mailing address line 1
mailAddressLine2 System.String 30 Mailing address line 2
mailCitySTZip System.String 40 Mailing city, ST Zip line. Leave blank to have it format based on zip code.
mailZipCode System.String 9 [Required] Mailing Zip code
mailDeliveryPoint System.String 3 Mailing address delivery point
businessPhone System.String 10 Business Phone number including area code. Ex. 111-222-3333
emergencyPhone System.String 10 Emergency Phone number including area code. Ex. 111-222-3333
ownerName System.String 50 Owner name
ownerAddressLine1 System.String 30 Owner address line 1
ownerAddressLine2 System.String 30 Owner address line 2
ownerAddressLine3 System.String 30 Owner address line 3
ownerCitySTZip System.String 40 Owner city, ST Zip line. Leave blank to have it format based on zip code.
ownerZipCode System.String 9 [Required] Owner Zip code
ownerDeliveryPoint System.String 3 Mailing address delivery point
ownerPhone System.String 10 Owner Phone number including area code. Ex. 111-222-3333

Example

POST http://localhost/FusionServices/v2/Naviline/OccupationalLicense/UpdateBusinessOwner

Return Values

NameDescription
ChangeDate Change Date
ChangeTime Change Time
BusinessName Business Name
LocationNumber Location Number
BusinessAddress Business Address
BusinessCityStateZip City, State Zip for business
BusinessMailingAddressLine1 Mailing Address line 1 for business
BusinessMailingAddressLine2 Mailing Address line 2 for business
BusinessMailingCityStateZip Mailing Address City, State Zip for business
BusinessMailingZipCode Zip code for business
BusinessMailingDeliveryPoint Delivery point for business
BusinessAreaCode Area Code for businesss phone number
BusinessPhoneNumber Phone Number for business
EmergencyAreaCode Area Code for emergency phone number
EmergencyPhoneNumber Phone Number for emergency
OwnerName Name of business owner
OwnerAddressLine1 Address line 1 for business owner
OwnerAddressLine2 Address line 2 for business owner
OwnerAddressLine3 Address line 3 for business owner
OwnerCityStateZip City, State Zip for business owner
OwnerZipCode Zip code for business owner
OwnerDeliveryPoint Delivery point for business owner
OwnerAreaCode Area Code for business owner phone number
OwnerPhoneNumber Phone Number for business owner
Action C=Changed

Sample Responses

Sample Code

using System.Net;
using Newtonsoft.Json.Linq;

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/UpdateBusinessOwner";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("controlNumber",System.Web.HttpUtility.UrlEncode("3249"));
   postParms.Add("locationNumber",System.Web.HttpUtility.UrlEncode("30526"));
   postParms.Add("businessAddress",System.Web.HttpUtility.UrlEncode("5 SAINT ANDREWS CIR"));
   postParms.Add("mailAddressLine1",System.Web.HttpUtility.UrlEncode("5 SAINT ANDREWS CIR"));
   postParms.Add("mailAddressLine2",System.Web.HttpUtility.UrlEncode("Suite 301"));
   postParms.Add("mailZipCode",System.Web.HttpUtility.UrlEncode("759019999"));
   postParms.Add("businessPhone",System.Web.HttpUtility.UrlEncode("706-345-5674"));
   postParms.Add("emergencyPhone",System.Web.HttpUtility.UrlEncode("1112224444"));
   postParms.Add("ownerName",System.Web.HttpUtility.UrlEncode("EVANGIL RAVENSKI"));
   postParms.Add("ownerAddressLine1",System.Web.HttpUtility.UrlEncode("451 ARBOR DRIVE"));
   postParms.Add("ownerZipCode",System.Web.HttpUtility.UrlEncode("32746"));
   postParms.Add("ownerPhone",System.Web.HttpUtility.UrlEncode("5556667777"));

   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
   }
}

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 PostUpdateBusinessOwner
   {
       // Add property for each input param in order to map a field to it
       [Required(ErrorMessage = "Required")]
       [RegularExpression("[0-9]{0,7}", ErrorMessage = "Numeric values only. Must be 7 digits or less. ")]
       public string controlNumber{get; set;}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@{
   ViewBag.Title = "PostUpdateBusinessOwner";
}

<h2>PostUpdateBusinessOwner</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>PostUpdateBusinessOwner</legend>
       <div class="editor-label">
           @Html.LabelFor(model => model.controlNumber)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.controlNumber)
           @Html.ValidationMessageFor(model => model.controlNumber)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.locationNumber)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.locationNumber)
           @Html.ValidationMessageFor(model => model.locationNumber)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.changeDate)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.changeDate)
           @Html.ValidationMessageFor(model => model.changeDate)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.changeTime)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.changeTime)
           @Html.ValidationMessageFor(model => model.changeTime)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.businessAddress)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.businessAddress)
           @Html.ValidationMessageFor(model => model.businessAddress)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.businessCitySTZip)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.businessCitySTZip)
           @Html.ValidationMessageFor(model => model.businessCitySTZip)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.mailAddressLine1)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.mailAddressLine1)
           @Html.ValidationMessageFor(model => model.mailAddressLine1)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.mailAddressLine2)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.mailAddressLine2)
           @Html.ValidationMessageFor(model => model.mailAddressLine2)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.mailCitySTZip)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.mailCitySTZip)
           @Html.ValidationMessageFor(model => model.mailCitySTZip)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.mailZipCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.mailZipCode)
           @Html.ValidationMessageFor(model => model.mailZipCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.mailDeliveryPoint)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.mailDeliveryPoint)
           @Html.ValidationMessageFor(model => model.mailDeliveryPoint)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.businessPhone)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.businessPhone)
           @Html.ValidationMessageFor(model => model.businessPhone)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.emergencyPhone)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.emergencyPhone)
           @Html.ValidationMessageFor(model => model.emergencyPhone)
       </div>
       <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.ownerAddressLine1)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerAddressLine1)
           @Html.ValidationMessageFor(model => model.ownerAddressLine1)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.ownerAddressLine2)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerAddressLine2)
           @Html.ValidationMessageFor(model => model.ownerAddressLine2)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.ownerAddressLine3)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerAddressLine3)
           @Html.ValidationMessageFor(model => model.ownerAddressLine3)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.ownerCitySTZip)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerCitySTZip)
           @Html.ValidationMessageFor(model => model.ownerCitySTZip)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.ownerZipCode)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerZipCode)
           @Html.ValidationMessageFor(model => model.ownerZipCode)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.ownerDeliveryPoint)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerDeliveryPoint)
           @Html.ValidationMessageFor(model => model.ownerDeliveryPoint)
       </div>
       <div class="editor-label">
           @Html.LabelFor(model => model.ownerPhone)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.ownerPhone)
           @Html.ValidationMessageFor(model => model.ownerPhone)
       </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/PostUpdateBusinessOwner
public ActionResult PostUpdateBusinessOwner()
{
   // Create a new instance of the model to pick up any default values.
   PostUpdateBusinessOwner model =  new PostUpdateBusinessOwner();

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

// 
// POST: /MyController/PostUpdateBusinessOwner
[HttpPost]
public ActionResult PostUpdateBusinessOwner(FormCollection collection)
{
   string url = "v2/Naviline/OccupationalLicense/UpdateBusinessOwner";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("controlNumber", collection["controlNumber"]);
   inputParms.Add("locationNumber", collection["locationNumber"]);
   inputParms.Add("changeDate", collection["changeDate"]);
   inputParms.Add("changeTime", collection["changeTime"]);
   inputParms.Add("businessAddress", collection["businessAddress"]);
   inputParms.Add("businessCitySTZip", collection["businessCitySTZip"]);
   inputParms.Add("mailAddressLine1", collection["mailAddressLine1"]);
   inputParms.Add("mailAddressLine2", collection["mailAddressLine2"]);
   inputParms.Add("mailCitySTZip", collection["mailCitySTZip"]);
   inputParms.Add("mailZipCode", collection["mailZipCode"]);
   inputParms.Add("mailDeliveryPoint", collection["mailDeliveryPoint"]);
   inputParms.Add("businessPhone", collection["businessPhone"]);
   inputParms.Add("emergencyPhone", collection["emergencyPhone"]);
   inputParms.Add("ownerName", collection["ownerName"]);
   inputParms.Add("ownerAddressLine1", collection["ownerAddressLine1"]);
   inputParms.Add("ownerAddressLine2", collection["ownerAddressLine2"]);
   inputParms.Add("ownerAddressLine3", collection["ownerAddressLine3"]);
   inputParms.Add("ownerCitySTZip", collection["ownerCitySTZip"]);
   inputParms.Add("ownerZipCode", collection["ownerZipCode"]);
   inputParms.Add("ownerDeliveryPoint", collection["ownerDeliveryPoint"]);
   inputParms.Add("ownerPhone", collection["ownerPhone"]);

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