Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            frmCart frm = new frmCart();

            frm.Show();
        }
Example #2
0
        private void btnAddCart_Click(object sender, EventArgs e)
        {
            bool backgroundCheck = false;
            bool rockTypeCheck   = false;
            bool eyesCheck       = false;
            bool mouthCheck      = false;
            bool accessoryCheck  = false;

            StreamWriter writer1 = new StreamWriter(outFile1);

            foreach (RadioButton rdo in grpBackground.Controls.OfType <RadioButton>())
            {
                if (rdo.Checked)
                {
                    backgroundCheck = true;
                    break;
                }
            }

            foreach (RadioButton rdo in grpRockType.Controls.OfType <RadioButton>())
            {
                if (rdo.Checked)
                {
                    rockTypeCheck = true;
                }
            }

            foreach (RadioButton rdo in grpEyes.Controls.OfType <RadioButton>())
            {
                if (rdo.Checked)
                {
                    eyesCheck = true;
                }
            }

            foreach (RadioButton rdo in grpMouth.Controls.OfType <RadioButton>())
            {
                if (rdo.Checked)
                {
                    mouthCheck = true;
                }
            }

            foreach (RadioButton rdo in grpAccessories.Controls.OfType <RadioButton>())
            {
                if (rdo.Checked)
                {
                    accessoryCheck = true;
                }
            }

            if (backgroundCheck == true && rockTypeCheck == true && eyesCheck == true && mouthCheck == true && accessoryCheck == true)
            {
                writer1.WriteLine(background + DELIM + rockType + DELIM + eyes + DELIM + mouth + DELIM + accessory);

                frmCart frm = new frmCart();

                // Code to pass variables to cart form
                //frm.background = background

                frm.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("You must select an option from each group.");
            }

            writer1.Close();
            outFile1.Close();
        }