This commit is contained in:
2025-03-18 14:19:33 +08:00
parent 25cd61c5cb
commit 0dedff36fd
29 changed files with 2296 additions and 615 deletions

View File

@ -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);
// }
// }
//}
}
}
}