Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if ((comboBox4.SelectedIndex > -1) && (textBox1.Text != null) && (textBox2.Text != null) && (comboBox1.SelectedIndex > -1) && (comboBox2.SelectedIndex > -1) && (textBox3.Text != null) && (comboBox3.SelectedIndex > -1))//textBox4.Text != null && textBox5.Text != null &&
            {
                string result;

                string[] a = new string[2];

                List <string> list = new List <string>();
                list = Diferences(comboBox4.SelectedItem.ToString()); //визначаємо ім'я і призвище обране в комбобоксі
                int j = 0;
                foreach (string i in list)                            //дістаємо в
                {
                    a[j] = i;
                    j++;
                }

                Action.GamerControl gc = new Action.GamerControl();
                result = gc.ModifyGamer(a[0], a[1], textBox1.Text, textBox2.Text, Convert.ToBoolean(comboBox1.SelectedIndex), Convert.ToBoolean(comboBox2.SelectedIndex), Convert.ToDouble(textBox3.Text), comboBox3.SelectedItem.ToString());
                //textBox5.Text, textBox4.Text, list[1],list[2]
                label12.Text = result;
                this.Hide();
            }
            else
            {
                label7.Visible = true;
            }
        }
Пример #2
0
        private void ShowGamer_Load(object sender, EventArgs e)
        {
            listBox1.Text = null;
            Action.GamerControl gc   = new Action.GamerControl();
            List <string>       list = new List <string>();

            list = gc.ShowGamer();
            string [] lists = list.ToArray <string>();
            listBox1.Items.AddRange(lists);
        }
Пример #3
0
        public void AddValues()
        {
            Action.GamerControl gc = new Action.GamerControl();
            List <string>       st = new List <string>();

            st = gc.StadionReturning();
            int j = 0;

            foreach (string i in st)
            {
                comboBox3.Items.Insert(j, i);
                j++;
            }
        }
Пример #4
0
        public void ShowGemersInComboBox()
        {
            Action.GamerControl gc   = new Action.GamerControl();
            List <string>       fnst = new List <string>();
            List <string>       snst = new List <string>();

            fnst = gc.GamerFirstNameReturning();
            snst = gc.GamerSecondNameReturning();
            int j = 0;

            foreach (string i in fnst)
            {
                comboBox4.Items.Insert(j, i + " " + snst[j]);
                j++;
            }
        }
Пример #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if ((comboBox4.SelectedIndex > -1))
            {
                List <string> list = new List <string>();
                list = Diferences(comboBox4.SelectedItem.ToString());//визначаємо ім'я і призвище обране в комбобоксі

                Action.GamerControl gc = new Action.GamerControl();
                gc.DeleteGamer(list.ElementAt(0), list.ElementAt(1));
                this.Hide();
            }
            else
            {
                label7.Visible = true;
            }
        }
Пример #6
0
        private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
        {
            // повернення значень гравця в поля для зміни
            List <string> list = new List <string>();

            list = Diferences(comboBox4.SelectedItem.ToString());//визначаємо ім'я і призвище обране в комбобоксі

            Action.GamerControl gm     = new Action.GamerControl();
            List <string>       values = new List <string>();

            values = gm.ReturnValues(list.ElementAt(0), list.ElementAt(1));

            textBox1.Text = list.ElementAt(0);
            textBox2.Text = list.ElementAt(1);
            textBox3.Text = values.ElementAt(2);

            if (Convert.ToBoolean(Convert.ToBoolean(values.ElementAt(4)) == false))
            {
                comboBox1.SelectedIndex = 0;
            }
            else
            {
                comboBox1.SelectedIndex = 1;
            }
            if (Convert.ToBoolean(Convert.ToBoolean(values.ElementAt(3))) == false)
            {
                comboBox2.SelectedIndex = 0;
            }
            else
            {
                comboBox2.SelectedIndex = 1;
            }
            for (int i = 0; i < comboBox3.Items.Count; i++)
            {
                if (comboBox3.Items[i].ToString() == values.ElementAt(5))
                {
                    comboBox3.SelectedIndex = i;
                }
            }
            //comboBox3.SelectedItem = values.ElementAt(5);
        }