private void KotakBest_CellClick(object sender, DataGridViewCellEventArgs e) { KotakMenu.ClearSelection(); grpbxPesan.Enabled = true; makanan = KotakBest.Rows[e.RowIndex].Cells[0].Value.ToString(); TampilGambar(makanan); }
private void Form1_Load(object sender, EventArgs e) { SqlDataAdapter da = new SqlDataAdapter("select NamaMenu, Cast(HargaMenu as decimal) Harga from Menu", conn); DataSet ds = new DataSet(); da.Fill(ds, "Menu"); KotakMenu.DataSource = ds.Tables["Menu"]; da = new SqlDataAdapter("select Top 3 NamaMenu, HargaMenu from Menu order by Populer desc", conn); ds = new DataSet(); da.Fill(ds, "Menu"); KotakBest.DataSource = ds.Tables["Menu"]; Total.Text = "0"; grpbxPesan.Enabled = false; KotakMenu.Enabled = false; KotakBest.Enabled = false; TombolBayar.Enabled = false; daftarMeja.Enabled = true; KotakMenu.ClearSelection(); KotakBest.ClearSelection(); KotakPesanan.ClearSelection(); KotakPesanan.DataSource = null; pictureBox1.Image = null; }