iotgateway/IoTGateway.ViewModel/_Admin/FrameworkMenuVMs/FrameworkMenuBatchVM.cs
2021-12-12 14:55:48 +08:00

49 lines
1.3 KiB
C#

// WTM默认页面 Wtm buidin page
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
namespace WalkingTec.Mvvm.Mvc.Admin.ViewModels.FrameworkMenuVMs
{
public class FrameworkMenuBatchVM : BaseBatchVM<FrameworkMenu, FrameworkMenu_BatchEdit>
{
public FrameworkMenuBatchVM()
{
}
protected override void InitVM()
{
}
public override bool DoBatchDelete()
{
if (Ids != null)
{
foreach (var item in Ids)
{
FrameworkMenu f = new FrameworkMenu { ID = Guid.Parse(item) };
DC.CascadeDelete(f);
}
}
DC.SaveChanges();
return true;
}
}
public class FrameworkMenu_BatchEdit : BaseVM
{
public List<Guid> IDs { get; set; }
[Display(Name = "_Admin.ShowOnMenu")]
public bool ShowOnMenu { get; set; }
[Display(Name = "_Admin.ParentFolder")]
public Guid? ParentID { get; set; }
public List<ComboSelectListItem> AllParents { get; set; }
[Display(Name = "_Admin.Icon")]
public string Icon { get; set; }
}
}