private void Spisok_LB_SelectedValueChanged(object sender, EventArgs e) { if (Spisok_LB.SelectedItem != null) { Runner runnerDB = Spisok_LB.SelectedItem as Runner; if (runnerDB != null) { Height_TB.Text = runnerDB.Height.ToString(); Weight_TB.Text = runnerDB.Weight.ToString(); Age_TB.Text = runnerDB.Age.ToString(); Name_TB.Text = runnerDB.Name; Surname_TB.Text = runnerDB.Surname; Ranked_TB.Text = runnerDB.Ranked.ToString(); } StateButton(true); } else { Height_TB.Clear(); Weight_TB.Clear(); Age_TB.Clear(); Name_TB.Clear(); Surname_TB.Clear(); Ranked_TB.Clear(); StateButton(false); } }
private void Spisok_LB_SelectedValueChanged(object sender, EventArgs e) { if (Spisok_LB.SelectedItem != null) { Schoolboy SchoolboyDB = Spisok_LB.SelectedItem as Schoolboy; if (SchoolboyDB != null) { Averagerating_TB.Text = SchoolboyDB.Averagerating.ToString(); Age_TB.Text = SchoolboyDB.Age.ToString(); Name_TB.Text = SchoolboyDB.Name; Surname_TB.Text = SchoolboyDB.Surname; Middlename_TB.Text = SchoolboyDB.Middlename; Class_TB.Text = SchoolboyDB.Class.ToString(); Ranked_TB.Text = SchoolboyDB.Ranked.ToString(); } StateButton(true); } else { Averagerating_TB.Clear(); Age_TB.Clear(); Name_TB.Clear(); Surname_TB.Clear(); Middlename_TB.Clear(); Class_TB.Clear(); Ranked_TB.Clear(); StateButton(false); } }