using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Input;

namespace тест
{
    public partial class testirovanie : Form
    {
        string fname, lname, group, course;
        int sum;

        public testirovanie(string f, string l, string g, string c)
        {
            InitializeComponent();

            fname = f;
            lname = l;
            group = g;
            course = c;

            hiddenTabs.Add(tabPage1);
            hiddenTabs.Add(tabPage2);
            hiddenTabs.Add(tabPage3);
            hiddenTabs.Add(tabPage4);
            hiddenTabs.Add(tabPage5);

            tabControl1.TabPages.Remove(tabPage2);
            tabControl1.TabPages.Remove(tabPage3);
            tabControl1.TabPages.Remove(tabPage4);
            tabControl1.TabPages.Remove(tabPage5);

        }
        int v1;
        int v2;
        int v3;
        int v4;
        int v5;

        
        Form1 form1;
        List<TabPage> hiddenTabs = new List<TabPage>();


        private void testirovanie_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked == false)
            {
                if (radioButton2.Checked == true)
                {
                    if (radioButton3.Checked == false)
                    {
                        v1 = 1;
                    }
                    else { v1 = 0; }
                }
                else { v1 = 0; }

            }
            else { v1 = 0; }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked == false)
            {
                if (radioButton2.Checked == true)
                {
                    if (radioButton3.Checked == false)
                    {
                        v1 = 1;
                    }
                    else { v1 = 0; }
                }
                else { v1 = 0; }

            }
            else { v1 = 0; }
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked == false)
            {
                if (radioButton2.Checked == true)
                {
                    if (radioButton3.Checked == false)
                    {
                        v1 = 1;
                    }
                    else { v1 = 0; }
                }
                else { v1 = 0; }

            }
            else { v1 = 0; }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (tabControl1.TabPages.Contains(tabPage1))
            {
                tabControl1.TabPages.Add(hiddenTabs[1]);
                tabControl1.TabPages.Remove(tabPage1);
                return;
            }

            if (tabControl1.TabPages.Contains(tabPage2))
            {
                tabControl1.TabPages.Add(hiddenTabs[2]);
                tabControl1.TabPages.Remove(tabPage2);
                return;
            }
            
            if (tabControl1.TabPages.Contains(tabPage3))
            {
                tabControl1.TabPages.Add(hiddenTabs[3]);
                tabControl1.TabPages.Remove(tabPage3);
                return;
            }

            if (tabControl1.TabPages.Contains(tabPage4))
            {
                tabControl1.TabPages.Add(hiddenTabs[4]);
                tabControl1.TabPages.Remove(tabPage4);
                return;
            }
        }

        private void radioButton4_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton4.Checked == false)
            {
                if (radioButton6.Checked == true)
                {
                    if (radioButton5.Checked == false)
                    {
                        v2 = 1;
                    }
                    else { v2 = 0; }
                }
                else { v2 = 0; }

            }
            else { v2 = 0; }
        }


        private void radioButton6_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton4.Checked == false)
            {
                if (radioButton6.Checked == true)
                {
                    if (radioButton5.Checked == false)
                    {
                        v2 = 1;
                    }
                    else { v2 = 0; }
                }
                else { v2 = 0; }

            }
            else { v2 = 0; }
        }


        private void radioButton5_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton4.Checked == false)
            {
                if (radioButton6.Checked == true)
                {
                    if (radioButton5.Checked == false)
                    {
                        v2 = 1;
                    }
                    else { v2 = 0; }
                }
                else { v2 = 0; }

            }
            else { v2 = 0; }
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void radioButton7_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton8.Checked == false)
            {
                if (radioButton7.Checked == true)
                {
                    if (radioButton9.Checked == false)
                    {
                        v3 = 1;
                    }
                    else { v3 = 0; }
                }
                else { v3 = 0; }

            }
            else { v3 = 0; }
        }

        private void radioButton9_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton8.Checked == false)
            {
                if (radioButton7.Checked == true)
                {
                    if (radioButton9.Checked == false)
                    {
                        v3 = 1;
                    }
                    else { v3 = 0; }
                }
                else { v3 = 0; }

            }
            else { v3 = 0; }
        }

        private void radioButton8_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton8.Checked == false)
            {
                if (radioButton7.Checked == true)
                {
                    if (radioButton9.Checked == false)
                    {
                        v3 = 1;
                    }
                    else { v3 = 0; }
                }
                else { v3 = 0; }

            }
            else { v3 = 0; }
        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void radioButton14_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton15.Checked == false)
            {
                if (radioButton13.Checked == true)
                {
                    if (radioButton14.Checked == false)
                    {
                        v5 = 1;
                    }
                    else { v5 = 0; }
                }
                else { v5 = 0; }

            }
            else { v5 = 0; }
        }

        private void radioButton15_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton15.Checked == false)
            {
                if (radioButton13.Checked == true)
                {
                    if (radioButton14.Checked == false)
                    {
                        v5 = 1;
                    }
                    else { v5 = 0; }
                }
                else { v5 = 0; }

            }
            else { v5 = 0; }
        }

        private void pictureBox5_Click(object sender, EventArgs e)
        {

        }

        private void radioButton13_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton15.Checked == false)
            {
                if (radioButton13.Checked == true)
                {
                    if (radioButton14.Checked == false)
                    {
                        v5 = 1;
                    }
                    else { v5 = 0; }
                }
                else { v5 = 0; }

            }
            else { v5 = 0; }
        }

        private void radioButton12_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton11.Checked == false)
            {
                if (radioButton10.Checked == true)
                {
                    if (radioButton12.Checked == false)
                    {
                        v4 = 1;
                    }
                    else { v4 = 0; }
                }
                else { v4 = 0; }

            }
            else { v4 = 0; }
        }

        private void radioButton10_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton11.Checked == false)
            {
                if (radioButton10.Checked == true)
                {
                    if (radioButton12.Checked == false)
                    {
                        v4 = 1;
                    }
                    else { v4 = 0; }
                }
                else { v4 = 0; }

            }
            else { v4 = 0; }
        }

        private void radioButton11_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton11.Checked == false)
            {
                if (radioButton10.Checked == true)
                {
                    if (radioButton12.Checked == false)
                    {
                        v4 = 1;
                    }
                    else { v4 = 0; }
                }
                else { v4 = 0; }

            }
            else { v4 = 0; }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            sum = v1 + v2 + v3 + v4 + v5;

            result result = new result(fname, lname, group, course, sum, v1, v2, v3, v4, v5);
            result.Show();
            this.Hide();
        }
    }

}
