Exemplo n.º 1
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            Pay p = new Pay();

            p.Show();
            this.Close();
        }
Exemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e) //complete order button
        {
            Pay    p       = new Pay();
            string payment = totalpriceLabel.Content.ToString();

            p.pay.Content = payment;
            feedback f = new feedback();

            f.Show();
            this.Close();
        }
Exemplo n.º 3
0
        private void GoPay_Click(object sender, RoutedEventArgs e)
        {
            Pay p = new Pay();

            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());


                p.pay.Content = total1.ToString();
            }
            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());


                p.pay.Content = total2.ToString();
            }
            if (Table.table_id == 3)
            {
                string     totalPrice = "SELECT SUM (totalprice) FROM ORDR3";
                SqlCommand cmd        = new SqlCommand(totalPrice, con);

                double total3 = Convert.ToDouble(cmd.ExecuteScalar());


                p.pay.Content = total3.ToString();
            }

            con.Close();

            p.Show();
            this.Close();
        }