def clicked_bt_Add_Event(self): #if self.ui.lv_availableRoutes.curr item = self.ui.lv_availableRoutes.currentIndex() if int(item.row()) < 0: self.ui.errorLabel.setStyleSheet("color: red") self.ui.errorLabel.setText('Select a route') else: strin = str(item.data().toString()) values = strin.split(':') tdD = dict(Company=values[0], Frequency=values[1], Duration=values[2], DeliverDay=values[3], Origin = int(self.ui.cb_Origin.currentIndex() + 1), Destination = int(self.ui.cb_Destination.currentIndex() + 1), TransportType = str(self.ui.cb_TransportType.currentText()) ) messages = EH.discontinueTransport(tdD) if len(messages)==0: self.ui.errorLabel.setStyleSheet("color: white") self.ui.errorLabel.setText('Update Complete') self.updateDisplayedRoutes() else: self.ui.errorLabel.setStyleSheet("color: red") self.ui.errorLabel.setText(messages[0]) self.updateDisplayedRoutes()
def clicked_bt_Add_Event(self): pUD = dict( Origin = int(self.ui.cb_Origin.currentIndex() + 1), Destination = int(self.ui.cb_Destination.currentIndex() + 1), Priority = int(self.ui.cb_Priority.currentIndex()+1), PricePerGram = self.ui.tb_PriceG.text(), PricePerCC = self.ui.tb_PriceCC.text() ) messages =EH.updateCustomerPrice(pUD) if len(messages)==0: self.ui.errorLabel.setStyleSheet("color: white") self.ui.errorLabel.setText('Update Complete') self.updateDisplayedRoutes() else: self.ui.errorLabel.setStyleSheet("color: red") self.ui.errorLabel.setText(messages[0]) self.updateDisplayedRoutes()
def clicked_bt_Add_Event(self): costUpdate = dict( Origin = int(self.ui.cb_Origin.currentIndex() + 1), Destination = int(self.ui.cb_Destination.currentIndex() + 1), Company = str(self.ui.tb_Company.text()), TransportType = str(self.ui.cb_TransportType.currentText()), PricePerGram = self.ui.tb_PriceG.text(), PricePerCC = self.ui.tb_PriceCC.text(), DayOfWeek = int(self.ui.cb_DayOfWeek.currentIndex() + 1), Frequency = self.ui.tb_Frequency.text(), Duration = self.ui.tb_Duration.text()) messages =EH.insertTransportCost(costUpdate) if len(messages)==0: self.ui.errorLabel.setStyleSheet("color: white") self.ui.errorLabel.setText('Update Complete') self.updateDisplayedRoutes() else: self.ui.errorLabel.setStyleSheet("color: red") self.ui.errorLabel.setText(messages[0]) self.updateDisplayedRoutes()