def setUp(self): self.__connection=Mysql.Connect() self.cur=self.__connection.cursor() self.user=c.users() self.model=m.account() self.user.setBookname("Ma") self.user.setAuthor("Anisul") self.user.setEdition("n/a") self.user.setPublished("n/a") self.user.setPublisher("n/a")
def savemember(self): u=a.users() u.setFname(self.txt_fname.get()) u.setLname(self.txt_lname.get()) u.setUsername(self.txt_uname.get()) u.setContact(self.txt_phone.get()) u.setEmail(self.txt_email.get()) u.setPassword(self.txt_pswrd.get()) u.setDateRegistered(self.txt_dateRegistered.get()) am=m.account() am.addMember(u)
def savebook(self): """ Saves the book and updates the DB """ u = a.users() u.setBookname(self.txt_book_name.get()) u.setAuthor(self.txt_author.get()) u.setEdition(self.txt_edition.get()) u.setPublished(self.txt_published.get()) u.setPublisher(self.txt_publisher.get()) ab = m.account() ab.addBook(u)
def remove_member(self): u.setUserid(self.txt_book_combo.get().split('-')[0]) ib = m.account() ib.Removemember(u)
def return_book(self): u.setBookid(self.txt_book_combo.get().split('-')[0]) ib = m.account() ib.Deletebook(u)
def gotologin(): u=c.users() u.setUsername(self.txtFirstname.get()) u.setPassword(self.txtLastName.get()) a=m.account() a.Login(u)