Пример #1
0
 def updateNotification(notificationId, mobileNo, message, time, repeat, enable):
         sql = """UPDATE [dbo].[Notification]
                SET [Message] = '{0}', [Time] = '{1}', [Repeat] = '{2}', [Enable] = '{3}' where [Id] = '{4}' and [mobileNo] = '{5}'""".format(message, time, repeat, enable, notificationId, mobileNo)
         print("---------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #2
0
 def updateNotificationStatus(mobileNo, notificationId, enable):
         sql = """UPDATE [dbo].[Notification]
                SET [enable] = '{0}' where [Mobile_Number] = '{1}' and [Id] = '{2}'""".format(enable, mobileNo, notificationId)
         print("---------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #3
0
 def updateNotification(notificationId, mobileNo, message, time, repeat, enable):
         sql = """UPDATE Notification
                SET Message = '{0}', Time = '{1}', Repeat = '{2}', Enable = '{3}' where Id = '{4}' and mobileNo = '{5}'""".format(message, time, repeat, enable, notificationId, mobileNo)
         print("---------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #4
0
 def updatePassword(mobileNo, newPassword):
         sql = """UPDATE [dbo].[User_Info]
                SET [Password] = '{0}' where [Mobile_Number] = '{1}'""".format(newPassword, mobileNo)
         print("---------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #5
0
 def updateNotificationStatus(mobileNo, notificationId, enable):
         sql = """UPDATE Notification
                SET enable = '{0}' where Mobile_Number = '{1}' and Id = '{2}'""".format(enable, mobileNo, notificationId)
         print("---------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #6
0
 def updateMsg(mobileNo, message, notificationId):
         sql = """UPDATE Notification
                SET message = '{0}' where Mobile_Number = '{1}' and Id = '{2}'""".format(message, mobileNo, notificationId)
         print("---------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #7
0
 def updateMsg(mobileNo, message, notificationId):
         sql = """UPDATE [dbo].[Notification]
                SET [message] = '{0}' where [Mobile_Number] = '{1}' and [Id] = '{2}'""".format(message, mobileNo, notificationId)
         print("---------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #8
0
 def selectAllUsers():
         sql = "select * from User_Info"
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         userDetails = []
         for userDetail in cursor:
                 userDetails.append(userDetail)
         return userDetails
Пример #9
0
 def selectAllNotifications():
         sql = "select * from Notification"
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         allNotifations = []
         for userNotification in cursor:
                 allNotifations.append(userNotification)
         return allNotifations
Пример #10
0
 def selectNotificationsWhereMobileNo(mobileNo):
         sql = "select * from Notification where Mobile_No_FK = '{0}'".format(mobileNo)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         userNotifications = []
         for userNotification in cursor:
                 userNotifications.append(userNotification)
         return userNotifications
Пример #11
0
 def selectUserWhereMobileNo(mobileNo, password):
         sql = "select * from User_Info where Mobile_Number = '{0}' and password = '******'".format(mobileNo, password)
         print(";;;;;;;;;;;;;;;;;;;;;;;;;;")
         print(sql)
         db,cursor = dbConnect.connectDB()
         cursor.execute(sql)
         userDetails = []
         for userDetail in cursor:
                 userDetails.append(userDetail)
         return userDetails
Пример #12
0
 def insertNotification(mobileNo, message, timeOfNotification, repeat, enable):
         sql = """INSERT INTO Notification
    (Mobile_No_FK
    ,Message
    ,Time
    ,IsRepeat
    ,IsEnable)
         VALUES ('{0}','{1}','{2}','{3}','{4}')""".format(mobileNo, message, timeOfNotification, repeat, enable)
         print("----------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #13
0
 def insertUsers(firstname, lastname, mobileno, dob, emailid, password):
         sql = """INSERT INTO User_Info
    (First_Name
    ,Last_Name
    ,Mobile_Number
    ,DOB
    ,EmailID
    ,Password) values ('{0}','{1}','{2}','{3}','{4}','{5}')""".format(firstname, lastname, mobileno, dob, emailid, password)
         print("----------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #14
0
 def insertUsers(firstname, lastname, mobileno, dob, emailid, password):
         sql = """INSERT INTO [dbo].[User_Info]
    ([First_Name]
    ,[Last_Name]
    ,[Mobile_Number]
    ,[DOB]
    ,[EmailID]
    ,[Password]) values ('{0}','{1}','{2}','{3}','{4}','{5}')""".format(firstname, lastname, mobileno, dob, emailid, password)
         print("----------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #15
0
 def insertNotification(mobileNo, message, timeOfNotification, repeat, enable):
         sql = """INSERT INTO [dbo].[Notification]
    ([Mobile_No_FK]
    ,[Message]
    ,[Time]
    ,[Repeat]
    ,[Enable])
         VALUES ('{0}','{1}','{2}','{3}','{4}')""".format(mobileNo, message, timeOfNotification, repeat, enable)
         print("----------" + sql)
         db, cursor = dbConnect.connectDB()
         cursor.execute(sql)
         db.commit()
Пример #16
0
   def selectAllNotificationsWhereEnableAndTime(fromTime, toTime):
           sql = """SELECT [Id]
 ,[Mobile_No_FK]
 ,[Message]
 ,cast([Time] as time)[Time]
   ,cast([Time] as date)[Date]
 ,[Repeat]
 ,[Enable]
   FROM [PlanUrDay].[dbo].[Notification] where [Enable] = 'true' and cast([Time] as time) > cast('{0}' as time) and cast([Time] as time) < cast('{1}' as time)""".format(fromTime, toTime)
           print("-----------------")
           print(sql)
         #  "select * from [dbo].[Notification] where [Enable] = 'true' and time > '{0}' and time < {1}".format(time,time)
           db, cursor = dbConnect.connectDB()
           allNotifations = cursor.execute(sql)
           return allNotifations
Пример #17
0
   def selectAllNotificationsWhereEnableAndTime(fromTime, toTime):
           sql = """SELECT Id
 ,Mobile_No_FK
 ,Message
 ,date_format(Time, '%H:%i') as time
   ,date_format(Time, '%Y-%m-%d') as date
 ,IsRepeat
 ,IsEnable
   FROM Notification where IsEnable = 'true' and time > date_format('{0}', '%H:%i') and time < date_format('{0}', '%H:%i')""".format(fromTime, toTime)
           print("-----------------")
           print(sql)
         
           db, cursor = dbConnect.connectDB()
           cursor.execute(sql)
           allNotifations = []
           for userNotification in cursor:
                   allNotifations.append(userNotification)
           return allNotifations
Пример #18
0
 def selectNotificationsWhereMobileNo(mobileNo):
         sql = "select * from [dbo].[Notification] where Mobile_No_FK = '{0}'".format(mobileNo)
         db, cursor = dbConnect.connectDB()
         userNotifications = cursor.execute(sql)
         return userNotifications
Пример #19
0
 def selectAllUsers():
         sql = "select * from [dbo].[User_Info]"
         db, cursor = dbConnect.connectDB()
         userDetails = cursor.execute(sql)
         return userDetails
Пример #20
0
 def selectUserWhereMobileNo(mobileNo, password):
         sql = "select * from [dbo].[User_Info] where Mobile_Number = '{0}' and password = '******'".format(mobileNo, password)
         db, cursor = dbConnect.connectDB()
         userDetails = cursor.execute(sql)
         return userDetails
Пример #21
0
 def selectAllNotifications():
         sql = "select * from [dbo].[Notification]"
         db, cursor = dbConnect.connectDB()
         allNotifations = cursor.execute(sql)
         return allNotifations