Get Benefits
Name | Type | Length | Description |
---|---|---|---|
None | No input parameters to pass |
GET http://localhost/FusionServices/v3/Naviline/Payroll/Benefits
Name | Description |
---|---|
ErrorCode | Blank=Succes |
BenefitCode | Benefit Code |
BenefitDesc | Benefit Description |
BenefitPriority | Benefit Priority |
BenefitAmount | Benefit Amount (2 Decimal) |
PRBDAA | |
BenefitPerRateTime | Benefit amount or per $1000 of annual rate times (2 Decimal) |
BenefitPercent | Benefit Percent (3 Decimal) |
PRBEEL | |
PRBEOB | |
PRBEAN | |
BenefitMaxPerCheck | Benefit Maximum amount Per Check (2 Decimal) |
BenefitMaxPerYear | Benefit Maximum amount Per Year (2 Decimal) |
BenefitMultiplyAnnualRate | Benefit amount multiply annual rate by |
BenefitRoundToNearest | Round to nearest |
PRDSBY | |
BenefitRoundToNext | Round To Next |
PRFBFL | |
WorkersComp | |
GenerateBenefitNoEarnings | Generate benefit if no earnings |
BenefitSpecialBenefitType | Special Benefit Type |
PRFBFL | |
BenefitAccountNumberEarning | Benefit Account Number E |
BenefitAccountNumber | Benefit Account Number |
VendorNumber | Vendor Number |
Action | Action |
BenefitIncludeAccrualBatch | Include in year end accrual batch |
BenefitIncludeNetEarnings | Include in Net Earnings |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms)
{
string uri = "http://localhost/FusionServices/v3/Naviline/Payroll/Benefits";
WebClient wc = new WebClient();
wc.Headers.Set("X-APPID", "YOURID");
wc.Headers.Set("X-APPKEY", "YOURKEY");
string stringResult = wc.DownloadString(new Uri(uri));
JObject response = JObject.Parse(stringResult);
string error = response["OutputParms"]["ErrorCode"].ToString();
if (error == "0000")
{
JArray jRows = (JArray)response["Rows"];
foreach (JObject row in jRows)
{
string BenefitCode = row["BenefitCode"].ToString();
string BenefitDesc = row["BenefitDesc"].ToString();
string BenefitPriority = row["BenefitPriority"].ToString();
string BenefitAmount = row["BenefitAmount"].ToString();
string PRBDAA = row["PRBDAA"].ToString();
string BenefitPerRateTime = row["BenefitPerRateTime"].ToString();
string BenefitPercent = row["BenefitPercent"].ToString();
string PRBEEL = row["PRBEEL"].ToString();
string PRBEOB = row["PRBEOB"].ToString();
string PRBEAN = row["PRBEAN"].ToString();
string BenefitMaxPerCheck = row["BenefitMaxPerCheck"].ToString();
string BenefitMaxPerYear = row["BenefitMaxPerYear"].ToString();
string BenefitMultiplyAnnualRate = row["BenefitMultiplyAnnualRate"].ToString();
string BenefitRoundToNearest = row["BenefitRoundToNearest"].ToString();
string PRDSBY = row["PRDSBY"].ToString();
string BenefitRoundToNext = row["BenefitRoundToNext"].ToString();
string PRFBFL = row["PRFBFL"].ToString();
string WorkersComp = row["WorkersComp"].ToString();
string GenerateBenefitNoEarnings = row["GenerateBenefitNoEarnings"].ToString();
string BenefitSpecialBenefitType = row["BenefitSpecialBenefitType"].ToString();
string PRRAFT = row["PRRAFT"].ToString();
string BenefitAccountNumberEarning = row["BenefitAccountNumberEarning"].ToString();
string BenefitAccountNumber = row["BenefitAccountNumber"].ToString();
string VendorNumber = row["VendorNumber"].ToString();
string Action = row["Action"].ToString();
string BenefitIncludeAccrualBatch = row["BenefitIncludeAccrualBatch"].ToString();
string BenefitIncludeNetEarnings = row["BenefitIncludeNetEarnings"].ToString();
// TODO - YOUR CODE HERE
}
}
}
$.get('http://localhost/FusionServices/v3/Naviline/Payroll/Benefits', function(response) {
$('#resultDiv).html(response);
});
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 GetBenefits
{
// Add property for each input param in order to map a field to it
public GetBenefits()
{
//Set any defaults here
}
}
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the GetBenefits 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.GetBenefits
@{
ViewBag.Title = "GetBenefits";
string myUrl = "http://localhost/FusionServices/v3/Naviline/Payroll/Benefits";
}
<h2>GetBenefits</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>GetBenefits</legend>
<div class="editor-label">Use the fields below to change the values and resubmit.</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/GetBenefits
public ActionResult GetBenefits()
{
// Create a new instance of the model to pick up any default values.
GetBenefits model = new GetBenefits();
// pass model to set to default values
// NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
return View("~/Views/MyFolderPath/GetBenefits.cshtml", model);
}
//
// POST: /MyController/GetBenefits
[HttpPost]
public ActionResult GetBenefits(FormCollection collection)
{
string url = "v3/Naviline/Payroll/Benefits";
// Get the value from each input field
NameValueCollection inputParms = new NameValueCollection();
try
{
// Send the request
FusionServiceRequest request = new FusionServiceRequest();
FusionServiceResult result = request.Get(url, inputParms);
return View("Result", result);
}
catch(Exception e)
{
HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "GetBenefits");
return View("Error", info);
}
}