示例#1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Homepage homepage = new Homepage(user);

            homepage.Show();
            this.Close();
        }
示例#2
0
 private void deleteButton_Click(object sender, RoutedEventArgs e)
 {
     Book.deleteBook(@"..\\..\\books.txt", book); // deleteing book
     homepage = new Homepage(user);
     homepage.Show();
     this.Close();
 }
示例#3
0
        private void addBookButton_Click(object sender, RoutedEventArgs e)
        {
            Book book = new Book();

            book.bookDetails(title.Text, author.Text, price.Text, ISBN.Text, genre.Text);
            Library.Instance.libraryList.Add(book);
            book.saveToFile();
            MessageBox.Show(book.bookTitle + " has been added to the library");
            this.Close();
            Homepage homepage = new Homepage(user);

            homepage.Show();
        }
示例#4
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     login = new Login();
     if (login.verifyCredentials(userInput.Text, passInput.Password, userlist))
     {
         user     = new User(userInput.Text, passInput.Password, login.isAdmin);
         homepage = new Homepage(user);
         homepage.Show();
         this.Close();
     }
     else
     {
         System.Windows.MessageBox.Show("Please enter a valid username and password", "Invalid login credentials");
     }
 }