duheng
2025-04-18 d2b91c9d98f38ccbd657f2adff1473aba29f66b2
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 Yw.WinFrmUI;
 
namespace PBS.WinFrmUI
{
    public partial class AddFacilityDlg : DevExpress.XtraEditors.XtraForm
    {
        public AddFacilityDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
            this.generalOkAndCancelCtrl1.OkEvent += GeneralOkAndCancelCtrl1_OkEvent;
        }
 
        public event Func<Vmo.FacilityVmo, Task<bool>> ReloadDataEvent;
 
        public async void SetBindingData()
        {
            await this.facilitiesCtrl.SetBindingData();
        }
 
        /// <summary>
        /// 确定
        /// </summary>
        private async void GeneralOkAndCancelCtrl1_OkEvent()
        {
            var vmo = this.facilitiesCtrl.GetData();
            if (vmo == null)
                return;
            if (await ReloadDataEvent.Invoke(vmo))
            {
                TipFormHelper.ShowSucceed("新增成功!");
            }
            else
            {
                TipFormHelper.ShowError("新增失败!");
            }
            this.Close();
        }
    }
}