public async Task <IViewComponentResult> InvokeAsync(string view, WorkNotificationFilterVM filter)
        {
            ViewBag.userId = userContext.UserId;
            if (filter == null)
            {
                filter = workNotificationService.MakeDefaultFilter();
            }
            switch (view)
            {
            case "MyNotifications":
            {
                return(await Task.FromResult <IViewComponentResult>(View(view, filter)));
            }

            case "NotificationCount":
            {
                var notifications = workNotificationService.SelectWorkNotifications(filter).ToList();
                int modelCnt      = notifications.Count();
                return(await Task.FromResult <IViewComponentResult>(View(view, modelCnt)));
            }

            default:
                return(null);
            }
        }
Exemplo n.º 2
0
        public IActionResult ListData(IDataTablesRequest request, WorkNotificationFilterVM filterData)
        {
            filterData.UserId     = userContext.UserId;
            filterData.CourtId    = userContext.CourtId;
            filterData.SourceType = 0;
            filterData.SourceId   = 0;
            var data = service.SelectWorkNotifications(filterData);

            return(request.GetResponse(data));
        }