コード例 #1
0
        public async Task <ActionResult> Warning(Guid notificationId)
        {
            var data = await mediator.SendAsync(new GetNotificationBasicInfo(notificationId));

            var model = new WarningChoiceViewModel(notificationId, data.NotificationType);

            return(View(model));
        }
コード例 #2
0
        public void PostWarning_LeaveUpload_RedirectsToOptions()
        {
            var model = new WarningChoiceViewModel(Guid.NewGuid(), type);

            var warningChoice = RadioButtonStringCollectionViewModel.CreateFromEnum(WarningChoicesList.Leave);

            model.WarningChoices = warningChoice;

            var result = controller.Warning(model) as RedirectToRouteResult;

            Assert.NotNull(result);
            Assert.Equal("Index", (string)result.RouteValues["action"]);
            Assert.Equal("Options", (string)result.RouteValues["controller"]);
        }
コード例 #3
0
        public ActionResult Warning(WarningChoiceViewModel model, string cfp)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (model.GetEnumDisplayValue(WarningChoicesList.Leave).Equals(model.WarningChoices.SelectedValue))
            {
                TempData.Remove("PrenotificationShipments");
                TempData.Remove("PreNotificationFileName");
                TempData.Remove("DraftBulkUploadId");

                return(RedirectToAction("Index", "Options", new { area = "NotificationApplication", id = model.NotificationId }));
            }
            if (model.GetEnumDisplayValue(WarningChoicesList.Return).Equals(model.WarningChoices.SelectedValue))
            {
                return(RedirectToAction("Documents"));
            }

            return(View(model));
        }
コード例 #4
0
        public ActionResult Warning(Guid notificationId)
        {
            var model = new WarningChoiceViewModel(notificationId);

            return(View(model));
        }