Example #1
0
        protected void btnXuatExcel_Click(object sender, DirectEventArgs e)
        {
            daBaoCaoSoDu dBCSD = new daBaoCaoSoDu();
            DataTable    dt;

            dt = dBCSD.TonQuyCuoiNgay(UIHelper.daPhien.MaDonVi, NgayThang);
            try
            {
                dt.Columns.Remove("Dam");
                dt.Columns.Remove("Nghieng");
                dt.Columns.Remove("Muc");
            }
            catch { }

            daXuatExcel dXuatE = new daXuatExcel();

            dXuatE.TenFileExcel = "TonQuyCuoiNgayBDH" + DateTime.Now.ToString("ddMMyyyHHmmss") + ".xls";
            dXuatE.DuongDan     = Server.MapPath("~");

            dXuatE.TenFileMau = dXuatE.DuongDan + "\\Resource\\FileMauExcel\\TonQuyCuoiNgay.xls";

            dXuatE.DuLieu      = dt;
            dXuatE.TenDonVi    = UIHelper.daPhien.MaDonVi;
            dXuatE.NgayHienThi = "Ngày " + NgayThang.ToString("dd/MM/yyyy");

            string _url = UIHelper.daPhien.LayDiaChiURL(dXuatE.XuatFileExcel_TheoMau());

            Response.Redirect(_url);
        }
        protected void btnXuatExcel_Click(object sender, DirectEventArgs e)
        {
            daXuatExcel dXuatE = new daXuatExcel();

            dXuatE.TenFileExcel = "DoanhThu" + DateTime.Now.ToString("ddMMyyyHHmmss") + ".xls";
            dXuatE.DuongDan     = Server.MapPath("..");

            dXuatE.TenFileMau = dXuatE.DuongDan + "\\Resource\\FileMauExcel\\MauDoanhThuCTiet.xls";

            dXuatE.DuLieu = DoanhThuCTiet();

            string _url = UIHelper.daPhien.LayDiaChiURL(dXuatE.XuatFileExcel_TheoMau());

            Response.Redirect(_url);
        }
        protected void btnTheoDoiDonViCot_Click(object sender, DirectEventArgs e)
        {
            daXuatExcel dXuatE = new daXuatExcel();

            dXuatE.TenFileExcel = "TheoDoiDoanhThu" + DateTime.Now.ToString("ddMMyyyHHmmss") + ".xls";
            dXuatE.DuongDan     = Server.MapPath("..");

            daTheoDoiDoanhThu dDT = new daTheoDoiDoanhThu();

            dDT.TuNgay  = txtTuNgay.SelectedDate;
            dDT.DenNgay = txtDenNgay.SelectedDate;
            dDT.MaDonVi = txtMaDonVi.Text.Trim();

            dXuatE.DuLieu = dDT.BaoCaoDonViCot();

            string _url = UIHelper.daPhien.LayDiaChiURL(dXuatE.XuatExcelCotDong());

            Response.Redirect(_url);
        }
Example #4
0
        protected void btnXuatExcel_Click(object sender, DirectEventArgs e)
        {
            daBieu02TQ dB = new daBieu02TQ();

            dB.B02.Ngay    = txtNgayTongHop.SelectedDate;
            dB.B02.MaDonVi = UIHelper.daPhien.MaDonVi;
            if (dB.ThongTin() == null)
            {
                X.Msg.Alert("", "Báo cáo ngày " + dB.B02.Ngay.Value.ToString("dd/MM/yyyy") + " chưa được lập!").Show();
                return;
            }
            DataTable dt;

            dB.DuLieu.B02DLieu.IDBieuBaoCao = dB.B02.ID;
            dt = dB.DuLieu.BaoCao();
            try
            {
                dt.Columns.Remove("MaDonVi");
                dt.Columns.Remove("InDam");
                dt.Columns.Remove("InNghieng");
                dt.Columns.Remove("STTsx");
            }
            catch { }

            daXuatExcel dXuatE = new daXuatExcel();

            dXuatE.TenFileExcel = "NhuCauTiepQuyTinh" + DateTime.Now.ToString("ddMMyyyHHmmss") + ".xls";
            dXuatE.DuongDan     = Server.MapPath("..");

            dXuatE.TenFileMau = dXuatE.DuongDan + "\\Resource\\FileMauExcel\\Mau02TQ.xls";

            dXuatE.DuLieu      = dt;
            dXuatE.TenDonVi    = UIHelper.daPhien.TenNguoiSuDung;
            dXuatE.NgayHienThi = "Ngày " + dB.B02.Ngay.Value.ToString("dd/MM/yyyy");

            string _url = UIHelper.daPhien.LayDiaChiURL(dXuatE.XuatFileExcel_TheoMau());

            Response.Redirect(_url);
        }
        protected void btnXuatExcel_Click(object sender, DirectEventArgs e)
        {
            daXuatExcel dXuatE = new daXuatExcel();

            dXuatE.TenFileExcel = "BuuGuiPhatCODGiaTriLon" + DateTime.Now.ToString("ddMMyyyHHmmss") + ".xls";
            dXuatE.DuongDan     = Server.MapPath("..");

            dXuatE.TenFileMau = dXuatE.DuongDan + "\\Resource\\FileMauExcel\\MauBGGTri.xls";

            daSLDenBGGTri dBGGT = new daSLDenBGGTri();

            dBGGT.TuNgay   = DateTime.Parse(TuNgay);
            dBGGT.DenNgay  = DateTime.Parse(DenNgay);
            dBGGT.MaBuuCuc = MaBuuCuc;
            dBGGT.MaDonVi  = MaBuuCuc;
            Double _gt, _st;

            _gt = Convert.ToDouble(GiaTri);
            _st = Convert.ToDouble(SoTien);
            _st = _st / 2;
            DataTable dt = dBGGT.DanhSachCTiet(_gt - 500000, _gt + 500000);

            try
            {
                dt.Columns.Remove("Year");
                dt.Columns.Remove("DaPhat");
                dt.Columns.Remove("DaChuyenHoan");
                dt.Columns.Remove("DaHuy");
                dt.Columns.Remove("LyDo");
                dt.Columns.Remove("NgayHuy");
            }
            catch { }

            dXuatE.DuLieu = dt;

            string _url = UIHelper.daPhien.LayDiaChiURL(dXuatE.XuatFileExcel_TheoMau());

            Response.Redirect(_url);
        }