Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     System.Windows.Forms.DialogResult dr = MessageBox.Show("Borrow?", "Borrow Book", MessageBoxButtons.YesNo);
     if (dr == System.Windows.Forms.DialogResult.Yes)
     {
         bool res = LibraryManager.AddIntoBorrowed(userId, bookId, DateTime.Now, DateTime.Now.AddDays(2));
         if (res == true)
         {
             MessageBox.Show("Return Date :" + DateTime.Now.AddDays(2));
             this.Close();
         }
         else
         {
             MessageBox.Show("Insufficient copies. Try again later");
             this.Close();
         }
     }
     else
     {
         MessageBox.Show("Book not issued");
         this.Close();
     }
 }
Esempio n. 2
0
 private void ViewBookDetails_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = LibraryManager.getBook(BookId);
 }
Esempio n. 3
0
 private void Form1_Load(object sender, EventArgs e)
 {
     textBox1.Hide();
     LibraryManager.PopulateBook();
     LibraryManager.PopulateUser();
 }
Esempio n. 4
0
 public void setLogin()
 {
     textBox1.Text = "Welcome " + LibraryManager.getUser(id).Name;
     textBox1.Show();
 }
Esempio n. 5
0
 private void radCooking_Click(object sender, EventArgs e)
 {
     dataGridView1.DataSource = LibraryManager.GetByCategory(4);
 }
Esempio n. 6
0
 private void radFiction_Click(object sender, EventArgs e)
 {
     dataGridView1.DataSource = LibraryManager.GetByCategory(1);
 }