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

96 lines
3.3 KiB
C#

using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using Admin.Core.Service;
1 year ago
using Admin.Core.Tasks;
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;
1 year ago
IOldBoxFoamTypeServices _oldBoxFoamTypeServices;
public OldBoxFoamPageViewModel() {
_oldBoxFoamDataServices = App.ServiceProvider.GetService<IOldBoxFoamDataServices>();
1 year ago
_oldBoxFoamTypeServices = App.ServiceProvider.GetService<IOldBoxFoamTypeServices>();
1 year ago
Job_OldBoxFoam_Quartz.RefreshOldBoxFoamTypeDataDelegateEvent += OldBoxFoamTypeOnLoad;
1 year ago
OldBoxFoamOnLoad();
OldBoxFoamTypeOnLoad();
}
1 year ago
#region 初始化加载数据
public async Task OldBoxFoamOnLoad()
{
List<OldBoxFoamData> list = await _oldBoxFoamDataServices.QueryAsync();
if (list == null) return;
foreach (var item in list)
{
1 year ago
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);
}
}
1 year ago
public async Task OldBoxFoamTypeOnLoad()
{
var list =await _oldBoxFoamTypeServices.QueryAsync();
if (list == null) return;
foreach (var item in list)
{
OldBoxFoamTypeModel model = new OldBoxFoamTypeModel();
model.ObjId = item.ObjId;
model.Local = item.Local;
model.Boxtype = item.Boxtype;
model.Storeamount = item.Storeamount;
OldBoxFoamTypeDataGrid.Add(model);
}
}
#endregion
1 year ago
#region 初始化发泡线 datagrid
private ObservableCollection<OldBoxFoamDataModel> oldBoxFoamDataGrid = new ObservableCollection<OldBoxFoamDataModel>();
public ObservableCollection<OldBoxFoamDataModel> OldBoxFoamDataGrid
{
get { return oldBoxFoamDataGrid; }
set
{
oldBoxFoamDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
1 year ago
#region 初始化泡前库 datagrid
private ObservableCollection<OldBoxFoamTypeModel> oldBoxFoamTypeDataGrid = new ObservableCollection<OldBoxFoamTypeModel>();
public ObservableCollection<OldBoxFoamTypeModel> OldBoxFoamTypeDataGrid
{
get { return oldBoxFoamTypeDataGrid; }
set
{
oldBoxFoamTypeDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
}
}