public async Task <ActionResult> RecoveryCodes(Guid id) { var selectedCodes = await mediator.SendAsync(new GetOperationCodesByNotificationId(id)); var model = new OperationCodesViewModel(NotificationType.Recovery, selectedCodes); return(View(model)); }
public async Task <ActionResult> DisposalCodes(Guid id, bool?backToOverview = null) { var selectedCodes = await mediator.SendAsync(new GetOperationCodesByNotificationId(id)); var model = new OperationCodesViewModel(NotificationType.Disposal, selectedCodes); return(View(model)); }
public async Task<ActionResult> DisposalCodes(Guid id, bool? backToOverview = null) { var selectedCodes = await mediator.SendAsync(new GetOperationCodesByNotificationId(id)); var model = new OperationCodesViewModel(NotificationType.Disposal, selectedCodes); return View(model); }
public async Task<ActionResult> RecoveryCodes(Guid id) { var selectedCodes = await mediator.SendAsync(new GetOperationCodesByNotificationId(id)); var model = new OperationCodesViewModel(NotificationType.Recovery, selectedCodes); return View(model); }
public async Task <ActionResult> Edit(Guid id) { var basicInfo = await mediator.SendAsync(new GetNotificationBasicInfo(id)); var selectedCodes = await mediator.SendAsync(new GetOperationCodesByNotificationId(id)); OperationCodesViewModel model = new OperationCodesViewModel(basicInfo.NotificationType, selectedCodes); return(View(model)); }
public async Task<ActionResult> DisposalCodes(Guid id, OperationCodesViewModel model, bool? backToOverview = null) { if (!ModelState.IsValid) { return View(model); } await mediator.SendAsync(new AddDisposalCodes(id, model.SelectedValues)); return backToOverview.GetValueOrDefault() ? RedirectToAction("Index", "Home") : RedirectToAction("TechnologyEmployed", "WasteOperations"); }
public async Task <ActionResult> Edit(Guid id, OperationCodesViewModel model) { if (!ModelState.IsValid) { return(await Edit(id)); } await mediator.SendAsync(new SetOperationCodes(id, model.SelectedValues)); await this.auditService.AddAuditEntry(this.mediator, id, User.GetUserId(), NotificationAuditType.Updated, model.NotificationType == Core.Shared.NotificationType.Disposal?NotificationAuditScreenType.DisposalCodes : NotificationAuditScreenType.RecoveryCodes); return(RedirectToAction("Index", "Overview")); }
public async Task <ActionResult> DisposalCodes(Guid id, OperationCodesViewModel model, bool?backToOverview = null) { if (!ModelState.IsValid) { return(View(model)); } var existingsCodes = await mediator.SendAsync(new GetOperationCodesByNotificationId(id)); await mediator.SendAsync(new AddDisposalCodes(id, model.SelectedValues)); await this.auditService.AddAuditEntry(mediator, id, User.GetUserId(), existingsCodes.Count == 0?NotificationAuditType.Added : NotificationAuditType.Updated, NotificationAuditScreenType.DisposalCodes); return(backToOverview.GetValueOrDefault() ? RedirectToAction("Index", "Home") : RedirectToAction("TechnologyEmployed", "WasteOperations")); }