QuoteDesignGrid.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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. protected override void DoReconfigure(FluentList<DynamicGridOption> options)
  10. {
  11. base.DoReconfigure(options);
  12. options.AddRange(DynamicGridOption.RecordCount, DynamicGridOption.SelectColumns);
  13. }
  14. public Quote Quote { get; set; }
  15. protected override void Reload(Filters<QuoteDesign> criteria, Columns<QuoteDesign> columns, ref SortOrder<QuoteDesign> sort,
  16. Action<CoreTable, Exception> action)
  17. {
  18. criteria.Add(new Filter<QuoteDesign>(x => x.Quote.ID).IsEqualTo(Quote.ID));
  19. base.Reload(criteria, columns, ref sort, action);
  20. }
  21. protected override QuoteDesign CreateItem()
  22. {
  23. var result = base.CreateItem();
  24. result.Quote.ID = Quote.ID;
  25. result.Quote.Synchronise(Quote);
  26. return result;
  27. }
  28. }
  29. }