Exemplo n.º 1
0
	def ok(self):
		from Director.Director import InsertDirectorAPI
		from database import create_debug_engine, create_session
		de = create_debug_engine(True)
		session = create_session(de)
		self.api = InsertDirectorAPI()
		self.data = self.line()
		if self.data[0] == "":
			return self.view.close()
		session.add(self.api.insertUser(self.data[0],self.data[1],self.data[2],self.data[3],self.data[4]))
		session.commit()
		return self.view.close()
Exemplo n.º 2
0
	def accept(self):
		from Director.Director import InsertDirectorAPI
		from database import create_debug_engine, create_session
		de = create_debug_engine(True)
		session = create_session(de)
		self.api = InsertDirectorAPI()
		self.data = self.line()
		if self.data[0] == "":
			return self.view.ui.label12.setText("Пожалуйста, заполните все поля!!!")
		self.n = self.api.insertUser(self.data[0],self.data[1],self.data[2],self.data[3],self.data[4])
		if type(self.n) == str:
			return self.view.ui.label12.setText(self.n)
		session.add(self.n)
		return session.commit()
Exemplo n.º 3
0
	def accept(self):
		from Director.Director import InsertDirectorAPI
		from database import create_debug_engine, create_session
		de = create_debug_engine(True)
		session = create_session(de)
		self.api = InsertDirectorAPI()
		self.data = self.line()
		if self.data == None:
			return 0
		if self.data[0] == "":
			return self.view.ui.label_5.setText("Пожалуйста, заполните все поля!!!")
		self.n = self.api.insertShare(self.user_id, self.data[0], self.data[1], self.data[2], self.data[3])
		if type(self.n) == str:
			return self.view.ui.label_5.setText(self.n)
		if self.n ==0:
			return self.view.ui.label_5.setText("Данные обновлены") 
		session.add(self.n)
		return session.commit()
Exemplo n.º 4
0
    def parametr(self):
        self.text = self.ui.comboBox.currentText()
        if self.text == "Share":
            self.command = self.choose_s()
        else:
            self.command = self.choose_r()
        return self.command
            
    def choose_s(self):
        self.user_id = "1"
        self.b = []
        self.Share = Shares(self.user_id)
        self.b.append(self.Share.shares(self.user_id))
        self.b.append(self.Share.documents(self.user_id))
        return self.b
    def choose_r(self):
        self.region_id = "1"
        self.b = []
        self.Region = Regions(self.region_id)
        self.b.append(self.Region.areas(self.region_id))
        self.b.append(self.Region.numbers(self.region_id))
        return self.b


if __name__ == '__main__':
    de = create_debug_engine(True)
    session = create_session(de)
    app = QApplication(sys.argv)
    w = ApplicationWindow()
    w.show()
    sys.exit(app.exec_())