private void btnppPending_Click(object sender, RoutedEventArgs e) { kitchenViewModelButton.ChangeKOTStatus(txtbKOTItemIdHidden.Text, txtbKOTIdHidden.Text, 1); GetKitchenPending(KitchenOrder); ppStatus.StaysOpen = false; ppStatus.IsOpen = false; }
private void ChangeKOTStatus(object sender, MouseButtonEventArgs e) { try { SolidColorBrush solidColorBrush = new SolidColorBrush(); KitchenViewModel kitchenViewModel = new KitchenViewModel(); var kotDetailPanel = sender as WrapPanel; var txtfoodmenuName = kotDetailPanel.Children[0] as TextBlock; var txtQty = kotDetailPanel.Children[1] as TextBlock; var txtbKOTItemId = kotDetailPanel.Children[2] as TextBlock; var txtbKOTId = kotDetailPanel.Children[3] as TextBlock; var txtbKOTStatus = kotDetailPanel.Children[4] as TextBlock; var txtOrderTable = kotDetailPanel.Children[5] as TextBlock; int status = 0; ppStatus.StaysOpen = true; ppStatus.IsOpen = true; txtppTableNumber.Text = txtOrderTable.Text; txtppFoodmenuName.Text = txtfoodmenuName.Text; txtppQty.Text = txtQty.Text; txtbKOTItemIdHidden.Text = txtbKOTItemId.Text; txtbKOTIdHidden.Text = txtbKOTId.Text; if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Completed.ToString()) { solidColorBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#ffffff")); } else if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Pending.ToString()) { solidColorBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#ff726f")); } else if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Cooking.ToString()) { solidColorBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#fbff99")); } else if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Ready.ToString()) { solidColorBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#5cff7e")); } else if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Served.ToString()) { solidColorBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#ccd9ff")); } grItem.Background = solidColorBrush; e.Handled = true; return; if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Pending.ToString()) { status = (int)EnumUtility.KOTStatus.Cooking; } else if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Cooking.ToString()) { status = (int)EnumUtility.KOTStatus.Ready; } else if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Ready.ToString()) { status = (int)EnumUtility.KOTStatus.Served; } else if (txtbKOTStatus.Text == EnumUtility.KOTStatus.Served.ToString()) { status = (int)EnumUtility.KOTStatus.Completed; } if (status != 0) { kitchenViewModel.ChangeKOTStatus(txtbKOTItemId.Text, txtbKOTId.Text, status); GetKitchenPending(KitchenOrder); } } catch (Exception ex) { SystemError.Register(ex); } }