|
@@ -1075,16 +1075,16 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
private async void txtTimeCho_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
+ listCts.ForEach(t => t.Cancel());
|
|
|
+ listCts.Clear();
|
|
|
+ this.gridHomePosRes.DataSource = new List<PosRes>();//先设为空,数据相同时便于观察结果有没有变化
|
|
|
if (tsk==null)
|
|
|
{
|
|
|
- this.gridHomePosRes.DataSource = new List<PosRes>();
|
|
|
return;
|
|
|
}
|
|
|
- listCts.ForEach(t => t.Cancel());
|
|
|
- listCts.Clear();
|
|
|
var cts = new CancellationTokenSource();
|
|
|
listCts.Add(cts);
|
|
|
- switch (txtTimeCho.SelectedText)
|
|
|
+ switch (txtTimeCho.Text)
|
|
|
{
|
|
|
case "最近1小时":
|
|
|
case "最近6小时":
|
|
@@ -1094,7 +1094,6 @@ namespace XdCxRhDW.App.UserControl
|
|
|
layoutControlItemStartTime.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
|
|
|
layoutControlItemEndTime.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
|
|
|
layoutControlItemSearch.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
|
|
|
- this.gridHomePosRes.DataSource = new List<PosRes>();//先设为空,数据相同时便于观察结果有没有变化
|
|
|
this.gridHomePosRes.DataSource = await searchPos(cts.Token);
|
|
|
break;
|
|
|
case "自定义":
|
|
@@ -1155,7 +1154,6 @@ namespace XdCxRhDW.App.UserControl
|
|
|
}
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
|
- var taskId = tsk.ID;
|
|
|
var posRes = await db.PosRes.Where(w => w.SigTime >= start && w.SigTime <= end && w.TaskInfoID == tsk.ID).OrderByDescending(o => o.SigTime).ToListAsync(ct);
|
|
|
return posRes;
|
|
|
}
|