private void ProductNameBTN_Click(object sender, EventArgs e) { MainGrid.DataSource = null; MainGrid.Refresh(); try { var c = db.Products.SqlQuery("SELECT * FROM Products WHERE ProductName LIKE'%" + ProductNameTB.Text + "%'"); MainGrid.DataSource = c.ToList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void MenuDishNameBNT_Click(object sender, EventArgs e) { MainGrid.DataSource = null; MainGrid.Refresh(); try { var c = db.Menu.SqlQuery("SELECT * FROM Menu WHERE DishName LIKE '%" + MenuDishNameTB.Text + "%'"); MainGrid.DataSource = c.ToList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ChefPozFilterBTN_Click(object sender, EventArgs e) { if (!ChefPozFilterTB.Text.Equals(string.Empty)) { MainGrid.DataSource = null; MainGrid.Refresh(); try { var c = db.Chefs.SqlQuery("SELECT * FROM Chefs WHERE Pozition_name LIKE '%" + ChefPozFilterTB.Text + "%';"); MainGrid.DataSource = c.ToList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }