private static Hashtable getStockIDTable() { Hashtable ht = new Hashtable(); StockItemNewDB sidb = new StockItemNewDB(); List <stockitemnew> Silist = sidb.getStockItems(); foreach (stockitemnew si in Silist) { try { string id = si.StockItemID; string key = id.Substring(0, 12); string value = id.Substring(12, 4); if (ht.ContainsKey(key)) { ht[key] = value; } else { ht.Add(key, value); } } catch (Exception ex) { } } return(ht); }
private void ListStockItem() { try { grdList.Rows.Clear(); StockItemNewDB SiDb = new StockItemNewDB(); List <stockitemnew> SIlist = SiDb.getStockItems(); foreach (stockitemnew item in SIlist) { grdList.Rows.Add(item.StockItemID, item.Name, item.Group1Code, item.Group1CodeDescription, item.Unit, getStatusString(item.Status), item.DocumentStatus); } filterGridData(); } catch (Exception) { MessageBox.Show("Error in Stock listing"); } enableBottomButtons(); pnlList.Visible = true; }