public async Task<ActionResult> Index(Guid id, int? status) { var movementsSummary = await mediator.SendAsync(new GetSummaryAndTable(id, (MovementStatus?)status)); var model = new NotificationOptionsViewModel(id, movementsSummary); model.SelectedMovementStatus = (MovementStatus?)status; return View(model); }
public async Task <ActionResult> Index(Guid id, int?status, int page = 1) { var movementsSummary = await mediator.SendAsync(new GetSummaryAndTable(id, (MovementStatus?)status, page)); var model = new NotificationOptionsViewModel(id, movementsSummary); model.SelectedMovementStatus = (MovementStatus?)status; model.IsOwner = await mediator.SendAsync(new CheckIfNotificationOwner(id)); if (!model.IsOwner) { var sharedUsers = await mediator.SendAsync(new GetSharedUsersByNotificationId(id)); model.IsSharedUser = sharedUsers.Count(p => p.UserId == User.GetUserId()) > 0; } model.HasSharedUsers = await mediator.SendAsync(new CheckIfSharedUserExists(id)); return(View(model)); }