Esempio n. 1
0
    def add_new_donation_menu():                             #new event registration
            if file_handler.file_accessible(DONATION_PATH, "a"):
                donation_event_actual = event_class.DonationEvent()
                donation_event_actual.get_data_from_input()
                if donation_event_actual.check_validation():
                    file_handler.data_to_file(DONATION_PATH, donation_event_actual)
            else:
                print("Creating new data file...")
                donation_header = ",".join(event_input.DonationEventInput.DONATION_HEADER)
                file_handler.create_csv_file_if_not_present(DONATION_PATH, donation_header)
                time.sleep(3)

            MainMenu().main_menu()
Esempio n. 2
0
 def add_new_donor_menu():
         if file_handler.file_accessible(DONOR_PATH, "a"):                               #new donor registration
             actual_donor = donor_class.Donor()
             actual_donor.get_data_from_input()
             if file_handler.check_if_id_not_in_file(DONOR_PATH, actual_donor.identifier) and actual_donor.is_suitable():
                 file_handler.data_to_file(DONOR_PATH, actual_donor)
             elif not file_handler.check_if_id_not_in_file(DONOR_PATH, actual_donor.identifier):
                 input("The donor's data is already present in the file.")
         else:
             print("Creating new data file...")
             donor_header = ",".join(donor_input.DonorInput.DONOR_HEADER)
             file_handler.create_csv_file_if_not_present(DONOR_PATH, donor_header)
             time.sleep(3)
         MainMenu().main_menu()