// клик по строке блюда/ингредиента private void root_MouseUp(object sender, MouseButtonEventArgs e) { // проверка попадания на кнопку перелистывания страниц if ((Application.Current.MainWindow != null) && (Application.Current.MainWindow is MainWindow)) { MainWindow mainWin = (MainWindow)Application.Current.MainWindow; if (mainWin.ClickPageButton) { mainWin.ClickPageButton = false; return; } } string sLogMsg = "click on order ITEM"; // КЛИКАБЕЛЬНОСТЬ (условия отсутствия) // 1. не входит в отображаемые отделы if (AppLib.IsDepViewOnKDS(_dishView.DepartmentId) == false) { AppLib.WriteLogClientAction(sLogMsg + " - NO action (dep not view)"); return; } // 2. условие кликабельности ингредиента (независимо от блюда) или блюда на допнаправлении else if (!_isDish) { // IsIngredientsIndependent может меняться динамически, поэтому проверяем каждый раз bool b1 = (bool)WpfHelper.GetAppGlobalValue("IsIngredientsIndependent", false); if (!b1) { AppLib.WriteLogClientAction(sLogMsg + " - NO action (клик по ингр/допНП не разрешен в IsIngredientsIndependent)"); return; } } OrderViewModel orderView = null; FrameworkElement orderPanel = WpfHelper.FindVisualParent(this, typeof(OrderPanel), null); if (orderPanel != null) { orderView = (orderPanel as OrderPanel).OrderViewModel; } AppLib.WriteLogClientAction("{0} - open StateChange window for dishId {1} ({2})", sLogMsg, _dishView.Id, _dishView.DishName); App.OpenStateChangeWindow(orderView, _dishView); e.Handled = true; }
// в _dataProvider.Departments, поле IsViewOnKDS = true, если отдел разрешен для показа на этом КДСе private bool checkAllowDepartment(OrderFilterValue dish) { return(AppLib.IsDepViewOnKDS(dish.DepartmentId)); }