Exemple #1
0
        /// <summary>
        ///


        public static void LogMessage(string message, int error, bool verbose)
        {
            if (!Connected)
            {
                return;
            }

            System.Diagnostics.Debug.Assert(ETLController.connection.State == ConnectionState.Open);

            ControllerMessage msg = new ControllerMessage();

            msg.Message = message;
            msg.Error   = error;

            if (verbose || (ETLController.Header.Options & 1) == 1)
            {
                string infoXML = ControllerProcessInfo.build(ETLController.Header, msg);
                ETLController.print.Parameters["@pProcessInfo"].Value = infoXML;
                try
                {
                    ETLController.print.ExecuteNonQuery();
                    int retval = Convert.ToInt32(ETLController.print.Parameters["@RTC"].Value, CultureInfo.InvariantCulture);
                    if (retval != 0)
                    {
                        throw new CouldNotSendMessage(message);
                    }
                }
                catch (Exception e)
                {
                    throw new CouldNotSendMessage(e.Message, e);
                }
            }
        }
Exemple #2
0
        public static string build(ControllerHeader header, ControllerMessage message)
        {
            ControllerProcessInfo processInfo = new ControllerProcessInfo();

            processInfo.Header  = header;
            processInfo.Message = message;
            XmlSerializer serparam = new XmlSerializer(typeof(ControllerProcessInfo));
            StringWriter  sw       = new StringWriter();

            serparam.Serialize(sw, processInfo);
            return(sw.ToString());
        }
Exemple #3
0
        public static string build(ETLHeader input, string msg, int err)
        {
            ControllerHeader  header  = new ControllerHeader();
            ControllerMessage message = new ControllerMessage();

            header.BatchID  = input.BatchID;
            header.StepID   = input.StepID;
            header.RunID    = input.RunID;
            header.Options  = input.Options;
            message.Message = msg;
            message.Error   = err;
            return(build(header, message));
        }