private void LibraryScreen_Load(object sender, EventArgs e)
        {
            context           = new SA47_Team12aCADatabaseEntities();
            Mem               = context.Members.ToList();
            Books             = context.Books.ToList();
            Aut               = context.Authors.ToList();
            labelWelcome.Text = showname;


            //-------------------------HIDE TABS BASED ON USER------------------------------
            if (login == "b")
            {
                this.BookMaintain.Hide();
                tabControlMenus.TabPages.Remove(IssueBook);
                this.MemberMaintain.Hide();
                tabControlMenus.TabPages.Remove(ReturnBook);
                this.BookMaintain.Hide();
                tabControlMenus.TabPages.Remove(BookMaintain);
                this.MemberMaintain.Hide();
                tabControlMenus.TabPages.Remove(MemberMaintain);
                this.Reports.Hide();
                tabControlMenus.TabPages.Remove(Reports);

                this.buttonSProceed.Hide();
                this.buttonASProceed.Hide();
            }


            //----------------------------SEARCH------------------
            pub  = new List <string>();
            type = new List <string>();

            for (int i = 0; i < Books.Count; i++)
            {
                int    id    = Books[i].BookID;
                string title = Books[i].BookTitle;

                pub.Add(Books[i].Publisher);
                type.Add(Books[i].BookType);

                comboBoxBookID.Items.Add(id);
                comboBoxBookTitle.Items.Add(title);
            }

            var unique_pub = new HashSet <string>(pub);

            foreach (string publisher in unique_pub)
            {
                comboBoxPublisher.Items.Add(publisher);
            }

            var unique_type = new HashSet <string>(type);

            foreach (string booktype in unique_type)
            {
                comboBoxBookType.Items.Add(booktype);
            }

            for (int i = 0; i < Aut.Count; i++)
            {
                string authorName = Aut[i].AuthorName;
                comboBoxAuthorName.Items.Add(authorName);
            }
        }
        private void buttonRBSearchTrans_Click(object sender, EventArgs e)
        {
            try
            {
                context          = new SA47_Team12aCADatabaseEntities();
                IssueTransaction = context.IssueTrans.ToList();
                Mem   = context.Members.ToList();
                Books = context.Books.ToList();

                string memname  = textBoxRBMemName.Text.ToLower();
                string bookname = textBoxRBBookTitle.Text.ToLower();

                bool bookstatus = true;
                bool memstatus  = true;
                bool transtatus = true;

                for (int i = 0; i < Mem.Count; i++)
                {
                    if (memname == Mem[i].MemberName.ToLower())
                    {
                        //TextBoxTryMemName.Text = Mem[i].MemberID.ToString();
                        memID     = Mem[i].MemberID;
                        memstatus = false;
                        break;
                    }
                }
                if (memstatus == true)
                {
                    MessageBox.Show("Member not found");
                }

                for (int j = 0; j < Books.Count; j++)
                {
                    if (bookname == Books[j].BookTitle.ToLower())
                    {
                        //TryBookNameTextBox.Text = Books[j].BookID.ToString();
                        bookID     = Books[j].BookID;
                        bookstatus = false;
                        break;
                    }
                }
                if (bookstatus == true)
                {
                    MessageBox.Show("Book not found");
                }

                for (int count = 0; count < IssueTransaction.Count; count++)
                {
                    if ((bookID == IssueTransaction[count].BookID) || (memID == IssueTransaction[count].MemberID))
                    {
                        //var transrecord1 = context.IssueTrans.Where((x => (x.BookID == bookID && x.MemberID == memID)));
                        var transrecord1 = from x in context.IssueTrans.Where(x => (x.BookID == bookID || x.MemberID == memID))
                                           select(new { x.TransactionID, x.BookID, x.MemberID, x.IssueDate, x.DueDate, x.ActualReturnDate, x.FineAmount, x.Remarks, x.Status });

                        dataGridViewReturnBook.DataSource = transrecord1.ToList();
                        transtatus = false;
                    }
                }
                if (transtatus == true)
                {
                    MessageBox.Show("Transaction not found");
                }
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }