29 lines
951 B
C#
Raw Normal View History

2025-03-17 22:17:28 +08:00
using System.Collections.ObjectModel;
2025-03-16 03:17:36 +08:00
using CommunityToolkit.Mvvm.ComponentModel;
using Seyounth.Core.Extensions;
using Seyounth.Hyosung.Data.Entities;
using Seyounth.Hyosung.Data.Models;
namespace Seyounth.Hyosung.ViewModels;
public partial class VarietyViewModel : ObservableObject
{
2025-03-17 22:17:28 +08:00
[ObservableProperty] private ObservableCollection<Variety> _varieties;
[ObservableProperty] private ObservableCollection<Pallet> _pallets;
2025-03-16 03:17:36 +08:00
public IEnumerable<NeedTypeEnumItem> NeedTypeItems { get; }
2025-03-17 22:17:28 +08:00
public VarietyViewModel(PalletManagerViewModel palletManagerViewModel)
2025-03-16 03:17:36 +08:00
{
2025-03-17 22:17:28 +08:00
Pallets = new ObservableCollection<Pallet>(palletManagerViewModel.Pallets);
_varieties = new ObservableCollection<Variety>();
2025-03-16 03:17:36 +08:00
var needTypes = EnumHelper.GetValues<NeedType>();
NeedTypeItems = needTypes.Select(nt => new NeedTypeEnumItem
{
Value = nt,
Description = nt.GetDescription()
});
}
}