Exemplo n.º 1
0
        protected override ExeResEdm WriteLog(Log_SystemMonitorMQ model)
        {
            if (model == null)
            {
                return(new ExeResEdm());
            }
            //  AdoSQLHelper<Log_SystemMonitor> sqlHelper = new AdoSQLHelper<Log_SystemMonitor>();

            var dbAccessFac           = new Log_SystemMonitorDBAccessFac().DBAccessFactory();
            Log_SystemMonitor dbModel = AutoMapperConfig.GetLog_SystemMonitorModel(model);

            AddDBPara <Log_SystemMonitor> addDBPara = new AddDBPara <Log_SystemMonitor>()
            {
                DBType    = DBType.LogMonitor,
                Model     = dbModel,
                SkipCols  = new string[] { "Id" },
                TableName = "Log_SystemMonitor",
            };

            try
            {
                var n = dbAccessFac.Add(addDBPara);
                return(n);
            }
            catch (Exception ex)
            {
                ExeResEdm dbResEdm = new ExeResEdm()
                {
                    ErrCode = 1, ExBody = ex, Module = "WriteLog方法"
                };
                return(dbResEdm);
            }
        }
Exemplo n.º 2
0
        static string WriteLog(params LogMonitorEdm[] model)
        {
            if (model == null || model.Length <= 0)
            {
                return("");
            }

            try
            {
                List <Log_SystemMonitorMQ> list = new List <Log_SystemMonitorMQ>();
                foreach (var item in model)
                {
                    Log_SystemMonitorR cur = new Log_SystemMonitorR()
                    {
                        Remark       = item.Remark,
                        PageViewNumR = XmlSerializeHelper.ToSqlXml(item.PagesView),
                    };
                    Log_SystemMonitorMQ log_SystemMonitorMQ = AutoMapperConfig.GetLog_SystemMonitorMQModel(cur);

                    list.Add(log_SystemMonitorMQ);
                }
                appender.WriteLogAndHandFail(list);
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    throw ex.InnerException;
                }
                throw ex;
            }
            return("");
        }
Exemplo n.º 3
0
        public static Log_SystemMonitorMQ GetLog_SystemMonitorMQModel(Log_SystemMonitorR oldModel)
        {
            if (oldModel == null)
            {
                return(null);
            }
            Log_SystemMonitorMQ newModel = new Log_SystemMonitorMQ();

            try
            {
                newModel = AutoMapperExtension.MapTo <Log_SystemMonitorMQ>(oldModel);
            }
            catch
            {
                newModel = SerializerHelper.ObjectDeepCopy <Log_SystemMonitorMQ>(oldModel);
            }

            if (oldModel.DiskSpaceR != null)
            {
                newModel.DiskSpaceMQ = new SQLXMLEdm()
                {
                    IsNull = oldModel.DiskSpaceR.IsNull, Value = oldModel.DiskSpaceR.Value
                };
            }
            if (oldModel.PageViewNumR != null)
            {
                newModel.PageViewNumMQ = new SQLXMLEdm()
                {
                    IsNull = oldModel.PageViewNumR.IsNull, Value = oldModel.PageViewNumR.Value
                };
            }
            return(newModel);
        }
Exemplo n.º 4
0
        public static Log_SystemMonitor GetLog_SystemMonitorModel(Log_SystemMonitorMQ oldModel)
        {
            if (oldModel == null)
            {
                return(null);
            }
            Log_SystemMonitor newModel = new Log_SystemMonitor();

            try
            {
                newModel = AutoMapperExtension.MapTo <Log_SystemMonitor>(oldModel);
            }
            catch
            {
                newModel = SerializerHelper.ObjectDeepCopy <Log_SystemMonitor>(oldModel);
            }

            newModel.DiskSpace   = /* GetSQLXml */ GetSQLXmlString <DiskSpaceEdm>(oldModel.DiskSpaceMQ);
            newModel.PageViewNum = /* GetSQLXml */ GetSQLXmlString <PageVist>(oldModel.PageViewNumMQ);
            return(newModel);
        }
Exemplo n.º 5
0
 //写监控数据到MS SQL和InfluxDB
 protected void WriteMonitorDataToDB(Log_SystemMonitorMQ obj)
 {
     base.WriteLog(obj);
 }
Exemplo n.º 6
0
 //将Log_SystemMonitorR内容写到队列中
 protected override ExeResEdm WriteLog(Log_SystemMonitorMQ model)
 {
     return(SendLogToQueue(model, MQType.MonitorLog));
 }
Exemplo n.º 7
0
 //写Log_SystemMonitorR日志
 protected abstract ExeResEdm WriteLog(Log_SystemMonitorMQ model);