def new_client_create(self, subview):
     test = Client()
     test.setEmail(subview.e1.get())
     exist = self.model.client_db.get(test)
     if exist is False:
         subview.form.create_widgets()
     else:
         subview.form.already_exist()
Example #2
0
 def new_client_create(self, subview):
     test = Client()
     test.setEmail(subview.e1.get())
     exist = self.model.client_db.get(test)
     if exist is False:
         subview.form.create_widgets()
     else:
         subview.form.already_exist()
 def getByID(self, id):
     ans = self.database.executeKnowQuery('SELECT * FROM client WHERE id = ?', (id,))
     if (len(ans) == 0):
         return False
     ans = ans[0]
     ret = Client()
     ret.setAll(ans)
     return ret
 def get(self,client):
     ans = self.database.executeKnowQuery('SELECT * FROM client WHERE email = ?', (client.getEmail(),))
     if (len(ans) == 0):
         return False
     ans = ans[0]
     ret = Client()
     ret.setAll(ans)
     return ret
Example #5
0
 def getByID(self, id):
     ans = self.database.executeKnowQuery(
         'SELECT * FROM client WHERE id = ?', (id, ))
     if (len(ans) == 0):
         return False
     ans = ans[0]
     ret = Client()
     ret.setAll(ans)
     return ret
Example #6
0
 def get(self, client):
     ans = self.database.executeKnowQuery(
         'SELECT * FROM client WHERE email = ?', (client.getEmail(), ))
     if (len(ans) == 0):
         return False
     ans = ans[0]
     ret = Client()
     ret.setAll(ans)
     return ret
Example #7
0
 def getAll(self):
     ans = self.database.executeKnowQuery('SELECT * FROM client')
     if (len(ans) == 0):
         return False
     ret = []
     for row in ans:
         temp = Client()
         temp.setAll(row)
         ret.append(temp)
     return ret
 def getAll(self):
     ans = self.database.executeKnowQuery('SELECT * FROM client')
     if (len(ans) == 0):
         return False
     ret = []
     for row in ans:
         temp = Client()
         temp.setAll(row)
         ret.append(temp)
     return ret
Example #9
0
 def getByName(self, name):
     ans = self.database.executeKnowQuery('SELECT * FROM client ')
     if (ans == False):
         return False
     ret = []
     for row in ans:
         if (name not in row[2]): continue
         temp = Client()
         temp.setAll(row)
         ret.append(temp)
     return ret
 def getByName(self,name):
     ans = self.database.executeKnowQuery('SELECT * FROM client ')
     if (ans== False):
         return False
     ret = []
     for row in ans:
         if (name not in row[2]) : continue
         temp = Client()
         temp.setAll(row)
         ret.append(temp)
     return ret
Example #11
0
 def getByEmail(self, email):
     temp = Client()
     temp.email = email
     return self.get(temp)
 def new_client_submit(self, subview):
     data = subview.get_all()
     new= Client()
     new.setName(data[0])
     new.setEmail(data[1])
     new.setAddress(data[2])
     new.setPostalCode(data[3])
     new.setCity(data[4])
     new.setBirthDate(data[5])
     self.model.client_db.add(new)
     self.clear_frame(subview)
Example #13
0
 def new_client_submit(self, subview):
     data = subview.get_all()
     new = Client()
     new.setName(data[0])
     new.setEmail(data[1])
     new.setAddress(data[2])
     new.setPostalCode(data[3])
     new.setCity(data[4])
     new.setBirthDate(data[5])
     self.model.client_db.add(new)
     self.clear_frame(subview)
 def getByEmail(self,email):
     temp = Client()
     temp.email = email
     return self.get(temp)