You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AUCMA_SCADA/Aucma.Core.BoxFoam/ViewModels/FoamMachinesPageViewModel.cs

64 lines
2.3 KiB
C#

1 year ago
using Admin.Core.Common;
using Admin.Core.Model.ViewModels;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BoxFoam.ViewModels
{
public partial class FoamMachinesPageViewModel : ObservableObject
{
#region 加载DataGrid数据
//private async Task LoadData()
//{
// var storeCode = Appsettings.app("StoreInfo", "StoreCode");
// DateTime startTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
// DateTime endTime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 23:59:59"));
// System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
// {
// PlanInfoDataGrid.Clear();
// int i = 1;
// var list = await _recordInstoreServices.SaveRecordToDb(storeCode, startTime, endTime);
// foreach (var item in list.OrderByDescending(d => d.No))
// {
// PlanInfoDataGrid.Add(new EnterLibView()
// {
// No = i,
// PlanCode = item.PlanCode,
// MaterialCode = item.MaterialCode,
// MaterialName = item.MaterialName,
// MaterialBarCode = item.MaterialBarCode,
// EnterSpace = item.EnterSpace,
// ExecDateTime = item.ExecDateTime,
// Status = item.Status
// });
// i++;
// };
// //Datalist.Insert(0, Datalist[Datalist.Count - 1]);
// //Datalist.RemoveAt(Datalist.Count - 1);
// }));
//}
#endregion
#region 初始化datagrid
private ObservableCollection<EnterLibView> planInfoDataGrid = new ObservableCollection<EnterLibView>();
public ObservableCollection<EnterLibView> PlanInfoDataGrid
{
get { return planInfoDataGrid; }
set
{
planInfoDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
}
}