| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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();
- LinkProperty<RequisitionItem, ProductLink, String>(x => x.Product, x => x.Code, x => x.Code);
- LinkProperty<RequisitionItem, ProductLink, String>(x => x.Product, x => x.Name, x => x.Description);
- Holding = new StockHoldingLink();
- Location = new StockLocationLink();
- Style = new ProductStyleLink();
- LinkProperty<RequisitionItem, ProductStyleLink, Guid>(x=>x.Product.DefaultStyle, x => x.ID, x => x.Style.ID);
-
- //StockMovement = new StockMovementLink();
- }
- }
- }
|