public FThemSinhVien(string strMaSV) { InitializeComponent(); this.strMaSV = strMaSV; txtMaSinhVien.Enabled = false; btnThem.Enabled = false; txtMaSinhVien.Text = strMaSV; DataTable tb = new DataTable(); tb = CSinhVien_BLL.loadSinhVienInfor(strMaSV); txtHoTen.Text = tb.Rows[0]["HoTen"].ToString(); txtDiaChi.Text = tb.Rows[0]["DiaChi"].ToString(); txtThongTinKhac.Text = tb.Rows[0]["CacThongTin"].ToString(); dtmpNgaySinh.Value = DateTime.Parse(tb.Rows[0]["NgaySinh"].ToString()); picImageSV.Image = convertDataToImage(tb.Rows[0]["HinhAnh"].ToString()); if (tb.Rows[0]["GioiTinh"].ToString() == "True") { rdoNam.Checked = true; rdoNam.Select(); rdoNu.Checked = false; } else { rdoNam.Checked = false; rdoNu.Checked = true; rdoNu.Select(); } }
private void sửaThôngTinToolStripMenuItem_Click(object sender, EventArgs e) { FThemSinhVien frmSuaThongTin = new FThemSinhVien(strMaSV); frmSuaThongTin.StartPosition = FormStartPosition.CenterParent; frmSuaThongTin.ShowDialog(); lblTenSV.Text = CSinhVien_BLL.loadTenSinhVien(strMaSV); FMainForm_SizeChanged(this, new EventArgs()); }
//MonHoc private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { strMaMon = comboBox1.SelectedValue.ToString(); ReportParameter rparameter = new ReportParameter("HoTenSV", CSinhVien_BLL.loadTenSinhVien(strMaSV)); reportViewerDiem.LocalReport.SetParameters(rparameter); // = new ReportDataSource("dsDiem", CDiemSo_BLL.loadDSDiemMon(strMaSV, strMaMon, strMaHK)); reportDiemBindingSource.DataSource = CDiemSo_BLL.loadDSDiemMon(strMaSV, strMaMon, strMaHK); //this.reportViewerDiem.LocalReport.DataSources.Add(reportDiemBindingSource); this.reportViewerDiem.RefreshReport(); }
private void btnSua_Click(object sender, EventArgs e) { if (CSinhVien_BLL.suaSinhVien(strMaSV, txtHoTen.Text, rdoNam.Checked, dtmpNgaySinh.Value.Date, txtDiaChi.Text, txtThongTinKhac.Text, convertImageToData(picImageSV.Image))) { MessageBox.Show("Sửa Thành công."); this.Close(); } else { MessageBox.Show("Sửa Thất bại."); } }
private void btnThem_Click(object sender, EventArgs e) { this.strMaSV = txtMaSinhVien.Text; if (CSinhVien_BLL.themSinhVien(strMaSV, txtHoTen.Text, rdoNam.Checked, dtmpNgaySinh.Value.Date, txtDiaChi.Text, txtThongTinKhac.Text, convertImageToData(picImageSV.Image))) { #region Tạo account để sử dụng FDangKyTaiKhoan frmDangKyTaiKhoan = new FDangKyTaiKhoan(strMaSV); frmDangKyTaiKhoan.StartPosition = FormStartPosition.CenterParent; frmDangKyTaiKhoan.ShowDialog(); #endregion this.Close(); } else { MessageBox.Show("Thêm Thất bại."); } }
private void tmiDangNhap_Click(object sender, EventArgs e) { bool bCheck = CAccountSinhVien_BLL.checkAccount(ttxtTaiKhoan.Text, ttxtMatKhau.Text); if (bCheck == false) { MessageBox.Show("Đăng nhập thất bại."); bDangNhapThanhCong = false; return; } frmEmpty.Dispose(); try { this.ActiveMdiChild.Close(); } catch (Exception) {} bDangNhapThanhCong = true; this.strMaSV = ttxtTaiKhoan.Text; //Tim ten sinh vien lblTenSV.Text = CSinhVien_BLL.loadTenSinhVien(strMaSV); lblTenSV.Location = new Point(this.Size.Width - 75 - lblTenSV.Width, lblTenSV.Location.Y); frmTongQuan = new FTongQuan(strMaSV); frmTongQuan.FormBorderStyle = FormBorderStyle.FixedToolWindow; frmTongQuan.WindowState = FormWindowState.Maximized; frmTongQuan.MdiParent = this; frmTongQuan.Show(); tmiDangNhap.Visible = false; đăngKýToolStripMenuItem.Visible = false; ttxtMatKhau.Visible = false; ttxtTaiKhoan.Visible = false; tmiDangXuatTongQuan.Visible = true; lblTenSV.Visible = true; }