예제 #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);
            }
        }