Exemple #1
0
        private void TeamForm_Load(object sender, EventArgs e)
        {
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            teamds  = callWebService.readTeams();
            coachds = callWebService.readCoachs();

            bindingSource.AllowNew   = true;
            bindingSource.DataSource = teamds;
            bindingSource.DataMember = "Team";
            dataGridView1.DataSource = bindingSource;

            comboBox1.DataSource    = coachds.Coach;
            comboBox1.DisplayMember = "Surname";
            comboBox1.ValueMember   = "Id";

            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                if (column.Name == "Id")
                {
                    column.Visible = false;
                }
            }

            textBox1.DataBindings.Add(new Binding("Text", bindingSource, "Name"));
            textBox2.DataBindings.Add(new Binding("Text", bindingSource, "YearFoundation"));
            textBox3.DataBindings.Add(new Binding("Text", bindingSource, "City"));
            comboBox1.DataBindings.Add(new Binding("SelectedValue", bindingSource, "IdCoach"));

            comboBox2.DataSource    = coachds.Coach;
            comboBox2.DisplayMember = "Surname";
            comboBox2.ValueMember   = "Id";
        }
Exemple #2
0
        private void PlayerForm_Load(object sender, EventArgs e)
        {
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            teamds    = callWebService.readTeams();
            managerds = callWebService.readManagers();
            playerds  = callWebService.readPlayers();

            bindingSource.AllowNew   = true;
            bindingSource.DataSource = playerds;
            bindingSource.DataMember = "Player";
            dataGridView1.DataSource = bindingSource;

            comboBox1.DataSource    = teamds.Team;
            comboBox1.DisplayMember = "Name";
            comboBox1.ValueMember   = "Id";

            comboBox2.DataSource    = managerds.Manager;
            comboBox2.DisplayMember = "Surname";
            comboBox2.ValueMember   = "Id";

            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                if (column.Name == "Id")
                {
                    column.Visible = false;
                }
            }

            textBox1.DataBindings.Add(new Binding("Text", bindingSource, "Name"));
            textBox2.DataBindings.Add(new Binding("Text", bindingSource, "Surname"));
            textBox3.DataBindings.Add(new Binding("Text", bindingSource, "Age"));
            textBox4.DataBindings.Add(new Binding("Text", bindingSource, "NumberOfTeam"));
            comboBox1.DataBindings.Add(new Binding("SelectedValue", bindingSource, "IdTeam"));
            comboBox2.DataBindings.Add(new Binding("SelectedValue", bindingSource, "IdManager"));

            comboBox3.DataSource    = teamds.Team;
            comboBox3.DisplayMember = "Name";
            comboBox3.ValueMember   = "Id";

            comboBox4.DataSource    = managerds.Manager;
            comboBox4.DisplayMember = "Surname";
            comboBox4.ValueMember   = "Id";
        }
Exemple #3
0
        private void CoachForm_Load(object sender, EventArgs e)
        {
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            ds = callWebService.readCoachs();

            bindingSource.AllowNew   = true;
            bindingSource.DataSource = ds;
            bindingSource.DataMember = "Coach";
            dataGridView1.DataSource = bindingSource;

            textBox1.DataBindings.Add(new Binding("Text", bindingSource, "Name"));
            textBox2.DataBindings.Add(new Binding("Text", bindingSource, "Surname"));
            textBox3.DataBindings.Add(new Binding("Text", bindingSource, "NumberOfChampions"));

            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                column.Width = 120;
                if (column.Name == "Id")
                {
                    column.Visible = false;
                }
            }
        }