Esempio n. 1
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     txtIDHocSinh.Text = (HocSinhDAO.IDMax() + 1).ToString();
     lc = LuaChon.Them;
     AnButton();
     UnReadOnly();
     txtHoTen.Text  = "";
     txtSDT.Text    = "";
     txtDiaChi.Text = "";
 }
Esempio n. 2
0
        private void ThemHocSinh()
        {
            HocSinhDTO hs = new HocSinhDTO();

            hs.HoTen     = txtHoTen.Text;
            hs.GioiTinh  = rdbNam.Checked ? "Nam" : "Nữ";
            hs.SDT       = txtSDT.Text;
            hs.NgaySinh  = dtpNgaySinh.Value.ToShortDateString();
            hs.IDLop     = (int)cboLop.SelectedValue;
            hs.DiaChi    = txtDiaChi.Text;
            hs.IDHocSinh = HocSinhDAO.IDMax() + 1;
            HocSinhDAO.ThemHS(hs);
        }