QuoteDataModel.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using System.Collections.Generic;
  3. using InABox.Core;
  4. namespace Comal.Classes
  5. {
  6. public class QuoteDataModel : BaseDataModel<Quote>
  7. {
  8. public QuoteDataModel(Filter<Quote> filter) : base(filter)
  9. {
  10. //AddChildTable<Quote, QuoteDocument>(x => x.ID, x => x.EntityLink.ID);
  11. //AddChildTable<Quote, QuoteDiagram>(x => x.ID, x => x.Quote.ID);
  12. //AddChildTable<Quote, QuoteTakeoff>(x => x.ID, x => x.Quote.ID);
  13. //AddChildTable<Quote, QuoteDesign>(x => x.ID, x => x.Quote.ID);
  14. AddChildTable<QuoteDesign, QuoteDesignItem>(
  15. x => x.ID, x => x.Design.ID,
  16. parentalias: "Quote_QuoteDesign",
  17. childalias: "Quote_QuoteDesign_QuoteDesignItem"
  18. );
  19. AddChildTable<Quote, QuoteCostSheet>(
  20. x => x.ID, x => x.Quote.ID,
  21. parentalias: "Quote",
  22. childalias: "Quote_QuoteCostSheet"
  23. );
  24. AddChildTable<QuoteCostSheet, QuoteCostSheetItem>(
  25. x => x.ID, x => x.CostSheet.ID,
  26. parentalias: "Quote_QuoteCostSheet",
  27. childalias: "Quote_QuoteCostSheet_QuoteCostSheetItem"
  28. );
  29. //AddChildTable<Quote, QuoteProposal>(x => x.ID, x => x.Quote.ID);
  30. AddChildTable<QuoteProposal, QuoteProposalCostSheet>(
  31. x => x.ID, x => x.Proposal.ID,
  32. parentalias: "Quote_QuoteProposal",
  33. childalias: "Quote_QuoteProposal_QuoteProposalCostSheet"
  34. );
  35. AddChildTable<QuoteProposalCostSheet, QuoteCostSheetItem>(
  36. x => x.CostSheet.ID, x => x.CostSheet.ID, isdefault: false,
  37. parentalias: "Quote_QuoteProposal_QuoteProposalCostSheet",
  38. childalias: "Quote_QuoteProposal_QuoteProposalCostSheet_QuoteCostSheetItem"
  39. );
  40. /*AddChildTable<Quote, QuoteContract>(
  41. x => x.ID, x => x.Quote.ID,
  42. parentalias: "Quote",
  43. childalias: "Quote_QuoteContract"
  44. );*/
  45. AddChildTable<QuoteContract, QuoteContractProposal>(
  46. x => x.ID, x => x.Contract.ID,
  47. parentalias: "Quote_QuoteContract",
  48. childalias: "Quote_QuoteContract_QuoteContractProposal"
  49. );
  50. }
  51. public override string Name => "Quotes";
  52. }
  53. }