Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (var db = new OrderLink())
     {
         var data = from Pesan in db.Pesans where Pesan.Buah == textBox1.Text select Pesan;
         foreach (var item in data)
         {
             MessageBox.Show("----------Pesanan Anda----------\nBuah " + textBox1.Text + "\nJumlah : " + numericUpDown1.Text + "\n" + label1.Text);
         }
     }
 }
Example #2
0
        private void Fruitips_Cari_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && numericUpDown1.Text != "")
            {
                using (var db = new OrderLink())
                {
                    var data = from Pesan in db.Pesans where Pesan.Buah == textBox1.Text select Pesan;
                    foreach (var item in data)
                    {
                        label1.Text = ("Total : " + numericUpDown1.Value * item.Harga);
                    }
                }
            }

            else
            {
                MessageBox.Show("Isi terlebih dahulu pesanan anda ! ");
            }
        }