/// <summary> /// Get the Suppliert List according to the Item /// </summary> /// <param name="item"></param> /// <returns> /// List of supplier list /// </returns> public List <Supplier> GetPrioritySupplier(Item item) { try { supplierList = new List <Supplier>(); SupplierBroker supplierBroker = new SupplierBroker(this.inventory); itemPriceList = inventory.ItemPrices.Where(itemPrice => itemPrice.ItemId == item.Id).ToList <ItemPrice>(); Supplier supplier; foreach (ItemPrice itemPrice in itemPriceList) { supplier = new Supplier(); supplier.Id = itemPrice.SupplierId; supplier = supplierBroker.GetSupplier(supplier); supplierList.Add(supplier); } supplierList.Sort(); } catch (Exception e) { supplierList = null; } return(supplierList); }
/// <summary> /// Get the Suppliert List according to the Item /// </summary> /// <param name="item"></param> /// <returns> /// List of supplier list /// </returns> public List<Supplier> GetPrioritySupplier(Item item) { try { supplierList = new List<Supplier>(); SupplierBroker supplierBroker = new SupplierBroker(this.inventory); itemPriceList = inventory.ItemPrices.Where(itemPrice => itemPrice.ItemId == item.Id).ToList<ItemPrice>(); Supplier supplier; foreach (ItemPrice itemPrice in itemPriceList) { supplier = new Supplier(); supplier.Id = itemPrice.SupplierId; supplier = supplierBroker.GetSupplier(supplier); supplierList.Add(supplier); } supplierList.Sort(); } catch (Exception e) { supplierList = null; } return supplierList; }