示例#1
0
 private void NewOrderMenuItem_Click(object sender, RoutedEventArgs e)
 {
     ((Storyboard)this.Resources["StoryboardFadeOut"]).Begin(this);
     NewOrderWindow objNewOrderWindow = new NewOrderWindow();
     objNewOrderWindow.Owner = this;
     bool? dg = objNewOrderWindow.ShowDialog();
     if (dg == true)
     {
         if (cashierOrdersList != null)
         {
             cashierOrdersList.LoadOrders();
         }
         if (kitchenOrdersList != null)
         {
             kitchenOrdersList.LoadOrders();
         }
     }
     ((Storyboard)this.Resources["StoryboardFadeIn"]).Begin(this);
 }
 private void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     this.Cursor = Cursors.Wait;
     Window mainWindow = FindRootParent((FrameworkElement)this.Parent);
     ((Storyboard)mainWindow.Resources["StoryboardFadeOut"]).Begin(mainWindow);
     Button btn = (Button)sender;
     DataRowView selectedRow = (DataRowView)btn.Tag;
     OrdersGridView.SelectedItem = selectedRow;
     Int64 orderNo = (Int64)selectedRow["OrderNo"];
     string tableNo = selectedRow["TableNo"].ToString();
     Byte state = (Byte)selectedRow["State"];
     NewOrderWindow objNewOrderWindow = new NewOrderWindow(orderNo,tableNo);
     objNewOrderWindow.Owner = mainWindow;
     bool? dg = objNewOrderWindow.ShowDialog();
     if (dg == true)
     {
         FilterTextBox.Text = "";
         LoadOrders();
         try
         {
             TablesStatusUserControl ts = (TablesStatusUserControl)mainWindow.FindName("TablesStatus");
             ts.GetAllTables();
         }
         catch (Exception)
         {
             //Unable to refresh the tables list.
         }
     }
     ((Storyboard)mainWindow.Resources["StoryboardFadeIn"]).Begin(mainWindow);
     this.Cursor = Cursors.Arrow;
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.Window = ((Restaurant.NewOrderWindow)(target));
     
     #line 9 "..\..\NewOrderWindow.xaml"
     this.Window.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Window_MouseLeftButtonDown);
     
     #line default
     #line hidden
     
     #line 14 "..\..\NewOrderWindow.xaml"
     this.Window.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
     
     #line default
     #line hidden
     
     #line 15 "..\..\NewOrderWindow.xaml"
     this.Window.Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);
     
     #line default
     #line hidden
     return;
     case 3:
     this.StoryboardProductsHide_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target));
     return;
     case 4:
     this.StoryboardProductsShow_BeginStoryboard1 = ((System.Windows.Media.Animation.BeginStoryboard)(target));
     return;
     case 5:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     case 6:
     this.rectOuter = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 7:
     this.rectInner = ((System.Windows.Shapes.Rectangle)(target));
     return;
     case 8:
     this.txbWindowTitle = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 9:
     this.textBlock2 = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 10:
     this.textBlock1 = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 11:
     this.borderOrderNo = ((System.Windows.Controls.Border)(target));
     return;
     case 12:
     this.txbOrderNo = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 13:
     this.borderTableNo = ((System.Windows.Controls.Border)(target));
     
     #line 147 "..\..\NewOrderWindow.xaml"
     this.borderTableNo.MouseEnter += new System.Windows.Input.MouseEventHandler(this.borderTableNo_MouseEnter);
     
     #line default
     #line hidden
     return;
     case 14:
     this.txbTableNo = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 15:
     this.MainGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 16:
     this.border = ((System.Windows.Controls.Border)(target));
     return;
     case 17:
     this.cmbGroups = ((System.Windows.Controls.ComboBox)(target));
     
     #line 165 "..\..\NewOrderWindow.xaml"
     this.cmbGroups.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.cmbGroups_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 18:
     this.txtItem = ((System.Windows.Controls.TextBox)(target));
     
     #line 167 "..\..\NewOrderWindow.xaml"
     this.txtItem.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TextBox_TextChanged);
     
     #line default
     #line hidden
     return;
     case 19:
     this.ProductsGridView = ((Restaurant.SortableListView)(target));
     return;
     case 20:
     this.btnAddToOrder = ((System.Windows.Controls.Button)(target));
     
     #line 187 "..\..\NewOrderWindow.xaml"
     this.btnAddToOrder.Click += new System.Windows.RoutedEventHandler(this.btnAddToOrder_Click);
     
     #line default
     #line hidden
     return;
     case 21:
     this.btnHide = ((System.Windows.Controls.Button)(target));
     return;
     case 22:
     this.btnShow = ((System.Windows.Controls.Button)(target));
     return;
     case 23:
     this.borderOrder = ((System.Windows.Controls.Border)(target));
     return;
     case 24:
     this.OrderGridView = ((Restaurant.SortableListView)(target));
     return;
     case 25:
     this.btnRemoveItem = ((System.Windows.Controls.Button)(target));
     
     #line 213 "..\..\NewOrderWindow.xaml"
     this.btnRemoveItem.Click += new System.Windows.RoutedEventHandler(this.btnRemoveItem_Click);
     
     #line default
     #line hidden
     return;
     case 26:
     this.btnCancel = ((System.Windows.Controls.Button)(target));
     return;
     case 27:
     this.btnSaveOrder = ((System.Windows.Controls.Button)(target));
     
     #line 218 "..\..\NewOrderWindow.xaml"
     this.btnSaveOrder.Click += new System.Windows.RoutedEventHandler(this.btnSaveOrder_Click);
     
     #line default
     #line hidden
     return;
     case 28:
     this.PopUpSelectTable = ((System.Windows.Controls.Primitives.Popup)(target));
     
     #line 219 "..\..\NewOrderWindow.xaml"
     this.PopUpSelectTable.MouseLeave += new System.Windows.Input.MouseEventHandler(this.PopUpSelectTable_MouseLeave);
     
     #line default
     #line hidden
     return;
     case 29:
     this.cmbTableNo = ((System.Windows.Controls.ComboBox)(target));
     return;
     }
     this._contentLoaded = true;
 }