示例#1
0
        public async Task<AddAlertResponse> AddAlertNoPhoto(AddAlertContextModel model)
        {
            AddAlertResponse response = new AddAlertResponse();

            try
            {
                string error = null;

                if (model.IsValid(out error))
                {
                    response.IdAlert = _caseModule.AddAlert(model);
                }
                else
                    response.Error = error;
            }
            catch (Exception ex)
            {
                response.Error = _loggerService.GetClientException(ex);
                _loggerService.LogException("AddAlertNoPhoto", ex, model);
            }

            return response;
        }
示例#2
0
        public async Task<AddAlertResponse> AddAlert()
        {
            AddAlertContextModel model = new AddAlertContextModel();
            AddAlertResponse response = new AddAlertResponse();

            try
            {
                string error = await ProcessMultipartForm(model);

                if (string.IsNullOrWhiteSpace(error))
                {
                    response.IdAlert = _caseModule.AddAlert(model);
                }
                else
                    response.Error = error;
            }
            catch (Exception ex)
            {
                _loggerService.LogException("AddAlert", ex, model);
                response.Error = _loggerService.GetClientException(ex);
            }

            return response;
        }