Ejemplo n.º 1
0
        public async void AsyncLogModel(ModelType modelType, ActivityLogEditModel logModel, dynamic model, bool fromAPI = false)
        {
            if (modelType == ModelType.List)
            {
                await _activityLogService.LogListModel(logModel, model, fromAPI);
            }
            else if (modelType == ModelType.View)
            {
                await _activityLogService.LogViewModel(logModel, model, fromAPI);
            }
            else if (modelType == ModelType.Edit)
            {
                var modelId = GetEditModelIdValue(logModel);

                if (modelId > 0)
                {
                    await _activityLogService.LogEditModel(logModel, model, fromAPI);
                }
                else
                {
                    await _activityLogService.LogViewModel(logModel, model, fromAPI);
                }
            }
            else
            {
                await _activityLogService.LogEditModel(logModel, model, fromAPI);
            }
        }
Ejemplo n.º 2
0
        private bool ExceptionClassLogging(string modelName, object model, ActivityLogEditModel logModel)
        {
            if (modelName.ToLower().Equals("healthassessmenteditmodel"))
            {
                _activityLogService.LogListModel(logModel, model);
                return(true);
            }

            if (modelName.ToLower().Equals("massregistrationlistmodel"))
            {
                LogMassRegistrationModel(model, logModel);
                return(true);
            }

            if (modelName.ToLower().Equals("usereditmodel"))
            {
                LogUserEditModel(model, logModel);
                return(true);
            }
            return(false);
        }