コード例 #1
0
ファイル: NewOrder.cs プロジェクト: phearunum/Restaurant-C-
        private void button7_Click(object sender, EventArgs e)
        {
            try
            {
                //cM.ClearTextBoxes(this);
                Class.cOrder_detial order = new Class.cOrder_detial();

                dataGridView1.Rows.Clear();
                exUSD.Text       = "0";
                exReal.Text      = "0";
                txtReal.Text     = "0";
                txtAmount.Text   = "0";
                txtDiscount.Text = "0";
                txtPay.Text      = "0";
                txtTotal.Text    = "0";
                txtTotal.Text    = "0";
                txtTable.Text    = "0";
                txtUSD.Text      = "0";
                txtReal.Text     = "0";
                txtBack.Text     = "0";
                txtInvo.Text     = "0";
                fPayment pay = new fPayment();
                pay.txtGetReal = "0";
                pay.txtGetUsd  = "0";

                get_order_hold(txtInvo.Text);
                ListTable();
                flowLayoutPanel1.Enabled = true;
                flowLayoutPanel2.Hide();
                flowLayoutPanel1.Show();
                getTopId();
                getExchage();
            }
            catch
            {
            }
        }
コード例 #2
0
ファイル: NewOrder.cs プロジェクト: phearunum/Restaurant-C-
        private void button10_Click(object sender, EventArgs e)
        {
            if (txtTotal.Text == "0")
            {
            }
            else
            {
                try
                {
                    fPayment fpay = new fPayment();
                    //fpay.txtGetReal = "0";
                    //fpay.txtGetUsd = "0";
                    fpay.ShowDialog();
                    if (fpay.txtGetUsd != "")
                    {
                        if (exUSD.Text != "")
                        {
                            exUSD.Text = (Convert.ToDouble(exUSD.Text) + Convert.ToDouble(fpay.txtGetUsd)).ToString();
                        }
                        else
                        {
                            exUSD.Text = fpay.txtGetUsd;
                        }

                        double usd = Convert.ToDouble(exUSD.Text);
                        double ex  = Convert.ToDouble(txtexchage.Text);
                        exReal.Text = (usd * ex).ToString();
                    }
                    else if (fpay.txtGetReal != "")
                    {
                        if (exReal.Text != "")
                        {
                            exReal.Text = (Convert.ToDouble(exReal.Text) + Convert.ToDouble(fpay.txtGetReal)).ToString();
                        }
                        else
                        {
                            exReal.Text = fpay.txtGetReal;
                        }
                        double real = Convert.ToDouble(exReal.Text);
                        double ex   = Convert.ToDouble(txtexchage.Text);
                        exUSD.Text = (real / ex).ToString();
                    }
                    else
                    {
                        txtPay.Text = "0";
                    }
                    txtPay.Text = exUSD.Text;

                    if (txtPay.Text != "")
                    {
                        double pp = Convert.ToDouble(txtPay.Text);
                        double tt = Convert.ToDouble(txtAmount.Text);
                        if (tt > pp)
                        {
                            pic_alert.Show();
                        }
                        else
                        {
                            txtBack.Text = (pp - tt).ToString();
                            pic_alert.Hide();
                        }
                    }
                }
                catch
                {
                }
            }
        }