示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Please Fill in the details");
                Payment_Credit objFrm = new Payment_Credit();
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Please Fill in the details");
                Payment_Credit objFrm = new Payment_Credit();
            }
            else if (textBox3.Text == "")
            {
                MessageBox.Show("Please Fill in the details");
                Payment_Credit objFrm = new Payment_Credit();
            }
            else if (textBox4.Text == "")
            {
                MessageBox.Show("Please Fill in the details");
                Payment_Credit objFrm = new Payment_Credit();
            }
            else if (MessageBox.Show("Apakah anda yakin?", "Yes or No", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                MessageBox.Show("Payment Successful");

                this.Hide();
                Hello objFrm = new Hello();
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (cmbPayment.Text == "")
            {
                MessageBox.Show("Mohon Pilih Metode Pembayaran");
            }
            else if (lblTotal.Text == "Rp." + " " + "0")
            {
                MessageBox.Show("Mohon Memilih Makanan / Minuman Yang Tersedia");
            }
            else if (cmbPayment.Text == "Tunai")
            {
                if (MessageBox.Show("Apakah anda yakin?", "Yes or No", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    MessageBox.Show("Payment Successful");

                    Hello objFrm = new Hello();
                }
            }
            else if (cmbPayment.Text == "Credit Card")
            {
                Payment_Credit objFrm = new Payment_Credit();
                this.Hide();
                objFrm.Show();
            }
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            string[] ListFood = new string[11];
            ListFood[0]  = Convert.ToString(A1 + " " + textBox1.Text + " " + "Rp. 15.000/px" + "\n");
            ListFood[1]  = Convert.ToString(A2 + " " + textBox8.Text + " " + "Rp. 15.000/px" + "\n");
            ListFood[2]  = Convert.ToString(A3 + " " + textBox9.Text + " " + "Rp. 10.000/px" + "\n");
            ListFood[3]  = Convert.ToString(A4 + " " + textBox10.Text + " " + "Rp. 13.000/px" + "\n");
            ListFood[4]  = Convert.ToString(A5 + " " + textBox11.Text + " " + "Rp. 20.000/px" + "\n");
            ListFood[5]  = Convert.ToString(A6 + " " + textBox12.Text + " " + "Rp. 25.000/px" + "\n");
            ListFood[6]  = Convert.ToString(DR1 + " " + textBox14.Text + " " + "Rp. 11.000/px" + "\n");
            ListFood[7]  = Convert.ToString(DR2 + " " + textBox19.Text + " " + "Rp. 8.000/px" + "\n");
            ListFood[8]  = Convert.ToString(DR3 + " " + textBox20.Text + " " + "Rp. 5.000/px" + "\n");
            ListFood[9]  = Convert.ToString(DR4 + " " + textBox22.Text + " " + "Rp. 4.000/px" + "\n");
            ListFood[10] = Convert.ToString(DR5 + " " + textBox21.Text + " " + "Rp. 3.000/px" + "\n");


            double[] itemcost = new double[11];
            itemcost[0]  = Convert.ToDouble(textBox1.Text) * Harga_NasiAyam;
            itemcost[1]  = Convert.ToDouble(textBox8.Text) * Harga_MieRebusSpecial;
            itemcost[2]  = Convert.ToDouble(textBox9.Text) * Harga_IndomieBasah;
            itemcost[3]  = Convert.ToDouble(textBox10.Text) * Harga_GulaiIkan;
            itemcost[4]  = Convert.ToDouble(textBox11.Text) * Harga_NasiGorengTelur;
            itemcost[5]  = Convert.ToDouble(textBox12.Text) * Harga_PaketHemat;
            itemcost[6]  = Convert.ToDouble(textBox14.Text) * Harga_JusJeruk;
            itemcost[7]  = Convert.ToDouble(textBox19.Text) * Harga_MinumanBadak;
            itemcost[8]  = Convert.ToDouble(textBox20.Text) * Harga_TehManis;
            itemcost[9]  = Convert.ToDouble(textBox22.Text) * Harga_TehPahit;
            itemcost[10] = Convert.ToDouble(textBox21.Text) * Harga_AirPutih;

            double cost;

            iTotal = itemcost[0] + itemcost[1] + itemcost[2] + itemcost[3] + itemcost[4] + itemcost[5] + itemcost[6]
                     + itemcost[7] + itemcost[8] + itemcost[9] + itemcost[10];
            lblTotal.Text = Convert.ToString("Rp." + " " + iTotal);

            ListF = ListFood[0] + ListFood[1] + ListFood[2] + ListFood[3] + ListFood[4] + ListFood[5] + ListFood[6]
                    + ListFood[7] + ListFood[8] + ListFood[9] + ListFood[10];
            label46.Text = Convert.ToString(ListF);

            if (cmbPayment.Text == "Tunai")
            {
                MessageBox.Show("Pembayaran Berhasil");
                this.Close();
            }
            else if (cmbPayment.Text == "Debit")
            {
                Payment_Debit objFrm = new Payment_Debit();
                this.Hide();
                objFrm.Show();
            }
            else if (cmbPayment.Text == "Credit")
            {
                Payment_Credit objFrm = new Payment_Credit();
                this.Hide();
                objFrm.Show();
            }
        }