Ejemplo n.º 1
0
        protected void LogRelatedModel(dynamic filter, dynamic model, long customerId)
        {
            if (!IoC.Resolve <ISettings>().AuditEnabled)
            {
                return;
            }
            try
            {
                _activityType = Type.Retrieved;

                var logModel = _auditLogFilterHelper.GetActivityLogEditModel(this.Request, model, _activityType.ToString());

                if (logModel != null)
                {
                    if (customerId > 0)
                    {
                        logModel.CustomerId = customerId;
                    }
                    _activityLogService.LogRelatedModel(logModel, model);
                }
                else
                {
                    var logger = IoC.Resolve <ILogManager>().GetLogger("BasePage");
                    logger.Info("Session is null while Saving Audit Data");
                }
            }
            catch (Exception ex)
            {
                var logger = IoC.Resolve <ILogManager>().GetLogger("BaseUserControl");
                logger.Error("Error in BaseUserControl LogRelatedModel", ex);
            }
        }
Ejemplo n.º 2
0
        protected void LogRelatedModel(dynamic filter, dynamic model, string filePath, string requestType, long customerId)
        {
            if (!IoC.Resolve <ISettings>().AuditEnabled)
            {
                return;
            }
            try
            {
                _activityType = Type.Retrieved;

                var logModel = _auditLogFilterHelper.GetActivityLogEditModel(filePath, requestType, model, _activityType.ToString());
                if (customerId > 0)
                {
                    logModel.CustomerId = customerId;
                }
                _activityLogService.LogRelatedModel(logModel, model);
            }
            catch (Exception ex)
            {
                var logger = IoC.Resolve <ILogManager>().GetLogger("BaseWebService");
                logger.Error("Error in BaseWebService LogRelatedModel", ex);
            }
        }