public void SendMail(List <string> attachmentFilesPath, ClaimAdvice claimAdvice, IDictionary <string, string> Configurations)
        {
            string[] emailBodys     = HtmlTableGenerator.CreateHtmlMail(claimAdvice);
            bool     mailSentStatus = EmailSender.SendMail(Configurations, emailBodys[0], "Pickerings Claim Submission – Reference Number " + claimAdvice.ReferenceNumber, attachmentFilesPath);

            if (!mailSentStatus)
            {
                WriteCustomErrorLog.WriteLog("Email failed to AJG - Ref # : " + claimAdvice.ReferenceNumber.ToString());
                CsvGenerator.SaveAsCsV(claimAdvice, @Configurations["EmailToAJGrecoveryPath"], attachmentFilesPath);
            }

            Configurations["ToAddress"] = claimAdvice.ContactEmail;
            mailSentStatus = EmailSender.SendMail(Configurations, emailBodys[1], "Pickerings Claim Submission – Reference Number " + claimAdvice.ReferenceNumber);
            if (!mailSentStatus)
            {
                WriteCustomErrorLog.WriteLog("Email failed to initiator - Ref # : " + claimAdvice.ReferenceNumber.ToString());
                CsvGenerator.SaveAsCsV(claimAdvice, @Configurations["EmailToInitiatorRecoveryPath"], attachmentFilesPath);
            }

            if (attachmentFilesPath.Count > 0)
            {
                string serverPath = Path.GetDirectoryName(attachmentFilesPath[0]);
                new FileHandler().DeleteFiles(serverPath);
            }
        }
        protected void ExportToExcel()
        {
            var dataTable = HtmlTableGenerator.GenerateCsvFromGridview(gvHistoricalTrend);

            Session["ExportData"]     = dataTable;
            Session["ExportFileType"] = "csv";
            Session["ExportFileName"] = string.Format("HistoricalTrend Export {0}", DateTime.Now.ToShortDateString());
        }
Exemplo n.º 3
0
        private void ExportToExcel()
        {
            var dataTable = HtmlTableGenerator.GenerateCsvFromGridview(gvOverview);

            Session["ExportData"]     = dataTable;
            Session["ExportFileType"] = "csv";
            Session["ExportFileName"] = string.Format("Comparison Export {0}", DateTime.Now.ToShortDateString());
        }
        protected void ibExportToExcel_Click(object sender, EventArgs e)
        {
            var dataTable = HtmlTableGenerator.GenerateCsvFromGridview(gvOverview);

            Session["ExportData"]     = dataTable;
            Session["ExportFileType"] = "csv";
            Session["ExportFileName"] = string.Format("Reason History Export {0}", DateTime.Now.ToShortDateString());
        }
Exemplo n.º 5
0
        protected void ExportToExcel()
        {
            var dataTable = HtmlTableGenerator.GenerateHtmlTableFromGridview(gvHistory);

            Session["ExportData"]     = dataTable;
            Session["ExportFileType"] = "xls";
            Session["ExportFileName"] = string.Format("Approval History Export {0}", DateTime.Now.ToShortDateString());
        }
Exemplo n.º 6
0
        public static void ExportToExcel(List <object> dataToExport, string fileName, string[] headerNames)
        {
            var dataTable = HtmlTableGenerator.GenerateHtmlTableFromList(dataToExport, headerNames);

            HttpContext.Current.Session["ExportData"]     = dataTable;
            HttpContext.Current.Session["ExportFileType"] = "xls";
            HttpContext.Current.Session["ExportFileName"] = string.Format("{0} {1}", fileName, DateTime.Now.ToLongTimeString());
        }
Exemplo n.º 7
0
        protected void ExportToExcel()
        {
            var sb = new StringBuilder();

            sb.AppendLine(
                "Key, Fleet, 0-1 Days, 2-3 Days, 4-5 Days, 6-7 Days, 8-10 Days, 10-15 Days, 16-30 Days, 31+ Days");

            var body = HtmlTableGenerator.GenerateCsvFromGridview(gvAgeing, false);

            sb.Append(body);


            Session["ExportData"]     = sb.ToString();
            Session["ExportFileType"] = "csv";
            Session["ExportFileName"] = string.Format("Ageing Export {0}", DateTime.Now);
        }