change - 修改统计分析页面

dev
liuwf 1 year ago
parent dc6d77cdc8
commit d84f46b624

@ -41,7 +41,6 @@ namespace Aucma.Core.ProductOffLine.ViewModels
_productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
MvCodeHelper.ReceiveCodeEvent += ReceiveCode;
// test();
//List<MutiDBOperate> listdatabase = Appsettings.app<MutiDBOperate>("DBS")
// .Where(i => i.Enabled).ToList();

@ -1,4 +1,5 @@
using Aucma.Core.ProductOffLine.Models;
using Admin.Core.Model;
using Aucma.Core.ProductOffLine.Models;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
@ -8,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
namespace Aucma.Core.ProductOffLine.ViewModels
{
@ -54,35 +56,45 @@ namespace Aucma.Core.ProductOffLine.ViewModels
[RelayCommand]
private void ExecQuery(object obj)
{
var result = (StatisticModel)obj;
if (string.IsNullOrEmpty(result.BeginTime))
{
MessageBox.Show("开始时间不能为空!");
return;
}
if (string.IsNullOrEmpty(result.EndTime))
{
MessageBox.Show("结束时间不能为空!");
return;
}
var beginTime = result.BeginTime;
var endTime = result.EndTime;
//List<CodeBindingRecord> list;
//var result = (StatisticModel)obj;
//if (string.IsNullOrEmpty(result.BeginTime) && string.IsNullOrEmpty(result.EndTime))
//{
// list = await _codeBindingRecordServices.QueryAllByTime(null, null);
//}
//else if (string.IsNullOrEmpty(result.BeginTime))
//{
// list = await _codeBindingRecordServices.QueryAllByTime(result.BeginTime, null);
//}
//else if (string.IsNullOrEmpty(result.EndTime))
//{
// list = await _codeBindingRecordServices.QueryAllByTime(null, result.EndTime);
//}
//else
//{
// DateTime theBeginTime = Convert.ToDateTime(result.BeginTime);
// DateTime theEndTime = Convert.ToDateTime(result.EndTime);
// if (theBeginTime > theEndTime)
// {
// MessageBox.Show("结束时间要大于开始时间!");
// return;
// }
// list = await _codeBindingRecordServices.QueryAllByTime(result.BeginTime, result.EndTime);
//}
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
if (!string.IsNullOrEmpty(beginTime))
{
MaterialDataGrid.Clear();
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-可口可乐SC", PlanAmount = 50, CompleteAmount = 10 });
}
else
{
MaterialDataGrid.Clear();
LoadData();
}
//Datalist.Insert(0, Datalist[Datalist.Count - 1]);
//Datalist.RemoveAt(Datalist.Count - 1);
}));
//if (list != null)
//{
// System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
// {
// MaterialDataGrid.Clear();
// foreach (CodeBindingRecord item in list)
// {
// MaterialDataGrid.Add(new ReaderInfo() { No = item.ObjId, BoxCode = item.BoxCode, BoxName = item.BoxName, ProductCode = item.ProductCode, BindingResult = item.BindingResult, RecordTime = item.RecordTime1.ToString() });
// }
// }));
//}
}
#endregion
}

Loading…
Cancel
Save