-
Notifications
You must be signed in to change notification settings - Fork 2
/
quality.py
67 lines (53 loc) · 2.1 KB
/
quality.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import sys
import os
from PyQt5.QtWidgets import QApplication,QWidget,QMessageBox,QListWidgetItem,QTableWidget,QTableWidgetItem,QVBoxLayout
from PyQt5 import uic
from DB.warehouseDB import warehouseDB
class Quality(QWidget):
def __init__(self):
super().__init__()
self.InitUI()
def InitUI(self):
self.window = uic.loadUi(os.getcwd()+os.sep+r"GUI\quality.ui")
self.FillingTable()
self.window.tblList.doubleClicked.connect(self.RunProgram)
self.secim
self.window.show()
def FillingTable(self):
dataBase=warehouseDB()
listing=dataBase.ListingViewQuality()
for id,wName,locId,locName,MıD,mNo,mName,quan,mUId,mUName,partyNo,expDate in listing:
item=QListWidgetItem("{}/{}/{}/{}/{}/{}/{}/{}/{}/{}/{}/{}".format(id,wName,locId,locName,MıD,mNo,mName,quan,mUId,mUName,partyNo,expDate))
self.window.tblList.addItem(item)
def RunProgram(self):
dataBase=warehouseDB()
answer=QMessageBox.question(self,"QUESTION",'Do you want to take quality for this record ?',QMessageBox.Yes | QMessageBox.No)
if(answer==QMessageBox.Yes):
print("a")
#print(listing)
gelen=self.window.tblList.currentItem().text().split("/")
print(gelen)
#deneme = gelen[0]
#y=int(deneme)
processId='2'
mId=gelen[4]
quan=gelen[7]
mUId=gelen[8]
partyNo=gelen[10]
id=gelen[0]
locationId=gelen[2]
dataBase.InsertingProcess(processId,mId,quan,mUId,partyNo)
locationId='346' #quality id
dataBase.UpdatingWarehouseQuantity(id,locationId)
self.window.tblList.clear()
self.FillingTable()
elif(answer==QMessageBox.No):
print("Yok")
def secim(self):
dataBase=warehouseDB()
gelen=self.window.tblList.currentItem().text().split("/")
print(gelen)
if __name__ == "__main__":
app = QApplication(sys.argv)
ex = Quality()
sys.exit(app.exec_())