private void btnLuuThongTin_Click(object sender, EventArgs e) { try { ValidateLuu(); if (isInsert) { HocVien.Insert(LoadHocVien(), new TAIKHOAN() { TenDangNhap = txtTenDangNhap.Text, MatKhau = txtMatKhau.Text, }); InitializeHocVien(); MessageBox.Show("Thêm học viên thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { HocVien.Update(LoadHocVien(), new TAIKHOAN() { TenDangNhap = txtTenDangNhap.Text, MatKhau = txtMatKhau.Text, }); InitializeHocVien(); MessageBox.Show("Sửa học viên thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (ArgumentException ex) { MessageBox.Show(ex.Message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }