Exemplo n.º 1
0
 private void lsbCoaches_SelectedIndexChanged(object sender, EventArgs e)
 {
     if ((Coach)lsbCoaches.SelectedItem != null)
     {
         Coach coach = (Coach)lsbCoaches.SelectedItem;
         lblCoachInfo.Text = coach.ToString();
     }
     else
     {
         lblCoachInfo.Text = "No coach selected.";
     }
 }
Exemplo n.º 2
0
        private void btnAssignClub_Click(object sender, EventArgs e)
        {
            Coach coach = (Coach)lsbCoaches.SelectedItem;

            if (coach != null)
            {
                AssignClubForm frmAssignClub = new AssignClubForm(coach);
                DialogResult   dr            = frmAssignClub.ShowDialog(this);

                if (dr == DialogResult.OK)
                {
                    lblCoachInfo.Text = coach.ToString();
                    RefreshData();
                }
            }
            else
            {
                lblCoachInfo.Text = "No coach selected.";
            }
        }
Exemplo n.º 3
0
        private void GetCoachById()
        {
            PrintSpecial(Label("GET COACH BY ID"));

            try
            {
                Print("Id of the coach:");
                int id = int.Parse(Console.ReadLine());
                Print("");

                Coach coach = coachService.GetCoachById(id);

                Print(coach.ToString());
            }
            catch (ArgumentException)
            {
                Print("Coach not found.");
            }
            catch (Exception)
            {
                Print(SomethingWentWrong());
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Display all data about a Coach
 /// </summary>
 private void DisplayCoach(Coach coach)
 {
     // Display a Coach's data
     Console.Clear();
     Console.WriteLine(coach.ToString());
 }