private void TraineeForm_Load(object sender, EventArgs e) { idSelector.Items.Clear(); tn = new Trainee(); var lst = tn.IDList(); foreach (var ls in lst) { idSelector.Items.Add(ls.ToString()); } if (lst.Count != 0) { tn.GetDetail(lst[0]); FillData(tn); this.idSelector.SelectedIndex = 0; } else { MessageBox.Show("No Trainee Record Available", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } }
private void idSelector_SelectedIndexChanged(object sender, EventArgs e) { tn = new Trainee(); tn.GetDetail(int.Parse(idSelector.SelectedItem.ToString())); FillData(tn); }