| | |
| | | using DevExpress.XtraEditors; |
| | | using HStation.Vmo; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using Yw; |
| | | using Yw; |
| | | using Yw.WinFrmUI; |
| | | |
| | | namespace HStation.WinFrmUI |
| | |
| | | /// <summary> |
| | | /// 返回数据事件 |
| | | /// </summary> |
| | | public event Action<Yw.Vmo.Role> ReloadDataEvent; |
| | | public event Action<Yw.Vmo.RoleVmo> ReloadDataEvent; |
| | | |
| | | private Yw.Vmo.Role _vmo = null; |
| | | private Yw.Vmo.RoleVmo _vmo = null; |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public async void SetBindingData(Yw.Vmo.Role vmo) |
| | | public async void SetBindingData(Yw.Vmo.RoleVmo vmo) |
| | | { |
| | | if (vmo == null) |
| | | { |
| | |
| | | } |
| | | _vmo = vmo; |
| | | this.txtName.EditValue = vmo.Name; |
| | | this.txtCode.EditValue = vmo.Code; |
| | | this.txtDescription.EditValue = vmo.Description; |
| | | } |
| | | |
| | |
| | | this.dxErrorProvider1.SetError(this.txtName, "必填项"); |
| | | return false; |
| | | } |
| | | if (string.IsNullOrEmpty(this.txtMinorLoss.Text.Trim())) |
| | | if (string.IsNullOrEmpty(this.txtCode.Text.Trim())) |
| | | { |
| | | this.dxErrorProvider1.SetError(this.txtMinorLoss, "必填项"); |
| | | this.dxErrorProvider1.SetError(this.txtCode, "必填项"); |
| | | return false; |
| | | } |
| | | return true; |
| | |
| | | return; |
| | | } |
| | | _vmo.Name = this.txtName.Text.Trim(); |
| | | _vmo.Code = this.txtCode.Text.Trim(); |
| | | _vmo.Description = this.txtDescription.Text.Trim(); |
| | | |
| | | var bol = await BLLFactory<Yw.BLL.Role>.Instance.Update(_vmo); |
| | | if (!bol) |
| | | { |