Ejemplo n.º 1
0
        private void LblBooksOnHand_Click(object sender, EventArgs e)
        {
            frmOnHand frm = new frmOnHand(this);

            frm.lblLibrarian.Text   = admin;
            frm.lblStudentName.Text = lblName.Text;
            frm.Show();
        }
Ejemplo n.º 2
0
 public ucBooksOnHand(frmOnHand fonhand)
 {
     InitializeComponent();
     cn        = new SqlConnection(dbcon.MyConnection());
     frmonhand = fonhand;
 }
Ejemplo n.º 3
0
        private void BtnProcessIssue_Click(object sender, EventArgs e)
        {
            frmOnHand frm = new frmOnHand(this);



            if (txtSearchStud.Text == "")
            {
                txtSearchStud.Focus();
                MyMessageBox.ShowMessage("Please enter the student number", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            }
            else if (lblBookTitle.Text == "Book Title")
            {
                MyMessageBox.ShowMessage("Please choose the book to issue!", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            }
            else if (lblBooksOnHand.Text == borrowBooks)
            {
                MyMessageBox.ShowMessage("Student already reached the maximum number of borrowed book!", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            }
            else if (lblAvailable.Text == "0" || lblAvailable.Text == "-1")
            {
                MyMessageBox.ShowMessage("No available copies left!", "", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
            }
            else if (withPending == "False")
            {
                if (lblFine.Text == "₱.00" || lblFine.Text == "₱0.00")
                {
                    BorrowBook();
                    Clear();
                    LoadDetails();
                    BooksOnHand();
                    BorrowHistory();
                }
                else
                {
                    MyMessageBox.ShowMessage("Student needs to settle all pending payments to allow checking out another books.", "", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
            }
            else if (withOverdue == "False")
            {
                if (lblBooksOverdue.Text == "0")
                {
                    BorrowBook();
                    Clear();
                    LoadDetails();
                    BooksOnHand();
                    BorrowHistory();
                }
                else
                {
                    MyMessageBox.ShowMessage("Student needs to return all overdue books to allow checking out another books.", "", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
                }
            }
            else
            {
                BorrowBook();
                Clear();
                LoadDetails();
                BooksOnHand();
                BorrowHistory();
            }
        }