//REQUEUE OVERLOAD private string CreateHTMLEmailForClient(bool isSuccessful, string xsltFile, List <string> Sent, List <string> Pending, HTTPProcessObject _httpProcess) { string result = ""; IAPL.Transport.Util.XmlData xmlData = new IAPL.Transport.Util.XmlData(); // this.ErrorMessage = ""; try { int _total = Sent.Count + Pending.Count; xmlData.CreateMainTag("NewDataSet"); xmlData.AddElement("NewDataSet", "Table", ""); //xmlData.CreateMainTag("Table"); xmlData.AddElement("NewDataSet", "Subject", this.returnHtmlData(_httpProcess.EmailSubject)); //this.serverInformation.EmailSubject)); xmlData.AddElement("NewDataSet", "DateTime", this.returnHtmlData(DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss"))); xmlData.AddElement("NewDataSet", "SupplierName", this.returnHtmlData(_httpProcess.SupplierName)); //messageInformation.SupplierName)); xmlData.AddElement("NewDataSet", "SourceFileName", this.returnHtmlData(Path.GetFileName(xsltFile))); //this.SourceFile)); xmlData.AddElement("NewDataSet", "SourceFolder", this.returnHtmlData(_httpProcess.Guid)); xmlData.AddElement("NewDataSet", "ERPID", this.returnHtmlData(_httpProcess.ERP)); //this.messageInformation.ERP)); xmlData.AddElement("NewDataSet", "DestinationURL", this.returnHtmlData(_httpProcess.URL)); //this.messageInformation.ERP)); xmlData.AddElement("NewDataSet", "Total", this.returnHtmlData(Sent.Count + " / " + _total)); //this.messageInformation.ERP)); for (int i = 1; i < Sent.Count + 1; i++) { xmlData.AddElement("NewDataSet", "ItemEntry" + (i - 1), this.returnHtmlData(Sent[i - 1].ToString()));//this.messageInformation.ERP)); } for (int i = 1; i < Pending.Count + 1; i++) { xmlData.AddElement("NewDataSet", "PendingEntry" + (i - 1), this.returnHtmlData(Sent[i - 1].ToString()));//this.messageInformation.ERP)); } if (!isSuccessful) { xmlData.AddElement("Table", "ProcesslogID", this.returnHtmlData("ProcessLOGID"));//this.messageInformation.ProcessLogID)); xmlData.AddElement("Table", "CustomerID", ""); xmlData.AddElement("Table", "prlgProcessSource", ""); xmlData.AddElement("Table", "prlgStartDate", this.returnHtmlData("DateToday")); //this.messageInformation.StartDate)); xmlData.AddElement("Table", "prlgEndDate", this.returnHtmlData("END DATE")); //this.messageInformation.EndDate)); xmlData.AddElement("Table", "ERPID", this.returnHtmlData("ANOTHER ERPID")); //this.messageInformation.ERP)); xmlData.AddElement("Table", "prlgIsSuccess", "0"); xmlData.AddElement("Table", "apluCode", this.returnHtmlData("APLU CODE")); //this.messageInformation.ApplicationCode)); xmlData.AddElement("Table", "prlgDescription", this.returnHtmlData("Description")); //this.messageInformation.TransDescription)); xmlData.AddElement("Table", "prlgTechnicalErrDesc", this.returnHtmlData("Technical Error Desc")); //this.messageInformation.TechnicalErrorDescription)); xmlData.AddElement("Table", "prlgSourceParentCount", ""); xmlData.AddElement("Table", "prlgSourceParent", ""); xmlData.AddElement("Table", "prlgSourceChild", "0"); xmlData.AddElement("Table", "prlgSourceChildCount", "0"); xmlData.AddElement("Table", "prlgAddDate", this.returnHtmlData("ADD DATE"));//this.messageInformation.StartDate)); } result = convertXSLTToHTML(xsltFile, xmlData.GetXmlData); } catch (Exception ex) { string _result = ex.Message; Console.WriteLine("CreateHTMLEmailForClient: " + ex.Message); //this.ErrorMessage = ex.Message.ToString(); } return(result); }
private IAPL.Transport.Util.XmlData IMSRepBuildXML(int Report, IAPL.Transport.Util.XmlData xmlData, IAPL.Transport.IMS.Process.IMSReportDetails IMS) { xmlData.AddElement("NewDataSet", "Details", string.Empty); xmlData.AddElement("Details", "Country", this.returnHtmlData(IMS.Country)); xmlData.AddElement("Details", "CountryCode", this.returnHtmlData(IMS.CountryCode)); xmlData.AddElement("Details", "IMSDataSeq", this.returnHtmlData(IMS.IMSDataSeq)); if (IMS.SizeKB.Equals(0)) { xmlData.AddElement("Details", "SizeKB", ""); } else { xmlData.AddElement("Details", "SizeKB", this.returnHtmlData(Convert.ToDouble(IMS.SizeKB).ToString())); } if (!IMSNoFilesFound) { if (!IMS.IMSDataSeq.Equals(string.Empty)) { DateTime dt = IMS.DateSent; xmlData.AddElement("Details", "ISGDateSent", this.returnHtmlData(dt.ToString("MMMM dd, yyyy"))); } else { xmlData.AddElement("Details", "ISGDateSent", ""); } } else { xmlData.AddElement("Details", "ISGDateSent", ""); } switch (Report) { case 1: // Exception Report summary xmlData.AddElement("Details", "SendStatus", this.returnHtmlData(Convert.ToString(IMS.SendStatus))); xmlData.AddElement("Details", "Issue", this.returnHtmlData(IMS.ERS_Issue)); xmlData.AddElement("Details", "Resolution", ""); xmlData.AddElement("Details", "IMSSingaporeComment", ""); xmlData.AddElement("Details", "ISGComment", ""); break; case 2: xmlData.AddElement("Details", "Issue", this.returnHtmlData(IMS.IMSSR_Issue)); xmlData.AddElement("Details", "CommentResolution", this.returnHtmlData(IMS.CommentResolution)); xmlData.AddElement("Details", "DataFileRcvd", this.returnHtmlData(Convert.ToString(IMS.DataFileRecvd))); xmlData.AddElement("Details", "TransactionDate", this.returnHtmlData(Convert.ToString(IMS.TransactionDate))); if (IMS.SizeKB.Equals(0)) { xmlData.AddElement("Details", "RecordCount", ""); } else { xmlData.AddElement("Details", "RecordCount", this.returnHtmlData(Convert.ToString(IMS.RecordCount))); } if (IMS.SizeKB.Equals(0)) { xmlData.AddElement("Details", "IMSExtractionValue", ""); } else { xmlData.AddElement("Details", "IMSExtractionValue", this.returnHtmlData(Convert.ToString(IMS.IMSExtractionValue))); } break; } return(xmlData); }
private string IMSreadNoticationMessageBody(int Report, bool isSuccessful, string xsltFile, System.Collections.Hashtable DetailsForIMS, bool IMSBatchRun) { string result = ""; IAPL.Transport.Util.XmlData xmlData = new IAPL.Transport.Util.XmlData(); this.ErrorMessage = ""; try { xmlData.CreateMainTag("NewDataSet"); DateTime DataStatusReportDate = System.DateTime.Now; xmlData.AddElement("NewDataSet", "IMSDataStatusReportDate", this.returnHtmlData(DataStatusReportDate.ToString("MMMM dd, yyyy") + " (" + DataStatusReportDate.DayOfWeek + ")")); int ctr = 0; //do sorting //DetailsForIMS = (Hashtable)IAPL.Transport.Util.Utility.SortedHashTable(DetailsForIMS); foreach (DictionaryEntry IMSData in (Hashtable)DetailsForIMS) { ctr++; IAPL.Transport.IMS.Process.IMSReportDetails IMS = (IAPL.Transport.IMS.Process.IMSReportDetails)DetailsForIMS[IMSData.Key.ToString()]; switch (Report) { case 1: // Exception Report summary if (IMSBatchRun) { xmlData = IMSRepBuildXML(Report, xmlData, IMS); } else { if (!IMS.IMSDataSeq.Equals(string.Empty)) { xmlData = IMSRepBuildXML(Report, xmlData, IMS); } } break; case 2: // IMS Summary Report if (IMSBatchRun) { xmlData = IMSRepBuildXML(Report, xmlData, IMS); } else { if (!IMS.IMSDataSeq.Equals(string.Empty)) { xmlData = IMSRepBuildXML(Report, xmlData, IMS); } } break; } } if (System.IO.File.Exists(xsltFile)) { result = convertXSLTToHTML(xsltFile, xmlData.GetXmlData); } else { result = ""; this.ErrorMessage = xsltFile + " not found"; } } catch (Exception ex) { result = ""; this.ErrorMessage = ex.Message.ToString(); } return(result); }
//OLD CODE SR#33117 Ccenriquez / Capad -- November 5, 2009 //private string readNoticationMessageBody(string fileName, bool isSuccessful, string xsltFile) //NEW CODE SR#33117 Ccenriquez / Capad -- November 5, 2009 public string readNoticationMessageBody(string fileName, bool isSuccessful, string xsltFile) { string result = ""; IAPL.Transport.Util.XmlData xmlData = new IAPL.Transport.Util.XmlData(); this.ErrorMessage = ""; try { xmlData.CreateMainTag("NewDataSet"); xmlData.AddElement("NewDataSet", "Table", ""); //xmlData.CreateMainTag("Table"); xmlData.AddElement("NewDataSet", "Subject", this.returnHtmlData(this.serverInformation.EmailSubject)); //OLD CODE SR#33117 Ccenriquez -- Dec 8, 2009 //xmlData.AddElement("NewDataSet", "DateTime", this.returnHtmlData(DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss"))); //NEW CODE SR#33117 Ccenriquez -- Dec 8, 2009 xmlData.AddElement("NewDataSet", "DateTime", this.returnHtmlData(DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"))); xmlData.AddElement("NewDataSet", "Environment", this.returnHtmlData(IAPL.Transport.Configuration.Config.GetAppSettingsValue("environment", "development"))); xmlData.AddElement("NewDataSet", "OutputFileName", this.returnHtmlData(this.OutputFile)); xmlData.AddElement("NewDataSet", "DestinationFolder", this.returnHtmlData(this.DestinationFolder)); xmlData.AddElement("NewDataSet", "SupplierName", this.returnHtmlData(messageInformation.SupplierName)); xmlData.AddElement("NewDataSet", "SourceFileName", this.returnHtmlData(this.SourceFile)); xmlData.AddElement("NewDataSet", "SourceFolder", this.returnHtmlData(this.SourceFolder)); xmlData.AddElement("NewDataSet", "ERPID", this.returnHtmlData(this.messageInformation.ERP)); if (!isSuccessful) { xmlData.AddElement("Table", "ProcesslogID", this.returnHtmlData(this.messageInformation.ProcessLogID)); xmlData.AddElement("Table", "CustomerID", ""); xmlData.AddElement("Table", "prlgProcessSource", ""); xmlData.AddElement("Table", "prlgStartDate", this.returnHtmlData(this.messageInformation.StartDate)); xmlData.AddElement("Table", "prlgEndDate", this.returnHtmlData(this.messageInformation.EndDate)); xmlData.AddElement("Table", "ERPID", this.returnHtmlData(this.messageInformation.ERP)); if (messageInformation.TechnicalErrorDescription.Trim().Length > 0) { xmlData.AddElement("Table", "prlgIsSuccess", "0"); } else { xmlData.AddElement("Table", "prlgIsSuccess", "1"); } xmlData.AddElement("Table", "apluCode", this.returnHtmlData(this.messageInformation.ApplicationCode)); xmlData.AddElement("Table", "prlgDescription", this.returnHtmlData(this.messageInformation.TransDescription)); xmlData.AddElement("Table", "prlgTechnicalErrDesc", this.returnHtmlData(this.messageInformation.TechnicalErrorDescription)); xmlData.AddElement("Table", "prlgSourceParentCount", ""); xmlData.AddElement("Table", "prlgSourceParent", ""); xmlData.AddElement("Table", "prlgSourceChild", "0"); xmlData.AddElement("Table", "prlgSourceChildCount", "0"); xmlData.AddElement("Table", "prlgAddDate", this.returnHtmlData(this.messageInformation.StartDate)); } result = convertXSLTToHTML(xsltFile, xmlData.GetXmlData); } catch (Exception ex) { result = ""; this.ErrorMessage = ex.Message.ToString(); } return(result); }