public void run() { login(); // Insert new Jobs logStart("Inserting New Jobs..."); JobSampleBatchInsert insert = new JobSampleBatchInsert(mQuery); insert.run(); logFinish("Finished Inserting jobs"); logStart("Simulating job completion"); insert.updateJobsAsCompleted(); logFinish("Done"); // Get Completed Jobs logStart("Getting Complete Jobs and Photos..."); JobSampleBatch2Completed completed = new JobSampleBatch2Completed(mQuery); completed.run(); logFinish("Finished Getting Completed jobs"); // Run Configuration (once per day at night for example) JobSampleHolidays holidays = new JobSampleHolidays(mQuery); holidays.run(); }
public void run() { // Step 1: login logStart("Start Login..."); string token = Query.login("*****@*****.**", "demobiz"); logFinish("Login OK"); mQuery = new Query(token); // Step 2: create a list of job to insert List <Job> newJobs = getNewJobList(); // Step 3: insert the new jobs in Batch mode insertNewJobs(newJobs); // Step 4 : Simulate job completion // note : this is used for testing, in a real lie system, jobs would be completed only on the mobile updateJobsAsCompleted(); // 5. Get the List of Completed Jobs List <Job> completedJobList = getCompletedJobs(); /* * foreach(Job job in completedJobList) { * Console.WriteLine("////////////////"); * Console.WriteLine("Completed JobID: " + job.id); * * Console.WriteLine("Checkout Time: " + job.checkout); * Console.WriteLine("Checkout Geo Coordinates: " + job.checkoutgeo); * Console.WriteLine("Checkout Note: " + job.checkoutnote); * * Console.WriteLine("Meter Number: " + job.getCustomField("F6")); * Console.WriteLine("Meter Location: " + job.getCustomField("F3")); * Console.WriteLine("Customer Info: " + job.getCustomField("F8")); * * Console.WriteLine("Current Read: " + job.getCustomField("F12")); * Console.WriteLine("Completed Action: " + job.getCustomField("F5")); * Console.WriteLine("Skip Action: " + job.getCustomField("F14")); * for (int i = 0; i < 20; i++) { * string value = (string) job.getCustomField("F" + (i + 50)); * if (value == null || value == "") break; * else Console.WriteLine("Electricity Reading: " + value); * } * } */ // 6. Delete the List of completed Jobs deleteCompletedJobs(completedJobList); // get the list of job photos File[] photos = downloadPhotos(completedJobList); // delete Job Photos deletePhotos(photos); // TESTING : this should be done only every month or year. JobSampleHolidays holidays = new JobSampleHolidays(mQuery); holidays.run(); }
public void run() { // Step 1: login logStart("Start Login..."); string token = Query.login("*****@*****.**", "demobiz"); logFinish("Login OK"); mQuery = new Query(token); // Step 2: create a list of job to insert List<Job> newJobs = getNewJobList(); // Step 3: insert the new jobs in Batch mode insertNewJobs(newJobs); // Step 4 : Simulate job completion // note : this is used for testing, in a real lie system, jobs would be completed only on the mobile updateJobsAsCompleted(); // 5. Get the List of Completed Jobs List<Job> completedJobList = getCompletedJobs(); /* foreach(Job job in completedJobList) { Console.WriteLine("////////////////"); Console.WriteLine("Completed JobID: " + job.id); Console.WriteLine("Checkout Time: " + job.checkout); Console.WriteLine("Checkout Geo Coordinates: " + job.checkoutgeo); Console.WriteLine("Checkout Note: " + job.checkoutnote); Console.WriteLine("Meter Number: " + job.getCustomField("F6")); Console.WriteLine("Meter Location: " + job.getCustomField("F3")); Console.WriteLine("Customer Info: " + job.getCustomField("F8")); Console.WriteLine("Current Read: " + job.getCustomField("F12")); Console.WriteLine("Completed Action: " + job.getCustomField("F5")); Console.WriteLine("Skip Action: " + job.getCustomField("F14")); for (int i = 0; i < 20; i++) { string value = (string) job.getCustomField("F" + (i + 50)); if (value == null || value == "") break; else Console.WriteLine("Electricity Reading: " + value); } } */ // 6. Delete the List of completed Jobs deleteCompletedJobs(completedJobList); // get the list of job photos File[] photos = downloadPhotos(completedJobList); // delete Job Photos deletePhotos(photos); // TESTING : this should be done only every month or year. JobSampleHolidays holidays = new JobSampleHolidays(mQuery); holidays.run(); }