Пример #1
0
        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 LapBienLaiThuTien(DataTable dtDinhMuc, int IDSV_SinhVien)
        {
            // Them bien lai thu tien
            pTC_BienLaiThuTienInfo               = new TC_BienLaiThuTienInfo();
            pTC_BienLaiThuTienInfo.GhiChu        = "";
            pTC_BienLaiThuTienInfo.HocKy         = Program.HocKy;
            pTC_BienLaiThuTienInfo.IDDM_NamHoc   = Program.IDNamHoc;
            pTC_BienLaiThuTienInfo.IDHT_NguoiThu = Program.objUserCurrent.HT_UserID;
            pTC_BienLaiThuTienInfo.IDSV_SinhVien = IDSV_SinhVien;
            pTC_BienLaiThuTienInfo.IDDM_Lop      = pDM_LopInfo.DM_LopID;
            pTC_BienLaiThuTienInfo.NgayThu       = DateTime.Now;
            pTC_BienLaiThuTienInfo.NoiDung       = "THU TIỀN HỌC KỲ " + Program.HocKy.ToString() + " NĂM HỌC " + Program.NamHoc;
            pTC_BienLaiThuTienInfo.PhieuThu      = true;
            pTC_BienLaiThuTienInfo.Printed       = false;
            pTC_BienLaiThuTienInfo.SoPhieu       = GetSoPhieu(Program.HocKy, Program.IDNamHoc, IDSV_SinhVien, pDM_LopInfo.IDDM_DiaDiem);
            //dtDinhMuc.Columns[3].
            pTC_BienLaiThuTienInfo.SoTien        = SumColumnValue(dtDinhMuc, "SoTien");
            pTC_BienLaiThuTienInfo.SoTienBangChu = clsStrHelper.ReadMoney(pTC_BienLaiThuTienInfo.SoTien) + " đồng";
            pTC_BienLaiThuTienInfo.PhieuHuy      = false;
            pTC_BienLaiThuTienInfo.NgayHuy       = DateTime.Parse("1/1/1900");
            int intTC_BienLaiThuTienID = oBTC_BienLaiThuTien.Add(pTC_BienLaiThuTienInfo);

            // them bien lai thu tien chi tiet
            foreach (DataRow mdr in dtDinhMuc.Rows)
            {
                if (float.Parse("0" + mdr["SoTien"].ToString()) > 0 && mdr["TC_LoaiThuChiID"].ToString() != "")
                {
                    pTC_BienLaiThuTien_ChiTietInfo = new TC_BienLaiThuTien_ChiTietInfo();
                    pTC_BienLaiThuTien_ChiTietInfo.IDTC_BienLaiThuTien     = intTC_BienLaiThuTienID;
                    pTC_BienLaiThuTien_ChiTietInfo.IDTC_DinhMucThuSinhVien = int.Parse("0" + mdr["IDTC_DinhMucThuSinhVien"].ToString());
                    pTC_BienLaiThuTien_ChiTietInfo.IDTC_LoaiThuChi         = int.Parse(mdr["TC_LoaiThuChiID"].ToString());
                    pTC_BienLaiThuTien_ChiTietInfo.LanThu  = int.Parse("0" + mdr["LanThu"].ToString());
                    pTC_BienLaiThuTien_ChiTietInfo.NoiDung = mdr["NoiDung"].ToString();
                    pTC_BienLaiThuTien_ChiTietInfo.SoTien  = float.Parse("0" + mdr["SoTien"].ToString());
                    oBTC_BienLaiThuTien_ChiTiet.Add(pTC_BienLaiThuTien_ChiTietInfo);
                }
            }
        }
Пример #3
0
        private void btnInDanhSach_Click(object sender, EventArgs e)
        {
            dlgLopFilter dlg = new dlgLopFilter();

            if (dlg.ShowDialog() == DialogResult.Yes)
            {
                DM_LopInfo pDM_LopFilterInfo = dlg.pDM_LopInfo;
                DataTable  dtMain            = oBTC_DanhSachHocBong.GetInSinhVienByKyTruoc(pDM_LopFilterInfo, Program.IDNamHoc,
                                                                                           Program.HocKy, Program.NamHoc, int.Parse(cmbThang.Text));
                if (dtMain.Rows.Count > 0)
                {
                    dtMain.Columns.Add("Thang", typeof(string));
                    dtMain.Columns.Add("TenNam", typeof(string));
                    dtMain.Columns.Add("HeTrinhDo", typeof(string));
                    dtMain.Columns.Add("TongTienBangChu", typeof(string));
                    dtMain.Rows[0]["Thang"] = cmbThang.Text;
                    if (7 <= int.Parse(cmbThang.Text) && int.Parse(cmbThang.Text) <= 12)
                    {
                        dtMain.Rows[0]["TenNam"] = Program.NamHoc.Substring(0, 4);
                    }
                    else
                    {
                        dtMain.Rows[0]["TenNam"] = Program.NamHoc.Substring(5);
                    }
                    double SoTien           = double.Parse(dtMain.Compute("Sum(SoTienConLai)", "").ToString());
                    Lib.clsStringHelper cls = new Lib.clsStringHelper();
                    dtMain.Rows[dtMain.Rows.Count - 1]["TongTienBangChu"] = cls.ReadMoney(SoTien);

                    dtMain.Rows[0]["HeTrinhDo"] = dlg.HeTrinhDo;
                    frmReport frm = new frmReport(dtMain, dtMain, "rDanhSachHocBong_ChiTiet", "rDanhSachHocBong_BangKe", new string[] { "Subreport1" });
                    frm.ShowDialog();
                }
                else
                {
                    ThongBao("Không có dữ liệu để in báo cáo!");
                }
            }
        }