Esempio n. 1
0
        private void btnMore_Click(object sender, EventArgs e)
        {
            // Dialog form
            frm11BookSearchForStaff f = new frm11BookSearchForStaff();
            DialogResult            r = f.ShowDialog(this);

            // Display all fields of selected record if 'OK' was chosen in dialog
            if (r == DialogResult.OK)
            {
                b                  = context.Books.Where(x => x.BookID == f.SelectedID).First();
                txBookID.Text      = b.BookID;
                txTitle.Text       = b.Title;
                txAuthor.Text      = b.Author;
                txPublisher.Text   = b.Publisher;
                cbxCategory.Text   = b.BookCategory;
                cbxFloor.Text      = b.Location.Substring(1, 1);
                txShelf.Text       = b.Location.Substring(4, 3);
                txPrice.Text       = b.Price.ToString();
                txStock.Text       = b.TotalStock.ToString();
                txNumBorrowed.Text = b.NumberBorrowed.ToString();
                if (b.Availability.ToString() == "yes")
                {
                    rbtnYes.Checked = true;
                }
                else
                {
                    rbtnNo.Checked = true;
                }

                enableUpdateFields();
            }
        }
        private void btnSearchBook_Click(object sender, EventArgs e)
        {
            // Dialog form
            frm11BookSearchForStaff f = new frm11BookSearchForStaff();
            DialogResult            r = f.ShowDialog(this);

            f.Location = this.Location;

            // Display all fields of selected record if 'OK' was chosen in dialog
            if (r == DialogResult.OK)
            {
                Book b = context.Books.Where(x => x.BookID == f.SelectedID).First();
                txBookID.Text = b.BookID;
            }
        }
Esempio n. 3
0
        private void btnMore_Click(object sender, EventArgs e)
        {
            // Dialog form
            frm11BookSearchForStaff f = new frm11BookSearchForStaff();
            DialogResult            r = f.ShowDialog(this);

            f.Location = this.Location;

            // Display all fields of selected record if 'OK' was chosen in dialog
            if (r == DialogResult.OK)
            {
                b        = context.Books.Where(x => x.BookID == f.SelectedID).First();
                position = bookList.IndexOf(b);
                displayDetails();
                displayHistory();
            }
        }