예제 #1
0
 public async Task UpdateJobAsync(Job job)
 {
     job.Status = Job.CompleteStatus;
     
     // 5. update local db
     await jobTable.UpdateAsync(job);
 }
 public void NavigateTo(Job item)
 {
     JobDetailsPage page = new JobDetailsPage(jobService);
     page.BindingContext = item;
     Detail = new NavigationPage(page);
     IsPresented = false;
 }
        public async Task CompleteJobAsync(Job job)
        {
            await UpdateJobAsync(job);

            if (Online)
                await this.SyncAsync();
        }
예제 #4
0
        public async Task CompleteJobAsync(Job job)
        {
            job.Status = Job.CompleteStatus;
            await jobTable.UpdateAsync(job);

            var inprogress = await jobTable
                .Where(j => j.Status == Job.InProgressStatus)
                .Take(1)
                .ToListAsync();

            if(inprogress.Count == 0)
            {
                var nextJob = (await jobTable
                    .Where(j => j.Status == Job.PendingStatus)
                    .Take(1)
                    .ToListAsync()
                ).FirstOrDefault();

                if (nextJob != null)
                {
                    nextJob.Status = Job.InProgressStatus;
                    await jobTable.UpdateAsync(nextJob);
                }
            }
        }
 public async Task UpdateJobAsync(Job job)
 {
     job.Status = Job.CompleteStatus;
     
     await jobTable.UpdateAsync(job);
     
     // trigger an event so that the job list is refreshed
     await MobileService.EventManager.PublishAsync(new MobileServiceEvent("JobChanged"));
 }
예제 #6
0
 private async Task ShowJobDetailsAsync(Job selectedJob)
 {                        
     detailPage.BindingContext = selectedJob;
     await this.Navigation.PushAsync(detailPage);
 }