Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TProdyct.Text.Length != 0 && TKol.Text.Length != 0 && TIzmeren.Text.Length != 0)
            {
                int idprod = getProdict(TProdyct.SelectedItem.ToString());
                int idediz = getizmer(TIzmeren.SelectedItem.ToString());

                string quest = $"UPDATE Склад SET ID_продукта = '{idprod}', ID_ЕдИзмерний = '{idediz}', Количество = '{TKol.Text}'  WHERE ID_записи = {id}";
                db.connect.Open();
                OleDbCommand dataAdapter = new OleDbCommand(quest, db.connect);
                dataAdapter.ExecuteNonQuery();
                db.connect.Close();

                Form_Add w = new Form_Add();
                w.Show();
            }
            else
            {
                using (Form_Add_PoleNo form = new Form_Add_PoleNo())
                {
                    form.Show();
                }
            }
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TName.Text.Length != 0 && TKategor.Text.Length != 0 && TGod.Text.Length != 0 && TCena.Text.Length != 0 && TVes.Text.Length != 0)
            {
                int idediz = getKatalog(TKategor.SelectedItem.ToString());

                string quest = $"UPDATE Блюда SET Название = '{TName.Text}', Вес_порции = '{TVes.Value}', Цена = '{TCena.Text}'  WHERE ID_блюда = {id}";
                db.connect.Open();
                OleDbCommand dataAdapter = new OleDbCommand(quest, db.connect);
                dataAdapter.ExecuteNonQuery();
                db.connect.Close();

                Form_Add w = new Form_Add();
                w.Show();
            }
            else
            {
                using (Form_Add_PoleNo form = new Form_Add_PoleNo())
                {
                    form.ShowDialog();
                    this.OnLoad(e);
                }
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TKol.Text.Length != 0 && TProdyct.Text.Length != 0)
            {
                int idprodict = getProdict(TProdyct.SelectedItem.ToString());

                string quest = $"UPDATE Меню SET ID_блюд = '{idprodict}', Дата = '{dateTimePicker1.Value.ToShortDateString()}', Количество = '{TKol.Text}'  WHERE ID_запМеню = {id}";
                db.connect.Open();
                OleDbCommand dataAdapter = new OleDbCommand(quest, db.connect);
                dataAdapter.ExecuteNonQuery();
                db.connect.Close();

                Form_Add w = new Form_Add();
                w.Show();
            }
            else
            {
                using (Form_Add_PoleNo form = new Form_Add_PoleNo())
                {
                    form.ShowDialog();
                    this.OnLoad(e);
                }
            }
        }