duheng
2025-01-08 21067008153a810c72e8b86faaeca577290ff265
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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;
        }
 
        /// <summary>
        /// 确定
        /// </summary>
        private async void GeneralOkAndCancelCtrl1_OkEvent()
        {
           var a= (Yw.Model.eAdminType)this.txtEditAdminType.EditValue;
            var bol = await BLLFactory<Yw.BLL.User>.Instance.UpdateAdminType(_userId, Yw.Model.eAdminType.Admin);
            if (!bol)
            {
                XtraMessageBox.Show("修改失败!");
                return;
            }
            XtraMessageBox.Show("修改成功");
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}