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.

82 lines
2.5 KiB
C#

1 year ago
using Admin.Core.IService;
1 year ago
using Admin.Core.Model.Model_New;
using Admin.Core.Service;
using Aucma.Core.OldBoxFoam.Models;
1 year ago
using Aucma.Core.OldBoxFoam.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Aucma.Core.OldBoxFoam.ViewModels
{
/**
*
*
* */
public partial class RealRoadPageViewModel : ObservableObject
{
protected readonly IBoxFoamPlanServices? _boxFoamPlanServices;
1 year ago
private IOldBoxFoamTypeServices? _oldBoxFoamTypeServices;
1 year ago
public RealRoadPageViewModel()
{
_boxFoamPlanServices = App.ServiceProvider.GetService<IBoxFoamPlanServices>();
1 year ago
_oldBoxFoamTypeServices = App.ServiceProvider.GetService<IOldBoxFoamTypeServices>();
1 year ago
InitData();
}
public async void InitData()
{
1 year ago
List<OldBoxFoamType> list = await _oldBoxFoamTypeServices.QueryAsync();
foreach (OldBoxFoamType item in list)
1 year ago
{
1 year ago
ListItems.Add(new OldBoxFoamTypeModel()
{
ObjId = item.ObjId,
Local = item.Local,
Status = "1",
Storeamount = item.Storeamount,
MaterialCode = item.MaterialCode,
1 year ago
MaterialName=item.MaterialName,
1 year ago
Boxtype = item.Boxtype,
}); ;
1 year ago
}
}
1 year ago
#region 初始化datagrid
private ObservableCollection<OldBoxFoamTypeModel> listItems = new ObservableCollection<OldBoxFoamTypeModel>();
public ObservableCollection<OldBoxFoamTypeModel> ListItems
1 year ago
{
1 year ago
get { return listItems; }
set
{
listItems = value;
OnPropertyChanged();//属性通知
}
1 year ago
}
#endregion
#region 型号统计柱状图X轴日期
/// <summary>
/// 型号统计柱状图X轴日期
/// </summary>
private List<string> materialNameList;
public List<string> MaterialNameList
{
get { return materialNameList; }
set { materialNameList = value; }
}
#endregion
}
}