public InventoryEntity(Inventory Inventory, params object[] args) : base(Inventory) { foreach (object arg in args) { if (arg is Product Product) { ProductEntity = new ProductEntity(Product); } if (arg is WareHouse WareHouse) { WareHouseEntity = new WareHouseEntity(WareHouse); } if (arg is ICollection <Input> Inputs) { InputEntities = Inputs.Select(model => new InputEntity(model)).ToList(); } if (arg is ICollection <InventoryCheckpoint> InventoryCheckpoints) { InventoryCheckpointEntities = InventoryCheckpoints.Select(model => new InventoryCheckpointEntity(model)).ToList(); } if (arg is ICollection <Output> Outputs) { OutputEntities = Outputs.Select(model => new OutputEntity(model)).ToList(); } } }
public ReceiptNoteEntity(ReceiptNote ReceiptNote, params object[] args) : base(ReceiptNote) { foreach (object arg in args) { if (arg is Employee Employee) { EmployeeEntity = new EmployeeEntity(Employee); } if (arg is Supplier Supplier) { SupplierEntity = new SupplierEntity(Supplier); } if (arg is WareHouse WareHouse) { WareHouseEntity = new WareHouseEntity(WareHouse); } if (arg is ICollection <ReceiptNoteLine> ReceiptNoteLines) { ReceiptNoteLineEntities = ReceiptNoteLines.Select(model => new ReceiptNoteLineEntity(model, model.Product)).ToList(); } } }
public IssueNoteEntity(IssueNote IssueNote, params object[] args) : base(IssueNote) { foreach (object arg in args) { if (arg is Customer Customer) { CustomerEntity = new CustomerEntity(Customer); } if (arg is Invoice Invoice) { InvoiceEntity = new InvoiceEntity(Invoice); } if (arg is WareHouse WareHouse) { WareHouseEntity = new WareHouseEntity(WareHouse); } if (arg is ICollection <IssueNoteLine> IssueNoteLines) { IssueNoteLineEntities = IssueNoteLines.Select(model => new IssueNoteLineEntity(model, model.Product)).ToList(); } } }