Ejemplo n.º 1
0
 private void button16_Click(object sender, EventArgs e)
 {
     try
     {
         Reports.Dsbachitietmn rpt = new Reports.Dsbachitietmn();
         frmHienThi            frm = new frmHienThi();
         DataSet ds = new DataSet();
         Connect.Loadds(ds, "Select tenphong,Sum(BS) as BS,Sum(BC) as BC,Sum(BT) as BT, ntan From baoan group by tenphong,ntan", "baoan");
         rpt.tendv.Value   = thongtinketxuat.Default.tendv.ToString();
         rpt.tenct.Value   = thongtinketxuat.Default.tenct.ToString();
         rpt.diadanh.Value = thongtinketxuat.Default.diadanh.ToString() + ", ngay ... thang ... năm ......";
         rpt.nlb.Value     = thongtinketxuat.Default.nlb.ToString();
         rpt.ptkt.Value    = thongtinketxuat.Default.ptkt.ToString();
         rpt.ttdv.Value    = thongtinketxuat.Default.ttdv.ToString();
         rpt.ntkx.Value    = "Từ ngày: " + dtpNTTu.Text + "   đến ngày: " + dtpNTDen.Text;
         frm.printControl1.PrintingSystem = rpt.PrintingSystem;
         rpt.DataSource = ds;
         rpt.CreateDocument();
         frm.ShowDialog();
         this.Close();
     }
     catch (Exception loi)
     {
         MessageBox.Show("Lỗi: " + loi + " Bạn hãy kiểm tra lại!", "Thông báo");
     }
 }
Ejemplo n.º 2
0
        private void button16_Click(object sender, EventArgs e)
        {
            Reports.rptSoCTQuy rpt  = new Reports.rptSoCTQuy();
            frmHienThi         frm  = new frmHienThi();
            DataTable          dtSD = Connect.TruyVandt("Select * From qrSoQuyTM Where ngaygs < #" + DC1.ngaythang(dtpNTTu.Text) + "#");

            Dataset.dsChungTu ds = new Dataset.dsChungTu();
            foreach (DataRow row in Connect.TruyVandt("Select * From qrSoQuyTM Where ploai='Thu' and ngaygs Between #" + DC1.ngaythang(dtpNTTu.Text) + "# and #"
                                                      + DC1.ngaythang(dtpNTDen.Text) + "#").Rows)
            {
                ds.qrSoQuyTM.Rows.Add(row["ngaygs"], "", row["sohieu"], row["noidung"], 0, row["SoTien"], "", 0, row["thang"]);
            }
            foreach (DataRow row in Connect.TruyVandt("Select * From qrSoQuyTM Where ploai='Chi' and ngaygs Between #" + DC1.ngaythang(dtpNTTu.Text) + "# and #"
                                                      + DC1.ngaythang(dtpNTDen.Text) + "#").Rows)
            {
                ds.qrSoQuyTM.Rows.Add(row["ngaygs"], "", "", row["noidung"], row["SoTien"], 0, row["sohieu"], 0, row["thang"]);
            }

            foreach (DataRow row in ds.qrSoQuyTM.Rows)
            {
                row["sodu"] = dcts.TinhToan(dtSD.Select("ploai='Thu'"), "sotien") - dcts.TinhToan(dtSD.Select("ploai='Chi'"), "sotien");
            }
            rpt.Huyen.Value  = thongtinketxuat.Default.tendv.ToString();
            rpt.TNDN.Value   = "Năm " + Convert.ToDateTime(dtpNTDen.EditValue).Year.ToString();
            rpt.HTNGSo.Value = thongtinketxuat.Default.thuquy.ToString();
            rpt.HTKeTT.Value = thongtinketxuat.Default.ptkt.ToString();
            rpt.HTNK.Value   = thongtinketxuat.Default.ttdv.ToString();
            rpt.NTNSo.Value  = thongtinketxuat.Default.diadanh.ToString() + ", ngày ... tháng ... năm ......";
            frm.printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.DataSource = ds;
            rpt.CreateDocument();
            frm.ShowDialog();
            this.Close();
        }
