Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (emailReceiptCheck.Checked && String.IsNullOrEmpty(emailAddressText.Text))
            {
                checkLabel.Text = "Enter email address!";
            }

            else
            {
                email = emailAddressText.Text;
                if (CCBox.TextLength == 16)
                {
                    if (emailReceiptCheck.Checked)
                    {
                        sendReceipt();
                    }

                    db.CustomQuery("UPDATE orders SET status = 1 WHERE orderid = " + orderID + ";").Close();
                    CreditForm2 f2 = new CreditForm2(receipt.ToString());
                    f2.passValue = CCBox.Text;
                    f2.ShowDialog();
                    Close();
                }

                else
                {
                    checkLabel.Text = "Invalid card length!";
                }
            }
        }
Exemplo n.º 2
0
        public new void getComponents(NSADatabase d, NSAComponent[] allComponents)
        {
            if (components.Count > 0)
            {
                return;
            }
            MySqlDataReader reader     = d.CustomQuery("SELECT component FROM orderitemcomponents WHERE orderitemid = " + id + ";");
            List <int>      favcompIDs = new List <int>();

            if (reader != null)
            {
                while (reader.Read())
                {
                    favcompIDs.Add((int)reader["component"]);
                }
            }

            reader.Close();

            foreach (NSAComponent comp in allComponents)
            {
                if (favcompIDs.Contains(comp.ComponentID))
                {
                    components.Add(comp);
                    if (comp.Category == "Bread")
                    {
                        breadIndex = components.Count - 1;
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            CashForm1 f1 = new CashForm1(receipt, email);

            db.CustomQuery("UPDATE orders SET status = 1 WHERE orderid = " + orderID + ";").Close();
            f1.passValueOntoForms1 = textBox1.Text;
            f1.passValueOntoForms2 = textBox2.Text;
            double result1 = Convert.ToDouble(textBox1.Text);
            double result2 = Convert.ToDouble(textBox2.Text);
            string result  = Convert.ToString(result1 - result2);

            f1.passValueOntoForms3 = result;
            f1.ShowDialog();
            Close();
        }