Exemplo n.º 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
Exemplo n.º 2
0
	def UpdateChatId(self,ChatId):
		db.update("update users set ChatId = {} where Id = {}"
		.format(int(ChatId),self.Id))
Exemplo n.º 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))
Exemplo n.º 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
Exemplo n.º 5
0
 def TryUpdateDb(self):
     return db.update(
         "update access_logs set Exit_time = '{}' where Id = {}".format(
             self.ExitTime, self.Id))
Exemplo n.º 6
0
 def TryUpdateDb(self):
     return db.update(
         "update access_rights set roomId = {}, userId = {} where Id = {}".
         format(self.RoomId, self.UserId, self.Id))
Exemplo n.º 7
0
 def TryUpdateDb(self):
     return db.update(
         "update rooms set RoomName = '{}', IotDeviceName = '{}', IoTLightDevice = '{}' where Id = {}"
         .format(self.RoomName, self.IotDeviceName, self.IoTLightDevice,
                 self.Id))