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