Пример #1
0
        private void MyOrders_Load(object sender, EventArgs e)
        {
            userdetail user = new userdetail();

            label9.Text = user.getUname();
            FillMyOrdeers();
        }
Пример #2
0
        private void Home_Load(object sender, EventArgs e)
        {
            FillComboBox();
            Array.Clear(ItemList, 0, 5);
            TotalPrice  = 0;
            UpdateQuery = "";

            userdetail user = new userdetail();

            label9.Text = user.getUname();
        }
Пример #3
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                userdetail user = new userdetail();

                MySqlConnection conn  = new MySqlConnection(@"datasource=127.0.0.1;port=3306;SslMode=none;username=root;password=;database=wicrama;");
                string          query = "INSERT INTO `orders`(`user`,`details`,`price`) VALUES('" + user.getUname() + "','" + ArrayToString() + "'," + MyParent.TotalPrice + ");" + MyParent.UpdateQuery + "";
                MySqlCommand    cmd   = new MySqlCommand(query, conn);
                conn.Open();
                cmd.ExecuteNonQuery();
                conn.Close();
                MessageBox.Show("Success");
                button1_Click(sender, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }