private void btnBatDau_Click(object sender, EventArgs e) { string strMaSinhVien = txtMaSV.Text.Trim(); SqlDataReader objReader = HocPhiBUL.LoadInfoSinhVien(strMaSinhVien); if (objReader == null) { return; } while (objReader.Read()) { txtHoTen.Text = objReader[0].ToString(); txtMaLop.Text = objReader[1].ToString(); } m_lstHocPhi = HocPhiBUL.LoadHocPhi(strMaSinhVien); if (m_lstHocPhi == null) { return; } m_bdHocPhi = new BindingSource(); m_bdHocPhi.DataSource = m_lstHocPhi; InitializeDataGridView(); }
private void btnGhi_Click(object sender, EventArgs e) { string strMaSinhVien = txtMaSV.Text.Trim(); if (HocPhiBUL.InsertHocPhi(strMaSinhVien, m_lstHocPhi) == false) { MessageBox.Show("Ghi vào database thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } MessageBox.Show("Ghi vào database thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnTaiLai_Click(object sender, EventArgs e) { string strMaSinhVien = txtMaSV.Text.Trim(); m_lstHocPhi = HocPhiBUL.LoadHocPhi(strMaSinhVien); if (m_lstHocPhi == null) { return; } m_bdHocPhi = new BindingSource(); m_bdHocPhi.DataSource = m_lstHocPhi; InitializeDataGridView(); }
private void frmHocPhi_Load(object sender, EventArgs e) { m_lstMaSinhVien = new AutoCompleteStringCollection(); List <SinhVienDTO> lst = HocPhiBUL.LoadSinhVien(); if (lst == null) { return; } for (int i = 0; i < lst.Count; i++) { m_lstMaSinhVien.Add(lst[i].MASV.Trim()); } txtMaSV.AutoCompleteCustomSource = m_lstMaSinhVien; }