コード例 #1
0
        private void btnMoreBook_Click(object sender, EventArgs e)
        {
            BookSearchForm bookPopup = new BookSearchForm("available");

            bookPopup.ShowDialog();
            if (bookPopup.DialogResult == DialogResult.OK)
            {
                txtbRFID.Text = bookPopup.RFIDFound.RFID;
            }
        }
コード例 #2
0
        private void btnMoreRFID_Click(object sender, EventArgs e)
        {
            BookSearchForm popup = new BookSearchForm();

            popup.ShowDialog();
            if (popup.DialogResult == DialogResult.OK)
            {
                txtbRFID.Text = popup.RFIDFound.RFID;
            }
        }
コード例 #3
0
        private void btnFindBk_Click(object sender, EventArgs e)
        {
            using (BookSearchForm popsearch = new BookSearchForm())
            {
                if (popsearch.ShowDialog() == DialogResult.OK)
                {
                    bookFound        = popsearch.BookFound;
                    txtbBkId.Text    = bookFound.BookID.ToString();
                    mtbISBN.Text     = bookFound.ISBN.ToString();
                    txtbBkTitle.Text = bookFound.BookTitle.ToString();
                    txtbAuthor.Text  = bookFound.Author.ToString();
                    using (SA45Team07B_LibraryEntities context = new SA45Team07B_LibraryEntities())
                    {
                        txtbPublisher.Text   = context.Publishers.Where(x => x.PublisherID == bookFound.PublisherID).First().PublisherName.ToString();
                        txtbSubjectName.Text = context.BookSubjects.Where(x => x.SubjectCode == bookFound.SubjectCode).First().SubjectName.ToString();
                    }
                    txtbCallNum.Text = bookFound.CallNumber.ToString();
                    txtbPrice.Text   = string.Format("{0:c}", bookFound.Price);
                    if (bookFound.Edition != null)
                    {
                        txtbEd.Text = bookFound.Edition.ToString();
                    }
                    if (bookFound.PublishedYear != null)
                    {
                        mtbYear.Text = bookFound.PublishedYear.ToString();
                    }
                    bookFound.RFIDs = popsearch.RFIDsOfBookFound;

                    toolStripStatusLabel1.Text = string.Format("<<{0}>>", bookFound.BookTitle);

                    using (SA45Team07B_LibraryEntities context = new SA45Team07B_LibraryEntities())
                    {
                        //use bookid to find rfid list, use rfids to find each transaction in Issuetran, loop to check availability

                        ////get rfid liststed
                        var rfids = from x in context.RFIDs
                                    where x.BookID == bookFound.BookID
                                    orderby x.Availability
                                    select new
                        {
                            RFID         = x.RFID.ToUpper(),
                            Availability = x.Availability.ToUpper(),
                            DateBorrowed = context.IssueTrans.Where(y => y.RFID == x.RFID).FirstOrDefault().DateIssued.ToString(),
                            DueDate      = context.IssueTrans.Where(y => y.TransactionID == x.LastTransactionID).FirstOrDefault().DateDue.ToString(),
                            BorrowedBy   = context.IssueTrans.Where(y => y.TransactionID == x.LastTransactionID).FirstOrDefault().MemberID.ToString()
                        };
                        dgvAvail.DataSource = rfids.ToList();
                    }
                }
            }
        }
コード例 #4
0
 private void btnSearchRFID_Click(object sender, EventArgs e)
 {
     using (BookSearchForm bps = new BookSearchForm("onloan"))
     {
         if (bps.ShowDialog() == DialogResult.OK)
         {
             this.txtbRFID.Text = bps.RFIDFound.RFID.ToString();
             ValidatetxtbRFID();
         }
         else
         {
             return;
         }
     }
 }
コード例 #5
0
        private void btnFindBk_Click(object sender, EventArgs e)
        {
            using (BookSearchForm popsearch = new BookSearchForm())
            {
                if (popsearch.ShowDialog() == DialogResult.OK)
                {
                    bookFound     = popsearch.BookFound;
                    txtbBkId.Text = bookFound.BookID.ToString();
                    mtbISBN.Text  = bookFound.ISBN.ToString();

                    txtbBkTitle.Text = bookFound.BookTitle.ToString();
                    txtbAuthor.Text  = bookFound.Author.ToString();

                    toolStripStatusLabel1.Text = string.Format("<<{0}>>", bookFound.BookTitle.ToString());

                    using (SA45Team07B_LibraryEntities context = new SA45Team07B_LibraryEntities())
                    {
                        cbxPublisher.DataSource     = context.Publishers.Select(x => x.PublisherName).ToList();
                        cbxPublisher.SelectedItem   = context.Publishers.Where(x => x.PublisherID == bookFound.PublisherID).First().PublisherName.ToString();
                        cbxSubjectName.DataSource   = context.BookSubjects.Select(x => x.SubjectName).ToList();
                        cbxSubjectName.SelectedItem = context.BookSubjects.Where(x => x.SubjectCode == bookFound.SubjectCode).First().SubjectName.ToString();
                    }
                    txtbCallNum.Text = bookFound.CallNumber.ToString();
                    txtbPrice.Text   = bookFound.Price.ToString();
                    if (bookFound.Edition != null)
                    {
                        txtbEd.Text = bookFound.Edition.ToString();
                    }
                    if (bookFound.PublishedYear != null)
                    {
                        mtbYear.Text = bookFound.PublishedYear.ToString();
                    }
                    bookFound.RFIDs = popsearch.RFIDsOfBookFound;
                    foreach (RFIDTag rfid in bookFound.RFIDs)
                    {
                        lbxRFID.Items.Add(rfid.RFID.ToString().ToUpper());
                    }
                }
            }
            bookModified = new SA45Team07B.Book();
        }