public ActionResult ConfirmRegistration(int?id)
        {
            Session["bookID"] = id;

            Student studentApplication = db.students.Where(p => p.StID == id).FirstOrDefault();
            var     username           = User.Identity.GetUserName();
            var     attachments        = new List <Attachment>();

            attachments.Add(new Attachment(new MemoryStream(GeneratePDF(id)), "Proof of registration", "application/pdf"));
            var mailTo = new List <MailAddress>();

            mailTo.Add(new MailAddress(username, studentApplication.StudentName));
            var body = $"Hello {studentApplication.StudentName}, \n\n {studentApplication.StudentName} has been successfully registered at our school. Please Find the attached registration information(Proof of Registration)<br/> Regards,<br/><br/> New Erra <br/> .";

            DGSappSem2.Models.EmailService emailService = new DGSappSem2.Models.EmailService();
            emailService.SendEmail(new EmailContent()
            {
                mailTo          = mailTo,
                mailCc          = new List <MailAddress>(),
                mailSubject     = "Application Statement | Ref No.:" + studentApplication.StID,
                mailBody        = body,
                mailFooter      = "<br/> <br/> <b>New Erra</b>",
                mailPriority    = MailPriority.High,
                mailAttachments = attachments
            });
            TempData["AlertMessage"] = $"{studentApplication.StudentName} has been successfully Registered";

            return(RedirectToAction("Index"));
        }