| | |
| | | { |
| | | this.txtName.EditValue = _last.Name; |
| | | this.txtKeyWord.EditValue = KeyWordHelper.ToString(_last.KeyWords); |
| | | this.TextEditMinorLoss.EditValue = _last.MinorLoss; |
| | | this.setFlagsEditCtrl1.SetBindingData(flags?.Select(x => x.Name).ToList(), _last.Flags); |
| | | this.txtTagName.EditValue = _last.TagName; |
| | | this.txtDescription.EditValue = _last.Description; |
| | |
| | | this.dxErrorProvider1.SetError(this.txtName, "必填项"); |
| | | return false; |
| | | } |
| | | if (string.IsNullOrEmpty(this.TextEditMinorLoss.Text.Trim())) |
| | | if (string.IsNullOrEmpty(this.textEditRunThroughCoefficient.Text.Trim())) |
| | | { |
| | | this.dxErrorProvider1.SetError(this.TextEditMinorLoss, "必填项"); |
| | | this.dxErrorProvider1.SetError(this.textEditRunThroughCoefficient, "必填项"); |
| | | return false; |
| | | } |
| | | if (string.IsNullOrEmpty(this.textEditBranchThroughCoefficient.Text.Trim())) |
| | | { |
| | | this.dxErrorProvider1.SetError(this.textEditBranchThroughCoefficient, "必填项"); |
| | | return false; |
| | | } |
| | | var tagname = this.txtTagName.Text.Trim(); |
| | |
| | | return; |
| | | } |
| | | _vmo.Name = this.txtName.Text.Trim(); |
| | | _vmo.MinorLoss = double.Parse(this.TextEditMinorLoss.EditValue?.ToString()); |
| | | _vmo.KeyWords = HStation.Service.Assets.KeyWordHelper.ToList(this.txtKeyWord.Text.Trim()); |
| | | _vmo.Flags = this.setFlagsEditCtrl1.SelectedFlagList; |
| | | _vmo.TagName = this.txtTagName.Text.Trim(); |
| | |
| | | //匹配系数 |
| | | private async void MatchingFactor() |
| | | { |
| | | if (this.TextEditMinorLoss.EditValue == null) |
| | | if (this.textEditRunThroughCoefficient.EditValue == null && this.textEditBranchThroughCoefficient.EditValue == null) |
| | | { |
| | | var allFactorList = await GetAllFactorList(); |
| | | if (allFactorList != null && allFactorList.Count > 0) |
| | |
| | | var factor = factorList.FirstOrDefault(); |
| | | if (factor != null) |
| | | { |
| | | this.TextEditMinorLoss.EditValue = factor.MinorLoss; |
| | | this.textEditRunThroughCoefficient.EditValue = factor.RunThroughMinorLoss; |
| | | this.textEditBranchThroughCoefficient.EditValue = factor.BranchThroughMinorLoss; |
| | | } |
| | | } |
| | | } |