duheng
2024-09-22 9ffb31c233f3b4891550293294c2ee716f77b42a
WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/06-simulation/01-AutoMatching/AssetsMainChoicePage.cs
@@ -6,6 +6,11 @@
        {
            InitializeComponent();
            this.elbowsMatchingCtrl1.RowClickEvent += RowClickEvent;
            this.fourLinkMatchingCtrl1.RowClickEvent += RowClickEvent;
            this.pipeLineMatchingCtrl1.RowClickEvent += RowClickEvent;
            this.pumpMatchingCtrl1.RowClickEvent += RowClickEvent;
            this.threeLinkMatchingCtrl1.RowClickEvent += RowClickEvent;
            this.valveMatchingCtrl1.RowClickEvent += RowClickEvent;
        }
        private void RowClickEvent(string code)
@@ -15,6 +20,8 @@
        public event Action<string> FormRowClickEvent = null;
        public event Func<AssetsAutoMatchingViewModel, bool> RelaodEvent = null;
        private BLL.PumpMain _pumpMain = null;
        private BLL.AdaptingManage _adaptingManage = null;
@@ -23,18 +30,22 @@
        private BLL.ValveMain _valveMain = null;
        public void SetBindingData(AssetsAutoMatchingViewModel inputViewModel)
        private AssetsAutoMatchingViewModel _assetsAutoMatching = null;
        public async void SetBindingData(AssetsAutoMatchingViewModel inputViewModel)
        {
            _assetsAutoMatching = inputViewModel;
            this.elbowsMatchingCtrl1.SetBindingData(inputViewModel.ElbowsMatchingModels);
            this.pipeLineMatchingCtrl1.SetBindingData(inputViewModel.PipeLineMatchingModels);
            this.pumpMatchingCtrl1.SetBindingData(inputViewModel.PumpMatchingModels);
            this.threeLinkMatchingCtrl1.SetBindingData(inputViewModel.ThreeLinkMatchingModels);
            this.fourLinkMatchingCtrl1.SetBindingData(inputViewModel.FourLinkMatchingModels);
            this.valveMatchingCtrl1.SetBindingData(inputViewModel.ValveMatchingModels);
            await SetMatching(inputViewModel);
        }
        /// <summary>
        /// 初始化
        /// 自动匹配
        /// </summary>
        public async Task<AssetsAutoMatchingViewModel> SetMatching(AssetsAutoMatchingViewModel input)
        {
@@ -70,5 +81,18 @@
            assetsAutoMatching.ValveMatchingModels = valveMatching;
            return assetsAutoMatching;
        }
        //确定
        private void btnComplete_Click(object sender, EventArgs e)
        {
            if (RelaodEvent.Invoke(_assetsAutoMatching))
            {
                TipFormHelper.ShowSucceed("修改成功!");
            }
            else
            {
                TipFormHelper.ShowError("修改失败!");
            }
        }
    }
}