| | |
| | | using DevExpress.XtraEditors.Controls; |
| | | |
| | | namespace HStation.WinFrmUI.Assets |
| | | namespace HStation.WinFrmUI.Assets |
| | | { |
| | | public partial class EditValveSeriesDlg : DevExpress.XtraEditors.XtraForm |
| | | { |
| | |
| | | |
| | | public void SetBindingData(Vmo.ValveSeriesVmo seriesVmo) |
| | | { |
| | | TextEditType.Properties.AddEnum(typeof(HStation.Service.Assets.eValveSeriesType)); |
| | | TextEditType.EditValue = seriesVmo.Type; |
| | | _valveSeries = seriesVmo; |
| | | this.NameTextEdit.Text = _valveSeries.Name; |
| | | this.DescriptionTextEdit.Text = _valveSeries.Description; |
| | |
| | | if (!Valid()) |
| | | return; |
| | | _valveSeries.Name = NameTextEdit.Text; |
| | | if (Enum.TryParse(Convert.ToString(TextEditType.EditValue), true, out HStation.Service.Assets.eValveSeriesType valvetype)) |
| | | { |
| | | _valveSeries.Type = valvetype; |
| | | } |
| | | _valveSeries.TagName = TagNameTextEdit.Text; |
| | | _valveSeries.Description = DescriptionTextEdit.Text; |
| | | if (await this.ReloadDataEvent.Invoke(_valveSeries)) |
| | |
| | | } |
| | | else |
| | | { |
| | | TipFormHelper.ShowSucceed("修改失败!"); |
| | | TipFormHelper.ShowError("修改失败!"); |
| | | } |
| | | this.DialogResult = DialogResult.OK; |
| | | this.Close(); |