Examples
Creating a job
Here is a simple application that creates or updates a job through the API. A job in Dime.Scheduler is the equivalent of an order (service, sales, project, production, etc.) in the real world.
See the inline comments for the steps required to complete a request successfully.
- C#
public class Program
{
public static async Task Main(string[] args)
{
Console.WriteLine("Adding/updating a job to Dime.Scheduler");
Job job = new()
{
SourceApp = "MY APPLICATION",
SourceType = "SERVICE_ORDER_0001",
JobNo = "CUSTOMER_XYZ_REPAIRCODE_012",
ShortDescription = "Repair jobs 2023 for customer XYZ"
};
DimeSchedulerClient client = new("mykey");
await client.Import.ProcessAsync(job, TransactionType.Append);
Console.ReadLine();
}
}
This will have inserted a job into Dime.Scheduler. The next step then would be to insert a task. You may reuse the instance of the client:
- C#
// Step #4: add additional data
Task jobTask = new()
{
SourceApp = "MY APPLICATION", // Same as job
SourceType = "SERVICE_ORDER_0001", // Same as job
JobNo = "CUSTOMER_XYZ_REPAIRCODE_012", // Same as job
TaskNo = "Repair HVAC machine code 9900109 in storage room X", // Unique for this task
ShortDescription = "Repair HVAC Customer XYZ"
};
await client.Import.ProcessAsync(jobTask, TransactionType.Append);
More examples can be found on Github.