public PDFEntity GetPDFDetails(int ApplicantId)
        {
            PDFEntity pdfdetails = null;

            try
            {
                pdfdetails = apliDAL.GetPDFDetails(ApplicantId);
            }
            catch (Exception e) { }
            return(pdfdetails);
        }
        public string ReadPaymentPDF(int ApplicantId)
        {
            PDFEntity pdfDetails = GetPDFDetails(ApplicantId);
            string    RefNo      = string.Empty;
            string    html       = File.ReadAllText(System.Web.Hosting.HostingEnvironment.MapPath("/ui/" + ConfigurationManager.AppSettings["PaymentReceipt"]));

            //html = html.Replace("%backimg%", System.Web.Hosting.HostingEnvironment.MapPath("/img/" + ConfigurationManager.AppSettings["BackgroundImg"]));
            html = html.Replace("%logo%", System.Web.Hosting.HostingEnvironment.MapPath("/img/" + ConfigurationManager.AppSettings["LogoImg"]));
            if (pdfDetails != null)
            {
                RefNo = pdfDetails.CandidateRefNo;
                html  = html.Replace("%paymentdate%", pdfDetails.PaymentDate.ToString());
                html  = html.Replace("%candidatename%", pdfDetails.CandidateName.ToString());
                html  = html.Replace("%passportno%", pdfDetails.PassportNo.ToString());
                html  = html.Replace("%gbsrrefno%", pdfDetails.GBSRefNo.ToString());
                html  = html.Replace("%candidaterefno%", pdfDetails.CandidateRefNo.ToString());
                html  = html.Replace("%selectedpackage%", pdfDetails.SelectedPSV.ToString());
                int           i  = 0;
                StringBuilder sb = new StringBuilder();
                foreach (DocumentFields acadamic in pdfDetails.Documents)
                {
                    sb.Append("<tr>");
                    sb.Append("<td style='border: 1px solid #000; padding: 8px;line-height: 1.42857143;vertical-align: top; font-family: 'Raleway', sans-serif;font-size: 14px;'>");
                    sb.Append(acadamic.Category.ToString());
                    sb.Append("</td>");
                    sb.Append("<td style='border: 1px solid #000; padding: 8px;line-height: 1.42857143;vertical-align: top; font-family: 'Raleway', sans-serif;font-size: 14px;'>");
                    sb.Append(acadamic.NoOfDocuments.ToString());
                    sb.Append("</td");
                    sb.Append("<td style='border: 1px solid #000; padding: 8px;line-height: 1.42857143;vertical-align: top; font-family: 'Raleway', sans-serif;font-size: 14px;'>");
                    sb.Append(acadamic.IssueingAuthority);
                    sb.Append("</td>");
                    sb.Append("<td style='border: 1px solid #000; padding: 8px;line-height: 1.42857143;vertical-align: top; font-family: 'Raleway', sans-serif;font-size: 14px;'>");
                    sb.Append(acadamic.Details);
                    sb.Append("</td>");
                    sb.Append("</tr>");
                }
                html = html.Replace("%tabledata%", sb.ToString());
                html = html.Replace("%totalfeepaid%", pdfDetails.TotalFeePaid.ToString());
                html = html.Replace("%modeofpayment%", pdfDetails.ModeOfPayment.ToString());
            }
            return(GeneratePaymentPDF(html, RefNo));
        }