private void BtnTables_Click(object sender, RoutedEventArgs e) { KitchenStaff k = new KitchenStaff(); k.Show(); this.Close(); }
private void BtnKitStaff_Click(object sender, RoutedEventArgs e) { Login l = new Login(); KitchenStaff k = new KitchenStaff(); k.Show(); this.Close(); //this.Close(); }
private void GoBasket_Click(object sender, RoutedEventArgs e) { KitchenStaff k = new KitchenStaff(); Basket basket = new Basket(); con = new SqlConnection(@"Data Source=PC\SQLEXPRESS;Initial Catalog=SelfOrder_Customer;Integrated Security=True"); con.Open(); if (Table.table_id == 1) { string totalPrice = "SELECT SUM (totalprice) FROM ORDR1"; SqlCommand cmd = new SqlCommand(totalPrice, con); double total1 = Convert.ToDouble(cmd.ExecuteScalar()); basket.totalpriceLabel.Content = total1.ToString(); k.table1.Background = Brushes.Red; } else if (Table.table_id == 2) { string totalPrice = "SELECT SUM (totalprice) FROM ORDR2"; SqlCommand cmd = new SqlCommand(totalPrice, con); double total2 = Convert.ToDouble(cmd.ExecuteScalar()); basket.totalpriceLabel.Content = total2.ToString(); k.table2.Background = Brushes.Red; } if (Table.table_id == 3) { string totalPrice = "SELECT SUM (totalprice) FROM ORDR3"; SqlCommand cmd = new SqlCommand(totalPrice, con); double total3 = Convert.ToDouble(cmd.ExecuteScalar()); basket.totalpriceLabel.Content = total3.ToString(); k.table3.Background = Brushes.Red; } con.Close(); //k.Show(); basket.Show(); this.Close(); }