private void button1_Click(object sender, EventArgs e)
        {
            string ID_Otdela = MySqlOperations.Select_ID_From_ComboBox(MySqlQueries.Select_ID_Otdela, comboBox1.Text);

            MySqlOperations.Insert_Update(MySqlQueries.Insert_Sotrudniki, null, textBox1.Text, textBox2.Text, textBox3.Text, ID_Otdela, textBox4.Text);
            this.Close();
        }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text != "" && comboBox2.Text != "" && textBox1.Text != "")
     {
         string date1 = dateTimePicker1.Value.Year.ToString() + '-' + dateTimePicker1.Value.Month.ToString() + '-' + dateTimePicker1.Value.Day.ToString();
         string date2 = dateTimePicker2.Value.Year.ToString() + '-' + dateTimePicker2.Value.Month.ToString() + '-' + dateTimePicker2.Value.Day.ToString();
         MySqlOperations.Insert_Update(MySqlQueries.Insert_Kartochka, null, MySqlOperations.Select_ID_From_ComboBox(MySqlQueries.Select_ID_Otdela, comboBox1.Text), MySqlOperations.Select_ID_From_ComboBox(MySqlQueries.Select_ID_Othoda, comboBox2.Text), date1, date2, textBox1.Text);
         button1.Visible         = false;
         button3.Visible         = false;
         button8.Visible         = true;
         comboBox1.Enabled       = false;
         comboBox2.Enabled       = false;
         textBox1.Enabled        = false;
         dateTimePicker1.Enabled = false;
         dateTimePicker2.Enabled = false;
         MySqlOperations.Select_Text(MySqlQueries.Last_Insert_ID, ref ID);
         button4.Visible       = true;
         button5.Visible       = true;
         button6.Visible       = true;
         button7.Visible       = true;
         label6.Visible        = true;
         label7.Visible        = true;
         dataGridView1.Visible = true;
         dataGridView2.Visible = true;
     }
     else
     {
         MessageBox.Show("Поля не заполнены.", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != "" && comboBox1.Text != "")
     {
         textBox1.Text = textBox1.Text.Replace('.', ',');
         string date1 = dateTimePicker1.Value.Year.ToString() + '-' + dateTimePicker1.Value.Month.ToString() + '-' + dateTimePicker1.Value.Day.ToString();
         MySqlOperations.Insert_Update(MySqlQueries.Insert_Ubytiya, ID, date1, textBox1.Text, MySqlOperations.Select_ID_From_ComboBox(MySqlQueries.Select_ID_Organizacii, comboBox1.Text));
         this.Close();
     }
     else
     {
         MessageBox.Show("Поле 'Количество' не заполнено.", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Exemple #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != "")
     {
         string output = string.Empty;
         textBox1.Text = textBox1.Text.Replace('.', ',');
         MySqlOperations.Select_Text(MySqlQueries.Select_Kartochka_Ostatok, ref output, ID);
         if (output == "" || decimal.Parse(output) >= decimal.Parse(textBox1.Text))
         {
             string date1 = dateTimePicker1.Value.Year.ToString() + '-' + dateTimePicker1.Value.Month.ToString() + '-' + dateTimePicker1.Value.Day.ToString();
             MySqlOperations.Insert_Update(MySqlQueries.Insert_Pribytiya, ID, date1, textBox1.Text);
             this.Close();
         }
         else
         {
             MessageBox.Show("Количество больше остатка." + '\n' + "Остаток: " + output, "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     else
     {
         MessageBox.Show("Поле 'Количество' не заполнено.", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Exemple #5
0
 private void button1_Click(object sender, EventArgs e)
 {
     MySqlOperations.Insert_Update(MySqlQueries.Insert_Otdely, null, textBox1.Text);
     this.Close();
 }