lixiaojun
2024-10-29 2bbfc173c71bdd549a42bf31eee81b9432c2dbed
WinFrmUI/HStation.WinFrmUI.Assets.Core/06-threeLink/02-main/EditThreeLinkMainDlg.cs
@@ -3,17 +3,17 @@
namespace HStation.WinFrmUI.Assets
{
    public partial class EditThreeLinkMainDlg : DevExpress.XtraEditors.XtraForm
    public partial class EditAssetsThreelinkMainDlg : DevExpress.XtraEditors.XtraForm
    {
        public EditThreeLinkMainDlg()
        public EditAssetsThreelinkMainDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
        }
        private Vmo.ThreeLinkMainVmo _ThreeLinkVmo = null;
        private Vmo.AssetsThreelinkMainVmo _ThreeLinkVmo = null;
        public async void SetBindingData(Vmo.ThreeLinkMainVmo ThreeLinkVmo)
        public async void SetBindingData(Vmo.AssetsThreelinkMainVmo ThreeLinkVmo)
        {
            _ThreeLinkVmo = ThreeLinkVmo;
            var allCaliber = await new Yw.BLL.SysDictData().GetByTypeCode("1");
@@ -50,13 +50,15 @@
            {
                TextEditMaterial.EditValue = _ThreeLinkVmo.MaterialName.ToString();
            }
            this.textEditRunThroughCoefficient.Text = _ThreeLinkVmo.RunThroughCoefficient.ToString();
            this.textEditBranchThroughCoefficient.Text = _ThreeLinkVmo.BranchThroughCoefficient.ToString();
            this.TextEditName.Text = _ThreeLinkVmo.Name;
            this.DescriptionTextEdit.Text = _ThreeLinkVmo.Description;
            this.TextEditCoefficient.Text = _ThreeLinkVmo.Coefficient.ToString();
            this.TextEditKeyWorld.Text = _ThreeLinkVmo.KeyWord;
        }
        public event Func<Vmo.ThreeLinkMainVmo, Task<bool>> ReloadDataEvent = null;
        public event Func<Vmo.AssetsThreelinkMainVmo, Task<bool>> ReloadDataEvent = null;
        //数据验证
        private bool Valid()
@@ -91,6 +93,14 @@
            {
                _ThreeLinkVmo.Caliber = null;
            }
            if (double.TryParse(textEditRunThroughCoefficient.Text, out double runThrough))
            {
                _ThreeLinkVmo.Coefficient = runThrough;
            }
            if (double.TryParse(textEditBranchThroughCoefficient.Text, out double branchThough))
            {
                _ThreeLinkVmo.Coefficient = branchThough;
            }
            if (await this.ReloadDataEvent.Invoke(_ThreeLinkVmo))
            {
                TipFormHelper.ShowSucceed("修改成功!");