コード例 #1
0
 def updateRequestApprovalStatus(requestID, approval):
     if (requestID != None and approval != None):
         result = db.update("update access_request set IsApproved =  {} where Id = {}".format(approval, requestID))
         if result is True and approval == '1':
             requestObject = db.query("SELECT roomID, UserId from access_request where id = {}".format(requestID))
             result = requestObject[0]
             id = db.insert("insert into access_rights(RoomId, UserId) values({}, {})".format(result['roomID'], result['UserId']))
         return result
     else:
         return False
コード例 #2
0
	def UpdateChatId(self,ChatId):
		db.update("update users set ChatId = {} where Id = {}"
		.format(int(ChatId),self.Id))
コード例 #3
0
	def UpdateLastLogin(self):
		LastLogin = time.strftime('%Y-%m-%d %H:%M:%S')
		db.update("update users set LastLogin = '******' where Id = {}"
		.format(LastLogin,self.Id))
コード例 #4
0
	def addCardId(cardID, userID):
		if (cardID != None):
			id = db.update("update users set cardId =  '{}' where Id = {}".format(cardID, userID))
			return id
		return None
コード例 #5
0
 def TryUpdateDb(self):
     return db.update(
         "update access_logs set Exit_time = '{}' where Id = {}".format(
             self.ExitTime, self.Id))
コード例 #6
0
 def TryUpdateDb(self):
     return db.update(
         "update access_rights set roomId = {}, userId = {} where Id = {}".
         format(self.RoomId, self.UserId, self.Id))
コード例 #7
0
ファイル: Room.py プロジェクト: ThePikachu/IOT_CA2_Public
 def TryUpdateDb(self):
     return db.update(
         "update rooms set RoomName = '{}', IotDeviceName = '{}', IoTLightDevice = '{}' where Id = {}"
         .format(self.RoomName, self.IotDeviceName, self.IoTLightDevice,
                 self.Id))