lixiaojun
2024-09-26 158292021eb0b31e494b5fdc26a31c58af0bf01b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
namespace HStation.WinFrmUI.Xhs
{
    public partial class AssetsAutoMatchingMainDlg : DevExpress.XtraEditors.XtraForm
    {
        public AssetsAutoMatchingMainDlg()
        {
            InitializeComponent();
            this.AssetsMainChoicePage.FormRowClickEvent += AssetsMainChoicePage_FormRowClickEvent;
        }
 
        private void AssetsMainChoicePage_FormRowClickEvent(string code)
        {
            AssetsMatchingClickEvent.Invoke(code);
        }
 
        public event Func<AssetsAutoMatchingViewModel, bool> RelaodEvent = null;
 
        public event Action<string> AssetsMatchingClickEvent = null;
 
        private AssetsAutoMatchingViewModel _assetsAutoMatching = null;
 
        public void SetBindingData(AssetsAutoMatchingViewModel 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);
        }
    }
}