Example #1
0
        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);
        }
Example #2
0
        //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);
        }
Example #3
0
        //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);
        }