1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Linq.Expressions;
- using InABox.Core;
- namespace Comal.Classes
- {
- [UserTracking(typeof(Requisition))]
- public class RequisitionItem : Entity, IPersistent, IRemotable, INumericAutoIncrement<RequisitionItem>, ILicense<LogisticsLicense>
- {
- [IntegerEditor(Editable = Editable.Hidden)]
- [NullEditor]
- public int Sequence { get; set; }
- [EntityRelationship(DeleteAction.Cascade)]
- [NullEditor]
- public RequisitionLink RequisitionLink { get; set; }
- [EditorSequence(1)]
- public ProductLink Product { get; set; }
- [EditorSequence(2)]
- [NullEditor]
- public string BarCode { get; set; }
- [EditorSequence(3)]
- [CodeEditor(Visible = Visible.Hidden, Editable = Editable.Hidden)]
- public string Code { get; set; }
- [MemoEditor]
- [EditorSequence(4)]
- public string Description { get; set; }
- [EditorSequence(5)]
- public ProductStyleLink Style { get; set; }
- [EditorSequence(6)]
- public double Quantity { get; set; }
- [NullEditor]
- public StockHoldingLink Holding { get; set; }
- [EditorSequence(7)]
- public StockLocationLink Location { get; set; }
-
- public Expression<Func<RequisitionItem, int>> AutoIncrementField()
- {
- return x => x.Sequence;
- }
- public Filter<RequisitionItem> AutoIncrementFilter()
- {
- return new Filter<RequisitionItem>(x => x.RequisitionLink.ID).IsEqualTo(RequisitionLink.ID);
- }
- protected override void Init()
- {
- base.Init();
- RequisitionLink = new RequisitionLink();
- Product = new ProductLink(() => this);
-
- Holding = new StockHoldingLink();
- Location = new StockLocationLink();
- Style = new ProductStyleLink();
-
- //StockMovement = new StockMovementLink();
- }
- static RequisitionItem()
- {
- LinkedProperties.Register<RequisitionItem, ProductLink, String>(x => x.Product, x => x.Code, x => x.Code);
- LinkedProperties.Register<RequisitionItem, ProductLink, String>(x => x.Product, x => x.Name, x => x.Description);
- LinkedProperties.Register<RequisitionItem, ProductStyleLink, Guid>(x=>x.Product.DefaultStyle, x => x.ID, x => x.Style.ID);
- }
- }
- }
|