duheng
2024-12-27 1c3e5bc50d3045d51cb9a9f747d53442b82d9e2c
WinFrmUI/HStation.WinFrmUI.Assets.Core/06-threeLink/03-factor/AddAssetsThreelinkFactorDlg.cs
@@ -41,7 +41,8 @@
            if (_last != null)
            {
                this.txtName.EditValue = _last.Name;
                this.txtMinorLoss.EditValue = _last.MinorLoss;
                this.textEditBranchThroughCoefficient.EditValue = _last.BranchThroughMinorLoss;
                this.textEditRunThroughCoefficient.EditValue = _last.RunThroughMinorLoss;
                this.txtDescription.EditValue = _last.Description;
            }
        }
@@ -55,9 +56,14 @@
                this.dxErrorProvider1.SetError(this.txtName, "必填项");
                return false;
            }
            if (string.IsNullOrEmpty(this.txtMinorLoss.Text.Trim()))
            if (string.IsNullOrEmpty(this.textEditRunThroughCoefficient.Text.Trim()))
            {
                this.dxErrorProvider1.SetError(this.txtMinorLoss, "必填项");
                this.dxErrorProvider1.SetError(this.textEditRunThroughCoefficient, "必填项");
                return false;
            }
            if (string.IsNullOrEmpty(this.textEditBranchThroughCoefficient.Text.Trim()))
            {
                this.dxErrorProvider1.SetError(this.textEditBranchThroughCoefficient, "必填项");
                return false;
            }
            return true;
@@ -75,7 +81,8 @@
                return;
            }
            _vmo.Name = this.txtName.Text.Trim();
            _vmo.MinorLoss = double.Parse(this.txtMinorLoss.EditValue?.ToString());
            _vmo.RunThroughMinorLoss = double.Parse(this.textEditRunThroughCoefficient.EditValue?.ToString());
            _vmo.BranchThroughMinorLoss = double.Parse(this.textEditBranchThroughCoefficient.EditValue?.ToString());
            _vmo.Description = this.txtDescription.Text.Trim();
            var id = await BLLFactory<HStation.BLL.AssetsThreelinkFactor>.Instance.Insert(_vmo);
            if (id < 1)