Ejemplo n.º 3
0
        private void button16_Click(object sender, EventArgs e)
        {
            Connect.ThaoTac("Delete * From TblDC");
            insertDC();
            updateDC();
            DataSet   dts = new DataSet();
            DataTable dt  = Connect.TruyVandt("Select * From TblDC");

            dt.TableName = "TblDC";
            dts.Tables.Add(dt);
            Reports.SoTKPA rpt = new Reports.SoTKPA();
            frmHienThi     frm = new frmHienThi();

            //Dataset.dsTblDC dts = new Dataset.dsTblDC();
            //foreach (DataRow row in Connect.TruyVandt("Select distinct nhxu.matp, nhxu.tentp, nhxu.slnh, nhxu.dongia, nhxu.ttnh, nhxu.slxu, nhxu.dongia, nhxu.ttxu,nxct.ntnx"
            //    + " From nxct INNER JOIN nhxu ON nxct.idnxct = nhxu.idnxct Where nxct.ntnx Between #" + DC1.ngaythang(dtpNTTu.Text) + "# and #"
            //                                                + DC1.ngaythang(dtpNTDen.Text) + "#").Rows)
            //    dts.TblDC.Rows.Add(null, row["ntnx"], row["ntnx"], row["tentp"], row["matp"], "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
            //        0,0,row["slnh"],row["dongia"],row["ttnh"],row["slxu"],row["dongia"],row["ttxu"]);
            //foreach (DataRow row in dts.TblDC.Rows)
            //{
            //    row["SL1"] = soluongton(row["NTGS"].ToString(), row["TEN2"].ToString());
            //    row["SL2"] = sotienton(row["NTGS"].ToString(), row["TEN2"].ToString());
            //}
            //rpt.Huyen.Value = thongtinketxuat.Default.tendv.ToString();
            //rpt.NTNSo.Value = thongtinketxuat.Default.diadanh.ToString() + ", ngay ... thang ... năm ......";
            //rpt.HTNGSo.Value = thongtinketxuat.Default.thuquy.ToString();
            //rpt.HTKeTT.Value = thongtinketxuat.Default.ptkt.ToString();
            //rpt.HTNK.Value = thongtinketxuat.Default.ttdv.ToString();
            rpt.Namhoc.Value          = thongtinketxuat.Default.namhoc.ToString();
            rpt.DiaDanh.Value         = thongtinketxuat.Default.diadanh.ToString();
            rpt.TenDV.Value           = thongtinketxuat.Default.tendv.ToString();
            rpt.Thangnam.Value        = "THÁNG " + Convert.ToDateTime(dtpNTTu.Text).Month + " NĂM " + Convert.ToDateTime(dtpNTTu.Text).Year;
            rpt.Thangtruoc.Value      = thangtruoc().ToString("#,#");
            rpt.SoVett.Value          = Connect.doubltt(Connect.TruyVandr("Select thutien.sothu  FROM thutien INNER JOIN dmthu ON thutien.makhthu = dmthu.makhthu where thutien.ngaythu between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# and dmthu.tenkhoanthu = 'Tiền ăn'"), "sothu").ToString("#,#");
            rpt.Thanhtientt.Value     = Connect.doubltt(Connect.TruyVandr("Select thutien.sotienthu FROM thutien INNER JOIN dmthu ON thutien.makhthu = dmthu.makhthu where thutien.ngaythu between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# and dmthu.tenkhoanthu = 'Tiền ăn'"), "sotienthu").ToString("#,#");
            rpt.nguonbxtt.Value       = Connect.doubltt(Connect.TruyVandr("Select thtro from nxct where ntnx between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "#"), "thtro").ToString("#,#");
            rpt.Sobuaandc.Value       = Connect.doubltt(Connect.TruyVandr("Select Sum(BS) as SumofBS from baoan where ntan between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "#"), "SumofBS").ToString("#,#");
            rpt.tienandc.Value        = Connect.doubltt(Connect.TruyVandr("Select MA*BS as TienAn From baoan where ntan between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# "), "TienAn").ToString("#,#");
            rpt.Tienanthuathieu.Value = tienanthuathieutt().ToString("#,#");
            rpt.nguonbxdc.Value       = Connect.doubltt(Connect.TruyVandr("Select chibosung from nxct where ntnx between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "#"), "chibosung").ToString("#,#");
            rpt.toncuoithang.Value    = cuoithang().ToString("#,#");
            rpt.SoVeton.Value         = (Connect.doubltt(Connect.TruyVandr("Select thutien.sothu FROM thutien INNER JOIN dmthu ON thutien.makhthu = dmthu.makhthu where thutien.ngaythu <= #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# and dmthu.tenkhoanthu = 'Tiền ăn'"), "sothu")
                                         - Connect.doubltt(Connect.TruyVandr("Select Sum(BS) as SumofBS from baoan where ntan <= #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "#"), "SumofBS")).ToString("#,#");
            rpt.thanhtienveton.Value = (Connect.doubltt(Connect.TruyVandr("Select thutien.sotienthu FROM thutien INNER JOIN dmthu ON thutien.makhthu = dmthu.makhthu where thutien.ngaythu <= #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# and dmthu.tenkhoanthu = 'Tiền ăn'"), "sotienthu")
                                        - Connect.doubltt(Connect.TruyVandr("Select MA*BS as TienAn From baoan where ntan <= #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# "), "TienAn")).ToString("#,#");
            rpt.tontienanthuathieu.Value = tienanthuathieuct().ToString("#,#");
            rpt.nguonbxton.Value         = (Connect.doubltt(Connect.TruyVandr("Select thtro from nxct where ntnx <= #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "#"), "thtro") -
                                            Connect.doubltt(Connect.TruyVandr("Select chibosung from nxct where ntnx <= #" + classdc.dungchung.thaydoi(dtpNTDen.Text) + "#"), "chibosung")).ToString("#,#");
            frm.printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.DataSource = dts;
            rpt.CreateDocument();
            frm.ShowDialog();
            this.Close();
        }
Ejemplo n.º 4
0
        private void button16_Click(object sender, EventArgs e)
        {
            KPBT.Reports.rptSoCTNhapXuatTon rpt = new KPBT.Reports.rptSoCTNhapXuatTon();
            frmHienThi frm = new frmHienThi();

            Dataset.dsSoCTNhapXuatTon ds = new Dataset.dsSoCTNhapXuatTon();
            DataTable dtSD = Connect.TruyVandt("Select * From qrSoCTNhapXuatTon Where ntnx < #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and matp Like '" + dcts.GetStr(lumatp.EditValue) + "%'");
            DataTable dtTK = Connect.TruyVandt("Select * From qrSoCTNhapXuatTon Where ntnx Between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #"
                                               + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# and matp Like '" + dcts.GetStr(lumatp.EditValue) + "%'");

            foreach (DataRow row in Connect.TruyVandt("Select * From qrSoCTNhapXuatTon Where ntnx Between #" + classdc.dungchung.thaydoi(dtpNTTu.Text) + "# and #"
                                                      + classdc.dungchung.thaydoi(dtpNTDen.Text) + "# and matp Like '" + dcts.GetStr(lumatp.EditValue) + "%'").Rows)
            {
                ds.qrSoCTNhapXuatTon.ImportRow(row);
            }

            if (ds.qrSoCTNhapXuatTon.Rows.Count > 0)
            {
                foreach (DataRow row in ds.qrSoCTNhapXuatTon.Rows)
                {
                    row["sldunh"] = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "slnh");
                    row["slduxu"] = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "slxu");
                    row["ttdunh"] = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "ttnh");
                    row["ttduxu"] = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "ttxu");
                }
            }
            foreach (DataRow row in dtSD.Rows)
            {
                if (ds.qrSoCTNhapXuatTon.Select("matp='" + row["matp"] + "'").Length == 0)
                {
                    double sldunh = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "slnh");
                    double slduxu = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "slxu");
                    double ttdunh = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "ttnh");
                    double ttduxu = dcts.TinhToan(dtSD.Select("matp='" + row["matp"] + "'"), "ttxu");
                    ds.qrSoCTNhapXuatTon.Rows.Add(DBNull.Value, "", row["matp"], row["tentp"], 0, 0, 0, 0, 0, 0, slduxu, ttduxu, sldunh, ttdunh);
                }
            }
            rpt.tendv.Value  = thongtinketxuat.Default.tendv.ToString();
            rpt.tuan.Value   = "Tuần: ..... ( Từ ngày " + dtpNTTu.Text + " đến ngày " + dtpNTDen.Text + " )";
            rpt.ntkx.Value   = thongtinketxuat.Default.diadanh.ToString() + ", ngày ... tháng ... năm .....";
            rpt.thukho.Value = thongtinketxuat.Default.nlb.ToString();
            rpt.ktoan.Value  = thongtinketxuat.Default.ptkt.ToString();
            rpt.ttdv.Value   = thongtinketxuat.Default.ttdv.ToString();
            rpt.DataSource   = ds;
            frm.printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument();
            frm.ShowDialog();
            this.Close();
        }
Ejemplo n.º 5
0
 private void button16_Click(object sender, EventArgs e)
 {
     try
     {
         if (Connect.GetStr(Luhocsinh.EditValue) == "")
         {
             MessageBox.Show("Bạn cần phải chọn học sinh cần tạo!", "Thông báo");
         }
         else
         {
             foreach (DataRow row in Connect.TruyVandt("Select theodoisk.*, hocsinh.gths From theodoisk inner join hocsinh on theodoisk.mahocsinh = hocsinh.mshs" +
                                                       " Where mahocsinh = '" + Connect.GetStr(Luhocsinh.EditValue) + "' and ngaydanhgia Between #" + DC1.ngaythang(dtpNTTu.Text) + "# and #"
                                                       + DC1.ngaythang(dtpNTDen.Text) + "#").Rows)
             {
                 ds.theodoisk.Rows.Add(row["ngaydanhgia"], row["mahocsinh"], row["sothangtuoi"], row["cannang"], row["chieucao"], row["danhgia"], row["gths"]);
             }
             foreach (DataRow item in ds.theodoisk.Rows)
             {
                 item["chieucaochuan"] = dcts.LayGT(Connect.TruyVandt("Select chieucaochuan From tblchiso where thang = " + classdc.dungchung.kieudouble(item["sothangtuoi"].ToString()) + " and gioitinh = '" + item["gioitinh"].ToString() + "'").Select(), "chieucaochuan");
                 item["cannangchuan"]  = dcts.LayGT(Connect.TruyVandt("Select cannangchuan From tblchiso where thang = " + classdc.dungchung.kieudouble(item["sothangtuoi"].ToString()) + " and gioitinh = '" + item["gioitinh"].ToString() + "'").Select(), "cannangchuan");
             }
             //Connect.Loadds(dts, "Select * From theodoisk where mahocsinh = '" + Luhocsinh.EditValue.ToString() + "'", "theodoisk");
             Reports.Testchart rpt = new Reports.Testchart();
             frmHienThi        frm = new frmHienThi();
             rpt.TenDV.Value                  = thongtinketxuat.Default.tendv.ToString();
             rpt.TenHS.Value                  = Luhocsinh.Text;
             rpt.Lop.Value                    = Connect.LayGT("Select tenphong from hocsinh where mshs = '" + Connect.GetStr(Luhocsinh.EditValue) + "'", "tenphong");
             rpt.NgaySinh.Value               = Convert.ToDateTime(Connect.LayGT("Select ntns from hocsinh where mshs = '" + Connect.GetStr(Luhocsinh.EditValue) + "'", "ntns"));
             rpt.TungayDenngay.Value          = "Ngày đánh giá từ ngày " + dtpNTTu.Text + " đến ngày " + dtpNTDen.Text;
             rpt.Ketluan.Value                = danhgia();
             frm.printControl1.PrintingSystem = rpt.PrintingSystem;
             rpt.DataSource                   = ds;
             rpt.CreateDocument();
             frm.ShowDialog();
             this.Close();
         }
     }
     catch {
         MessageBox.Show("Có lỗi trong quá trình tạo báo cáo. Bạn hãy kiểm tra lại!", "Thông báo");
     }
 }
Ejemplo n.º 6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            Reports.BcTDSKHS rpt  = new Reports.BcTDSKHS();
            frmHienThi       frm  = new frmHienThi();
            DataTable        dtTT = Connect.TruyVandt("SELECT hocsinh.tenhs, hocsinh.gths, hocsinh.ntns, hocsinh.tenphong," +
                                                      " theodoisk.sothangtuoi, theodoisk.cannang, theodoisk.chieucao, theodoisk.ngaydanhgia, theodoisk.danhgia" +
                                                      " FROM hocsinh INNER JOIN theodoisk ON hocsinh.mshs = theodoisk.mahocsinh" +
                                                      " Where theodoisk.ngaydanhgia between #" + DC1.ngaythang(MtbNgayTT.Text) + "# and #" + DC1.ngaythang(MtbNgayTD.Text) + "#");

            Dataset.dsTblDC dts = new Dataset.dsTblDC();
            foreach (DataRow item in dtTT.Rows)
            {
                dts.TblDC.Rows.Add(null, item["ngaydanhgia"], item["ntns"], item["tenhs"], item["gths"], "", item["tenphong"], item["danhgia"], "", "", "", "" +
                                   "", "", "", "", "", "", "", "", "", "", "", "", item["sothangtuoi"], item["cannang"], item["chieucao"]);
            }
            rpt.NTT.Value = "Từ ngày " + MtbNgayTT.Text + " đến ngày " + MtbNgayTD.Text;
            //rpt.TenDV.Value = thongtinketxuat.Default.tendv.ToString();
            rpt.DataSource = dts;
            frm.printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument();
            frm.ShowDialog();
            this.Close();
        }
Ejemplo n.º 7
0
        private void button16_Click(object sender, EventArgs e)
        {
            string kt1 = "", kt2 = "", kt3 = "", kt4 = "", kt5 = "";
            double d = 0;
            double st1 = 0, st2 = 0, st3 = 0, st4 = 0, st5 = 0, st6 = 0, st = 0;

            for (int i = 0; i < grvCT.RowCount; i++)
            {
                if (grvCT.GetRowCellValue(i, colCheck).ToString() == "True")
                {
                    d += 1;
                    if (d == 1)
                    {
                        kt1 = grvCT.GetRowCellValue(i, colTenKhoanThu).ToString();
                    }
                    if (d == 2)
                    {
                        kt2 = grvCT.GetRowCellValue(i, colTenKhoanThu).ToString();
                    }
                    if (d == 3)
                    {
                        kt3 = grvCT.GetRowCellValue(i, colTenKhoanThu).ToString();
                    }
                    if (d == 4)
                    {
                        kt4 = grvCT.GetRowCellValue(i, colTenKhoanThu).ToString();
                    }
                    if (d == 5)
                    {
                        kt5 = grvCT.GetRowCellValue(i, colTenKhoanThu).ToString();
                    }
                }
            }
            DataTable dt = Connect.TruyVandt("Select * FROM qrThuTT ");

            Dataset.dsTblDC dts = new KPBT.Dataset.dsTblDC();
            foreach (DataRow item in Connect.TruyVandt("Select ngaythu, thang,tenphong From qrThuTT where ngaythu Between #" + DC1.ngaythang(dtpNTTu.Text) + "# and #" + DC1.ngaythang(dtpNTDen.Text) + "# Group by ngaythu,thang,tenphong").Rows)
            {
                dts.qrThuTT.Rows.Add(item["ngaythu"], "", "", "", item["thang"], item["tenphong"]);
            }
            foreach (DataRow item in dts.qrThuTT.Rows)
            {
                if (kt1 != "")
                {
                    item["SL3"] = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and ngaythu = '" + DateTime.Parse(item["ngaythu"].ToString()) + "' and tenkhoanthu = '" + kt1 + "'"), "SumOfsotienthu");
                    st1         = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = '" + kt1 + "'"), "SumOfsotienthu");
                }
                if (kt2 != "")
                {
                    item["SL4"] = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and ngaythu = '" + DateTime.Parse(item["ngaythu"].ToString()) + "' and tenkhoanthu = '" + kt2 + "'"), "SumOfsotienthu");
                    st2         = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = '" + kt2 + "'"), "SumOfsotienthu");
                }
                if (kt3 != "")
                {
                    item["SL5"] = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and ngaythu = '" + DateTime.Parse(item["ngaythu"].ToString()) + "' and tenkhoanthu = '" + kt3 + "'"), "SumOfsotienthu");
                    st3         = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = '" + kt3 + "'"), "SumOfsotienthu");
                }
                if (kt4 != "")
                {
                    item["SL6"] = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and ngaythu = '" + DateTime.Parse(item["ngaythu"].ToString()) + "' and tenkhoanthu = '" + kt4 + "'"), "SumOfsotienthu");
                    st4         = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = '" + kt4 + "'"), "SumOfsotienthu");
                }
                if (kt5 != "")
                {
                    item["SL7"] = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = '" + kt5 + "'"), "SumOfsotienthu");
                    st5         = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = '" + kt5 + "'"), "SumOfsotienthu");
                }
                item["SL8"]  = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu <> '" + kt1 + "' and tenkhoanthu <> '" + kt2 + "'and tenkhoanthu <> '" + kt3 + "'and tenkhoanthu <> '" + kt4 + "' and tenkhoanthu <> '" + kt5 + "'"), "SumOfsotienthu");
                st6          = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu <> '" + kt1 + "' and tenkhoanthu <> '" + kt2 + "'and tenkhoanthu <> '" + kt3 + "'and tenkhoanthu <> '" + kt4 + "' and tenkhoanthu <> '" + kt5 + "'"), "SumOfsotienthu");
                item["SL10"] = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = 'Tiền ăn'"), "SumOfsothu");
                item["SL11"] = dcts.TinhToan(dt.Select("tenphong = '" + item["lop"] + "' and thang = " + double.Parse(item["thang"].ToString()) + " and tenkhoanthu = 'Tiền ăn'"), "SumOfsotienthu");
                st           = st1 + st2 + st3 + st4 + st5 + st6;
                item["SL9"]  = st;
            }
            foreach (DataRow item in dts.qrThuTT.Rows)
            {
                item["siso"] = siso(item["lop"].ToString());
            }
            Reports.SoNKBG rpt = new Reports.SoNKBG();
            frmHienThi     frm = new frmHienThi();

            rpt.tendv.Value  = thongtinketxuat.Default.tendv.ToString();
            rpt.thukho.Value = thongtinketxuat.Default.thukho.ToString();
            rpt.ktoan.Value  = thongtinketxuat.Default.ptkt.ToString();
            rpt.ttdv.Value   = thongtinketxuat.Default.ttdv.ToString();
            rpt.KT1.Value    = kt1;
            rpt.KT2.Value    = kt2;
            rpt.KT3.Value    = kt3;
            rpt.KT4.Value    = kt4;
            rpt.KT5.Value    = kt5;
            frm.printControl1.PrintingSystem = rpt.PrintingSystem;
            rpt.DataSource = dts;
            rpt.CreateDocument();
            frm.ShowDialog();
            this.Close();
        }