| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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) |