using MECF.Framework.Common.OperationCenter;
using MECF.Framework.UI.Client.ClientBase;
using OpenSEMI.ClientBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MECF.Framework.UI.Client.TrayThickness
{
    public class WinPMThicknessDataViewModel : UiViewModelBase
    {
        PMDataViewManager pmDataViewManager;
        string trayID;
        public PMCoatingThickness PMData { get; set; }
        public WinPMThicknessDataViewModel(string _pmGuid)
        {
            PMData = new PMCoatingThickness(_pmGuid);
            pmDataViewManager = new PMDataViewManager(PMData, _pmGuid);
            UpTrayCoatingThickness();
        }
        public void UpTrayCoatingThickness()//打开时，初始化界面数据
        {
            pmDataViewManager.UpTrayCoatingThickness();
        }
        public void SET()//设置到数据库
        {
            if (pmDataViewManager.SET(out var reason))
            {
                DialogBox.ShowInfo("MinorCycle Info. created successfully!");
                TryClose();
            }
            else
            {
                DialogBox.ShowError(reason);
            }
        }

        public void LoadCoatingData(string part)//人工输入名称后，查询数据
        {
            pmDataViewManager.LoadCoatingData(part);
            Refresh();
        }
    }
}
