private void textBox6_TextChanged(object sender, EventArgs e) { RecipeBL = new RecipeBL(); RecipeBO = new RecipeBO(); Cursor = Cursors.WaitCursor; try { if (textBox6.Text != "Search box") { if (radioButton1.Checked == true) { RecipeBO.recipe = textBox6.Text.Trim(); RecipeBO.cat = cat; dataGridView1.DataSource = RecipeBL.searchRecipe(RecipeBO); } else { RecipeBO.recipe = textBox6.Text.Trim(); RecipeBO.cat = cat; dataGridView1.DataSource = RecipeBL.searchRecipeUn(RecipeBO); } } } catch (Exception) { Cursor = Cursors.Arrow; throw; } Cursor = Cursors.Arrow; }
private void frmRecipes_Load(object sender, EventArgs e) { RecipeBL = new Catering_Menu.RecipeBL(); RecipeBO = new Catering_Menu.RecipeBO(); cat = "Appetizer"; try { RecipeBO.recipe = ""; RecipeBO.cat = cat; dataGridView1.DataSource = RecipeBL.searchRecipe(RecipeBO); } catch (Exception) { throw; } }
private void toolStripMenuItem2_Click(object sender, EventArgs e) { recBO = new RecipeBO(); recBL = new RecipeBL(); diagAddRecipe diagAdd = new diagAddRecipe("Update", RecipeID); if (diagAdd.ShowDialog() == DialogResult.OK) { time = 0; notifier("Dish successfully updated."); lblNotif.Left = (this.ClientSize.Width - lblNotif.Size.Width) / 2; this.panel3.BackColor = System.Drawing.Color.DodgerBlue; try { RecipeBO.recipe = diagAdd.recipename; RecipeBO.cat = cat; dataGridView1.DataSource = RecipeBL.searchRecipe(RecipeBO); } catch (Exception) { throw; } } }
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { RecipeBL = new RecipeBL(); RecipeBO = new RecipeBO(); try { int selectedcat = Convert.ToInt32(tabControl1.SelectedIndex.ToString()); if (selectedcat == 0) { cat = "Appetizer"; } else if (selectedcat == 1) { cat = "Bread Service"; } else if (selectedcat == 2) { cat = "Soup"; } else if (selectedcat == 3) { cat = "Salad"; } else if (selectedcat == 4) { cat = "Pasta"; } else if (selectedcat == 5) { cat = "Main Dish"; } else if (selectedcat == 6) { cat = "Kiddie Meal"; } else if (selectedcat == 7) { cat = "Rice"; } else if (selectedcat == 8) { cat = "Dessert"; } else if (selectedcat == 9) { cat = "Cake"; } else if (selectedcat == 10) { cat = "Drinks"; } else if (selectedcat == 11) { cat = "Crew meal"; } else if (selectedcat == 12) { cat = "Others"; } if (radioButton1.Checked == true) { RecipeBO.recipe = textBox6.Text.Trim(); if (textBox6.Text == "Search box") { RecipeBO.recipe = ""; } RecipeBO.cat = cat; dataGridView1.DataSource = RecipeBL.searchRecipe(RecipeBO); } else { RecipeBO.recipe = textBox6.Text.Trim(); if (textBox6.Text == "Search box") { RecipeBO.recipe = " "; } RecipeBO.cat = cat; dataGridView1.DataSource = RecipeBL.searchRecipeUn(RecipeBO); } } catch (Exception) { throw; } }