示例#1
0
        private void speichernBtn_Click(object sender, EventArgs e)
        {
            string isError     = "Fehler:";
            string location    = locationInput.Text;
            string description = descriptionInput.Text;

            if (location.Length <= 0 || location.Length > 255)
            {
                if (isError.Length > 7)
                {
                    isError = String.Concat(isError, ", Treffpunkt ist ungültig");
                }
                else
                {
                    isError = String.Concat(isError, " Treffpunkt ist ungültig");
                }
            }

            if (description.Length <= 0 || description.Length > 255)
            {
                if (isError.Length > 7)
                {
                    isError = isError + ", Beschreibung ist ungültig";
                }
                else
                {
                    isError = isError + " Beschreibung ist ungültig";
                }
            }

            if (isError.Length < 8)
            {
                Bericht berichtView = new Bericht();

                PersonModel person = personSelect;

                DateTime date = this.dateTimePicker.Value.Date;

                terminController.einfuegen(person, date, locationInput.Text, descriptionInput.Text);
                this.Dispose();
            }
            else
            {
                MessageBox.Show(isError, "Invalide eingabe", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     View.Terminverwaltung.Bericht bericht = new View.Terminverwaltung.Bericht();
     bericht.ShowDialog();
 }