protected void btnUpdate_Click(object sender, EventArgs e) { //HocSinhDAO.HocSinhDTO hsdto = new HocSinhDAO.HocSinhDTO(); SSM_Service.HocSinhDTO hsdto = new SSM_Service.HocSinhDTO(); hsdto.MaHS = lblmahs.Text.ToString(); hsdto.HoTen = txthoten.Text.ToString(); if (ckbgioitinh.Checked == true) { hsdto.GioiTinh = 1; } else hsdto.GioiTinh = 0; hsdto.SoDienThoai = txtsodienthoai.Text.ToString(); hsdto.HoTenCha = txthotencha.Text.ToString(); hsdto.NgheNghiepCha = txtnghenghiepcha.Text.ToString(); hsdto.HoTenMe = txthotenme.Text.ToString(); hsdto.NgheNghiepMe = txtnghenghiepme.Text.ToString(); hsdto.DiaChi = txtdiachi.Text.ToString(); hsdto.NgaySinh = txtDate.Text.ToString(); if (hsbus.UpdateHS(hsdto) > 0) { Response.Write("<script>alert('Sửa thành công !')</script>"); // Response.Redirect("QuanlyHS.aspx"); } }
protected void btnluuthongtin_Click(object sender, EventArgs e) { //HocSinhDAO.HocSinhDTO hsdto = new HocSinhDAO.HocSinhDTO(); SSM_Service.HocSinhDTO hsdto = new SSM_Service.HocSinhDTO(); hsdto.MaHS = txtmahs.Text.ToString() + lblmahs.Text.ToString(); hsdto.HoTen = txthoten.Text.ToString(); if (ckbgioitinh.Checked == true) { hsdto.GioiTinh = 1; } else hsdto.GioiTinh = 0; hsdto.SoDienThoai = txtsodienthoai.Text.ToString(); hsdto.HoTenCha = txthotencha.Text.ToString(); hsdto.NgheNghiepCha = txthotencha.Text.ToString(); hsdto.HoTenMe = txthotenme.Text.ToString(); hsdto.NgheNghiepMe = txtnghenghiepme.Text.ToString(); hsdto.DiaChi = txtdiachi.Text.ToString(); hsdto.NgaySinh = txtDate.Text; //HocSinhBUS hsbus = new HocSinhBUS(); int result = hsbus.Insert(hsdto); if (result > 0) { Response.Write("<script>alert('Insert " + " successful !')</script>"); } else { Response.Write("<script>alert('Insert " + "dfa !')</script>"); } Response.Redirect("ThemHocSinh.aspx"); }