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.Model.eAdminType eAdminType)
{
_userId = userId;
this.txtEditAdminType.Properties.AddEnum(typeof(Yw.Model.eAdminType));
this.txtEditAdminType.EditValue = eAdminType;
}
///
/// 确定
///
private async void GeneralOkAndCancelCtrl1_OkEvent()
{
var bol = await BLLFactory.Instance.UpdateAdminType(_userId, (Yw.Model.eAdminType)(int)this.txtEditAdminType.EditValue);
if (!bol)
{
XtraMessageBox.Show("修改失败!");
}
else
{
XtraMessageBox.Show("修改成功");
}
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}