123456789101112131415161718192021222324252627282930 |
- using System;
- using Comal.Classes;
- using InABox.Core;
- using InABox.DynamicGrid;
- namespace PRSDesktop;
- public class JobScopeFormGrid : DynamicEntityFormGrid<JobForm, Job, JobLink>, IJobScopeGrid
- {
- public JobScope? Scope { get; set; }
- public JobScopeFormGrid(Job job): base(job)
- {
- }
- protected override void DoReconfigure(FluentList<DynamicGridOption> options)
- {
- base.DoReconfigure(options);
- options.Remove(DynamicGridOption.AddRows);
- }
- protected override void Reload(Filters<JobForm> criteria, Columns<JobForm> columns, ref SortOrder<JobForm>? sort, Action<CoreTable?, Exception?> action)
- {
- if ((Scope == null) || (Scope.ID == Guid.Empty))
- criteria.Add(new Filter<JobForm>(x => x.ID).None());
- else
- criteria.Add(new Filter<JobForm>(x => x.JobScope.ID).IsEqualTo(Scope.ID));
- base.Reload(criteria, columns, ref sort, action);
- }
- }
|