提交
This commit is contained in:
@ -236,23 +236,23 @@ namespace DHSoftware.Views
|
||||
|
||||
private void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var dlg = new AddCubicleWindow())
|
||||
{
|
||||
if (dlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var newItem = new MenuItem(dlg.CubicleName);
|
||||
//newItem.IconSvg = "AppstoreOutlined";
|
||||
// 防止重复添加
|
||||
if (!menu.Items.Cast<MenuItem>().Any(m => m.Text == newItem.Text))
|
||||
{
|
||||
menu.Items.Add(newItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
// AntdUI.Notification.warn(this, "新增工位失败", $"{dlg.CubicleName}已存在!", autoClose: 3, align: TAlignFrom.TR);
|
||||
}
|
||||
}
|
||||
}
|
||||
//using (var dlg = new AddCubicleWindow())
|
||||
//{
|
||||
// if (dlg.ShowDialog() == DialogResult.OK)
|
||||
// {
|
||||
// var newItem = new MenuItem(dlg.CubicleName);
|
||||
// //newItem.IconSvg = "AppstoreOutlined";
|
||||
// // 防止重复添加
|
||||
// if (!menu.Items.Cast<MenuItem>().Any(m => m.Text == newItem.Text))
|
||||
// {
|
||||
// menu.Items.Add(newItem);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // AntdUI.Notification.warn(this, "新增工位失败", $"{dlg.CubicleName}已存在!", autoClose: 3, align: TAlignFrom.TR);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user