Update Business Officer
Name | Type | Length | Description |
---|---|---|---|
action | System.String | 1 | [Required] Action code. A=Add, C=Change, D=Delete. Defaults to C=Change |
controlNumber | numeric | 7 | [Required] Business control 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. |
title | System.String | 20 | Title for officer |
name | System.String | 30 | Name of officer. Requried for Add or Change, not required for Delete |
addressLine1 | System.String | 30 | Address line 1. Requried for Add or Change, not required for Delete |
addressLine2 | System.String | 30 | Address line 2 |
addressLine3 | System.String | 30 | Address line 3 |
zipCode | System.String | 9 | Zip Code. Requried for Add or Change, not required for Delete |
deliveryPoint | numeric | 3 | Delivery point |
phone | numeric | 10 | Phone number. Ex. 111-222-3333. Requried for Add or Change, not required for Delete |
recordNumber | numeric | 14 | Record number. Use DatabaseRecordNumber from GetBusinessOwner . Requried for Change or Delete, not required for Add |
POST http://localhost/FusionServices/v2/Naviline/OccupationalLicense/UpdateBusinessOfficers
Name | Description |
---|---|
PersonTitle | Title for corporate officer |
NameOfPerson | Name of corporate officer |
PersonAddressLine1 | Address line 1 for corporate officer |
PersonAddressLine2 | Address line 2 for corporate officer |
PersonAddressLine3 | Address line 3 for corporate officer |
PersonCityStateZip | City, State Zip for corporate officer |
PersonZipCode | Zip code for corporate officer |
PersonDeliveryPoint | Delivery point for corporate officer |
PersonAreaCode | Area Code for corporate officer's phone number |
PersonPhoneNumber | Phone Number for corporate officer |
DatabaseRecordNumber | Record Number for corporate officer |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v2/Naviline/OccupationalLicense/UpdateBusinessOfficers";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("action",System.Web.HttpUtility.UrlEncode("C"));
postParms.Add("controlNumber",System.Web.HttpUtility.UrlEncode("3249"));
postParms.Add("title",System.Web.HttpUtility.UrlEncode("Chief Financial"));
postParms.Add("name",System.Web.HttpUtility.UrlEncode("Bartholomew Reech"));
postParms.Add("addressLine1",System.Web.HttpUtility.UrlEncode("1804 E Denman Ave"));
postParms.Add("addressLine2",System.Web.HttpUtility.UrlEncode("Suite 303"));
postParms.Add("addressLine3",System.Web.HttpUtility.UrlEncode("Room 102"));
postParms.Add("zipCode",System.Web.HttpUtility.UrlEncode("759010104"));
postParms.Add("phone",System.Web.HttpUtility.UrlEncode("661-772-8884"));
postParms.Add("recordNumber",System.Web.HttpUtility.UrlEncode("1384"));
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 PostUpdateBusinessOfficers
{
// 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 action{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("[0-9]{0,7}", ErrorMessage = "Numeric values only. Must be 7 digits or less. ")]
public string controlNumber{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,20}$).*", ErrorMessage = "Must be 20 characters or less. ")]
public string title{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string name{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string addressLine1{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string addressLine2{get; set;}
[RegularExpression("^(?=.{0,30}$).*", ErrorMessage = "Must be 30 characters or less. ")]
public string addressLine3{get; set;}
[RegularExpression("^(?=.{0,9}$).*", ErrorMessage = "Must be 9 characters or less. ")]
public string zipCode{get; set;}
[RegularExpression("[0-9]{0,3}", ErrorMessage = "Numeric values only. Must be 3 digits or less. ")]
public string deliveryPoint{get; set;}
[RegularExpression("[0-9]{0,10}", ErrorMessage = "Numeric values only. Must be 10 digits or less. ")]
public string phone{get; set;}
[RegularExpression("[0-9]{0,14}", ErrorMessage = "Numeric values only. Must be 14 digits or less. ")]
public string recordNumber{get; set;}
public PostUpdateBusinessOfficers()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostUpdateBusinessOfficers 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.PostUpdateBusinessOfficers
@{
ViewBag.Title = "PostUpdateBusinessOfficers";
}
<h2>PostUpdateBusinessOfficers</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostUpdateBusinessOfficers</legend>
<div class="editor-label">
@Html.LabelFor(model => model.action)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.action)
@Html.ValidationMessageFor(model => model.action)
</div>
<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.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.title)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.title)
@Html.ValidationMessageFor(model => model.title)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.name)
@Html.ValidationMessageFor(model => model.name)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.addressLine1)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.addressLine1)
@Html.ValidationMessageFor(model => model.addressLine1)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.addressLine2)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.addressLine2)
@Html.ValidationMessageFor(model => model.addressLine2)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.addressLine3)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.addressLine3)
@Html.ValidationMessageFor(model => model.addressLine3)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.zipCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.zipCode)
@Html.ValidationMessageFor(model => model.zipCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.deliveryPoint)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.deliveryPoint)
@Html.ValidationMessageFor(model => model.deliveryPoint)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.phone)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.phone)
@Html.ValidationMessageFor(model => model.phone)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.recordNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.recordNumber)
@Html.ValidationMessageFor(model => model.recordNumber)
</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/PostUpdateBusinessOfficers
public ActionResult PostUpdateBusinessOfficers()
{
// Create a new instance of the model to pick up any default values.
PostUpdateBusinessOfficers model = new PostUpdateBusinessOfficers();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostUpdateBusinessOfficers.cshtml", model);
}
//
// POST: /MyController/PostUpdateBusinessOfficers
[HttpPost]
public ActionResult PostUpdateBusinessOfficers(FormCollection collection)
{
string url = "v2/Naviline/OccupationalLicense/UpdateBusinessOfficers";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("action", collection["action"]);
inputParms.Add("controlNumber", collection["controlNumber"]);
inputParms.Add("changeDate", collection["changeDate"]);
inputParms.Add("changeTime", collection["changeTime"]);
inputParms.Add("title", collection["title"]);
inputParms.Add("name", collection["name"]);
inputParms.Add("addressLine1", collection["addressLine1"]);
inputParms.Add("addressLine2", collection["addressLine2"]);
inputParms.Add("addressLine3", collection["addressLine3"]);
inputParms.Add("zipCode", collection["zipCode"]);
inputParms.Add("deliveryPoint", collection["deliveryPoint"]);
inputParms.Add("phone", collection["phone"]);
inputParms.Add("recordNumber", collection["recordNumber"]);
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", "PostUpdateBusinessOfficers");
return View("Error", info);
}
}