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();
|
}
|
}
|
}
|