コード例 #1
0
	def submit_all():
		result = askquestion(title="Confirmation", message= "Do you want to process?")

		if result == "yes":
			person = Person()
			person.lname = input_lastname.get(1.0, "end-1c")
			person.fname = input_firstname.get(1.0, "end-1c")
			person.birthday = datetime.date(birthYear.get(), months.index(birthMonth.get()) + 1, birthDay.get())
			person.nationality = selected_nationality.get()
			person.gender = selected_gender.get()
			person.streetNumber = str(input_houseNo.get(1.0, "end-1c")) + str(input_houseNo2.get(1.0, "end-1c"))
			person.streetname = input_street.get(1.0, "end-1c")
			person.city = input_city.get(1.0, "end-1c")
			person.postalCode = str(input_postal.get(1.0, "end-1c")) + str(input_postal2.get(1.0, "end-1c"))
			person.phone = input_phoneNumber.get(1.0, "end-1c")
			person.email = input_email.get(1.0, "end-1c")
			person.insert()

			student = Student()
			student.personID = person.personID
			student.studentID = int(input_studentID.get(1.0, "end-1c"))
			student.startYear = datetime.date(startYear.get(), 1, 1)
			student.enrolled = selected_study.get()
			counseler_index = counsellornames.index(selected_counsellor.get())
			student.studyCouncelor = counsellors[counseler_index].teacherID
			student.insert()

			person.userName = (person.lname + str(student.studentID))
			person.userPass = "******"
			person.update()
		
			ui.AdminWindowStudents.admin_window_students(window, return_function) #avoid circular import
コード例 #2
0
    def submit_data():
        get_id = input_id.get(1.0, "end-1c")
        student = Student()

        if student.load(get_id) == False:
            showerror(title="Error",
                      message="Student ID not found!",
                      icon="error")
        else:
            result = askquestion(title="Confirmation",
                                 message="Do you want to proceed?")
            if result == "yes":
                print(get_id)
                student.enrolled = study.studyname
                student.update()
                ui.AdminWindowStudyViewStudents.view_students(
                    window, return_function, study)
コード例 #3
0
def generateStudent():
    person = generatePerson()

    student = Student()
    student.startYear = datetime.date(random.randint(2012, 2024), 1, 1)
    student.studyCouncelor = random.choice(counselers).teacherID
    student.enrolled = random.choice(studies).studyname
    student.personID = person.personID
    student.insert()

    person.userName = (person.lname + str(student.studentID))
    person.userPass = "******"
    person.update()

    for course in random.sample(courses, 4):
        student.enrollInCourse(course.courseID)

    return student