/// <summary> /// Connects to the database and generates a list of /// items from the Inventory Table. /// </summary> /// <returns>List of Items from Inventory Table</returns> public List <String> populateItemList() { try { //Make a new list List <String> items = new List <String>(); int iRet = 0; //Send query DataSet ds = ExecuteSQLStatement(ClsQuery.getAllFromItemsDesc(), ref iRet); //Populate list foreach (DataRow dr in ds.Tables[0].Rows) { items.Add(dr[0].ToString()); } //Return list return(items); } catch (Exception ex) { throw new Exception(ex.Message); } }
/// <summary> /// Fills labels and shows data for the item code selected. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cm_Item_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { //Make a new list List <String> items = new List <String>(); int iRet = 0; //Send query DataSet ds = inVoManager.ExecuteSQLStatement(ClsQuery.getAllFromItemsDesc(), ref iRet); //Populate list foreach (DataRow dr in ds.Tables[0].Rows) { items.Add(dr[0].ToString()); } //Return list cm_Item.ItemsSource = items; } catch (Exception ex) { throw new Exception(ex.Message); } }