コード例 #1
0
ファイル: FacilityController.cs プロジェクト: DEFRA/prsd-iws
        public async Task <ActionResult> Index(Guid id, MultipleFacilitiesViewModel model)
        {
            var facilityCollection = await mediator.SendAsync(new GetDraftData <FacilityCollection>(id));

            foreach (var f in facilityCollection.Facilities)
            {
                f.IsActualSite = f.Id == model.SelectedSiteOfTreatment;
            }

            await mediator.SendAsync(new SetDraftData <FacilityCollection>(id, facilityCollection));

            return(RedirectToAction("Index", "Shipment"));
        }
コード例 #2
0
        public async Task<ActionResult> Index(Guid id, MultipleFacilitiesViewModel model)
        {
            var facilityCollection = await mediator.SendAsync(new GetDraftData<FacilityCollection>(id));

            foreach (var f in facilityCollection.Facilities)
            {
                f.IsActualSite = f.Id == model.SelectedSiteOfTreatment;
            }

            await mediator.SendAsync(new SetDraftData<FacilityCollection>(id, facilityCollection));

            return RedirectToAction("Index", "Shipment");
        }
コード例 #3
0
        public async Task<ActionResult> Index(Guid id)
        {
            var facilityCollection = await mediator.SendAsync(new GetDraftData<FacilityCollection>(id));
            var details = await mediator.SendAsync(new GetNotificationDetails(id));

            var model = new MultipleFacilitiesViewModel
            {
                NotificationId = details.ImportNotificationId,
                NotificationType = details.NotificationType,
                Facilities = facilityCollection.Facilities
            };
            
            return View(model);
        }
コード例 #4
0
ファイル: FacilityController.cs プロジェクト: DEFRA/prsd-iws
        public async Task <ActionResult> Index(Guid id)
        {
            var facilityCollection = await mediator.SendAsync(new GetDraftData <FacilityCollection>(id));

            var details = await mediator.SendAsync(new GetNotificationDetails(id));

            var model = new MultipleFacilitiesViewModel
            {
                NotificationId   = details.ImportNotificationId,
                NotificationType = details.NotificationType,
                Facilities       = facilityCollection.Facilities
            };

            return(View(model));
        }
コード例 #5
0
ファイル: FacilityController.cs プロジェクト: DEFRA/prsd-iws
        public async Task <ActionResult> List(Guid id, bool?backToOverview = null)
        {
            ViewBag.BackToOverview = backToOverview.GetValueOrDefault();

            var model = new MultipleFacilitiesViewModel();

            var response =
                await mediator.SendAsync(new GetFacilitiesByNotificationId(id));

            var notificationInfo =
                await mediator.SendAsync(new GetNotificationBasicInfo(id));

            model.NotificationId   = id;
            model.FacilityData     = response;
            model.NotificationType = notificationInfo.NotificationType;

            return(View(model));
        }
コード例 #6
0
        public async Task<ActionResult> List(Guid id, bool? backToOverview = null)
        {
            ViewBag.BackToOverview = backToOverview.GetValueOrDefault();

            var model = new MultipleFacilitiesViewModel();

            var response =
                await mediator.SendAsync(new GetFacilitiesByNotificationId(id));

            var notificationInfo =
                await mediator.SendAsync(new GetNotificationBasicInfo(id));

            model.NotificationId = id;
            model.FacilityData = response;
            model.NotificationType = notificationInfo.NotificationType;

            return View(model);
        }