EntitySpreadsheet.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using InABox.Core;
  3. namespace Comal.Classes
  4. {
  5. public abstract class EntitySpreadsheet<TParent, TParentLink> : Entity, IRemotable, IPersistent, IOneToMany<TParent>, ISpreadsheet<TParent,TParentLink>
  6. where TParent : Entity
  7. where TParentLink : IEntityLink<TParent>, new()
  8. {
  9. [EditorSequence(1)]
  10. [CodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]
  11. public String Code { get; set; }
  12. [EditorSequence(2)]
  13. [TextBoxEditor]
  14. public String Description { get; set; }
  15. [EditorSequence(3)]
  16. [TimestampEditor]
  17. [LoggableProperty]
  18. public DateTime Superceded { get; set; }
  19. [NullEditor]
  20. public TParentLink Parent { get; set; }
  21. public byte[] Data { get; set; }
  22. protected override void Init()
  23. {
  24. base.Init();
  25. Parent = new TParentLink();
  26. Data = new byte[] { };
  27. }
  28. }
  29. public class JobSpreadsheet : EntitySpreadsheet<Job, JobLink>, ILicense<ProjectManagementLicense> { }
  30. public class QuoteSpreadsheet : EntitySpreadsheet<Quote, QuoteLink>, ILicense<QuotesManagementLicense> { }
  31. public class ProductSpreadsheet : EntitySpreadsheet<Product, ProductLink>, ILicense<ProductManagementLicense> { }
  32. public class CustomerSpreadsheet : EntitySpreadsheet<Customer, CustomerLink>, ILicense<AccountsReceivableLicense> { }
  33. public class SupplierSpreadsheet : EntitySpreadsheet<Supplier, SupplierLink>, ILicense<AccountsPayableLicense> { }
  34. public class EmployeeSpreadsheet : EntitySpreadsheet<Employee, EmployeeLink>, ILicense<HumanResourcesLicense> { }
  35. }