internal PayrollRequest UpdateEmployeeRequest(PayrollEncoder encoder, object[] args) { var requestBody = new JsonDoc() .Set("ClientCode", encoder.Encode(ClientCode)) .Set("EmployeeId", EmployeeId) .Set("EmploymentStatus", EnumConverter.GetDescription(EmploymentStatus)) .Set("HireDate", HireDate) //.Set("TerminationDate", TerminationDate) //.Set("TerminationReasonId", TerminationReasonId) .Set("EmployeeNumber", EmployeeNumber) .Set("EmploymentCategory", EnumConverter.GetDescription(EmploymentCategory)) .Set("TimeClockId", TimeClockId) .Set("FirstName", FirstName) .Set("LastName", encoder.Encode(LastName)) .Set("MiddleName", MiddleName) .Set("SSN", encoder.Encode(Ssn)) .Set("Address1", encoder.Encode(Address1)) .Set("Address2", Address2) .Set("City", City) .Set("StateCode", StateCode) .Set("ZipCode", encoder.Encode(ZipCode)) .Set("MaritalStatus", EnumConverter.GetDescription(MaritalStatus)) .Set("BirthDate", encoder.Encode(BirthDay)) .Set("Gender", EnumConverter.GetDescription(Gender)) .Set("PayGroupId", PayGroupId) .Set("PayTypeCode", EnumConverter.GetDescription(PayTypeCode)) .Set("HourlyRate", encoder.Encode(HourlyRate)) .Set("PerPaySalary", encoder.Encode(PerPaySalary)) .Set("WorkLocationId", WorkLocationId).ToString(); return(new PayrollRequest { Endpoint = @"/api/pos/employee/UpdateEmployee", RequestBody = requestBody }); }
internal static PayrollRequest SignIn(string username, string password, PayrollEncoder encoder) { var request = new JsonDoc() .Set("Username", username) .Set("Password", encoder.Encode(password)); return(new PayrollRequest { Endpoint = "/api/pos/session/signin", RequestBody = request.ToString() }); }
internal PayrollRequest GetClientInfoRequest(PayrollEncoder encoder, object[] args) { var request = new JsonDoc() .Set("FederalEin", encoder.Encode(FederalEin)) .ToString(); return(new PayrollRequest { Endpoint = "/api/pos/client/getclients", RequestBody = request }); }
internal string ToJson(PayrollEncoder encoder) { return(new JsonDoc() .Set("RecordId", RecordId) .Set("ClientCode", encoder.Encode(ClientCode)) .Set("EmployeeId", EmployeeId) .Set("PayItemLaborFields", PayItemLaborFields) .Set("PayItemTitle", PayItemTitle) .Set("Hours", Hours) .Set("Dollars", Dollars) .Set("PayRate", PayRate) .ToString()); }
internal PayrollRequest TerminateEmployeeRequest(PayrollEncoder encoder, object[] args) { var requestBody = new JsonDoc() .Set("ClientCode", encoder.Encode(ClientCode)) .Set("EmployeeId", EmployeeId) .Set("TerminationDate", TerminationDate?.ToString("MM/dd/yyyy")) .Set("TerminationReasonId", TerminationReasonId) .Set("InactivateDirectDepositAccounts", DeactivateAccounts ? 1 : 0) .ToString(); return(new PayrollRequest { Endpoint = @"/api/pos/employee/TerminateEmployee", RequestBody = requestBody }); }
internal PayrollRequest GetEmployeeRequest(PayrollEncoder encoder, object[] args) { var requestBody = new JsonDoc() .Set("ClientCode", encoder.Encode(ClientCode)) .Set("EmployeeId", EmployeeId) .Set("ActiveEmployeeOnly", Active) .Set("EmployeeOffset", EmployeeOffset) .Set("EmployeeCount", EmployeeCount) .Set("FromDate", FromDate?.ToString("MM/dd/yyyy HH:mm:ss")) .Set("ToDate", ToDate?.ToString("MM/dd/yyyy HH:mm:ss")) .Set("PayTypeCode", EnumConverter.GetDescription(PayTypeCode)) .ToString(); return(new PayrollRequest { Endpoint = (EmployeeId != null) ? "/api/pos/employee/GetEmployee" : "/api/pos/employee/GetEmployees", RequestBody = requestBody }); }
internal PayrollRequest GetCollectionRequestByType(PayrollEncoder encoder, object[] args) { var endpoints = new Dictionary <Type, string> { { typeof(TerminationReason), @"/api/pos/termination/GetTerminationReasons" }, { typeof(WorkLocation), @"/api/pos/worklocation/GetWorkLocations" }, { typeof(LaborField), @"/api/pos/laborField/GetLaborFields" }, { typeof(PayGroup), @"/api/pos/payGroup/GetPayGroups" }, { typeof(PayItem), @"/api/pos/payItem/GetPayItems" } }; var type = args[0] as Type; var requestBody = new JsonDoc() .Set("ClientCode", encoder.Encode(ClientCode)) .ToString(); return(new PayrollRequest { Endpoint = endpoints[type], RequestBody = requestBody }); }