Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (TProdyct.Text.Length != 0 && TEDIzmerenia.Text.Length != 0)
            {
                int idprodyct = getProdyct(TProdyct.SelectedItem.ToString());
                int idediz    = getEdizmeren(TEDIzmerenia.SelectedItem.ToString());

                string quest = "INSERT INTO СоставБлюд (ID_блюд, ID_продукт, Количество, Eд, Рецепт) VALUES('" + idblydo + "','" + idprodyct + "','" + TKol.Value + "','" + idediz + "','" + TRecept.Text + "')";
                db.connect.Open();
                OleDbCommand dataAdapter = new OleDbCommand(quest, db.connect);
                dataAdapter.ExecuteNonQuery();
                db.connect.Close();

                DGSostav(idblydo);

                Form_Add formadd = new Form_Add();
                formadd.ShowDialog();
            }
            else
            {
                using (Form_Add_PoleNo form = new Form_Add_PoleNo())
                {
                    form.ShowDialog();
                    this.OnLoad(e);
                }
            }
        }
Пример #2
0
        private void toolStrip_add_Click(object sender, EventArgs e)
        {
            //打开添加学生的信息窗体
            Form_Add formadd = new Form_Add();

            formadd.ShowDialog();
            initContracts();
        }