private void check_in_Click(object sender, EventArgs e)
        {
            LMSentities ctx        = new LMSentities();
            int         loanNumber = (int)dataGridView1.CurrentRow.Cells[0].Value;
            LoanRecord  checkedIn  = ctx.LoanRecords.Where(x => x.LoanNumber == loanNumber).First();

            checkedIn.DateReturned = dateTimePicker1.Value;
            checkedIn.LoadStatus   = "in";
            ctx.SaveChanges();
        }
        private void search_Click(object sender, EventArgs e)
        {
            LMSentities ctx         = new LMSentities();
            string      searchfield = textBox2.Text;


            if (isDigitOnly(searchfield))
            {
                int searchNum = Convert.ToInt32(searchfield);
                dataGridView1.DataSource = ctx.LoanRecords.Where(x => x.MemberID == searchNum && x.LoadStatus == "out").Select(x => new { x.LoanNumber, x.ISBN, x.Book.Title, x.Book.Author, x.MemberID, x.Member.MumberName, x.LoadStatus }).ToList();
            }

            else
            {
                dataGridView1.DataSource = ctx.LoanRecords.Where(
                    x => x.ISBN == searchfield ||
                    x.Book.Title == searchfield ||
                    x.Book.Author == searchfield ||
                    x.Member.MumberName == searchfield

                    ).Select(x => new { x.LoanNumber, x.ISBN, x.Book.Title, x.Book.Author, x.MemberID, x.Member.MumberName, x.LoadStatus }).ToList();
            }
        }
        private void Return_Load(object sender, EventArgs e)
        {
            LMSentities ctx = new LMSentities();

            dataGridView1.DataSource = ctx.LoanRecords.Where(x => x.LoadStatus == "out").Select(x => new { x.LoanNumber, x.ISBN, x.Book.Title, x.Book.Author, x.MemberID, x.Member.MumberName, x.LoadStatus }).ToList();
        }