Esempio n. 1
0
        private void bAddIngr_Click(object sender, EventArgs e)
        {
            add_ingr_in_food ingr_in_food = new add_ingr_in_food(Program.data_module, _id);
            ingr_in_food.food_name = this.tb_name.Text;
            ingr_in_food.ShowDialog();

            this.load_data_table(this._current_state);
            this.fill_food_data();
            this.Update();
        }
Esempio n. 2
0
        private void gw_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            add_ingr_in_food ingr_in_food = null;
                try
                {

                     ingr_in_food = new add_ingr_in_food(Program.data_module, gw.Rows[gw.CurrentRow.Index].Cells[0].Value.ToString(),
                                                                              gw.Rows[gw.CurrentRow.Index].Cells[1].Value.ToString(),
                                                                              Convert.ToInt32(gw.Rows[gw.CurrentRow.Index].Cells[4].Value.ToString()),
                                                                              Convert.ToInt32(gw.Rows[gw.CurrentRow.Index].Cells[5].Value.ToString()));
                     ingr_in_food.ShowDialog();
                }
                catch (Exception)
                {
                     MessageBox.Show("Выберите ингридиент!");
                }

            this.load_data_table(this._current_state);
            this.fill_food_data();
            this.Update();
        }
 //Добавление ингридиента
 private void add_new_ingr_in_food()
 {
     add_ingr_in_food add_ingr = new add_ingr_in_food(Program.data_module, ingr_id);
     add_ingr.ShowDialog();
 }