private void button1_Click(object sender, EventArgs e)
        {
            switch (button1.Text)
            {
            case "Eintragen":
                button1.Enabled = false;
                button2.Enabled = false;
                if (Eintragen())
                {
                    button1.Text = "Status wechseln";
                    notification.Show("Ins Dienstblatt eingetragen!", AlertType.success);
                    button1.Enabled = true;
                    button2.Enabled = true;
                }
                break;

            case "Status wechseln":

                button1.Enabled = false;
                button2.Enabled = false;
                Austragen();
                if (Eintragen("", fahrzeug))
                {
                    notification.Show("Status gewechselt!", AlertType.success);

                    button1.Enabled = true;
                    button2.Enabled = true;
                }
                break;

            case "Freistellen":
                if (comboBox2.SelectedIndex != -1)
                {
                    if (dateTimePicker1.Text != dateTimePicker2.Text)
                    {
                        if (comboBox1.SelectedIndex == 23)
                        {
                            db.Insert("INSERT INTO Freistellung (userid, name, beginn, ende) VALUES ('" + Form1.userid + "', '" + comboBox2.Text + "', '" + dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss") + "', '" + dateTimePicker2.Value.ToString("yyyy-MM-dd HH:mm:ss") + "')");
                            notification.Show("Freistellung eingetragen!", AlertType.success);
                            comboBox1.SelectedIndex = 0;
                            comboBox2.SelectedIndex = -1;
                            comboBox2.Items.Clear();
                            //Load_DB();
                        }
                    }
                    else
                    {
                        notification.Show("Zeiten müssen unterschiedlich sein!", AlertType.warning);
                    }
                }
                else
                {
                    notification.Show("Kein Mitarbeiter gewählt!", AlertType.warning);
                }
                break;
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (richTextBox1.Text != "")
     {
         var type = 0;
         if (radioButton2.Checked)
         {
             type = 1;
         }
         db.Insert("INSERT INTO Schwarzes_Brett (type, eintrag, eingetragen, autor, aktiv) VALUES ('" + type + "', '" + richTextBox1.Text + "', NOW(), '" + Form1.userid + "', '1')");
         notification.Show("Eintrag erfolgreich!", AlertType.success);
         Content();
     }
 }
 private void Neuerchangelog_Click(object sender, EventArgs e)
 {
     if (Neuerchangelogtitel.Text != "Titel" && Neuerchangelogtitel.Text != "")
     {
         if (Neuerchangelogbox.Text != "")
         {
             Neuerchangelog.Visible      = false;
             Neuerchangelogbox.Visible   = false;
             Neuerchangelogtitel.Visible = false;
             db.Insert("INSERT INTO Changelog (`titel`, `text`, `datum`) VALUES ('" + Neuerchangelogtitel.Text + "','" + Neuerchangelogbox.Text + "',NOW())");
             Fill_Changelog();
             notification.Show("Neuer Changelog eingetragen!", AlertType.success);
         }
         else
         {
             notification.Show("Kein Changelogtext eingegeben!", AlertType.info);
         }
     }
     else
     {
         notification.Show("Kein Titel eingetragen!", AlertType.info);
     }
 }