using DevExpress.XtraEditors; using Yw; namespace HStation.WinFrmUI { public partial class UpdateAdminTypeDlg : DevExpress.XtraEditors.XtraForm { public UpdateAdminTypeDlg() { InitializeComponent(); this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent; ; } private long _userId; public void SetBingingData(long userId,Yw.Vmo.eAdminType eAdminType) { _userId = userId; this.txtEditAdminType.Properties.AddEnum(typeof(Yw.Model.eAdminType)); this.txtEditAdminType.EditValue = eAdminType; } /// /// 确定 /// private async void GeneralOkAndCancelCtrl1_OkEvent() { var a= (Yw.Model.eAdminType)this.txtEditAdminType.EditValue; var bol = await BLLFactory.Instance.UpdateAdminType(_userId, Yw.Model.eAdminType.Admin); if (!bol) { XtraMessageBox.Show("修改失败!"); return; } XtraMessageBox.Show("修改成功"); this.DialogResult = DialogResult.OK; this.Close(); } } }