| | |
| | | this.dxErrorProvider1.SetError(this.NameTextEdit, "必填项"); |
| | | return false; |
| | | } |
| | | if (this.TextEditCatalogChoice.EditValue==null) |
| | | { |
| | | this.dxErrorProvider1.SetError(this.TextEditCatalogChoice, "必填项"); |
| | | return false; |
| | | } |
| | | if (string.IsNullOrEmpty(TextEditCatalogChoice.Text.Trim())) |
| | | if (this.TextEditCatalogChoice.EditValue == null) |
| | | { |
| | | this.dxErrorProvider1.SetError(this.TextEditCatalogChoice, "必填项"); |
| | | return false; |
| | |
| | | //完成 |
| | | private async void BtnOk_ClickAsync(object sender, EventArgs e) |
| | | { |
| | | if (!Valid()) |
| | | return; |
| | | var model = new AddPumpSeriesDto(); |
| | | model.Name = NameTextEdit.Text.Trim(); |
| | | model.TagName = TagNameTextEdit.Text.Trim(); |
| | | model.MotorFrequency = MotorFrequencyTextEdit.Text.Trim(); |
| | | if (long.TryParse(TextEditCatalogChoice.EditValue?.ToString()??"", out long catalogID)) |
| | | if (long.TryParse(TextEditCatalogChoice.EditValue?.ToString() ?? "", out long catalogID)) |
| | | { |
| | | model.CatalogID = catalogID; |
| | | } |