public static List <InventoryReportItem> GetSelectedInventoryReportItemList(string search) { List <InventoryReportItem> reportItemList = new List <InventoryReportItem>(); List <Item> iList = EFBroker_Item.SearchItemsByItemCodeOrDesc(search); foreach (Item i in iList) { InventoryReportItem rItem = new InventoryReportItem(i); reportItemList.Add(rItem); } return(reportItemList); }
public List <WCFCatalogueItem> SearchItems(string search) { List <Item> iList = EFBroker_Item.SearchItemsByItemCodeOrDesc(search); List <WCFCatalogueItem> ciList = new List <WCFCatalogueItem>(); foreach (Item i in iList) { if (i.BalanceQty != null) { int adjustments = GetAdjustmentSum(i); WCFCatalogueItem ci = WCFCatalogueItem.Make(i.ItemCode, i.Description, i.UnitOfMeasure, (int)i.BalanceQty, adjustments, i.Bin); ciList.Add(ci); } } return(ciList); }
protected void BtnSearch_Click(object sender, EventArgs e) { //Search button Dictionary <Item, String> searchResults = new Dictionary <Item, String>(); string search = txtSearch.Text.ToLower(); List <Item> iList = EFBroker_Item.SearchItemsByItemCodeOrDesc(search); foreach (Item i in iList) { //If a monthly inventory check discrepancy is not yet approved, the sum of only //discrepancies starting from the monthly one will be displayed Discrepency dMonthly = EFBroker_Discrepancy.GetPendingMonthlyDiscrepancyByItemCode(i.ItemCode); List <Discrepency> dList = EFBroker_Discrepancy.GetPendingDiscrepanciesByItemCode(i.ItemCode); if (dMonthly == null) { string adjStr = GetAdjustmentsString(dList); searchResults.Add(i, adjStr); } else { string adjStr = GetPartialAdjustmentsString(dList, dMonthly); searchResults.Add(i, adjStr); } } gvItemList.DataSource = searchResults; gvItemList.DataBind(); foreach (GridViewRow row in gvItemList.Rows) { HyperLink link = row.FindControl("hlkDesc") as HyperLink; Label lbl = row.FindControl("lblItemCodeItem") as Label; string itemCode = lbl.Text; link.NavigateUrl = LoginController.AddItemDiscrepancyURI + "?itemCode=" + itemCode; } }