Пример #1
0
        private void Btn_AddTime_Click(object sender, EventArgs e)
        {
            var frm = new frmEditTime(false, null);

            frm.ShowDialog();

            Refresh();
        }
Пример #2
0
        private void Btn_EditTime_Click(object sender, EventArgs e)
        {
            if (lbTimes.SelectedIndex == -1)
            {
                var msgBox = new CustomMsgBox("Ops!", $"Selecione um time para editar.", MessageBoxType.E_OK);
                var result = msgBox.ShowDialog();
                return;
            }

            int id = (int)lbTimes.SelectedItem;

            var frm = new frmEditTime(true, Manager.Instance.dBTimes.Times.Find(x => x.ID == id));

            frm.ShowDialog();

            Refresh();

            int newID = (int)lbTimes.SelectedItem;

            lbAtletas.DataSource = Manager.Instance.dBTimes.Times.Find(x => x.ID == newID).Jogadores.ToArray();
        }