QuoteDesignGrid.cs 910 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Core;
  4. using InABox.DynamicGrid;
  5. namespace PRSDesktop
  6. {
  7. public class QuoteDesignGrid : DynamicDataGrid<QuoteDesign>
  8. {
  9. public QuoteDesignGrid()
  10. {
  11. Options.AddRange(DynamicGridOption.RecordCount, DynamicGridOption.SelectColumns);
  12. }
  13. public Guid QuoteID { get; set; }
  14. protected override void Reload(Filters<QuoteDesign> criteria, Columns<QuoteDesign> columns, ref SortOrder<QuoteDesign> sort,
  15. Action<CoreTable, Exception> action)
  16. {
  17. criteria.Add(new Filter<QuoteDesign>(x => x.Quote.ID).IsEqualTo(QuoteID));
  18. base.Reload(criteria, columns, ref sort, action);
  19. }
  20. protected override QuoteDesign CreateItem()
  21. {
  22. var result = base.CreateItem();
  23. result.Quote.ID = QuoteID;
  24. return result;
  25. }
  26. }
  27. }