Beispiel #1
0
    def update(self):
        discipline = self.comboBox.currentText()
        group = self.comboBox_3.currentText()
        class_format = self.comboBox_2.currentText()
        audience = self.comboBox_4.currentText()

        o = Occupation()
        o.update(self.session, self.discipline_old, self.group_old,
                 self.class_format_old, discipline, group, class_format,
                 audience)

        self.set_default_date()
        self.timetable_window.hide()
        self.timetable_window.show()
        self.update_class_window.close()
Beispiel #2
0
    def add(self):
        discipline = self.comboBox.currentText()
        format = self.comboBox_2.currentText()
        audience = self.comboBox_3.currentText()
        group = self.comboBox_4.currentText()
        date = self.dateEdit.date().getDate()
        time = self.timeEdit.time().toString()

        o = Occupation()
        o.add_once(self.session, discipline, format, audience, group, date,
                   time)
        self.set_default_date()
        self.timetable_window.hide()
        self.timetable_window.show()
        self.add_class_once_window.close()
Beispiel #3
0
    def add(self):
        discipline = self.comboBox.currentText()
        format = self.comboBox_2.currentText()
        audience = self.comboBox_5.currentText()
        group = self.comboBox_6.currentText()
        date_begin = self.dateEdit.date().getDate()
        date_end = self.dateEdit_2.date().getDate()
        time = self.timeEdit.time().toString()
        weekday = self.comboBox_3.currentIndex()
        period = self.comboBox_4.currentText()

        o = Occupation()
        o.add(self.session, discipline, format, audience, group, date_begin,
              date_end, time, weekday, period)
        self.set_default_date()
        self.timetable_window.hide()
        self.timetable_window.show()
        self.add_class_window.close()
Beispiel #4
0
    def set_defualt_timetable_main_window(self, monday, saturday):
        tuesday = monday + datetime.timedelta(days=1)
        wednesday = monday + datetime.timedelta(days=2)
        thursday = monday + datetime.timedelta(days=3)
        friday = monday + datetime.timedelta(days=4)

        o = Occupation()
        monday_ls = o.show_all(self.session, monday)
        tuesday_ls = o.show_all(self.session, tuesday)
        wednesday_ls = o.show_all(self.session, wednesday)
        thursday_ls = o.show_all(self.session, thursday)
        friday_ls = o.show_all(self.session, friday)
        saturday_ls = o.show_all(self.session, saturday)

        monday_ls = np.array(monday_ls)
        self.tableWidget_main.setRowCount(0)
        self.tableWidget_main = set_items_to_table(self.tableWidget_main,
                                                   monday_ls)
        self.tableWidget_main.resizeColumnsToContents()

        tuesday_ls = np.array(tuesday_ls)
        self.tableWidget_2_main.setRowCount(0)
        self.tableWidget_2_main = set_items_to_table(self.tableWidget_2_main,
                                                     tuesday_ls)
        self.tableWidget_2_main.resizeColumnsToContents()

        wednesday_ls = np.array(wednesday_ls)
        self.tableWidget_3_main.setRowCount(0)
        self.tableWidget_3_main = set_items_to_table(self.tableWidget_3_main,
                                                     wednesday_ls)
        self.tableWidget_3_main.resizeColumnsToContents()

        thursday_ls = np.array(thursday_ls)
        self.tableWidget_4_main.setRowCount(0)
        self.tableWidget_4_main = set_items_to_table(self.tableWidget_4_main,
                                                     thursday_ls)
        self.tableWidget_4_main.resizeColumnsToContents()

        friday_ls = np.array(friday_ls)
        self.tableWidget_5_main.setRowCount(0)
        self.tableWidget_5_main = set_items_to_table(self.tableWidget_5_main,
                                                     friday_ls)
        self.tableWidget_5_main.resizeColumnsToContents()

        saturday_ls = np.array(saturday_ls)
        self.tableWidget_6_main.setRowCount(0)
        self.tableWidget_6_main = set_items_to_table(self.tableWidget_6_main,
                                                     saturday_ls)
        self.tableWidget_6_main.resizeColumnsToContents()
Beispiel #5
0
    def set_defualt_timetable(self, monday, saturday):
        tuesday = monday + datetime.timedelta(days=1)
        wednesday = monday + datetime.timedelta(days=2)
        thursday = monday + datetime.timedelta(days=3)
        friday = monday + datetime.timedelta(days=4)

        o = Occupation()
        monday_ls = o.show_all(self.session, monday)
        tuesday_ls = o.show_all(self.session, tuesday)
        wednesday_ls = o.show_all(self.session, wednesday)
        thursday_ls = o.show_all(self.session, thursday)
        friday_ls = o.show_all(self.session, friday)
        saturday_ls = o.show_all(self.session, saturday)

        monday_ls = np.array(monday_ls)
        self.tableWidget.setRowCount(0)
        self.tableWidget = set_items_to_table(self.tableWidget, monday_ls)
        self.tableWidget.resizeColumnsToContents()

        tuesday_ls = np.array(tuesday_ls)
        self.tableWidget_2.setRowCount(0)
        self.tableWidget_2 = set_items_to_table(self.tableWidget_2, tuesday_ls)
        self.tableWidget_2.resizeColumnsToContents()

        wednesday_ls = np.array(wednesday_ls)
        self.tableWidget_3.setRowCount(0)
        self.tableWidget_3 = set_items_to_table(self.tableWidget_3,
                                                wednesday_ls)
        self.tableWidget_3.resizeColumnsToContents()

        thursday_ls = np.array(thursday_ls)
        self.tableWidget_4.setRowCount(0)
        self.tableWidget_4 = set_items_to_table(self.tableWidget_4,
                                                thursday_ls)
        self.tableWidget_4.resizeColumnsToContents()

        friday_ls = np.array(friday_ls)
        self.tableWidget_5.setRowCount(0)
        self.tableWidget_5 = set_items_to_table(self.tableWidget_5, friday_ls)
        self.tableWidget_5.resizeColumnsToContents()

        saturday_ls = np.array(saturday_ls)
        self.tableWidget_6.setRowCount(0)
        self.tableWidget_6 = set_items_to_table(self.tableWidget_6,
                                                saturday_ls)
        self.tableWidget_6.resizeColumnsToContents()