CustomerProduct.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using InABox.Core;
  2. namespace Comal.Classes
  3. {
  4. public enum ProductPriceType
  5. {
  6. FixedPrice,
  7. CostPlus
  8. }
  9. [UserTracking(typeof(Product))]
  10. public class CustomerProduct : Entity, IPersistent, IRemotable, IManyToMany<Customer, Product>, ILicense<ProductManagementLicense>, IExportable,
  11. IImportable
  12. {
  13. [EntityRelationship(DeleteAction.Cascade)]
  14. [EditorSequence(0)]
  15. public CustomerLink CustomerLink { get; set; }
  16. [EntityRelationship(DeleteAction.Cascade)]
  17. [EditorSequence(1)]
  18. public ProductLink ProductLink { get; set; }
  19. [EnumLookupEditor(typeof(ProductPriceType))]
  20. [EditorSequence(2)]
  21. public ProductPriceType PriceType { get; set; }
  22. [CurrencyEditor]
  23. [EditorSequence(3)]
  24. public double Price { get; set; }
  25. [DoubleEditor]
  26. [EditorSequence(4)]
  27. public double Markup { get; set; }
  28. protected override void Init()
  29. {
  30. base.Init();
  31. CustomerLink = new CustomerLink();
  32. ProductLink = new ProductLink(() => this);
  33. }
  34. }
  35. }