private void ShowJobs() { using (AccessPointClient accessPoint = new AccessPointClient()) { JobData[] jobs = accessPoint.GetJobs(new GetJobsRequest { Skip = 0, Take = int.MaxValue, }).Jobs; JobsList.DataSource = jobs; JobsList.DataBind(); JobsListPager.Visible = jobs.Length > JobsListPager.MaximumRows; } }
private void ShowJobs() { using (AccessPointClient accessPoint = new AccessPointClient()) { List <JobData> jobs = new List <JobData>(); JobData[] page; do { page = accessPoint.GetJobs(new GetJobsRequest { Skip = (uint)jobs.Count, Take = PageSize, }).Jobs; jobs.AddRange(page); }while (page != null && page.Length == PageSize); JobsList.DataSource = jobs; JobsList.DataBind(); JobsListPager.Visible = jobs.Count > JobsListPager.MaximumRows; } lblLastRefresh.Text = DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"); }
public void ShowJobs() { using (AccessPointClient accessPoint = new AccessPointClient()) { List <JobData> jobs = new List <JobData>(); JobData[] page; do { if (!string.IsNullOrWhiteSpace(ApplicationName)) { page = accessPoint.GetJobs(new GetJobsRequest { Skip = (uint)jobs.Count, Take = PageSize, Applications = new string[] { ApplicationName }, JobStatuses = ShownStatuses.ToArray(), }).Jobs; jobs.AddRange(page); } else { page = accessPoint.GetJobs(new GetJobsRequest { Skip = (uint)jobs.Count, Take = PageSize, JobStatuses = ShownStatuses.ToArray(), }).Jobs; jobs.AddRange(page.Where(j => string.IsNullOrWhiteSpace(j.Application))); } }while (page != null && page.Length == PageSize); jobs = jobs.Where(j => string.IsNullOrWhiteSpace(GroupName) ? j.Group == null || j.Group == "" : j.Group == GroupName).ToList(); JobsList.DataSource = jobs; JobsList.DataBind(); JobsListPager.Visible = jobs.Count > JobsListPager.MaximumRows; } }