コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            MySqlOperations.OpenConnection();
            string output = string.Empty;

            MySqlOperations.Select_Text(MySqlQueries.Select_Avtorizaciya, ref output, null, textBox1.Text, textBox2.Text);
            if (output == "1")
            {
                MySqlOperations.Select_Text(MySqlQueries.Select_User_Form, ref output, null, textBox1.Text, textBox2.Text);
                if (output == "")
                {
                    this.DialogResult = DialogResult.No;
                    this.Close();
                }
                else
                {
                    ID = output;
                    this.DialogResult = DialogResult.Yes;
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Неверный логин или пароль.", "Авторизация", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            MySqlOperations.CloseConnection();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string date = dateTimePicker1.Value.Year.ToString() + '-' + dateTimePicker1.Value.Month.ToString() + '-' + dateTimePicker1.Value.Day.ToString();

            MySqlOperations.Insert_Update(MySqlQueries.Insert_Zayavka_GP, ID_Zakaza, date);
            MySqlOperations.Select_Text(MySqlQueries.Select_Last_Insert, ref ID_Zayavki_GP);
            MySqlOperations.Insert_Update(MySqlQueries.Insert_Zayavka_CUP, ID_Zakaza, date);
            MySqlOperations.Select_Text(MySqlQueries.Select_Last_Insert, ref ID_Zayavki_CUP);
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                MySqlOperations.Insert_Update(MySqlQueries.Insert_Sostav_Zayavki, ID_Zayavki_GP, MySqlOperations.Select_ID_From_ComboBox(MySqlQueries.Select_Product_ID, dataGridView1.Rows[i].Cells[1].Value.ToString()), dataGridView1.Rows[i].Cells[2].Value.ToString());
            }
            for (int i = 0; i < dataGridView2.Rows.Count; i++)
            {
                MySqlOperations.Insert_Update(MySqlQueries.Insert_Sostav_Zayavki, ID_Zayavki_CUP, MySqlOperations.Select_ID_From_ComboBox(MySqlQueries.Select_Product_ID, dataGridView2.Rows[i].Cells[1].Value.ToString()), dataGridView2.Rows[i].Cells[2].Value.ToString());
            }
            MySqlOperations.Insert_Update(MySqlQueries.Update_Identify_Zakaz, ID_Zakaza);
            this.Close();
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string date = dateTimePicker1.Value.Year.ToString() + '-' + dateTimePicker1.Value.Month.ToString() + '-' + dateTimePicker1.Value.Day.ToString();

            MySqlOperations.Insert_Update(MySqlQueries.Insert_Zakaz, ID_Org, date);
            MySqlOperations.Select_Text(MySqlQueries.Select_Last_Insert, ref ID_Zakaza);
            groupBox1.Visible = true;
            groupBox2.Visible = true;
            MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sostav_CUP, dataGridView1, ID_Zakaza);
            MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sostav_GP, dataGridView2, ID_Zakaza);
        }
コード例 #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text != "")
     {
         string output = string.Empty;
         MySqlOperations.Select_Text(MySqlQueries.Select_Product_ID, ref output, null, comboBox1.Text);
         MySqlOperations.Insert_Update(MySqlQueries.Insert_Sostav_Zakaza, ID, output, numericUpDown1.Value.ToString().Replace(',', '.').ToString());
         this.Close();
     }
     else
     {
         MessageBox.Show("Выберите продукцию.", "Добавление", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }