yangyin
2024-08-29 147cd9a7d821b4e60396213b105d83ee585a1b0d
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
42
43
44
45
46
47
48
49
50
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace HStation.WinFrmUI.Auth
{
    public partial class AddMenuDlg : DevExpress.XtraEditors.XtraForm
    {
        public AddMenuDlg()
        {
            InitializeComponent();
        }
        string error;
        Yw.BLL.ProjectMenu _sever = new Yw.BLL.ProjectMenu();
        //确定
        private async void simpleButtonOK_Click(object sender, EventArgs e)
        {
            error = "";
            Yw.Vmo.ProjectMenu Menu = new Yw.Vmo.ProjectMenu();
            Menu = menuInfoCtrl.OperateData(Menu, out error);
            if (!string.IsNullOrEmpty(error))
            {
                MessageBox.Show(error);
                return;
            }
            var id = await _sever.Insert(Menu);
            if (id == 0)
            {
                MessageBox.Show("添加失败!");
                return;
            }
            MessageBox.Show("添加成功!");
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        //取消
        private void simpleButtonCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}