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
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
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 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
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)
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)