Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                var AUTHKEY = "";
                System.Diagnostics.Debug.Write("Here");
                // Create the workorder service client.
                var workOrderServiceClient = new WorkOrderServiceClient();
                System.Diagnostics.Debug.Write("New Client");
                JobPartialEntity job = new JobPartialEntity
                {
                    GUID = new Guid("0B67EAA4-6CC3-429E-9BD3-C254CF7B133D"),
                    SiteOrderGUID = new Guid("C8000C32-4F92-E311-88F3-8B711F764498"),
                    ActionGUID = new Guid("892D0325-4F92-E311-88F3-8B711F764498"),
                    ContainerTypeGUID = new Guid("DD2D0325-4F92-E311-88F3-8B711F764498"),
                    ConsignmentNoteNoPart1 = "note1",
                    ConsignmentNoteNoPart2 = "note2",
                    HazardousLoadReference = "load ref",
                    TicketNo = "My Ticket",
                    DestinationLocationGUID = new Guid("3A2E0325-4F92-E311-88F3-8B711F764498"),
                    DateRequired = DateTime.Now.Date,
                    AccessNotes = "Some accessnotes",
                    AccessStartTime = DateTime.Now,
                    AccessEndTime = DateTime.Now,
                };

                // Save route
                var jobGUID = workOrderServiceClient.SaveJob(AUTHKEY, job);

                System.Diagnostics.Debug.Write("Successfully saved job.");

                // Always close the client.
                workOrderServiceClient.Close();

            }
            catch (System.ServiceModel.FaultException ex)
            {
                System.Diagnostics.Debug.Write("Failed to save job.- {0}", ex.Message);
            }
        }