Ejemplo n.º 1
0
 private void createEvent_btn_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(name_txtBox.Text) &&
         !string.IsNullOrWhiteSpace(type_txtBox.Text) &&
         !string.IsNullOrWhiteSpace(place_txtBox.Text) &&
         !string.IsNullOrWhiteSpace(date_txtBox.Text) &&
         !string.IsNullOrWhiteSpace(time_txtBox.Text))
     {
         Error res = new Error();
         if (!update)
         {
             res = TransactionScripts.createEvent(name_txtBox.Text,
                                                  type_txtBox.Text, place_txtBox.Text,
                                                  date_txtBox.Text, time_txtBox.Text);
         }
         else
         {
             res = TransactionScripts.updateEvent(event_, name_txtBox.Text,
                                                  type_txtBox.Text, place_txtBox.Text,
                                                  date_txtBox.Text, time_txtBox.Text);
         }
         if (!res.error)
         {
             mainF.update();
             this.Close();
         }
         else
         {
             DialogResult result = MessageBox.Show(
                 //res.message,
                 "Ошибка",
                 "Проверьте корректность введенных данных",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Information,
                 MessageBoxDefaultButton.Button1);
         }
     }
     else
     {
         MessageBox.Show("Заполните все поля");
     }
 }