private void frmMealCreate_Load(object sender, EventArgs e) { fsMasterlist = DataConnection.ListAllFoodstuffs(); foreach (FoodStuff fs in fsMasterlist) { ListViewItem lsvItem = new ListViewItem(fs.Name.ToString()); lsvRecipes.Items.Add(lsvItem); } }
private void frmNewSearch_Load(object sender, EventArgs e) { fsMasterlist = DataConnection.ListAllFoodstuffs(); PopulateListView(fsMasterlist); fsFilteredlist = new List <FoodStuff>(); py = 3; // //if (/*Passes filter rule.*/) // //{ // // //Then adds the items returned to listview // // // //} }
private void frmSearchRecipes_Load(object sender, EventArgs e) { fsMasterlist = DataConnection.ListAllFoodstuffs(); foreach (FoodStuff fs in fsMasterlist) { ListViewItem lsvItem = new ListViewItem(fs.Name.ToString()); lsvItem.SubItems.Add(fs.Servings.ToString()); lsvItem.SubItems.Add(fs.Cost.ToString("C")); lsvItem.SubItems.Add(fs.CostPerServing().ToString("C")); lsvItem.SubItems.Add(fs.PrepTime.ToString() + " mins"); lsvItem.SubItems.Add(fs.CookTime.ToString() + " mins"); lsvItem.SubItems.Add(fs.ID.ToString()); lsvSearch.Items.Add(lsvItem); } }
private void frmShowAllRecipes_Load(object sender, EventArgs e) { // Imports all items from the recipes list into listview... fsMasterlist = DataConnection.ListAllFoodstuffs(); foreach (FoodStuff fs in fsMasterlist) { ListViewItem lsvItem = new ListViewItem(fs.Name.ToString()); lsvItem.SubItems.Add(fs.Servings.ToString()); lsvItem.SubItems.Add(fs.Cost.ToString("C")); lsvItem.SubItems.Add(fs.CostPerServing().ToString("C")); lsvItem.SubItems.Add(fs.PrepTime.ToString() + " mins"); lsvItem.SubItems.Add(fs.CookTime.ToString() + " mins"); lsvItem.SubItems.Add(fs.ID.ToString()); lsvAllRecipes.Items.Add(lsvItem); } }
private void btnClear_Click(object sender, EventArgs e) { fsFilteredlist.Clear(); pnlMain.Controls.Clear(); lsvSearch.Items.Clear(); //lstDynAndOrBtns.Clear(); lstDynCBOs.Clear(); py = 3; fsMasterlist = DataConnection.ListAllFoodstuffs(); foreach (FoodStuff fs in fsMasterlist) { ListViewItem lsvItem = new ListViewItem(fs.Name.ToString()); lsvItem.SubItems.Add(fs.Servings.ToString()); lsvItem.SubItems.Add(fs.Cost.ToString("C")); lsvItem.SubItems.Add(fs.CostPerServing().ToString("C") + " Each"); lsvItem.SubItems.Add(fs.PrepTime.ToString() + " mins"); lsvItem.SubItems.Add(fs.CookTime.ToString() + " mins"); lsvItem.SubItems.Add(fs.ID.ToString()); lsvSearch.Items.Add(lsvItem); } }