private void btnIssueBook_Click(object sender, RoutedEventArgs e)
        {
            int id = int.Parse(txtIssueStdId.Text);

            try {
                if (context.BOOKS.Any(o => o.ss_id == txtIssueBookId.Text) && context.STUDENTS.Any(o => o.std_id == id))
                {
                    var issue = new BOOK_ISSUES
                    {
                        book_id    = txtIssueBookId.Text,
                        issue_date = DateTime.Today.ToString("dd-MM-yyyy"),
                        std_id     = int.Parse(txtIssueStdId.Text)
                    };
                    context.BOOK_ISSUES.Add(issue);
                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                lblIssueMsg.Content = "Your Book is issued";
            }
        }
        private void btnReturnBook_Click(object sender, RoutedEventArgs e)
        {
            int id = int.Parse(txtRtnIssueId.Text);

            try
            {
                if (context.BOOK_ISSUES.Any(o => o.book_issue_id == id))
                {
                    var issue = new BOOK_RETURN
                    {
                        issue_id   = int.Parse(txtRtnIssueId.Text),
                        issue_date = DateTime.Today.ToString("dd-MM-yyyy"),
                    };
                    context.BOOK_RETURN.Add(issue);

                    context.SaveChanges();
                    try
                    {
                        var record = new BOOK_ISSUES {
                            book_issue_id = id
                        };
                        context.BOOK_ISSUES.Attach(record);
                        context.BOOK_ISSUES.Remove(record);
                        context.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.InnerException.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                lblRtnMsg.Content = "Please fill the field correctly";
            }
        }