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")); }
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"); }
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); }
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)); }
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)); }
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); }