private void GUIsubmit_Click(object sender, RoutedEventArgs e) { switch (get_action()) { case "add": switch (get_view()) { case "worker": Console.WriteLine(DB.add_worker(user_name.Text, user_first_name.Text, user_last_name.Text, (user_date_of_birth.SelectedDate.HasValue ? (DateTime)user_date_of_birth.SelectedDate : DateTime.Now), int.Parse(user_worker_access.Text), CURRENT_USER).ToString()); break; case "client": Console.WriteLine(DB.add_client(user_name.Text, user_first_name.Text, user_last_name.Text, (user_date_of_birth.SelectedDate.HasValue ? (DateTime)user_date_of_birth.SelectedDate : DateTime.Now), CURRENT_USER).ToString()); break; case "book": Console.WriteLine(DB.add_book(book_name.Text, book_author.Text, book_category.Text, int.Parse(book_rating.Text), CURRENT_USER).ToString()); break; } break; case "remove": switch (get_view()) { case "worker": worker tempw = DB.delete_worker(user_name.Text, user_first_name.Text, user_last_name.Text, (user_date_of_birth.SelectedDate.HasValue ? (DateTime)user_date_of_birth.SelectedDate : DateTime.Now), int.Parse(user_worker_access.Text), CURRENT_USER); if (tempw != null) { Console.WriteLine(tempw.ToString()); } break; case "client": client tempc = DB.delete_client(user_name.Text, user_first_name.Text, user_last_name.Text, (user_date_of_birth.SelectedDate.HasValue ? (DateTime)user_date_of_birth.SelectedDate : DateTime.Now), CURRENT_USER); if (tempc != null) { Console.WriteLine(tempc.ToString()); } break; case "book": book tempb = DB.delete_book(book_name.Text, book_author.Text, book_category.Text, int.Parse(book_rating.Text), CURRENT_USER); if (tempb != null) { Console.WriteLine(tempb.ToString()); } break; } break; } GUI_clear(); }