/* * public AllocationListModel FindAllocationsListModel(PurchaseOrderDetailModel pod) { * AllocationListModel model = new AllocationListModel(); * foreach (var item in db.FindAllocationsToPurchaseOrder(pod.PurchaseOrderHeaderId) * .Where(a => a.PurchaseLineId == pod.Id) * .OrderBy(a => a.DateCreated)) { * var alloc = MapToModel(item); * model.Items.Add(alloc); * } * return model; * } */ public AllocationListModel FindAllocationListModel(CompanyModel company, ProductModel product) { var model = new AllocationListModel(); foreach (var item in db.FindAllocations(company.Id, product.Id)) { model.Items.Add(MapToModel(item)); } return(model); }
public AllocationListModel FindAllocationsForSale(SalesOrderDetailModel sod) { AllocationListModel model = new AllocationListModel(); foreach (var item in db.FindAllocationsForSalesOrderDetail(sod.CompanyId, sod.Id) .OrderBy(a => a.SaleLineId) .ThenBy(a => a.DateCreated)) { var alloc = MapToModel(item); model.Items.Add(alloc); } return(model); }
public AllocationListModel FindAllocationsToPurchaseOrder(PurchaseOrderHeaderModel poh) { AllocationListModel model = new AllocationListModel(); foreach (var item in db.FindAllocationsToPurchaseOrder(poh.Id) .OrderBy(a => a.PurchaseLineId) .ThenBy(a => a.DateCreated)) { var alloc = MapToModel(item); model.Items.Add(alloc); } return(model); }