|
@@ -7,6 +7,7 @@ using DW5S.Repostory;
|
|
|
using DW5S.ViewModel;
|
|
|
using DxHelper;
|
|
|
using ExtensionsDev;
|
|
|
+using Google.Protobuf.WellKnownTypes;
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
@@ -14,6 +15,9 @@ using System.Drawing;
|
|
|
using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows.Forms;
|
|
|
+using System.Linq;
|
|
|
+using System.Linq.Expressions;
|
|
|
+using Microsoft.EntityFrameworkCore.Query;
|
|
|
namespace DW5S.App.UserControl
|
|
|
{
|
|
|
public partial class CtrlRefTask : DevExpress.XtraEditors.XtraUserControl
|
|
@@ -41,7 +45,7 @@ namespace DW5S.App.UserControl
|
|
|
var ids = data.Select(p => p.Id);
|
|
|
var unitOfWork = IocContainer.UnitOfWork;
|
|
|
var reps = unitOfWork.OfLong<RefTaskFreq>();
|
|
|
- await reps.UpdatePropAsync(p => ids.Contains(p.Id), p => p.Enable, true);
|
|
|
+ await reps.UpdatePropAsync(p => ids.Contains(p.Id), s => s.SetProperty(b => b.Enable, true));
|
|
|
await unitOfWork.SaveAsync();
|
|
|
|
|
|
data.ForEach(d => d.Enable = true);
|
|
@@ -54,7 +58,7 @@ namespace DW5S.App.UserControl
|
|
|
IocContainer.Logger.Error(ex, "一键启用异常");
|
|
|
}
|
|
|
}, false)
|
|
|
- .AddContentMenu<RefTaskFreq>("一键禁用", SvgHelper.CreateCycle("#FF0000"), async data =>
|
|
|
+ .AddContentMenu<RefTaskViewModel>("一键禁用", SvgHelper.CreateCycle("#FF0000"), async data =>
|
|
|
{
|
|
|
|
|
|
try
|
|
@@ -62,7 +66,7 @@ namespace DW5S.App.UserControl
|
|
|
var ids = data.Select(p => p.Id);
|
|
|
var unitOfWork = IocContainer.UnitOfWork;
|
|
|
var reps = unitOfWork.OfLong<RefTaskFreq>();
|
|
|
- await reps.UpdatePropAsync(p => ids.Contains(p.Id), p => p.Enable, false);
|
|
|
+ await reps.UpdatePropAsync(p => ids.Contains(p.Id), s => s.SetProperty(b => b.Enable, false));
|
|
|
await unitOfWork.SaveAsync();
|
|
|
|
|
|
data.ForEach(d => d.Enable = false);
|