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); } }