Example #1
0
 private void Add_act_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (flag_ok != "OK" && flag_cancel != "CANCEL")
     {
         if (MessageBox.Show("Сохранить изменения", "Уведомление", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             mysql.add_new_act(System.Convert.ToInt32(comboBox1.SelectedItem.ToString()), dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"), textBox1.Text, list_services, ((KeyValuePair <int, string>)comboBox3.SelectedItem).Key);
             Dispose();
             list_act_work list_Act_Work = new list_act_work();
             list_Act_Work.ShowDialog();
         }
     }
 }
Example #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     foreach (var item in listBox1.Items)
     {
         list_services.Add(((KeyValuePair <int, string>)item).Key);
     }
     mysql.add_new_act(System.Convert.ToInt32(comboBox1.SelectedItem.ToString()), dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss"), textBox1.Text, list_services, ((KeyValuePair <int, string>)comboBox3.SelectedItem).Key);
     if (MessageBox.Show("Регистрация акта выполненных работ прошла успешно!", "Уведомление", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
     {
         flag_ok = "OK";
         this.Close();
         list_act_work list_Act_Work = new list_act_work();
         list_Act_Work.ShowDialog();
     }
     flag_ok = "OK";
 }