Click or drag to resize

WSLaborLevelGetLaborLevel Method

Returns a GetLaborLevelOut response with a result model List<GetLaborLevelModel>

Namespace: AppOne.Services.V2.Methods
Assembly: AppOne.Web.Service (in AppOne.Web.Service.dll) Version: 1.0.141
Syntax
public GetLaborLevelOut GetLaborLevel(
	GetLaborLevelIn input
)

Parameters

input  GetLaborLevelIn
A new GetLaborLevelIn object

Return Value

GetLaborLevelOut
A GetLaborLevelOut object
Remarks
Use this method to get a results list of GetLaborLevelModel

Note  Note
For a higher level overview of the business rules for labor-levels see the class WSLaborLevel of this web method.

DataAction Names

NameDescriptionValues Example
SELECT-ALLReturns all labor levels in system regardless of any state.[ignored]
SELECT-IDReturns only the labor levels with the specified ID.4,8,95...
SELECT-ISDELETEDWhen true all labor levels marked as deleted will return, if false all active labor levels will return.true

DataFilter Names

NameDescriptionValues Example
BY-NAMEFilters the Results based on the labor level by name."Division", "Location"
Note  Note
Business Rules:
Labor levels are used to create a structure for labor distribution, job costing and reporting. The individual labor levels, such as Department or Job are defined below. Labor levels (GetLaborLevelModel) are merely group containers for labor level details (GetLaborLevelDetailModel).

Setup:
Configuration > Labor Levels > Define
Caution note  Caution
Labor levels and labor level details are not the same. 'Labor Level Details' are children of a particular 'Labor Level' and labor levels are read-only items that are a fixed system record. Below are the base values that come pre-setup with every time-web system. Direct access to setting these values must be done in the time web services user interface.

Base Labor Level Values

  • Division
  • Location
  • Department
  • Job
Example
JSON Request
//EXAMPLE 1: 
//Returns all Labor Levels
{
    "AuthToken":"...",
    "DataAction":{
        "Name":"SELECT-ALL",
        "Values":[]
    }
}

//EXAMPLE 2: 
//Returns all Labor Levels and hides those with the name Division
{
    "AuthToken":"...",
    "DataAction":{
        "Name":"SELECT-ALL",
        "Values":[]
    },
    "DataFilter":{
        "Name":"BY-NAME",
        "HideValues":true,
        "Values":["Division"]
    }
}
JSON Response
//EXAMPLE JSON RESPONSE
{
    "Report": {
        "ProcessTime": "0.0445699",
        "RequestTime": "/Date(1429743756253-0700)/",
        "ResponseTime": "/Date(1429743756297-0700)/",
        "Results": 4
    },
    "Results": [
        {
            "ID": 89,
            "IsDeleted": false,
            "ModifiedEmployeeID": "0",
            "ModifiedOn": "/Date(-2208963600000-0700)/",
            "Name": "Division",
            "OrdinalPosition": 1,
            "UnrestrictedAccessEnabled": false
        },
    ...(3 more record sets) ...
}
SOAP: C# WCF Sample
// ==================================
//TEST 1: SELECT-ALL
int countTest_1 = 0;
SoapServiceV2.GetLaborLevelRequest request1 = new SoapServiceV2.GetLaborLevelRequest();
request1.input = new SoapServiceV2.GetLaborLevelIn
{
    AuthToken = AuthToken,
    DataAction = new DataAction
    {
        Name = "SELECT-ALL"
    }
};
SoapServiceV2.GetLaborLevelResponse response1 = client.GetLaborLevel(request1);
countTest_1 = (response1.GetLaborLevelResult.Results != null) ? response1.GetLaborLevelResult.Results.Count : 0;

// ==================================
//TEST 2: SELECT-ID 
int countTest_2 = 0;
SoapServiceV2.GetLaborLevelRequest request2 = new SoapServiceV2.GetLaborLevelRequest();
request2.input = new SoapServiceV2.GetLaborLevelIn
{
    AuthToken = AuthToken,
    DataAction = new DataAction
    { 
        Name = "SELECT-ID",
        Values = new List<string>() {
            response1.GetLaborLevelResult.Results[0].ID.ToString(), 
            response1.GetLaborLevelResult.Results[1].ID.ToString()
        } 
    }
};
SoapServiceV2.GetLaborLevelResponse response2 = client.GetLaborLevel(request2);
countTest_2 = (response2.GetLaborLevelResult.Results != null) ? response2.GetLaborLevelResult.Results.Count : 0;

Assert.IsTrue(countTest_2 > 0 && countTest_1 > 0);
See Also