Exemplo n.º 1
0
        public static bool AddLogInDb(InformationLog infoLog, IdentifyClass dataId = null)
        {
            try
            {
                if (_context == null)
                {
                    AddInnerException(new Exception("ThisAppContextInterface was not override in SSC.D_Common.Model.ThisAppContext"));
                    return(false);
                }

                if (!_context.AddInformationLogInDataBase(infoLog, UserIdentifyData, dataId))
                {
                    return(AddLogInFile(infoLog, dataId));
                }
            }
            catch (Exception e)
            {
                try
                {
                    var infoLog2 = new InformationLog(e);

                    AddLogInFile(infoLog2);
                    return(AddLogInFile(infoLog, dataId));
                }
                catch (Exception innerExData)
                {
                    AddInnerException(innerExData);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        public void AddToMessageList(InformationLog data)
        {
            if (_messageList == null)
            {
                _messageList = new List <InformationLog>();
            }

            _messageList.Add(data);
        }
Exemplo n.º 3
0
        public void AddInformationLog(InformationLog log)
        {
            if (_logDataList == null)
            {
                CleanInformationLog();
            }

            _logDataList.Add(log);
        }
Exemplo n.º 4
0
        public static bool AddLogInFile(InformationLog infoLog, IdentifyClass dataId = null)
        {
            try
            {
                if (_context == null)
                {
                    AddInnerException(new Exception("ThisAppContextInterface was not override in SSC.D_Common.Model.ThisAppContext"));
                    return(false);
                }

                if (!_context.AddInformationLogInFile(infoLog, UserIdentifyData, dataId))
                {
                    throw new Exception("Can not save InformationLog in File Source", new Exception(infoLog.SerializeObject()));
                }
            }
            catch (Exception e)
            {
                AddInnerException(e);
            }

            return(false);
        }
Exemplo n.º 5
0
        public OperationStatusResult(OperationStatusEnum status, IdentifyClass identifyData, InformationLog e)
        {
            MakeDefaults();

            Status       = status;
            IdentifyData = identifyData;

            AddToMessageList(e);
        }