private void barbtnInDanhSachDuThi_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (grdDanhSachDuThi.DataSource != null) { CreateWaitDialog("Đang tải dữ liệu, xin vui lòng chờ!", "Xuất báo cáo"); DataTable dt = oBKQHT_ToChucThi.GetDanhSachDuThi_TotNghiep(KQHT_ToChucThiID); if (dt.Rows.Count > 0) { string HoVa = ""; foreach (DataRow dr in dt.Rows) { dr["Ten"] = GetTen(dr["HoVaTen"].ToString(), ref HoVa); dr["HoVa"] = HoVa; } frmReport frm = new frmReport(dt, "rDanhSachDuThi_TotNghiep"); frm.Show(); CloseWaitDialog(); } else { CloseWaitDialog(); ThongBao("Không có dữ liệu để in báo cáo."); } } else { ThongBao("Bạn phải chọn khóa học."); } }
private void btnInDsKhongDuDK_Click(object sender, EventArgs e) { if (cmbKhoaHoc.EditValue != null) { CreateWaitDialog("Đang tải dữ liệu, xin vui lòng chờ!", "Xuất báo cáo"); GetpLopInfo(); pDM_LopInfo.DM_LopID = cmbLop.EditValue == null ? 0 : int.Parse(cmbLop.EditValue.ToString()); DataTable dt = oBSV_SinhVien.GetDanhSachKhongDuThiTotNghiep(pDM_LopInfo, Program.NamHoc, Program.IDNamHoc); if (dt.Rows.Count > 0) { dt.Columns.Add("TenKhoaHoc", typeof(string)); dt.Rows[0]["TenKhoaHoc"] = cmbTrinhDo.Text + " " + cmbKhoaHoc.Text; frmReport frm = new frmReport(dt, "rDanhSachKhongDuDieuKienDuThiTotNghiep"); frm.Show(); CloseWaitDialog(); } else { CloseWaitDialog(); ThongBao("Không có dữ liệu để in báo cáo."); } } else { ThongBao("Bạn phải chọn khóa học."); } }
private void btnInGiayBao_Click(object sender, EventArgs e) { if (grvSVTrungTuyen != null && grvSVTrungTuyen.DataRowCount > 0) { if (cmbTrinhDo.ItemIndex >= 0 && cmbKhoaHoc.ItemIndex >= 0) { DataTable dtTrungTuyen = dtSinhVien.Clone(); for (int i = 0; i < grvSVTrungTuyen.DataRowCount; i++) { dtTrungTuyen.ImportRow(grvSVTrungTuyen.GetDataRow(i)); } oBSV_SinhVienNhapTruong.XuLyGiayBao(ref dtTrungTuyen, Program.NamHoc, cmbTrinhDo.Text + " - Khóa: " + cmbKhoaHoc.Text); frmReport frm = new frmReport(dtTrungTuyen, "rGiayBaoNhapHoc"); frm.Show(); } else { ThongBao("Bạn cần chọn Trình độ và khóa học."); } } else { ThongBao("Chưa có sinh viên nào trong danh sách."); } }
private void btnInDanhSach_Click(object sender, EventArgs e) { if (cmbLoaiThuChi.EditValue != null && grvTongHop.DataRowCount > 0) { DataTable dtReport = dtTongHop.Copy(); dtReport.Columns.Add("TenLoaiThuChi", typeof(string)); dtReport.Columns.Add("NoiDungBaoCao", typeof(string)); dtReport.Columns.Add("HeTrinhDo", typeof(string)); dtReport.Columns.Add("TongTienBangChu", typeof(string)); dtReport.Rows[0]["TenLoaiThuChi"] = cmbLoaiThuChi.Text.ToUpper(); if (rdDanhSach.EditValue.ToString() == "0") { dtReport.Rows[0]["NoiDungBaoCao"] = "Từ " + dtpTuNgay.Text + " đến " + dtpDenNgay.Text; } else if (rdDanhSach.EditValue.ToString() == "1") { dtReport.Rows[0]["NoiDungBaoCao"] = "Học kỳ: " + Program.HocKy.ToString() + " - Năm học: " + Program.NamHoc; } else { dtReport.Rows[0]["NoiDungBaoCao"] = "Năm học: " + Program.NamHoc; } string HeTrinhDo = ""; if (ucLocHeTrinhDo.cmbHe.EditValue != null) { HeTrinhDo = "HỆ: " + ucLocHeTrinhDo.cmbHe.Text.ToUpper(); } if (ucLocHeTrinhDo.cmbTrinhDo.EditValue != null) { HeTrinhDo += (HeTrinhDo == "" ? "TRÌNH ĐỘ: " : " - TRÌNH ĐỘ: ") + ucLocHeTrinhDo.cmbTrinhDo.Text.ToUpper(); } if (cmbCoSo.EditValue != null) { HeTrinhDo += (HeTrinhDo == "" ? "TẠI: " : " - TẠI: ") + cmbCoSo.Text.ToUpper(); } dtReport.Rows[0]["HeTrinhDo"] = HeTrinhDo; Lib.clsStringHelper cls = new Lib.clsStringHelper(); dtReport.Rows[dtReport.Rows.Count - 1]["TongTienBangChu"] = cls.ReadMoney(TongThu) + " đồng."; frmReport frm = new frmReport(dtReport, dtReport, "rBangKeThuChi", "rBangTongHopThuChi", new string[] { "Subreport1" }); frm.Show(); } else { ThongBao("Chưa chọn loại thu chi."); } }
private void btnInDanhSach_Click(object sender, EventArgs e) { if (dtSinhVien != null) { DataTable dtReport = dtSinhVien.Copy(); dtReport.Columns.Add("NoiDungBaoCao", typeof(string)); dtReport.Columns.Add("HeTrinhDo", typeof(string)); dtReport.Rows[0]["NoiDungBaoCao"] = "Học kỳ: " + Program.HocKy.ToString() + " - Năm học: " + Program.NamHoc; string HeTrinhDo = ""; if (cmbHe.EditValue != null) { HeTrinhDo = "HỆ: " + cmbHe.Text.ToUpper(); } if (cmbTrinhDo.EditValue != null) { HeTrinhDo += HeTrinhDo == "" ? "" : " - TRÌNH ĐỘ: " + cmbTrinhDo.Text.ToUpper(); } dtReport.Rows[0]["HeTrinhDo"] = HeTrinhDo; frmReport frm = new frmReport(dtReport, dtReport, "rDanhSachXetHocBongChiTiet", "rDanhSachXetHocBong", new string[] { "Subreport1" }); frm.Show(); } }
private void btnInBangDiem_Click(object sender, EventArgs e) { if (grvLichSu.FocusedRowHandle < 0) { ThongBao("Bạn chưa chọn lần nhập lại điểm nào !"); return; } // Lấy danh sách sinh viên dtSinhVien = CreateTable(); AddBand(); XuLyTable((int)grvLichSu.GetDataRow(grvLichSu.FocusedRowHandle)["KQHT_ChoNhapLaiDiemID"]); if (dtSinhVien.Rows.Count <= 0) { ThongBao("Không có dữ liệu để in báo cáo !"); return; } DataTable dtMain = oBKQHT_DiemThanhPhan.CreateTableReportMain(); DataRow dr = dtMain.NewRow(); dr["TenMonHoc"] = drMonHoc["TenMonHoc"]; dr["TenLop"] = pDM_LopInfo.TenLop.Replace("Lớp: ", ""); dr["HocKy"] = Program.HocKy; dr["NamHoc"] = Program.NamHoc; dr["SoTiet"] = drMonHoc["SoTiet"]; #region Tổng hợp Xếp loại // Đưa dữ liệu phần tỷ lệ kết quả học tập DataTable dtXepLoai; cBKQHT_XepLoaiMonHoc oBKQHT_XepLoaiMonHoc = new cBKQHT_XepLoaiMonHoc(); KQHT_XepLoaiMonHocInfo pKQHT_XepLoaiMonHocInfo = new KQHT_XepLoaiMonHocInfo(); int SoSinhVien; dtXepLoai = oBKQHT_XepLoaiMonHoc.Get(pKQHT_XepLoaiMonHocInfo); //dr = dtMain.NewRow(); SoSinhVien = dtSinhVien.Rows.Count; // Tỷ lệ giỏi string Condition = ""; int SoLuong = 0; DataRow[] ArrDr = dtXepLoai.Select("MaXepLoai = 'G'"); if (ArrDr.Length > 0) { Condition = "IDKQHT_XepLoai_1 = " + ArrDr[0]["KQHT_XepLoaiMonHocID"]; //foreach (DataRow drXL in ArrDr) //{ // Condition += (Condition == "" ? "" : " OR ") + "IDKQHT_XepLoai_1 = " + drXL["KQHT_XepLoaiMonHocID"]; //} SoLuong = int.Parse(dtSinhVien.Compute("Count(SV_SinhVienID)", Condition).ToString()); dr["LoaiGioi"] = TinhPhanTram(SoLuong, SoSinhVien); } // Tỷ lệ khá ArrDr = dtXepLoai.Select("MaXepLoai = 'K'"); if (ArrDr.Length > 0) { Condition = "IDKQHT_XepLoai_1 = " + ArrDr[0]["KQHT_XepLoaiMonHocID"]; //foreach (DataRow drXL in ArrDr) //{ // Condition += (Condition == "" ? "" : " OR ") + "IDKQHT_XepLoai_1 = " + drXL["KQHT_XepLoaiMonHocID"]; //} SoLuong = int.Parse(dtSinhVien.Compute("Count(SV_SinhVienID)", Condition).ToString()); dr["LoaiKha"] = TinhPhanTram(SoLuong, SoSinhVien); } // Tỷ lệ trung bình ArrDr = dtXepLoai.Select("MaXepLoai = 'TB'"); if (ArrDr.Length > 0) { Condition = "IDKQHT_XepLoai_1 = " + ArrDr[0]["KQHT_XepLoaiMonHocID"]; //foreach (DataRow drXL in ArrDr) //{ // Condition += (Condition == "" ? "" : " OR ") + "IDKQHT_XepLoai_1 = " + drXL["KQHT_XepLoaiMonHocID"]; //} SoLuong = int.Parse(dtSinhVien.Compute("Count(SV_SinhVienID)", Condition).ToString()); dr["LoaiTrungBinh"] = TinhPhanTram(SoLuong, SoSinhVien); } // Tỷ lệ yếu ArrDr = dtXepLoai.Select("MaXepLoai = 'Y'"); if (ArrDr.Length > 0) { Condition = "IDKQHT_XepLoai_1 = " + ArrDr[0]["KQHT_XepLoaiMonHocID"]; //foreach (DataRow drXL in ArrDr) //{ // Condition += (Condition == "" ? "" : " OR ") + "IDKQHT_XepLoai_1 = " + drXL["KQHT_XepLoaiMonHocID"]; //} SoLuong = int.Parse(dtSinhVien.Compute("Count(SV_SinhVienID)", Condition).ToString()); dr["LoaiYeu"] = TinhPhanTram(SoLuong, SoSinhVien); } // Tỷ lệ kém ArrDr = dtXepLoai.Select("MaXepLoai = 'KM'"); if (ArrDr.Length > 0) { Condition = "IDKQHT_XepLoai_1 = " + ArrDr[0]["KQHT_XepLoaiMonHocID"]; //foreach (DataRow drXL in ArrDr) //{ // Condition += (Condition == "" ? "" : " OR ") + "IDKQHT_XepLoai_1 = " + drXL["KQHT_XepLoaiMonHocID"]; //} Condition += " OR IDKQHT_XepLoai_1 = 0"; SoLuong = int.Parse(dtSinhVien.Compute("Count(SV_SinhVienID)", Condition).ToString()); dr["LoaiKem"] = TinhPhanTram(SoLuong, SoSinhVien); } dtMain.Rows.Add(dr); #endregion DataTable dtSub = oBKQHT_DiemThanhPhan.CreateTableReportSub_CDCNKT(dtSinhVien, dtThanhPhan, ColStart, IDKQHT_ThanhPhanTBHS); frmReport frm = new frmReport(dtMain, dtSub, "rBangKetQuaHocTap", "rBangKetQuaHocTapSub", new string[] { "SubReport1" }); frm.Show(); }