JobScopeKanbanGrid.cs 851 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Core;
  4. using InABox.DynamicGrid;
  5. namespace PRSDesktop;
  6. public class JobScopeKanbanGrid : DynamicDataGrid<Kanban>, IJobScopeGrid
  7. {
  8. public JobScope? Scope { get; set; }
  9. protected override void DoReconfigure(FluentList<DynamicGridOption> options)
  10. {
  11. base.DoReconfigure(options);
  12. options.Remove(DynamicGridOption.AddRows);
  13. }
  14. protected override void Reload(Filters<Kanban> criteria, Columns<Kanban> columns, ref SortOrder<Kanban>? sort, Action<CoreTable?, Exception?> action)
  15. {
  16. if ((Scope == null) || (Scope.ID == Guid.Empty))
  17. criteria.Add(new Filter<Kanban>(x => x.ID).None());
  18. else
  19. criteria.Add(new Filter<Kanban>(x => x.JobScope.ID).IsEqualTo(Scope.ID));
  20. base.Reload(criteria, columns, ref sort, action);
  21. }
  22. }