示例#1
0
        private void htmlStarter(string message, DateTime reportDate, out string error)
        {
            error = string.Empty;

            string rName;

            if (this.workingHeader != null)
            {
                rName = this.workingHeader.XmlFileName;
            }
            else
            {
                rName = "R9999.xml";
            }

            string[] errorMessages = new string[2];

            try
            {
                errorMessages = message.Split(breakToken, StringSplitOptions.None);
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }


            if (this.reportName != this.html.ReportName)
            {
                if (this.html.htmlStarted)
                {
                    // close old, start new, update html instance
                    this.html.EndReport();
                }

                this.html.ReportName = this.reportName;
                this.html.RFile      = rName;
            }

            if (this.reportName == html.ReportName)
            {
                //Run the existing report
                if (!html.reportStarted)
                {
                    //Report not started yet:
                    html.StartReport(reportName, rName, rFileLoc1, rFileLoc2);
                    html.AppendError(message);
                    html.reportStarted = true;

                    //Log a new report:
                    reportID = SQLLog.AddReport(reportName, reportDate, out error);
                    fileID   = SQLLog.AddFile(reportID, rName, rFileLoc1, rFileLoc2, out error);

                    if (errorMessages.Length > 1)
                    {
                        errorID = SQLLog.AddError(fileID, errorMessages[0], errorMessages[1], out error);
                    }
                }
                else
                {
                    //update an error list item
                    //check for new r file:
                    if (rName == html.RFile)
                    {
                        //r file exists:
                        html.AppendError(message);
                        errorID = SQLLog.AddError(fileID, errorMessages[0], errorMessages[1], out error);
                    }
                    else
                    {
                        // r file doesn't exist:
                        html.NewRFile(rName, rFileLoc1, rFileLoc2);
                        html.AppendError(message);
                        html.RFile = rName;
                        fileID     = SQLLog.AddFile(reportID, rName, rFileLoc1, rFileLoc2, out error);
                        errorID    = SQLLog.AddError(fileID, errorMessages[0], errorMessages[1], out error);
                    }
                }
            }
        }
示例#2
0
        private void UpdateDataBase()
        {
            string error;

            SQLLog.ModifyBaseLine(errorID, false, out error);
        }