コード例 #1
0
        public override StreamWriter SetAllInfo(StreamWriter FW, string Encabezado, infoSuceso Suceso)
        {
            try
                {
                FW.WriteLine("======================================");
                FW.WriteLine(Encabezado);
                FW.WriteLine("Date: " + Suceso.Date.ToString());
                FW.WriteLine("Application: " + Suceso.Application);
                FW.WriteLine("Event: " + Suceso.Event);
                FW.WriteLine("Method: " + Suceso.Method);
                FW.WriteLine("Status: " + Suceso.Status);
                FW.WriteLine("Custom Message: " + Suceso.CustomMessage);
                FW.WriteLine("System Error Message: " + Suceso.SystemMessage);
                FW.WriteLine("File Name: " + Suceso.FileName);
                FW.WriteLine("File Name: " + Suceso.OpcionalField);
                FW.WriteLine("Opcional: " + Suceso.OpcionalField2);
                FW.WriteLine("======================================");
                if (Suceso.SystemError != null)
                    {
                    FW.WriteLine("Type of Errorr: " + Suceso.SystemError.GetType().ToString());
                    }
                FW.WriteLine("======================================");
                }
            catch (Exception)
                {

                throw;
                }

            return FW;
        }
コード例 #2
0
 public override StreamWriter SetOnlyErros(StreamWriter FW, string Encabezado, infoSuceso Suceso)
 {
     if (Suceso.TypeEvent == EventType.Error)
         {
         FW.WriteLine("======================================");
         FW.WriteLine(Encabezado);
         FW.WriteLine("Date: " + Suceso.Date.ToString());
         FW.WriteLine("Interfas: " + Suceso.NombreInterfase);
         FW.WriteLine("IdProceso: " + Suceso.IdInterfase);
         FW.WriteLine("Event: " + Suceso.Event);
         FW.WriteLine("Method: " + Suceso.Method);
         FW.WriteLine("Resultado: " + Suceso.Resultado);
         FW.WriteLine("Subject: " + Suceso.Subject);
         FW.WriteLine("System Error Message: " + Suceso.SystemMessage);
         FW.WriteLine("Opcional: " + Suceso.OpcionalField);
         FW.WriteLine("Archivo Datos: " + Suceso.ADatos);
         FW.WriteLine("Archivo Control: " + Suceso.AControl);
         if (Suceso.SystemError != null)
             {
             FW.WriteLine("Type of Error: " + Suceso.SystemError.GetType().ToString());
             }
         FW.WriteLine("======================================");
         }
     return FW;
 }
コード例 #3
0
        public override XElement SetAllInfo(XElement xml, string Encabezado, infoSuceso Suceso)
        {
            switch (Suceso.TypeEvent)
                {
                case EventType.Information:
                    xml.Element(Encabezado).Add(
                new XElement("Event", new XAttribute("Aplication", Suceso.Application)
                    , new XAttribute("EventName", Suceso.Event)
                    , new XAttribute("MethodName", Suceso.Method)
                    , new XAttribute("Date", Suceso.Date.ToString())));
                    xml.Element("Information").Descendants("Event").Last().Add(new XElement("CustomMessage", Suceso.CustomMessage)
                        , new XElement("SystemMessage", Suceso.SystemMessage)
                        , new XElement("FileName", Suceso.FileName)
                        , new XElement("Status", Suceso.Status)
                         , new XElement("Opcional", Suceso.OpcionalField));
                    break;
                case EventType.Alert:
                    xml.Element(Encabezado).Add(
                  new XElement("Event", new XAttribute("Aplication", Suceso.Application)
                      , new XAttribute("EventName", Suceso.Event)
                      , new XAttribute("MethodName", Suceso.Method)
                      , new XAttribute("Date", Suceso.Date.ToString())));
                    xml.Element("Alerts").Descendants("Event").Last().Add(new XElement("CustomMessage", Suceso.CustomMessage)
                      , new XElement("SystemMessage", Suceso.SystemMessage)
                      , new XElement("FileName", Suceso.FileName)
                      , new XElement("Status", Suceso.Status)
                       , new XElement("Opcional", Suceso.OpcionalField));
                    break;
                case EventType.Error:
                    xml.Element(Encabezado).Add(
                  new XElement("Event", new XAttribute("Aplication", Suceso.Application)
                      , new XAttribute("EventName", Suceso.Event)
                      , new XAttribute("MethodName", Suceso.Method)
                      , new XAttribute("Date", Suceso.Date.ToString())));
                    xml.Element("Errors").Descendants("Event").Last().Add(new XElement("CustomMessage", Suceso.CustomMessage)
                        , new XElement("Status", Suceso.Status)
                        , new XElement("SystemMessage", Suceso.SystemMessage)
                        , new XElement("SystemError", Suceso.SystemError)
                        , new XElement("FileName", Suceso.FileName)
                        , new XElement("Opcional", Suceso.OpcionalField)
                         , new XElement("Opcional", Suceso.OpcionalField2));
                    break;
                default:
                    break;
                }

            return xml;
        }
コード例 #4
0
 public string CreateHeader(EventType HederType, int Conf,infoSuceso pInfo)
 {
     Config = Conf;
          InformacionSuceso = pInfo;
          switch (HederType)
              {
              case EventType.Information:
                header= "(i) Information";
                  break;
              case EventType.Alert:
                  header= "/A\\ Alert";
                  break;
              case EventType.Error:
                  header= "[*] Error";
                  break;
              default:
                  header= "";
                  break;
              }
          return header;
 }
コード例 #5
0
 public MediaTextBuilder(int pConfig, TemplateTextAbstract pTemplate, infoSuceso pInfo)
     : base(pConfig, pInfo.TypeEvent, pTemplate, pInfo)
 {
 }
コード例 #6
0
 public abstract StreamWriter SetOnlyErros(StreamWriter FW, string Encabezado, infoSuceso Suceso);
コード例 #7
0
 public abstract StreamWriter SetAllInfo(StreamWriter FW, string Encabezado, infoSuceso Suceso);
コード例 #8
0
 public MediaAbstract(int pConfig, EventType pTypeEvent, ITemplate pTemplate, infoSuceso pInfo)
 {
     Template = pTemplate;
     Template.CreateHeader(pTypeEvent, pConfig, pInfo);
 }
コード例 #9
0
 public abstract XElement SetOnlyErros(XElement xml, string Encabezado, infoSuceso Suceso);
コード例 #10
0
 public abstract XElement SetAllInfo(XElement xml, string Encabezado, infoSuceso Suceso);
コード例 #11
0
 /// <summary>
 /// Constructor Vacio
 /// </summary>
 public SucesoEventBuilder(infoSuceso pInformacionSuceso)
 {
     InformacionSuceso = pInformacionSuceso;
 }
コード例 #12
0
 public SucesoInterfaseBuilder(infoSuceso pInformacionSuceso)
 {
     InformacionSuceso = pInformacionSuceso;
 }