QuoteDiagramGrid.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Core;
  4. using InABox.DynamicGrid;
  5. namespace PRSDesktop
  6. {
  7. internal class QuoteDiagramGrid : DynamicDataGrid<QuoteDiagram>
  8. {
  9. private Guid _quoteid;
  10. public QuoteDiagramGrid()
  11. {
  12. Options.AddRange(DynamicGridOption.RecordCount, DynamicGridOption.SelectColumns);
  13. }
  14. public Guid QuoteID
  15. {
  16. get => _quoteid;
  17. set
  18. {
  19. _quoteid = value;
  20. Refresh(false, true);
  21. }
  22. }
  23. protected override void Reload(Filters<QuoteDiagram> criteria, Columns<QuoteDiagram> columns, ref SortOrder<QuoteDiagram> sort,
  24. Action<CoreTable, Exception> action)
  25. {
  26. criteria.Add(new Filter<QuoteDiagram>(x => x.Quote.ID).IsEqualTo(_quoteid));
  27. base.Reload(criteria, columns, ref sort, action);
  28. }
  29. protected override QuoteDiagram CreateItem()
  30. {
  31. var result = base.CreateItem();
  32. result.Quote.ID = _quoteid;
  33. return result;
  34. }
  35. }
  36. }