public IActionResult List(DataSourceRequest command) { if (!_permissionService.Authorize(StandardPermissionProvider.AccessAdminPanel)) { return(AccessDeniedKendoGridJson()); } var pickupPoints = _MediaService.GetAllsMedia(pageIndex: command.Page - 1, pageSize: command.PageSize); var model = pickupPoints.Select(point => { return(new MediaModel() { Id = point.Id, Title = point.Title, CreateDates = Tools.Core.Date.ConvertDateTime.ToShorShamsi(point.CreateDate), FileExtention = point.FileExtention, CategoryName = _MediaCategoryService.CategoryNavigation(_MediaCategoriesService.GetLastCategory(point.Id).Id), CustomerName = _genericAttributeService.GetAttributesForEntity(point.UserId, "Customer").Where(a => a.Key == "LastName").FirstOrDefault().Value, }); }).ToList(); return(Json(new DataSourceResult { Data = model, Total = pickupPoints.TotalCount })); }
public IActionResult Configure(int Id = 0) { if (!_permissionService.Authorize(StandardPermissionProvider.AccessAdminPanel)) { return(AccessDeniedView()); } CategoryViewModel model = new CategoryViewModel { Id = Id, Navigation = _MediaCategoryService.CategoryNavigation(Id) }; return(View("~/Plugins/Company.Media/Views/MediaCategory/Configure.cshtml", model)); }