Beispiel #1
0
        protected void btnExport_Click(object sender, EventArgs e)
        {
            ExportParameter exportParameter = new ExportParameter();

            int leadID = Convert.ToInt32(Session["LeadIds"]);

            //string filepath = Server.MapPath("~/Temp");
            string finalReportPath = null;

            exportParameter.isClaimLogo    = cbxClaimLog.Checked;
            exportParameter.isCoverage     = cbxCoverage.Checked;
            exportParameter.isDemographics = cbxDemographics.Checked;
            exportParameter.isDocuments    = cbxDocuments.Checked;
            exportParameter.isPhotos       = cbxPhotos.Checked;


            exportParameter.policyTypeID = Convert.ToInt32(ddlPolicyType.SelectedValue);

            try {
                finalReportPath = ExportLeadHelper.exportLead(exportParameter, leadID);

                emailDocumentLink(finalReportPath, txtEmailTo.Text.Trim());

                lblMessage.Text     = "Claim has been successfully exported.";
                lblMessage.CssClass = "ok";
            }
            catch (Exception ex) {
                lblMessage.Text     = "Error while exporting claim.";
                lblMessage.CssClass = "error";

                Core.EmailHelper.emailError(ex);
            }

            //renderToClient(finalReportPath);
        }
        protected void btnPrintOnly_Click(object sender, EventArgs e)
        {
            ExportParameter exportParameter = new ExportParameter();

            int claimID = SessionHelper.getClaimID();
            int leadID  = SessionHelper.getLeadId();

            //string filepath = Server.MapPath("~/Temp");
            string finalReportPath = null;

            exportParameter.isClaimLogo    = cbxClaimLog.Checked;
            exportParameter.isCoverage     = cbxCoverage.Checked;
            exportParameter.isDemographics = cbxDemographics.Checked;
            exportParameter.isDocuments    = cbxDocuments.Checked;
            exportParameter.isPhotos       = cbxPhotos.Checked;


            try {
                finalReportPath = ExportLeadHelper.exportLead(exportParameter, claimID);

                addReportToClaimDocument(finalReportPath, claimID);

                string siteURL = ConfigurationManager.AppSettings["siteURL"].ToString();

                string path = siteURL + "/Temp/" + Path.GetFileName(finalReportPath);

                string js = string.Format("window.open('{0}', '_blank','height=800,width=800,titlebar=yes,top=25,left=25, scrollbars=yes,status=no,resizable=yes');", path);

                ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "report", js, true);
            }
            catch (Exception ex) {
                lblMessage.Text     = ex.Message;
                lblMessage.CssClass = "error";

                Core.EmailHelper.emailError(ex);
            }
        }
        protected void btnExport_Click(object sender, EventArgs e)
        {
            ExportParameter exportParameter = new ExportParameter();

            int claimID = SessionHelper.getClaimID();
            int leadID  = SessionHelper.getLeadId();

            //string filepath = Server.MapPath("~/Temp");
            string finalReportPath = null;

            exportParameter.isClaimLogo    = cbxClaimLog.Checked;
            exportParameter.isCoverage     = cbxCoverage.Checked;
            exportParameter.isDemographics = cbxDemographics.Checked;
            exportParameter.isDocuments    = cbxDocuments.Checked;
            exportParameter.isPhotos       = cbxPhotos.Checked;


            try {
                finalReportPath = ExportLeadHelper.exportLead(exportParameter, claimID);

                //generateSharedDocumentPage(claimID, leadID);

                emailDocumentLink(finalReportPath, txtEmailTo.Text.Trim(), claimID);

                addReportToClaimDocument(finalReportPath, claimID);

                lblMessage.Text     = "Claim report has been printed and emailed successfully.";
                lblMessage.CssClass = "ok";
            }
            catch (Exception ex) {
                lblMessage.Text     = ex.Message;
                lblMessage.CssClass = "error";

                Core.EmailHelper.emailError(ex);
            }
        }