public void HienThiSV(int vitri) { CSinhVien sv = (CSinhVien)arrSV[vitri]; txtMSV.Text = sv.MSV; txtHT.Text = sv.HT; dtpNS.Value = sv.NS; txtT.Text = sv.Tuoi().ToString(); chkGT.Checked = sv.GT; lblImg.Image = (sv.GT == true ? imageList1.Images[1] : imageList1.Images[0]); txtML.Text = sv.ML; }
private void btnSua_Click(object sender, EventArgs e) { CSinhVien sv = (CSinhVien)arrSV[ipos]; sv.MSV = txtMSV.Text; sv.HT = txtHT.Text; sv.NS = dtpNS.Value; txtT.Text = sv.Tuoi().ToString(); sv.GT = chkGT.Checked; sv.ML = txtML.Text; HienThiDSSV(); }
private void btnThem_Click(object sender, EventArgs e) { CSinhVien sv = new CSinhVien(); sv.MSV = txtMSV.Text; sv.HT = txtHT.Text; sv.NS = dtpNS.Value; txtT.Text = sv.Tuoi().ToString(); sv.GT = chkGT.Checked; sv.ML = txtML.Text; arrSV.Add(sv); ipos++; HienThiDSSV(); ClearInput(); }