//protected void btnEncashCertificate_Click(object sender, EventArgs e) //{ // ReportDAL rdal = new ReportDAL(); // Result oResult = new Result(); // Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; // if (!string.IsNullOrEmpty(txtRegistrationNo.Text)) // { // if (oConfig != null) // { // oResult = rdal.EncashmentCertificate(txtRegistrationNo.Text, txtIssueName.Text, oConfig.BranchID); // //Page.RegisterStartupScript(Constants.REPORT_WINDOW, "<script> alert('opended')</script>"); // if (oResult.Status) // { // Session[Constants.SES_RPT_DATA] = oResult.Return; // Page.RegisterStartupScript(Constants.REPORT_WINDOW, Util.OpenReport()); // } // } // } // else // { // ucMessage.OpenMessage("Enter a valid reg no. Please check!", Constants.MSG_TYPE_INFO); // ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); // } //} //protected void btnPaymentCertificate_Click(object sender, EventArgs e) //{ // ReportDAL rdal = new ReportDAL(); // Result oResult = new Result(); // Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; // if (!string.IsNullOrEmpty(txtRegistrationNo.Text)) // { // if (oConfig != null) // { // oResult = rdal.PaymentCertificate(txtRegistrationNo.Text, txtIssueName.Text, oConfig.BranchID,ddlTaxYear.SelectedValue.ToString()); // //Page.RegisterStartupScript(Constants.REPORT_WINDOW, "<script> alert('opended')</script>"); // if (oResult.Status) // { // Session[Constants.SES_RPT_DATA] = oResult.Return; // Page.RegisterStartupScript(Constants.REPORT_WINDOW, Util.OpenReport()); // } // } // } // else // { // ucMessage.OpenMessage("Enter a valid reg no. Please check!", Constants.MSG_TYPE_INFO); // ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); // } //} protected void btnIssueDocument_Click(object sender, EventArgs e) { IssueDAL oIssueDAL = new IssueDAL(); Result oResult = oIssueDAL.LoadIssueDocument_PDF(txtRegistrationNo.Text.Trim()); if (oResult.Status) { if (((DataTable)oResult.Return).Rows.Count > 0) { Session[Constants.SES_PDF_DATA] = (byte[])(((DataTable)oResult.Return).Rows[0]["IssuePDFFile"]); Page.RegisterStartupScript(Constants.PDF_WINDOW, Util.OpenPDFView()); //byte[] oRepDoc = null; //oRepDoc = (byte[])(((DataTable)oResult.Return).Rows[0]["IssuePDFFile"]); //Response.Buffer = true; //Response.Charset = ""; ////if (Request.QueryString["download"] == "1") ////{ //Response.AppendHeader("Content-Disposition", "attachment; filename=IssueDocument_" + DateTime.Today.ToString("yyyyMMdd")); ////} //Response.Cache.SetCacheability(HttpCacheability.NoCache); //Response.ContentType = "application/pdf"; //Response.BinaryWrite(oRepDoc); //Response.Flush(); //Response.End(); } } }