changes
parent
81c62f892d
commit
ad20db3995
55
src/ui.c
55
src/ui.c
|
@ -25,7 +25,7 @@ int main(void)
|
|||
Task *task = newTask(taskname, taskcreation_date, taskdeadline_date, taskpriority, taskspare);
|
||||
if (task == NULL) {
|
||||
printf("Fehler beim Erstellen der Aufgabe.\n");
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (list == NULL) {
|
||||
|
@ -48,7 +48,8 @@ int main(void)
|
|||
printf("Falsche Eingabe\n");};
|
||||
choice = 0;
|
||||
|
||||
while(( choice < 1 || choice > 5)){
|
||||
while(( choice < 1 || choice > 5))
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
case 1:
|
||||
|
@ -78,35 +79,37 @@ int main(void)
|
|||
if (scanf("%d", &taskspare) != 1) {
|
||||
printf("Ungültige Eingabe.\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
printf("Geben Sie die zur verfuegung stehende Zeit für die Fächer an: \n");
|
||||
scanf("%c", &taskspare);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
printf("Geben Sie die zur verfuegung stehende Zeit für die Fächer an: \n");
|
||||
scanf("%c", &taskspare);
|
||||
break;
|
||||
case 3: if( task == NULL)
|
||||
{
|
||||
printf("Die Liste ist leer");
|
||||
}
|
||||
else
|
||||
{
|
||||
llist *iterator = list;
|
||||
while (iterator != NULL) {
|
||||
Task *currentTask = (Task *)(iterator->data); // Cast zu Task
|
||||
printf("Fach: %s, Deadline: %ld, Priorität: %d\n",
|
||||
currentTask->name, currentTask->deadline, currentTask->priority);
|
||||
iterator = iterator->next; // Gehe zum nächsten Listenelement
|
||||
}
|
||||
}
|
||||
|
||||
case 3: if( task == NULL){
|
||||
printf("Die Liste ist leer");
|
||||
}
|
||||
else
|
||||
{
|
||||
llist *iterator = list;
|
||||
while (iterator != NULL) {
|
||||
Task *currentTask = (Task *)(iterator->data); // Cast zu Task
|
||||
printf("Fach: %s, Deadline: %ld, Priorität: %d\n",
|
||||
currentTask->name, currentTask->deadline, currentTask->priority);
|
||||
iterator = iterator->next; // Gehe zum nächsten Listenelement
|
||||
break;
|
||||
// case 4: iCAl();break;
|
||||
}
|
||||
while (choice !=5);{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
// case 4: iCAl();break;
|
||||
}
|
||||
}while (choice !=5);
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue