-
Notifications
You must be signed in to change notification settings - Fork 117
/
resident_view.py
executable file
·40 lines (28 loc) · 1.34 KB
/
resident_view.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
from PySide6.QtWidgets import *
from qtpy.uic import loadUi
from database.db_resident_utils import dbGetResidentDatasByPlate
from helper.gui_maker import get_status_text
from helper.text_decorators import *
params = Parameters()
class residentView(QDialog):
def __init__(self, parent=None, residnetPlate='s'):
super(residentView, self).__init__()
loadUi('./gui/residentView.ui', self)
self.setFixedSize(self.size())
editingResident = dbGetResidentDatasByPlate(
join_elements(convert_persian_to_english(split_string_language_specific(residnetPlate))))
self.labelFname.setText(editingResident.getFirstName())
self.labelLname.setText(editingResident.getLastName())
self.labelBuilding.setText(editingResident.getBuilding(appendBuilding=True))
self.labelBlock.setText(editingResident.getBlock())
self.labelNum.setText(editingResident.getNum())
self.labelCarModel.setText(editingResident.getCarModel())
self.labelStatus.setText(get_status_text(editingResident.getStatus(item=False)))
self.labelPlateNum.setText(editingResident.getPlateNumber(display=True))
if __name__ == "__main__":
app = QApplication(sys.argv)
window = residentView()
window.setWindowTitle('ثبت ساکن جدید')
window.show()
sys.exit(app.exec_())