예제 #1
0
        }       //	addLog

        /// <summary>
        /// Get Logs
        /// </summary>
        /// <returns>ProcessInfoLog[]</returns>
        public ProcessInfoLog[] GetLogs()
        {
            if (_logs == null)
            {
                return(null);
            }
            ProcessInfoLog[] logs = new ProcessInfoLog[_logs.Count];
            logs = _logs.ToArray();
            return(logs);
        }       //	getLogs
예제 #2
0
        }       //	addLog

        /// <summary>
        /// Add to Log
        /// </summary>
        /// <param name="logEntry">log entry</param>
        public void AddLog(ProcessInfoLog logEntry)
        {
            if (logEntry == null)
            {
                return;
            }
            if (_logs == null)
            {
                _logs = new List <ProcessInfoLog>();
            }
            _logs.Add(logEntry);
        }       //	addLog
예제 #3
0
        }       //	getLogs

        /// <summary>
        /// <para>
        /// Set Log of Process.
        /// - Translated Process Message
        /// - List of log entries
        ///     Date - Number - Msg
        /// </para>
        /// </summary>
        /// <param name="html">if true with HTML markup</param>
        /// <returns>Log Info</returns>
        public String GetLogInfo(bool html)
        {
            //NOTE** : dateformat has not been implemented

            if (_logs == null)
            {
                return("");
            }
            //
            StringBuilder sb = new StringBuilder();

            //SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.DateTime);
            if (html)
            {
                sb.Append("<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">");
            }
            //
            for (int i = 0; i < _logs.Count; i++)
            {
                if (html)
                {
                    sb.Append("<tr>");
                }
                else if (i > 0)
                {
                    sb.Append("\n");
                }
                //
                ProcessInfoLog log = (ProcessInfoLog)_logs[i];

                /**
                 * if (log.getP_ID() != 0)
                 *  sb.append(html ? "<td>" : "")
                 *      .append(log.getP_ID())
                 *      .append(html ? "</td>" : " \t");	**/
                //
                if (log.GetP_Date() != DateTime.MinValue)
                {
                    sb.Append(html ? "<td>" : "")
                    .Append(log.GetP_Date())
                    .Append(html ? "</td>" : " \t");
                }
                //
                if (log.GetP_Number() != null)
                {
                    sb.Append(html ? "<td>" : "")
                    .Append(log.GetP_Number())
                    .Append(html ? "</td>" : " \t");
                }
                //
                if (log.GetP_Msg() != null)
                {
                    sb.Append(html ? "<td>" : "")
                    .Append(Utility.Msg.ParseTranslation(Utility.Env.GetContext(), log.GetP_Msg()))
                    .Append(html ? "</td>" : "");
                }
                //
                if (html)
                {
                    sb.Append("</tr>");
                }
            }
            if (html)
            {
                sb.Append("</table>");
            }
            return(sb.ToString());
        }       //	getLogInfo