/// <summary> /// Gets the recurrence type to be created. /// </summary> /// <returns>Returns the recurrence type as an enum.</returns> private RecurrenceType GetRecurrenceType() { RecurrenceType recurrenceType; do { Console.WriteLine("\n1. Einmaliger Termin"); Console.WriteLine("2. Wöchtenlicher Termin"); Console.WriteLine("3. Jährlicher Termin"); Console.WriteLine("0. Abbruch"); Console.Write("Geben Sie die entsprechende Nummer ein um fortzufahren: "); int input = AppointmentViewGeneral.GetUserInputInt(); switch (input) { case 1: recurrenceType = RecurrenceType.Never; break; case 2: recurrenceType = RecurrenceType.Weekly; break; case 3: recurrenceType = RecurrenceType.Yearly; break; case 0: recurrenceType = RecurrenceType.None; AppointmentViewGeneral.PrintCanceledAction(); break; default: recurrenceType = RecurrenceType.Invalid; AppointmentViewGeneral.PrintInvalidInput(); break; } }while (recurrenceType == RecurrenceType.Invalid); return(recurrenceType); }
/// <summary> /// Gets the appointment type to be created. /// </summary> /// <returns>Returns the appointment type as an enum.</returns> private AppointmentType GetAppointmentType() { AppointmentType appointmentType; do { Console.WriteLine("\n1. Ganztägiger Termin"); Console.WriteLine("2. Termin mit Dauer"); Console.WriteLine("0. Abbruch"); Console.Write("Geben Sie die entsprechende Nummer ein um fortzufahren: "); int input = AppointmentViewGeneral.GetUserInputInt(); switch (input) { case 1: appointmentType = AppointmentType.AllDay; break; case 2: appointmentType = AppointmentType.Duration; break; case 0: appointmentType = AppointmentType.None; AppointmentViewGeneral.PrintCanceledAction(); break; default: appointmentType = AppointmentType.Invalid; AppointmentViewGeneral.PrintInvalidInput(); break; } }while (appointmentType == AppointmentType.Invalid); return(appointmentType); }