def Save(self):
     USERNAME_KEY = 'Username_key'
     myDatabase = database('travelschedulerserver.database.windows.net',
                           'TravelScheduler', 'TravelSchedulerServer',
                           'G00dGrad3s')
     myUserName = keyring.get_password("TravelSchedulerUsername",
                                       USERNAME_KEY)
     myEventName = self.tableWidget.item(0, 0).text()
     myStartTime = self.tableWidget.item(0, 4).text()
     myEndTime = self.tableWidget.item(0, 5).text()
     myCurrAddress = self.tableWidget.item(0, 3).text()
     myDestAddress = self.tableWidget.item(0, 2).text()
     myDatabase.modifyEvent(myEventName, myUserName, myDestAddress,
                            myCurrAddress, myStartTime, myEndTime)
     myEventName = self.tableWidget.item(1, 0).text()
     myStartTime = self.tableWidget.item(1, 4).text()
     myEndTime = self.tableWidget.item(1, 5).text()
     myCurrAddress = self.tableWidget.item(1, 3).text()
     myDestAddress = self.tableWidget.item(1, 2).text()
     myDatabase.modifyEvent(myEventName, myUserName, myDestAddress,
                            myCurrAddress, myStartTime, myEndTime)
     myEventName = self.tableWidget.item(2, 0).text()
     myStartTime = self.tableWidget.item(2, 4).text()
     myEndTime = self.tableWidget.item(2, 5).text()
     myCurrAddress = self.tableWidget.item(2, 3).text()
     myDestAddress = self.tableWidget.item(2, 2).text()
     myDatabase.modifyEvent(myEventName, myUserName, myDestAddress,
                            myCurrAddress, myStartTime, myEndTime)
 def login(self):
     USERNAME_KEY = 'Username_key'
     username = self.lineEdit.text()
     password = self.lineEdit_2.text()
     myDatabase = database('travelschedulerserver.database.windows.net',
                           'TravelScheduler', 'TravelSchedulerServer',
                           'G00dGrad3s')
     ogPassword = myDatabase.getPassword(username)
     keyring.set_password("TravelSchedulerUsername", USERNAME_KEY, username)
     keyring.set_password("TravelScheduler", username, password)
     boo = bcrypt.verify(password, ogPassword)
     if (boo):
         os.system('python Dashboard.py')
 def signup(self):
     myFullName = self.lineEdit.text()
     myUsername = self.lineEdit_2.text()
     myEmail = self.lineEdit_3.text()
     myPassword = self.lineEdit_4.text()
     myAddress = self.lineEdit_5.text()
     myTimeOffSet = self.lineEdit_6.text()  #0 for now
     hashedPass = bcrypt.hash(myPassword)
     myDatabase = database('travelschedulerserver.database.windows.net',
                           'TravelScheduler', 'TravelSchedulerServer',
                           'G00dGrad3s')
     myDatabase.addUser(myUsername, hashedPass, myAddress, myEmail,
                        myFullName, myTimeOffSet)
     os.system('python Login.py')
 def add(self):
     USERNAME_KEY = 'Username_key'
     myDatabase = database('travelschedulerserver.database.windows.net',
                           'TravelScheduler', 'TravelSchedulerServer',
                           'G00dGrad3s')
     myUserName = keyring.get_password("TravelSchedulerUsername",
                                       USERNAME_KEY)
     myEventName = self.lineEdit.text()
     myStartTime = self.dateTimeEdit.text()
     myEndTime = self.dateTimeEdit_2.text()
     myCurrAddress = self.lineEdit_4.text()
     myDestAddress = self.lineEdit_5.text()
     myDatabase.addEvent(myEventName, myUserName, myDestAddress,
                         myCurrAddress, parser.parse(myStartTime),
                         parser.parse(myEndTime))
 def Table(self):
     USERNAME_KEY = 'Username_key'
     myDatabase = database('travelschedulerserver.database.windows.net',
                           'TravelScheduler', 'TravelSchedulerServer',
                           'G00dGrad3s')
     myUserName = keyring.get_password("TravelSchedulerUsername",
                                       USERNAME_KEY)
     rows = myDatabase.getEventList(myUserName)
     self.tableWidget.setRowCount(0)
     self.tableWidget.setColumnCount(6)
     #print (rows)
     for row_number, row_data in enumerate(rows):
         self.tableWidget.insertRow(row_number)
         for column_number, data in enumerate(row_data):
             self.tableWidget.setItem(row_number, column_number,
                                      QtWidgets.QTableWidgetItem(str(data)))