123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class CostSheetDocumentCount : CoreAggregate<CostSheet, CostSheetDocument, Guid>
- {
- public override Expression<Func<CostSheetDocument, Guid>> Aggregate => x => x.ID;
- public override AggregateCalculation Calculation => AggregateCalculation.Count;
- public override Dictionary<Expression<Func<CostSheetDocument, object>>, Expression<Func<CostSheet, object>>> Links =>
- new Dictionary<Expression<Func<CostSheetDocument, object>>, Expression<Func<CostSheet, object>>>()
- {
- { CostSheetDocument => CostSheetDocument.EntityLink.ID, Delivery => Delivery.ID }
- };
- }
- [UserTracking(typeof(Quote))]
- public class CostSheet : Entity, ICostSheet, IRemotable, IPersistent, IIssues, ILicense<QuotesManagementLicense>
- {
- [EntityRelationship(DeleteAction.SetNull)]
- [EditorSequence(3)]
- public CostSheetTypeLink Type { get; set; }
- [EntityRelationship(DeleteAction.SetNull)]
- [EditorSequence(4)]
- public CostSheetBrandLink Brand { get; set; }
- [CheckBoxEditor]
- [EditorSequence(5)]
- public bool Active { get; set; } = true;
- [Aggregate(typeof(CostSheetDocumentCount))]
- [IntegerEditor(Editable = Editable.Hidden)]
- [EditorSequence(6)]
- public int Documents { get; set; }
- [UniqueCodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]
- [EditorSequence(1)]
- public string Code { get; set; }
- [TextBoxEditor]
- [EditorSequence(2)]
- public string Description { get; set; }
- [NullEditor]
- public string Issues { get; set; }
- public override string ToString()
- {
- return string.Format("{0}: {1}", Code, Description);
- }
- }
- }
|