Beispiel #1
0
        public IActionResult OnPost()
        {
            _logger.LogInformation($"MailDeliverySetup->onPost: Picked country id = {CountryId}");
            var state = _messageDeliveryRepository.ExecuteQuery(CountryId, CityId, BatchId);

            if (state.IsSuccess)
            {
                var affectedRowsAmount = state.Cast <ModelResult <int> >().Model;
                _logger.LogInformation($"MailDeliverySetup->onPost: IsSuccess = true, rows affected = {affectedRowsAmount}");
                Message = $"Запрос выполнился успешно, {affectedRowsAmount} полей добавилось!";
                return(OnGet());
            }

            Message = "Произошла ошибка: " + state.Message;
            return(Page());
        }
Beispiel #2
0
        public IActionResult OnPost()
        {
            _logger.LogInformation($"MailDeliverySetup->onPost: Picked country id = {CountryId}");
            var state = _messageDeliveryRepository.ExecuteQuery(CountryId, CityId, BatchId);

            if (state.IsSuccess)
            {
                var affectedRowsAmount = state.Cast <ModelResult <int> >().Model;
                _logger.LogInformation($"MailDeliverySetup->onPost: IsSuccess = true, rows affected = {affectedRowsAmount}");
                Message = $"Query Executed, {affectedRowsAmount} rows affected!";
                //todo render to user the amount of rows affected.

                return(RedirectToPage("/Index"));
            }
            return(RedirectToPage("/Error"));
        }