private void MyOrders_Load(object sender, EventArgs e) { userdetail user = new userdetail(); label9.Text = user.getUname(); FillMyOrdeers(); }
private void Home_Load(object sender, EventArgs e) { FillComboBox(); ItemList = ""; TotalPrice = 0; UpdateQuery = ""; userdetail user = new userdetail(); label9.Text = user.getUname(); }
private void Home_Load(object sender, EventArgs e) { userdetail user = new userdetail(); lblUsername.Text = user.getUname(); }
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=talight;"); string query = "INSERT INTO `orders`(`user`,`details`,`price`) VALUES('" + user.getUname() + "','" + MyParent.ItemList + "'," + 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()); } }