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;
 }
Exemplo n.º 2
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);
 }