| | |
| | | namespace HStation.WinFrmUI.Assets |
| | | { |
| | | public partial class EditPumpTypeDlg : DevExpress.XtraEditors.XtraForm |
| | | public partial class EditAssetsPumpTypeDlg : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | public EditPumpTypeDlg() |
| | | public EditAssetsPumpTypeDlg() |
| | | { |
| | | InitializeComponent(); |
| | | this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; |
| | | } |
| | | |
| | | public event Func<Vmo.PumpTypeVmo, Task<bool>> ReloadDataEvent = null; |
| | | public event Func<Vmo.AssetsPumpTypeVmo, Task<bool>> ReloadDataEvent = null; |
| | | |
| | | private Vmo.PumpTypeVmo _PumpType; |
| | | private Vmo.AssetsPumpTypeVmo _AssetsPumpType; |
| | | |
| | | public async void SetBindingData(long TypeID) |
| | | { |
| | | var bll = new BLL.PumpType(); |
| | | _PumpType = await bll.GetByID(TypeID); |
| | | if (_PumpType != null) |
| | | var bll = new BLL.AssetsPumpType(); |
| | | _AssetsPumpType = await bll.GetByID(TypeID); |
| | | if (_AssetsPumpType != null) |
| | | { |
| | | this.TextEditName.Text = _PumpType.Name; |
| | | this.memoEditDescription.Text = _PumpType.Description; |
| | | this.TextEditName.Text = _AssetsPumpType.Name; |
| | | this.memoEditDescription.Text = _AssetsPumpType.Description; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private async void BtnOk_Click(object sender, EventArgs e) |
| | | { |
| | | _PumpType.Name = TextEditName.Text.Trim(); |
| | | _PumpType.Description = memoEditDescription.Text.Trim(); |
| | | if (await this.ReloadDataEvent.Invoke(_PumpType)) |
| | | _AssetsPumpType.Name = TextEditName.Text.Trim(); |
| | | _AssetsPumpType.Description = memoEditDescription.Text.Trim(); |
| | | if (await this.ReloadDataEvent.Invoke(_AssetsPumpType)) |
| | | { |
| | | MessageBoxHelper.ShowSuccess("修改成功!"); |
| | | } |