Example #1
0
        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();
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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);
            }
        }
Example #5
0
        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);
            }
        }
Example #6
0
        private void tbxDisSearchName_TextChanged(object sender, EventArgs e)
        {
            if (tbxDisSearchName.Text.Equals(""))
            {
                RefreshData();
            }
            else
            {
                DataTable data = new DishORM().Search(tbxDisSearchName.Text);
                dgvDis.DataSource = data;
            }

            /*
             */
        }