Exemplo n.º 1
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.º 2
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);
        }