private void FormAddMenu_Load(object sender, EventArgs e) { DishORM menuORM = new DishORM(); dgvAMeAdded.DataSource = menuORM.SearchFromMenu(id); dgvAMeAvailable.DataSource = menuORM.SearchExceptFromMenu(id); formatAddedDgv(dgvAMeAdded); formatAvailableDgv(dgvAMeAvailable); resizeGrids(); }
public void Create() { MenuORM menuORM = new MenuORM(); int menuId = menuORM.Create(Build()); DishORM dishORM = new DishORM(); List <Dish> addedDishes = getAddedDishes(menuId); foreach (Dish dish in addedDishes) { dishORM.addRelation(dish); } }
public void Create() { DishORM dishORM = new DishORM(); int dishId = dishORM.Create(Build()); IngredientORM ingredientORM = new IngredientORM(); List <Ingredient> addedIgredients = getAddedIngredients(dishId); foreach (Ingredient ingredient in addedIgredients) { ingredientORM.addRelation(ingredient); } }
public void Edit() { MenuORM menuORM = new MenuORM(); menuORM.Edit(Build()); DishORM dishORM = new DishORM(); dishORM.DeleteAllRelations(id); List <Dish> addedDishes = getAddedDishes(id); foreach (Dish dish in addedDishes) { dishORM.addRelation(dish); } }
public void Edit() { DishORM dishORM = new DishORM(); dishORM.Edit(Build()); IngredientORM ingredientORM = new IngredientORM(); ingredientORM.DeleteAllRelations(id); List <Ingredient> addedIgredients = getAddedIngredients(id); foreach (Ingredient ingredient in addedIgredients) { ingredientORM.addRelation(ingredient); } }
private void tbxDisSearchName_TextChanged(object sender, EventArgs e) { if (tbxDisSearchName.Text.Equals("")) { RefreshData(); } else { DataTable data = new DishORM().Search(tbxDisSearchName.Text); dgvDis.DataSource = data; } /* */ }