lixiaojun
2024-12-09 25f7d54d23dd47d6f2bfd91e7edfd218a4b9ec3e
WinFrmUI/HStation.WinFrmUI.Assets.Core/05-elbow/02-main/AddElbowMainDlg.cs
@@ -42,9 +42,10 @@
                    TextEditMaterial.Properties.Items.Add(imageItem);
                }
            }
            imageComboBoxEditConnectlenght.Properties.AddEnum(typeof(eLengthType));
            imageComboBoxEditConnectlenght.Properties.AddEnum(typeof(eElbowType));
            TextEditCaliber.SelectedIndex = 0;
            TextEditMaterial.SelectedIndex = 0;
            this.selectFlagsPopupCtrl1.SetBindingData<AssetsFlags>();
        }
        public event Func<Vmo.AssetsElbowMainVmo, Task<bool>> ReloadDataEvent = null;
@@ -151,7 +152,9 @@
            {
                _ElbowVmo.Angle = angle;
            }
            _ElbowVmo.ElbowLengthType = (eLengthType)this.imageComboBoxEditConnectlenght.EditValue;
            _ElbowVmo.ElbowType = (eElbowType)this.imageComboBoxEditConnectlenght.EditValue;
            _ElbowVmo.Flags = this.selectFlagsPopupCtrl1.SelectedFlags;
            if (await this.ReloadDataEvent.Invoke(_ElbowVmo))
            {
                TipFormHelper.ShowSucceed("添加成功!");
@@ -163,5 +166,13 @@
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            var vm = this.treeList1.GetCurrentViewModel(_AssetsElbowCoefficient);
            if (vm == null)
                return;
            this.TextEditCoefficient.Text = vm.MinorLoss.ToString();
        }
    }
}