示例#1
0
 def ShowFriend(self, id):
     if self.isSignIn():
         conOb = cn()
         conOb.Open()
         conOb.Showfriend(self.id)
     else:
         print("*****>>>Ban chua dang nhap<<<*****\n")
示例#2
0
 def Showmessen(self, id):
     if self.isSignIn():
         conOb = cn()
         conOb.Open()
         print('danh sach friend: \n')
         conOb.Showfriend(self.id)
         print("nhap ten ban muon ...:\n")
         frien = input()
         id2 = conOb.TranNameToId(frien)
         conOb.ShowMessSen(self.id, id2)
示例#3
0
 def Showmesdrec(self, id):
     if self.isSignIn():
         conOb = cn()
         conOb.Open()
         print('danh sach friend: \n')
         conOb.Showfriend(self.id)
         print("nhap ten ban muon ...:\n")
         frien = input()
         id2 = conOb.TranNameToId(frien)
         print(id2, self.id)
         conOb.ShowMessRec(id2, self.id)
         with cn.con:
             conOb.Statusmes(id2, self.id)
示例#4
0
 def SignIn(self):
     print("Nhap vao username: \n")
     username = input()
     print("Nhap vao password: \n")
     password = input()
     conOb = cn()
     conOb.Open()
     with cn.con:
         if conOb.CheckSignIn(username, password) > 0:
             print("Dang nhap thanh cong!\n")
             self.id = conOb.CheckSignIn(username, password)
             self.flag = 1
         else:
             print("Dang nhap that bai!\n")
             self.flag = 0
示例#5
0
 def SenMess(self, id):
     if self.isSignIn():
         conOb = cn()
         conOb.Open()
         #conOb.Showfriend(self.id)
     print("Chon nguoi dung: \n")
     name = input()
     id2 = conOb.TranNameToId(name)
     dt = time.ctime()
     #print(dt)
     if id2 > 0:
         print("To  :  ", name)
         print("soan tin nhan:\n")
         mess = input()
         with cn.con:
             if conOb.Checkfriend(self.id, id2) != 0:
                 conOb.WriteToMess(self.id, id2, mess, dt)
示例#6
0
    def SignUp(self):
        print("*******>>>nhap thong tin dang ki<<******")
        print("username:"******"password:"******"fullname:")
        fullname = input()
        print("city:")
        city = input()
        print("birthday")
        birthday = input()
        print(username)
        print(password)
        print(fullname)
        print(city)
        print(birthday)
        conOb = cn()
        conOb.Open()
        with cn.con:

            conOb.SignUp(username, password, fullname, birthday, city)
示例#7
0
 def AddFriend(self, id):
     if self.isSignIn() == 1:
         print(self.id)
         print("Nhap ten ban muon them: ")
         name = input()
         conOb = cn()
         conOb.Open()
         id2 = conOb.TranNameToId(name)
         #print(id2)
         if id2 > 0:
             if conOb.Checkfriend(self.id, id2) != 0:
                 with cn.con:
                     conOb.WriteToFriend(self.id, id2)
                     #conOb.Showfriend(self.id)
             else:
                 print(
                     ">>>Ban da bi nguoi nay chan hoac ban nhap ten cua minh<<<\n\n"
                 )
         else:
             print("*******>>>Tai khoan khong ton tai<<<***********\n")
     else:
         print("*****>>>Ban chua dang nhap<<<*****\n")