Create Action Logs
Errors - 0000:Success; 0001:Error = Project number not found;0004:Error = Revision / path / step / sequence not found;0005:Error = Action code not valid;0006:Error = Action by code not valid;0007:Error = Action date not valid;0008:Error = Action user ID not valid ;0009:Error = User does not have authority to agency ;0010:Error = User does not have authority to action by code
Name | Type | Length | Description |
---|---|---|---|
projectID | System.String | 20 | [Required] Project ID |
revisionNumber | System.String | 3 | [Required] Revision Number |
applTrkPath | System.String | 1 | [Required] Application Tracking Path |
applTrkStep | System.String | 2 | [Required] Application Tracking Step |
agencyCode | System.String | 4 | [Required] Agency Code |
stepSeqNum | System.String | 2 | [Required] Step Sequence Number |
actionCode | System.String | 3 | [Required] Action Code |
actionByCode | System.String | 3 | [Required] Action By Code |
actionDate | System.String | 10 | [Required] Action Date (MM/DD/CCYY) |
actionUserID | System.String | 10 | [Required] Action User ID |
stepComplete | System.String | 1 | [Required] Step Complete (Y/N) |
actionComments | System.String | 600 | [Required] Action Comments |
printPermitFlag | System.String | 1 | [Required] Print on Permit Flag (Y/*blank) |
correctionReportPrintFlag | System.String | 1 | [Required] Correction Report Print Flag (Y/N) |
POST http://localhost/FusionServices/v3/Naviline/EPR/CreateActionLogs
Name | Description |
---|---|
ErrorCode | Error Code |
ErrorMessage | Error Message |
Error Code | Error Message |
---|---|
0000 | Success |
0001 | Project number not found |
0004 | Revision/path/step/sequence not found |
0005 | Action code not valid |
0006 | Action by code not valid |
0007 | Action date not valid |
0008 | Action user ID not valid |
0009 | User does not have authority to agency |
0010 | User does not have authority to action by code |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/EPR/CreateActionLogs";
System.Collections.Specialized.NameValueCollection postParms =
new System.Collections.Specialized.NameValueCollection();
// Set paramater values
postParms.Add("projectID",System.Web.HttpUtility.UrlEncode("2200198"));
postParms.Add("revisionNumber",System.Web.HttpUtility.UrlEncode("000"));
postParms.Add("applTrkPath",System.Web.HttpUtility.UrlEncode("0"));
postParms.Add("applTrkStep",System.Web.HttpUtility.UrlEncode("00"));
postParms.Add("agencyCode",System.Web.HttpUtility.UrlEncode("ELEC"));
postParms.Add("stepSeqNum",System.Web.HttpUtility.UrlEncode("00"));
postParms.Add("actionCode",System.Web.HttpUtility.UrlEncode("APP"));
postParms.Add("actionByCode",System.Web.HttpUtility.UrlEncode("CD"));
postParms.Add("actionDate",System.Web.HttpUtility.UrlEncode("10/11/2022"));
postParms.Add("actionUserID",System.Web.HttpUtility.UrlEncode("QFAN"));
postParms.Add("stepComplete",System.Web.HttpUtility.UrlEncode("Y"));
postParms.Add("actionComments",System.Web.HttpUtility.UrlEncode("ACTION LOG FROM FUSION"));
postParms.Add("printPermitFlag",System.Web.HttpUtility.UrlEncode(""));
postParms.Add("correctionReportPrintFlag",System.Web.HttpUtility.UrlEncode("Y"));
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 PostCreateActionLogs
{
// Add property for each input param in order to map a field to it
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,20}$).*", ErrorMessage = "Must be 20 characters or less. ")]
public string projectID{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
public string revisionNumber{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string applTrkPath{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string applTrkStep{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,4}$).*", ErrorMessage = "Must be 4 characters or less. ")]
public string agencyCode{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,2}$).*", ErrorMessage = "Must be 2 characters or less. ")]
public string stepSeqNum{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
public string actionCode{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,3}$).*", ErrorMessage = "Must be 3 characters or less. ")]
public string actionByCode{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,10}$).*", ErrorMessage = "Must be 10 characters or less. ")]
public string actionDate{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,10}$).*", ErrorMessage = "Must be 10 characters or less. ")]
public string actionUserID{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string stepComplete{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,600}$).*", ErrorMessage = "Must be 600 characters or less. ")]
public string actionComments{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string printPermitFlag{get; set;}
[Required(ErrorMessage = "Required")]
[RegularExpression("^(?=.{0,1}$).*", ErrorMessage = "Must be 1 characters or less. ")]
public string correctionReportPrintFlag{get; set;}
public PostCreateActionLogs()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostCreateActionLogs 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.PostCreateActionLogs
@{
ViewBag.Title = "PostCreateActionLogs";
}
<h2>PostCreateActionLogs</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>PostCreateActionLogs</legend>
<div class="editor-label">
@Html.LabelFor(model => model.projectID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.projectID)
@Html.ValidationMessageFor(model => model.projectID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.revisionNumber)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.revisionNumber)
@Html.ValidationMessageFor(model => model.revisionNumber)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applTrkPath)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applTrkPath)
@Html.ValidationMessageFor(model => model.applTrkPath)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.applTrkStep)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.applTrkStep)
@Html.ValidationMessageFor(model => model.applTrkStep)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.agencyCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.agencyCode)
@Html.ValidationMessageFor(model => model.agencyCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.stepSeqNum)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.stepSeqNum)
@Html.ValidationMessageFor(model => model.stepSeqNum)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.actionCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.actionCode)
@Html.ValidationMessageFor(model => model.actionCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.actionByCode)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.actionByCode)
@Html.ValidationMessageFor(model => model.actionByCode)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.actionDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.actionDate)
@Html.ValidationMessageFor(model => model.actionDate)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.actionUserID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.actionUserID)
@Html.ValidationMessageFor(model => model.actionUserID)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.stepComplete)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.stepComplete)
@Html.ValidationMessageFor(model => model.stepComplete)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.actionComments)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.actionComments)
@Html.ValidationMessageFor(model => model.actionComments)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.printPermitFlag)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.printPermitFlag)
@Html.ValidationMessageFor(model => model.printPermitFlag)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.correctionReportPrintFlag)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.correctionReportPrintFlag)
@Html.ValidationMessageFor(model => model.correctionReportPrintFlag)
</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/PostCreateActionLogs
public ActionResult PostCreateActionLogs()
{
// Create a new instance of the model to pick up any default values.
PostCreateActionLogs model = new PostCreateActionLogs();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/PostCreateActionLogs.cshtml", model);
}
//
// POST: /MyController/PostCreateActionLogs
[HttpPost]
public ActionResult PostCreateActionLogs(FormCollection collection)
{
string url = "v3/Naviline/EPR/CreateActionLogs";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
inputParms.Add("projectID", collection["projectID"]);
inputParms.Add("revisionNumber", collection["revisionNumber"]);
inputParms.Add("applTrkPath", collection["applTrkPath"]);
inputParms.Add("applTrkStep", collection["applTrkStep"]);
inputParms.Add("agencyCode", collection["agencyCode"]);
inputParms.Add("stepSeqNum", collection["stepSeqNum"]);
inputParms.Add("actionCode", collection["actionCode"]);
inputParms.Add("actionByCode", collection["actionByCode"]);
inputParms.Add("actionDate", collection["actionDate"]);
inputParms.Add("actionUserID", collection["actionUserID"]);
inputParms.Add("stepComplete", collection["stepComplete"]);
inputParms.Add("actionComments", collection["actionComments"]);
inputParms.Add("printPermitFlag", collection["printPermitFlag"]);
inputParms.Add("correctionReportPrintFlag", collection["correctionReportPrintFlag"]);
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", "PostCreateActionLogs");
return View("Error", info);
}
}