duheng
2024-09-20 8a8983dd2053b631c559b257b1501d740bedf4a5
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/AssetsAutoMatchingMainDlg.cs
@@ -7,13 +7,37 @@
            InitializeComponent();
        }
        public void SetBindingData()
        public event Func<AssetsAutoMatchingInputViewModel, bool> RelaodEvent = null;
        private AssetsAutoMatchingInputViewModel _assetsAutoMatching = null;
        public void SetBindingData(AssetsAutoMatchingInputViewModel assetsAutoMatchingInputViewModel)
        {
            _assetsAutoMatching = assetsAutoMatchingInputViewModel;
            this.AssetsMainChoicePage.SetBindingData(_assetsAutoMatching);
        }
        //完成
        private void btnComplete_Click(object sender, EventArgs e)
        {
            if (RelaodEvent.Invoke(_assetsAutoMatching))
            {
                TipFormHelper.ShowSucceed("修改成功!");
            }
            else
            {
                TipFormHelper.ShowError("修改失败!");
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        //自动匹配
        private async void BtnAutoMatching_Click(object sender, EventArgs e)
        {
            WaitFormHelper.ShowWaitForm(this);
            _assetsAutoMatching = await this.AssetsMainChoicePage.SetMatching(_assetsAutoMatching);
            WaitFormHelper.HideWaitForm(this);
        }
    }
}