You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
using Application.Domain.Entities;
|
|
using Infrastructure.Application;
|
|
using Infrastructure.Data;
|
|
using Infrastructure.Extensions;
|
|
using Infrastructure.Web.Mvc;
|
|
using IoTCenter.Application.Models;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Linq;
|
|
|
|
namespace IoTCenter.Areas.Admin.Controllers
|
|
{
|
|
[Authorize]
|
|
[Area(nameof(Admin))]
|
|
public class GlobalSceneController : CrudController<Scene, EditGlobalSceneModel>
|
|
{
|
|
public GlobalSceneController(IRepository<Scene> repo) : base(repo)
|
|
{
|
|
}
|
|
|
|
public override IQueryable<Scene> Query(PagedListModel<EditGlobalSceneModel> model, IQueryable<Scene> query)
|
|
{
|
|
return query.Where(o => o.NodeId == null)
|
|
.WhereIf(!string.IsNullOrEmpty(model.Query.Name), o => o.Name.Contains(model.Query.Name))
|
|
.WhereIf(model.Query.Hidden.HasValue, o => o.Hidden == model.Query.Hidden.Value)
|
|
.OrderBy(o => o.DisplayOrder);
|
|
}
|
|
|
|
public override void ToDisplayModel(Scene entity, EditGlobalSceneModel model)
|
|
{
|
|
base.ToDisplayModel(entity, model);
|
|
}
|
|
}
|
|
} |