Beispiel #1
0
 def save_new_data(self, id_emp):
     db_file.getConnection()
     parse_str = self.dossier_choice.currentText().split('#')
     dossier_num = parse_str[0]
     db_file.save_bio_age(self.get_data(self), self.rw_glomeruli.text(), self.rw_arteries.text(),
                          self.rw_stroma.text(), self.result_age.text(), dossier_num, id_emp, self.category)
     self.inform('Данные сохранены!')
 def delete_emp(self):
     db_file.getConnection()
     if self.employees_list.currentItem().isSelected():
         answer = self.question()
         if answer:
             note_id = self.employees_list.currentItem().text()
             db_file.del_emp(note_id)
Beispiel #3
0
 def save_new_data(self, id_emp):
     db_file.getConnection()
     parse_str = self.dossier_choice.currentText().split('#')
     dossier_num = parse_str[0]
     db_file.save_dip_plane_calculation(self.get_data(self), self.rw_weight.text(), self.rw_height.text(),
                                        self.surface, dossier_num, id_emp, self.power, self.lab_result_text.text(),
                                        self.category)
     self.inform('Данные сохранены!')
Beispiel #4
0
    def save_new_emp(self, mode, note_id):
        if (len(self.rw_name.text()) == 0 or len(self.rw_surname.text()) == 0
                or len(self.rw_post.text()) == 0
                or len(self.rw_right.currentText()) == 0
                or len(self.rw_login_new.text()) == 0
                or len(self.rw_pass_new.text()) == 0):
            self.warning("Заполните все поля со * !")

        else:
            db_file.getConnection()
            if mode == 0:
                login_comp = db_file.login_comparison(self.rw_login_new.text())
                pass_comp = db_file.pass_comparison(self.rw_pass_new.text())
                if login_comp:
                    self.warning("Логин уже существует!\nВведите другой!")
                if pass_comp:
                    self.warning("Пароль уже существует!\nВведите другой!")
                db_file.new_emp_note(self.rw_name.text(),
                                     self.rw_surname.text(),
                                     self.rw_patr.text(), self.rw_age.text(),
                                     self.rw_post.text(),
                                     self.rw_education.text(),
                                     self.rw_right.currentText(),
                                     self.rw_login_new.text(),
                                     self.rw_pass_new.text(),
                                     self.rw_photo.text())
                self.inform('Сотрудник добавлен!')
            if mode == 1:
                db_file.edit_emp_note(note_id, self.rw_name.text(),
                                      self.rw_surname.text(),
                                      self.rw_patr.text(), self.rw_age.text(),
                                      self.rw_post.text(),
                                      self.rw_education.text(),
                                      self.rw_right.currentText(),
                                      self.rw_login_new.text(),
                                      self.rw_pass_new.text(),
                                      self.rw_photo.text())
                self.inform('Данные успешно изменены!')


# if __name__ == "__main__":
#     import sys
#     app = QtGui.QApplication(sys.argv)
#     window_main = Wind(0, -1)
#     window_main.show()
#     sys.exit(app.exec_())
Beispiel #5
0
    def save_new_data(self, id_emp):
        db_file.getConnection()
        parse_str = self.dossier_choice.currentText().split('#')
        dossier_num = parse_str[0]
        db_file.save_alcohol_excretion(self.get_data(self),
                                       self.rw_weight.text(),
                                       self.rw_amount.text(),
                                       self.rw_alc_cont.text(),
                                       self.result_time.text(), dossier_num,
                                       id_emp, self.category)
        self.inform('Данные сохранены!')


# if __name__ == "__main__":
#     import sys
#     app = QtGui.QApplication(sys.argv)
#     window_main = AlcoholExcretion(2)
#     window_main.show()
#     sys.exit(app.exec_())
Beispiel #6
0
    def save_new_term(self):
        db_file.getConnection()
        name = db_file.term_comparison(self.rw_name.text())
        if len(self.rw_name.text()) == 0 or len(self.rw_describe.toPlainText()) == 0:
            self.warning("Заполните все поля!")
        else:
            if name:
                self.warning("Термин уже существует!")
            else:
                db_file.save_term(self.rw_name.text(), self.rw_describe.toPlainText())
                self.inform('Данные сохранены!')


# if __name__ == "__main__":
#     import sys
#     app = QtGui.QApplication(sys.argv)
#     window_main = TermNew()
#     window_main.show()
#     sys.exit(app.exec_())
    def save_new_data(self, id_emp):
        db_file.getConnection()
        parse_str = self.dossier_choice.currentText().split('#')
        dossier_num = parse_str[0]
        db_file.save_body_weight_determination(self.get_data(self),
                                               self.rw_height.text(),
                                               self.rw_thorax.text(),
                                               self.rw_leg.text(),
                                               self.rw_breech.text(), self.sex,
                                               self.result_weight.text(),
                                               dossier_num, id_emp,
                                               self.category)
        self.inform('Данные сохранены!')


# if __name__ == "__main__":
#     import sys
#     app = QtGui.QApplication(sys.argv)
#     window_main = BodyWeight(2)
#     window_main.show()
#     sys.exit(app.exec_())
Beispiel #8
0
    def saving_new_dossier(self):
        if (len(self.rw_name.text()) == 0 or len(self.rw_surname.text()) == 0
                or len(self.rw_birthday.text()) == 0):
            self.warning("Заполните все поля!")
        else:
            parse_date_str = self.rw_birthday.text().split('.')
            date_year = parse_date_str[0]
            if len(date_year) != 4 or len(self.rw_birthday.text()) != 10:
                self.warning("Неправильно введена дата!\nВведите: гггг.мм.дд")
            else:
                db_file.getConnection()
                db_file.new_dossier(self.rw_name.text(),
                                    self.rw_surname.text(),
                                    self.rw_birthday.text())
                self.inform('Дело успешно добавлено!')


# if __name__ == "__main__":
#     import sys
#     app = QtGui.QApplication(sys.argv)
#     window_main = NewDossier()
#     window_main.show()
#     sys.exit(app.exec_())
Beispiel #9
0
 def on_show(self):
     db_file.getConnection()
     entry_condition = db_file.entering(self.rw_login.text(),
                                        self.rw_pass.text())
     if entry_condition > 0:
         self.current_emp_id = entry_condition
         right = db_file.rights_check(self.rw_login.text())
         if right:
             self.new_worker.setEnabled(True)
             self.workers_list.setEnabled(True)
             self.param = True
         else:
             self.new_worker.setEnabled(False)
             self.workers_list.setEnabled(False)
             self.param = False
         self.layout_3.deleteLater()
         # lay_window1(self)
         main_window_contain(self, self.current_emp_id)
         #win = ModalWind(self)
         # #win.show()
         #self.setCentralWidget(win)
     else:
         self.warning("Неверный логин или пароль!" "\nПовторите ввод!")
 def get_data_from_db(self):
     db_file.getConnection()
     entries = db_file.load_emp_notes()
     for entry in entries:
         self.make_item(entry)