private void cboTim_SelectedIndexChanged(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); sv.Ma_Lop = cboTim.Text.ToString(); dgvDSSV.DataSource = SinhVienBUS.LayDSSVLop(sv.Ma_Lop); }
public frmQL_CTXH_HDRL() { ktButton = frmMain.ktButtonClick; ctxhBUS = new CTXHBUS(); rlBUS = new RenLuyenBUS(); svBUS = new SinhVienBUS(); dsCTXHBUS = new DSSV_CTXHBUS(); dsRLBUS = new DSSV_RLBUS(); InitializeComponent(); kiemTra(); Clear(); this.txtNhapMaSV.AutoCompleteMode = AutoCompleteMode.Suggest; this.txtNhapMaSV.AutoCompleteSource = AutoCompleteSource.CustomSource; var lstMSSV = svBUS.getMSSV(); AutoCompleteStringCollection AutoComp = new AutoCompleteStringCollection(); foreach (var sv in lstMSSV) { AutoComp.Add(sv); } this.txtNhapMaSV.AutoCompleteCustomSource = AutoComp; }
private void frmCapNhatSinhVien_Load(object sender, EventArgs e) { try { //grid control nguon = SinhVienBUS.DanhSachSV(); gridControl1.DataSource = nguon; gridView1.ExpandAllGroups(); //cmbLop LayNguonChoLop(); //Bingding data txtMSSV.DataBindings.Clear(); txtMSSV.DataBindings.Add("Text", nguon, "MSSV"); txtHoTen.DataBindings.Clear(); txtHoTen.DataBindings.Add("Text", nguon, "HoTen"); dateNgaySinh.DataBindings.Clear(); dateNgaySinh.DataBindings.Add("DateTime", nguon, "NgaySinh"); cmbLop.DataBindings.Clear(); cmbLop.DataBindings.Add("EditValue", nguon, "MaLop"); txtDiaChi.DataBindings.Clear(); txtDiaChi.DataBindings.Add("Text", nguon, "DiaChi"); } catch (Exception ex) { ExceptionUtil.ThrowMsgBox(ex.Message); } }
public frmQL_VP() { vpBUS = new ViPhamBUS(); svBUS = new SinhVienBUS(); InitializeComponent(); LoadData(); }
public frmTKDiemThi() { dtBUS = new DIemThiBUS(); svBUS = new SinhVienBUS(); InitializeComponent(); if (frmMain.user.LoaiUser == "SinhVien") { this.txtNhapMSSV.Text = frmMain.user.Ma; TimThongTin(); this.txtNhapMSSV.Enabled = false; } else { this.txtNhapMSSV.AutoCompleteMode = AutoCompleteMode.Suggest; this.txtNhapMSSV.AutoCompleteSource = AutoCompleteSource.CustomSource; var lstMSSV = svBUS.getMSSV(); AutoCompleteStringCollection AutoComp = new AutoCompleteStringCollection(); foreach (var sv in lstMSSV) { AutoComp.Add(sv); } this.txtNhapMSSV.AutoCompleteCustomSource = AutoComp; } }
public frmTK_HoatDong() { hpBUS = new HocPhanBUS(); svBUS = new SinhVienBUS(); ctxhBUS = new CTXHBUS(); dsCTXHBUS = new DSSV_CTXHBUS(); rlBUS = new RenLuyenBUS(); dsRLBUS = new DSSV_RLBUS(); vpBUS = new ViPhamBUS(); ktButton = frmMain.ktButtonClick; InitializeComponent(); kiemTra(); if (frmMain.user.LoaiUser == "SinhVien") { this.txtNhapMSSV.Text = frmMain.user.Ma; this.txtNhapMSSV.Enabled = false; TimThongTin(); } else { this.txtNhapMSSV.AutoCompleteMode = AutoCompleteMode.Suggest; this.txtNhapMSSV.AutoCompleteSource = AutoCompleteSource.CustomSource; var lstMSSV = svBUS.getMSSV(); AutoCompleteStringCollection AutoComp = new AutoCompleteStringCollection(); foreach (var sv in lstMSSV) { AutoComp.Add(sv); } this.txtNhapMSSV.AutoCompleteCustomSource = AutoComp; } }
private void btnXemTatCa_Click(object sender, EventArgs e) { txtTimKiem.Text = ""; dgv.DataSource = SinhVienBUS.LoadSinhVien(); dgv.Columns[Anh].Visible = false; dgv.Refresh(); dgv.Update(); }
public frmQLDiemThi() { dtBUS = new DIemThiBUS(); hpBUS = new HocPhanBUS(); svBUS = new SinhVienBUS(); InitializeComponent(); LoadData(); }
public frmQuanLyNguoiDung() { gvBUS = new GiangVienBUS(); svBUS = new SinhVienBUS(); tkBUS = new TaiKhoanBUS(); InitializeComponent(); LoadData(); }
protected void ChonLop() { SinhVienDTO sv = new SinhVienDTO(); LopHocDTO lh = new LopHocDTO(); cboChonLop.DataSource = SinhVienBUS.LayDSLopHoc(sv); cboChonLop.DisplayMember = "Ma_Lop"; cboChonLop.ValueMember = "Ma_Lop"; }
public frmSinhVien() { lopBUS = new LopBUS(); cnBUS = new ChuyenNganhBUS(); gvBUS = new GiangVienBUS(); khoaBUS = new KhoaBUS(); svBUS = new SinhVienBUS(); InitializeComponent(); LoadData(); }
public frmTimKiem() { ktButton = frmMain.ktButtonClick; svBUS = new SinhVienBUS(); hpBUS = new HocPhanBUS(); InitializeComponent(); kiemTra(); LoadData(); }
private void txtMSSV_TextChanged(object sender, EventArgs e) { SinhVienDTO sinhVienDTO = SinhVienBUS.GetSinhVienDTO(txtMSSV.Text); if (sinhVienDTO != null) { lblHoTen.Text = sinhVienDTO.HoTen; lblNgaySinh.Text = sinhVienDTO.NgaySinh.ToString("dd/MM/yyyy"); lblCMND.Text = sinhVienDTO.CMND; lblGioiTinh.Text = sinhVienDTO.GioiTinh; lblSoDienThoai.Text = sinhVienDTO.SoDienThoai; lblKhoa.Text = sinhVienDTO.Khoa; lblQueQuan.Text = sinhVienDTO.QueQuan; lblDienUuTien.Text = sinhVienDTO.DienUuTien; lblEmail.Text = sinhVienDTO.Email; try { picAnh.Image = Image.FromFile(MainForm.ThuMucAnh + sinhVienDTO.Anh); } catch { picAnh.Image = null; } } else { lblHoTen.Text = ""; lblNgaySinh.Text = ""; lblCMND.Text = ""; lblGioiTinh.Text = ""; lblSoDienThoai.Text = ""; lblKhoa.Text = ""; lblQueQuan.Text = ""; lblDienUuTien.Text = ""; lblEmail.Text = ""; picAnh.Image = null; } if (CheDoHienTai == CheDo.THEM) { if (!SinhVienBUS.KiemTraSinhVien(txtMSSV.Text)) { lblNotFoundMSSV.Show(); } else { lblNotFoundMSSV.Hide(); } } else { lblNotFoundMSSV.Hide(); } }
private void btnTim_Click(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); sv.Ma_SV = txtTim.Text.ToString(); if (txtTim.Text == "") { MessageBox.Show("Bạn chưa nhập thông tin cần tìm"); } else { dgvDSSV.DataSource = SinhVienBUS.TimKiemMaSV(sv.Ma_SV); } }
private void btnLamMoi_Click(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); LopHocDTO lh = new LopHocDTO(); sv.Ma_Lop = cboTim.Text.ToString(); lh.Ma_Lop = sv.Ma_Lop; string path = Directory.GetCurrentDirectory() + @"\TrainedImages"; string[] files = Directory.GetFiles(path, "*.bmp", SearchOption.AllDirectories); if (cboTim.Text.ToString() != "") { DialogResult dialogResult = MessageBox.Show("Bạn có chắc là làm mới danh sách sinh viên lớp " + sv.Ma_Lop + " ?", "Thông báo", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { SinhVienBUS.LamMoiDSSV(sv); LopHocBUS.CapNhatSoSinhVienKhiLamMoi(lh); foreach (var file in files) { string mssv = file.Split('\\').Last().Split('_')[0]; string lop = file.Split('\\').Last().Split('_')[1]; for (int i = 1; i <= SoKhuonMat; i++) { string[] fileLop = Directory.GetFiles(path, mssv + "_" + sv.Ma_Lop + "_" + i + ".bmp", SearchOption.AllDirectories); foreach (var filelops in fileLop) { if (sv.Ma_Lop == lop) { Debug.WriteLine(filelops); File.Delete(filelops); } } } } LoadDSSV(); ChonLop(); } if (dialogResult == DialogResult.No) { } } else { MessageBox.Show("Bạn Chưa Chọn Lớp !!", "Thông Báo"); } }
private void DSSV_Load(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); sv.Ma_Lop = cboTim.Text.ToString(); dgvDSSV.DataSource = SinhVienBUS.LayDSSVLop(sv.Ma_Lop); btnStop.Enabled = false; btnXoa.Enabled = false; btnCapNhat.Enabled = false; btnSua.Enabled = false; txtHoten.Enabled = false; txtMSSV.Enabled = false; cboLop.Enabled = false; btnThem.Enabled = false; }
private void btnSua_Click(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); sv.Ten_SV = txtHoten.Text.Trim(); sv.Ma_SV = txtMSSV.Text; if (SinhVienBUS.SuaSV(sv)) { MessageBox.Show("Thay đổi thành công"); dgvDSSV.DataSource = SinhVienBUS.TimKiemMaSV(sv.Ma_SV); } else { MessageBox.Show("Thay đổi thất bại"); } }
// report Tim Kiem HocBong public frmReport(string namHoc, int hocKy, int ktra) { SinhVienBUS svBUS = new SinhVienBUS(); InitializeComponent(); // HB Nhat Lop if (ktra == 1) { ReportDataSource reportDataSource = new ReportDataSource(); reportDataSource.Name = "dsSearchHocBong"; reportDataSource.Value = svBUS.getDSSVHBNhatLop(namHoc, hocKy); reportViewer1.LocalReport.DataSources.Add(reportDataSource); this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpSearchHBNhatLop.rdlc"; } else { // HB Gioi if (ktra == 2) { ReportDataSource reportDataSource = new ReportDataSource(); reportDataSource.Name = "dsSearchHocBong"; reportDataSource.Value = svBUS.getDSSVHBGioi(namHoc, hocKy); reportViewer1.LocalReport.DataSources.Add(reportDataSource); this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpSearchHBGioi.rdlc"; } // HB Kha else { ReportDataSource reportDataSource = new ReportDataSource(); reportDataSource.Name = "dsSearchHocBong"; reportDataSource.Value = svBUS.getDSSVHBGioi(namHoc, hocKy); reportViewer1.LocalReport.DataSources.Add(reportDataSource); this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpSearchHBKha.rdlc"; } } ReportParameter[] rp = new ReportParameter[2]; rp[0] = new ReportParameter("NamHoc", namHoc); rp[1] = new ReportParameter("HocKy", hocKy.ToString()); reportViewer1.LocalReport.SetParameters(rp); }
private void btnXoa_Click(object sender, EventArgs e) { var row = dgv.SelectedRows; if (row.Count > 0) { string MSSV = row[0].Cells[MaSo].Value.ToString(); if (SinhVienBUS.XoaSinhVien(MSSV)) { MessageBox.Show("Xóa thành công sinh viên " + MSSV); } else { MessageBox.Show("Xóa thất bại sinh viên " + MSSV, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } } btnXemTatCa_Click(null, null); }
private void btnDiemDanhTC_Click(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); sv.Ma_SV = txtDiemDanhTC.Text; sv.SoNgayHoc = 1; sv.SoNgayVang = 0; if (SinhVienBUS.CapNhatChuyenCan(sv)) { MessageBox.Show("Điểm danh thành công"); txtDiemDanhTC.Text = ""; } else { MessageBox.Show("Sinh viên không tồn tại"); txtDiemDanhTC.Text = ""; } }
// Report DSSV public frmReport(string maKhoa, string maChuyenNganh, string maLop) { InitializeComponent(); SinhVienBUS svBUS = new SinhVienBUS(); ReportDataSource reportDataSource = new ReportDataSource(); reportDataSource.Name = "dsSinhVien"; reportDataSource.Value = svBUS.getSVTheoMaLop(maLop); reportViewer1.LocalReport.DataSources.Add(reportDataSource); this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpDSSVTheoMaLop.rdlc"; ReportParameter[] rp = new ReportParameter[3]; rp[0] = new ReportParameter("MaLop", maLop); rp[1] = new ReportParameter("MaChuyenNganh", maChuyenNganh); rp[2] = new ReportParameter("MaKhoa", maKhoa); reportViewer1.LocalReport.SetParameters(rp); }
public frmQLHocPhi() { dtBUS = new DIemThiBUS(); svBUS = new SinhVienBUS(); InitializeComponent(); this.txtMSSV.AutoCompleteMode = AutoCompleteMode.Suggest; this.txtMSSV.AutoCompleteSource = AutoCompleteSource.CustomSource; var lstMSSV = svBUS.getMSSV(); AutoCompleteStringCollection AutoComp = new AutoCompleteStringCollection(); foreach (var sv in lstMSSV) { AutoComp.Add(sv.MaSV); } this.txtMSSV.AutoCompleteCustomSource = AutoComp; }
private void TaoMa() { try { string lop = cmbLop.EditValue.ToString(); string dinhDang = lop.Substring(0, 1) + lop.Substring(4, 2); if (dinhDang[0] == 'D') { dinhDang = dinhDang.Insert(3, (int.Parse(lop.Substring(2, 2)) - 1).ToString()); } else { dinhDang = dinhDang.Insert(3, (int.Parse(lop.Substring(2, 2)) - 25).ToString()); } txtMSSV.Text = SinhVienBUS.SinhMa(dinhDang); } catch (Exception ex) { throw ex; } }
private void btnXoa_Click(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); LopHocDTO lh = new LopHocDTO(); sv.Ma_SV = txtMSSV.Text; sv.Ma_Lop = cboLop.Text; lh.Ma_Lop = sv.Ma_Lop; lh.SoSinhVien = 1; DialogResult dialogResult = MessageBox.Show("Bạn có chắc là muốn xóa không ?", "Thông báo", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { if (SinhVienBUS.XoaSV(sv)) { for (int i = 1; i <= SoKhuonMat; i++) { string path = Directory.GetCurrentDirectory() + @"\TrainedImages"; string[] files = Directory.GetFiles(path, txtMSSV.Text + "_" + cboLop.Text + "_" + i + ".bmp", SearchOption.AllDirectories); foreach (var file in files) { File.Delete(file); Debug.WriteLine(file + "test" + files.Length); } } LopHocBUS.CapNhatSoSinhVienKhiXoa(lh); MessageBox.Show("Xóa thành công"); XoaForm(); dgvDSSV.DataSource = SinhVienBUS.LayDSSVLop(sv.Ma_Lop); } else { MessageBox.Show("Xóa Thất bại"); } } else if (dialogResult == DialogResult.No) { } }
private void toolStripMenuXoa_Click(object sender, EventArgs e) { try { if (MsgboxUtil.YesNo("Bạn muốn xóa sinh viên " + txtMSSV.Text + "?") == DialogResult.Yes) { int[] i = gridView1.GetSelectedRows(); if (i.Length > 0) { string mssv = gridView1.GetRowCellDisplayText(i[0], "MSSV"); gridView1.DeleteRow(i[0]); SinhVienBUS.Xoa(mssv); StaticClass.LuuThayDoi(); StaticClass.Log.GhiFile("Xóa sinh viên " + txtMSSV.Text); } } } catch (Exception ex) { ExceptionUtil.ThrowMsgBox(ex.Message); } }
private void btnImportFromExcel_Click(object sender, EventArgs e) { try { OpenFileDialog open = new OpenFileDialog(); open.Filter = "Excel 2007-2010 (*.xlsx)|*.xlsx|All file (*.*)|*.*"; open.Multiselect = false; if (open.ShowDialog() == DialogResult.OK) { if (tenBang == "SinhVien") { SinhVienBUS.NhapTuExcel(open.FileName); } this.lsvTables.Items[0].Selected = true; StaticClass.Log.GhiFile("Import dữ liệu vào bảng SinhVien từ file: " + open.FileName); } } catch (Exception ex) { ExceptionUtil.ThrowMsgBox(ex.Message); } }
private void btnTim_Click(object sender, EventArgs e) { SinhVienDTO sv = new SinhVienDTO(); sv.Ma_SV = txtTim.Text.ToString(); sv.Ma_Lop = cboTim.Text; if (txtTim.Text == "") { MessageBox.Show("Bạn chưa nhập thông tin cần tìm"); } else { if (SinhVienBUS.TimKiemMaSV(sv.Ma_SV) != null) { dgvDS.DataSource = SinhVienBUS.TimKiemMaSVCoHinh(sv.Ma_SV); } else { MessageBox.Show("Sinh viên không tồn tại"); } } }
private void simpleButton1_Click(object sender, EventArgs e) { try { SinhVien sv = new SinhVien(); if (TaoMoi(sv)) { frmMatKhau frm = new frmMatKhau(); frm.truyen += new frmMatKhau.TruyenMatKhau(GetMatKhau); if (frm.ShowDialog() == DialogResult.OK) { NguoiDung user = new NguoiDung() { TenDangNhap = sv.MSSV.ToLower(), MatKhau = UtilitiesClass.MaHoaMD5(_matKhau), TenNguoiDung = sv.HoTen, Quyen = (int)QuyenNguoiDung.SinhVien, MoTaQuyen = "Sinh viên" }; NguoiDungBUS.Them(user); SinhVienBUS.Them(sv); StaticClass.LuuThayDoi(); log.GhiFile("Thêm mới sinh viên: " + sv.MSSV); MsgboxUtil.Success("Thành công"); ClearText(); TaoMa(); } else { MsgboxUtil.Exclamation("Không thể thêm sinh viên khi chưa thiết lập mật khẩu"); } } } catch (Exception ex) { ExceptionUtil.ThrowMsgBox(ex.Message); } }
// Report Tim Kiem Canh Bao public frmReport(int ktra) { SinhVienBUS svBUS = new SinhVienBUS(); InitializeComponent(); ReportDataSource reportDataSource = new ReportDataSource(); // Canh Bao Hoc Vu if (ktra == 4) { reportDataSource.Name = "dsSearchCBHV"; reportDataSource.Value = svBUS.getDSSVCanhBaoHV(); reportViewer1.LocalReport.DataSources.Add(reportDataSource); this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpSearchCBHV.rdlc"; } else { // Diem CTXH if (ktra == 5) { reportDataSource.Name = "dsSearchSVThieuDiemCTXH"; reportDataSource.Value = svBUS.getSVThieuDiemCTXH(); reportViewer1.LocalReport.DataSources.Add(reportDataSource); this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpSearchSVThieuDiemCTXH.rdlc"; } // No Hoc Phi SV Toan truong else { reportDataSource.Name = "dsSearchSVNoHP"; reportDataSource.Value = svBUS.getSVNoHocPhi(); reportViewer1.LocalReport.DataSources.Add(reportDataSource); this.reportViewer1.LocalReport.ReportEmbeddedResource = "GUI.ReportViews.rpSearchSVNoHP.rdlc"; } } }
public frmQLHocPhan() { mhBUS = new MonHocBUS(); hpBUS = new HocPhanBUS(); svBUS = new SinhVienBUS(); dtBUS = new DIemThiBUS(); gvBUS = new GiangVienBUS(); InitializeComponent(); LoadData(); this.txtMaSV.AutoCompleteMode = AutoCompleteMode.Suggest; this.txtMaSV.AutoCompleteSource = AutoCompleteSource.CustomSource; var lstMSSV = svBUS.getMSSV(); AutoCompleteStringCollection AutoComp = new AutoCompleteStringCollection(); foreach (var sv in lstMSSV) { AutoComp.Add(sv); } this.txtMaSV.AutoCompleteCustomSource = AutoComp; }