|
|
|
|
using Admin.Core.IService;
|
|
|
|
|
using Admin.Core.Model.Model_New;
|
|
|
|
|
using Admin.Core.Service;
|
|
|
|
|
using Aucma.Core.OldBoxFoam;
|
|
|
|
|
using Aucma.Core.OldBoxFoam.Models;
|
|
|
|
|
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.BoxFoam.ViewModels
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public partial class RoadKindPageViewModel : ObservableObject
|
|
|
|
|
{
|
|
|
|
|
protected readonly IBoxFoamPlanServices? _boxFoamPlanServices;
|
|
|
|
|
protected IOldBoxFoamTypeServices? _boxFoamTypeServices;
|
|
|
|
|
public RoadKindPageViewModel()
|
|
|
|
|
{
|
|
|
|
|
_boxFoamPlanServices = App.ServiceProvider.GetService<IBoxFoamPlanServices>();
|
|
|
|
|
_boxFoamTypeServices = App.ServiceProvider.GetService<IOldBoxFoamTypeServices>();
|
|
|
|
|
InitData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async void InitData()
|
|
|
|
|
{
|
|
|
|
|
List<OldBoxFoamType> list = await _boxFoamTypeServices.QueryAsync();
|
|
|
|
|
if (list == null) return;
|
|
|
|
|
foreach(OldBoxFoamType item in list)
|
|
|
|
|
{
|
|
|
|
|
OldBoxFoamTypeModel model= new OldBoxFoamTypeModel();
|
|
|
|
|
model.MaterialCode = item.MaterialCode;
|
|
|
|
|
model.Status = "1";
|
|
|
|
|
Shapes.Add(model);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 初始化
|
|
|
|
|
private ObservableCollection<OldBoxFoamTypeModel> _shapes = new ObservableCollection<OldBoxFoamTypeModel>();
|
|
|
|
|
public ObservableCollection<OldBoxFoamTypeModel> Shapes
|
|
|
|
|
{
|
|
|
|
|
get => _shapes;
|
|
|
|
|
set => SetProperty(ref _shapes, value);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|