Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Hide();
            Form8DobNP form8 = new Form8DobNP();

            form8.ShowDialog();
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            using (MySqlConnection mysqlCon = new MySqlConnection(connectionString))
            {
                int _kol_tovara = 0;

                mysqlCon.Open();
                MySqlCommand mySqlCmd = new MySqlCommand("tovar1AddOrEdit", mysqlCon);
                mySqlCmd.CommandType = CommandType.StoredProcedure;
                mySqlCmd.Parameters.AddWithValue("__id_tovara", _id_tovara);
                mySqlCmd.Parameters.AddWithValue("_name", textBox1.Text.Trim());
                mySqlCmd.Parameters.AddWithValue("__id_otdela", comboBox1.SelectedValue);
                mySqlCmd.Parameters.AddWithValue("_kol_tovara", _kol_tovara);
                mySqlCmd.Parameters.AddWithValue("_edinica_izmereniay", textBox4.Text.Trim());
                mySqlCmd.Parameters.AddWithValue("_cena_na_prod", textBox3.Text.Trim());
                mySqlCmd.ExecuteNonQuery();
                MessageBox.Show("Запись добавлена");
                Clear();
                //GridFill();

                Hide();
                Form8DobNP form8 = new Form8DobNP();
                form8.ShowDialog();
            }
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            using (MySqlConnection mysqlCon = new MySqlConnection(connectionString))
            {
                mysqlCon.Open();
                MySqlCommand mySqlCmd = new MySqlCommand("postav_N", mysqlCon);
                mySqlCmd.CommandType = CommandType.StoredProcedure;
                mySqlCmd.Parameters.AddWithValue("__id_post", _id_post);
                mySqlCmd.Parameters.AddWithValue("_name_post", textBox1.Text.Trim());
                mySqlCmd.Parameters.AddWithValue("_adres", textBox2.Text.Trim());
                mySqlCmd.Parameters.AddWithValue("_telefon", textBox3.Text.Trim());
                mySqlCmd.ExecuteNonQuery();
                MessageBox.Show("Запись добавлена");
                dataGridView1.Refresh();
                Clear();
                GridFill2();
            }
            Hide();
            Form8DobNP form8 = new Form8DobNP();

            form8.ShowDialog();
        }