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/OldBoxFoamPageViewModel.cs

59 lines
1.9 KiB
C#

using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using Admin.Core.Service;
using Aucma.Core.BoxFoam.Models;
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.Extensions.DependencyInjection;
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 OldBoxFoamPageViewModel : ObservableObject
{
IOldBoxFoamDataServices? _oldBoxFoamDataServices;
public OldBoxFoamPageViewModel() {
_oldBoxFoamDataServices = App.ServiceProvider.GetService<IOldBoxFoamDataServices>();
OnLoad();
}
public async void OnLoad()
{
List<OldBoxFoamData> list = await _oldBoxFoamDataServices.QueryAsync();
if (list == null) return;
foreach (var item in list)
{
OldBoxFoamDataModel model=new OldBoxFoamDataModel();
model.ObjId = item.ObjId;
model.Fixtureboxtype = item.Fixtureboxtype;
model.Fixturestatus = item.Fixturestatus;
model.Production = item.Production;
model.CuringTimeSettingValue = item.CuringTimeSettingValue;
model.ActualValue = item.ActualValue;
OldBoxFoamDataGrid.Add(model);
}
}
#region 初始化datagrid
private ObservableCollection<OldBoxFoamDataModel> oldBoxFoamDataGrid = new ObservableCollection<OldBoxFoamDataModel>();
public ObservableCollection<OldBoxFoamDataModel> OldBoxFoamDataGrid
{
get { return oldBoxFoamDataGrid; }
set
{
oldBoxFoamDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
}
}