Exemplo n.º 1
0
        private void addButtonClick(object sender, EventArgs e)
        {
            FootballerForm footballerForm = new FootballerForm
            {
                Text = Properties.Resources.CreateFootballerFormTitle
            };

            if (footballerForm.ShowDialog() == DialogResult.OK)
            {
                logCountChangeHander?.Invoke(footballers.Count, footballers.Count + 1);
                footballers.Add(footballerForm.ResultFootballer);
                RefillFootballersView();
            }
        }
Exemplo n.º 2
0
        private void editButtonClick(object sender, EventArgs e)
        {
            if (!CorrectSelectedItemForEdit())
            {
                return;
            }
            uint           index          = (uint)footballersDataGridView.SelectedRows[0].Index;
            FootballerForm footballerForm = new FootballerForm(footballers[index].Clone());

            footballerForm.Text = Properties.Resources.EditFootballerFormTitle;
            if (footballerForm.ShowDialog() == DialogResult.OK)
            {
                if (footballers[index] == footballerForm.ResultFootballer)
                {
                    return;
                }
                footballers[index] = footballerForm.ResultFootballer;
                RefillFootballersView();
            }
        }