static void PostJob() { FormitizeClient client = CreateClient(); FormitizeJob job = new FormitizeJob(); job.Title = "API Test"; job.JobNumber = "1111"; job.Notes = "Test Notes - NSW"; job.Agent = "APIDemo"; job.Location = "Some Place"; job.setDueDateFromDate(DateTime.UtcNow); FormitizeJobForm jform = new FormitizeJobForm(); jform.FormID = 10355; //the id for 'Interstate Run sheet' jform.setValue (0, "formDate_1", "2016-02-20") .setValue (0, "formLocation_1", "Some location") .setValueMultipleChoice (0, "formCheckbox_1", "Test Value A", "Test Value B", "Test Value C"); job.AttachJobForm(ref jform); FormitizeJobPostResponse resp = client.Post<FormitizeJobPostResponse>(job); if (resp.hasError()) { Console.WriteLine("Error Code " + resp.getErrorCode()); Console.WriteLine(resp.getErrorMessage()); return; } Console.WriteLine("Job ID - " + resp.getJobID()); Console.WriteLine("Agent ID - " + resp.getAgentID()); }
public void AttachJobForm(ref FormitizeJobForm form) { AttachedForms[form.FormID.ToString()] = form; }