| | |
| | | List<string> ids = Model.DataSource.Where(x => x.Selected).Select(x => x.Id).ToList(); |
| | | if (ids == null || ids.Count <= 0) |
| | | { |
| | | ToastHelper.Warning(Window.GetWindow(this), LangUtil.Get("HMI.Menu.NoDeleteData")); |
| | | ToastHelper.Warning(Window.GetWindow(this), LangUtil.Get("HMI.NoDeleteData")); |
| | | return; |
| | | } |
| | | |
| | | var res = MsgBoxHelper.WarnMessage(Window.GetWindow(this), |
| | | string.Format(LangUtil.Get("HMI.Menu.MakeSureDeletes"), ids.Count)); |
| | | string.Format(LangUtil.Get("HMI.MakeSureDeletes"), ids.Count)); |
| | | if (res == MessageBoxResult.OK) |
| | | { |
| | | Model.DeleteMenuByIds(ids); |
| | |
| | | { |
| | | var data = (MenuData)((Button)sender).DataContext; |
| | | var res = MsgBoxHelper.WarnMessage(Window.GetWindow(this), |
| | | string.Format(LangUtil.Get("HMI.Menu.MakeSureDeleteSingle"), data.Name)); |
| | | string.Format(LangUtil.Get("HMI.MakeSureDeleteSingle"), data.Name)); |
| | | if (res == MessageBoxResult.OK) |
| | | { |
| | | Model.DeleteMenuById(data.Id); |