private void btnXemBaoCao_Click(object sender, EventArgs e) { if (this.dateTuNgay.DateTime == null || this.dateDenNgay.DateTime == null) { MessageBox.Show("Xin vui lòng chọn ngày", "Chọn ngày", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } RptBaoCaoHoatDongTaiChinh rpt = new RptBaoCaoHoatDongTaiChinh(); rpt.TuNgay.Value = this.dateTuNgay.DateTime; rpt.DenNgay.Value = this.dateDenNgay.DateTime; List <int> phanLoaiChiIds = new List <int>(); int[] selectedRowHandlers = this.gvMain.GetSelectedRows(); if (ArrayUtil.IsEmpty(selectedRowHandlers)) { MessageBox.Show("Xin vui lòng chọn Mã loại chi", "Chọn Mã loại chi", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (int rowHandler in selectedRowHandlers) { int phanLoaiChiId = (int)this.gvMain.GetRowCellValue(rowHandler, "PhanLoaiChiId"); phanLoaiChiIds.Add(phanLoaiChiId); } rpt.PhanLoaiChiIds.Value = StringUtil.Join(phanLoaiChiIds, ","); FormMainFacade.ShowReport(rpt); }
private void btnIn_Click(object sender, EventArgs e) { RptThongTinHocSinh rpt = new RptThongTinHocSinh(); this.fillReportHocSinh(rpt); FormMainFacade.ShowReport(rpt); }
private void btnXemBaoCao_Click(object sender, EventArgs e) { if (this.dateTuNgay.DateTime == null || this.dateDenNgay.DateTime == null) { MessageBox.Show("Xin vui lòng chọn ngày", "Chọn ngày", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } SoThuTienService soThuTienService = new SoThuTienService(); RptBangKeTongHopThuTienHS rpt = new RptBangKeTongHopThuTienHS(); DateTime fromDate = DateTimeUtil.StartOfDate(dateTuNgay.DateTime); DateTime toDate = DateTimeUtil.EndOfDate(dateDenNgay.DateTime); rpt.FromDate.Value = fromDate; rpt.ToDate.Value = toDate; List <BangKeThuTienItem> allBangKeThuTienItems = soThuTienService.GetBangKeTongHopThuTien(toDate, (int?)cmLop.EditValue); List <BangKeThuTienItem> displayedBangKeThuTienItems = new List <BangKeThuTienItem>(); int stt = 1; foreach (BangKeThuTienItem item in allBangKeThuTienItems) { if (item.NgayNop >= fromDate && item.NgayNop <= toDate) { item.STT = stt++; displayedBangKeThuTienItems.Add(item); } } rpt.viewBangThuTienRowbindingSource.DataSource = displayedBangKeThuTienItems; FormMainFacade.ShowReport(rpt); }
private void btnPrintGiayBaoNopTien_Click(object sender, EventArgs e) { if (this.isValidNgayTinhAndLop() && !this.isDataTableEmpty()) { RptGiayBaoNopTien rpt = new RptGiayBaoNopTien(); this.fillRptGiayBaoNopTien(rpt); FormMainFacade.ShowReport(rpt); } }
private void btnPrint2_Click(object sender, EventArgs e) { if (this.isValidNgayTinhAndLop() && !this.isDataTableEmpty()) { RptSoThuTienTrang2 rpt = new RptSoThuTienTrang2(); this.fillRptSoThuTienTrang2(rpt); FormMainFacade.ShowReport(rpt); } }
private void btnXemBaoCao_Click(object sender, EventArgs e) { if (this.dateTuNgay.DateTime == null || this.dateDenNgay.DateTime == null) { MessageBox.Show("Xin vui lòng chọn ngày", "Chọn ngày", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } RptBaoCaoChiTietHoatDongTaiChinh rpt = new RptBaoCaoChiTietHoatDongTaiChinh(); rpt.TuNgay.Value = this.dateTuNgay.DateTime; rpt.DenNgay.Value = this.dateDenNgay.DateTime; FormMainFacade.ShowReport(rpt); }
private void btnXemBaoCao_Click(object sender, EventArgs e) { if (ControlUtil.IsEditValueNull(this.cmbYear)) { MessageBox.Show("Xin vui lòng chọn năm", "Chọn năm", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } RptSoTheoDoiTaiSan rpt = new RptSoTheoDoiTaiSan(); QLMamNon.Dao.QLMamNonDs.ViewBanGiaoTaiSanDataTable table = this.viewBanGiaoTaiSanTableAdapter.GetDataByYear((int)cmbYear.EditValue); List <SoTheoDoiTaiSanItem> soTheoDoiTaiSan = new List <SoTheoDoiTaiSanItem>(); SoTheoDoiTaiSanItem prevSoTheoDoiTaiSanItem = null; SoTheoDoiTaiSanItem soTheoDoiTaiSanItem = null; foreach (QLMamNon.Dao.QLMamNonDs.ViewBanGiaoTaiSanRow row in table) { row.LopName = StaticDataUtil.GetLopNameByLopId(row.LopId); if (prevSoTheoDoiTaiSanItem != null && prevSoTheoDoiTaiSanItem.TaiSanId == row.TaiSanId) { soTheoDoiTaiSanItem = new SoTheoDoiTaiSanItem() { TaiSanId = row.TaiSanId, GhiChu = CommonConstant.EMPTY, LyDoGiam = "Bàn giao", NgayChungTuGiam = row.NgayChungTu, SoChungTuGiam = row.SoChungTu, SoLuongBanGiao = row.SoLuongBanGiao, SoTienBanGiao = row.DonGia * row.SoLuongBanGiao, }; } else { soTheoDoiTaiSanItem = new SoTheoDoiTaiSanItem() { TaiSanId = row.TaiSanId, Ten = row.Ten, DonGia = row.DonGia, DonViTinh = row.DonViTinh, GhiChu = CommonConstant.EMPTY, LyDoGiam = "Bàn giao", NgayChungTu = row.NgayChungTu, NgayChungTuGiam = row.NgayChungTu, SoChungTu = row.SoChungTu, SoChungTuGiam = row.SoChungTu, SoLuong = row.SoLuong, SoLuongBanGiao = row.SoLuongBanGiao, SoTienBanGiao = row.DonGia * row.SoLuongBanGiao, ThanhTien = row.SoLuong * row.DonGia }; } soTheoDoiTaiSan.Add(soTheoDoiTaiSanItem); prevSoTheoDoiTaiSanItem = soTheoDoiTaiSanItem; } rpt.bindingSource.DataSource = soTheoDoiTaiSan; rpt.Year.Value = this.cmbYear.EditValue; FormMainFacade.ShowReport(rpt); }
private void btnXemBaoCao_Click(object sender, EventArgs e) { if (this.dateTuNgay.DateTime == null || this.dateDenNgay.DateTime == null) { MessageBox.Show("Xin vui lòng chọn ngày", "Chọn ngày", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (chkTon.Checked && StringUtil.IsEmpty(txtTon.Text)) { MessageBox.Show("Xin vui lòng nhập số tiền tồn tháng trước", "Nhập số tiền tồn tháng trước", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <int> phanLoaiThuIds = new List <int>(); int[] selectedThuRowHandlers = this.gvThu.GetSelectedRows(); if (ArrayUtil.IsEmpty(selectedThuRowHandlers)) { MessageBox.Show("Xin vui lòng chọn Phân loại thu", "Chọn Phân loại thu", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (int rowHandler in selectedThuRowHandlers) { int phanLoaiThuId = (int)this.gvThu.GetRowCellValue(rowHandler, "PhanLoaiThuId"); phanLoaiThuIds.Add(phanLoaiThuId); } List <int> phanLoaiChiIds = new List <int>(); int[] selectedRowHandlers = this.gvMain.GetSelectedRows(); if (ArrayUtil.IsEmpty(selectedRowHandlers)) { MessageBox.Show("Xin vui lòng chọn Mã loại chi", "Chọn Mã loại chi", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (int rowHandler in selectedRowHandlers) { int phanLoaiChiId = (int)this.gvMain.GetRowCellValue(rowHandler, "PhanLoaiChiId"); phanLoaiChiIds.Add(phanLoaiChiId); } DateTime fromDate = DateTimeUtil.StartOfDate(this.dateTuNgay.DateTime); DateTime toDate = DateTimeUtil.EndOfDate(this.dateDenNgay.DateTime); decimal soTienTonDauKy = findSoTienTonDauKy(toDate); SortedList soQuyTienMatMap = new SortedList(); SoQuyTienMatItem soQuyTienMatDauKy = new SoQuyTienMatItem() { DienGiai = "Số tồn đầu kỳ", SoTienTon = (double)soTienTonDauKy }; soQuyTienMatMap.Add(DateTime.MinValue, soQuyTienMatDauKy); addPhieuThuToReport(soQuyTienMatMap, fromDate, toDate, phanLoaiThuIds); addPhieuChiToReport(soQuyTienMatMap, fromDate, toDate, phanLoaiChiIds); List <SoQuyTienMatItem> soQuyTienMat = calculateSoTienTonForSoQuyTienMatItems(soQuyTienMatMap); RptSoQuyTienMat rpt = new RptSoQuyTienMat(); rpt.FromDate.Value = fromDate; rpt.ToDate.Value = toDate; rpt.bindingSource.DataSource = soQuyTienMat; FormMainFacade.ShowReport(rpt); }
private void btnXemBaoCao_Click(object sender, EventArgs e) { if (this.dateTuNgay.DateTime == null || this.dateDenNgay.DateTime == null) { MessageBox.Show("Xin vui lòng chọn ngày", "Chọn ngày", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <int> phanLoaiThuIds = new List <int>(); int[] selectedThuRowHandlers = this.gvThu.GetSelectedRows(); if (ArrayUtil.IsEmpty(selectedThuRowHandlers)) { MessageBox.Show("Xin vui lòng chọn Phân loại thu", "Chọn Phân loại thu", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (int rowHandler in selectedThuRowHandlers) { int phanLoaiThuId = (int)this.gvThu.GetRowCellValue(rowHandler, "PhanLoaiThuId"); phanLoaiThuIds.Add(phanLoaiThuId); } List <int> phanLoaiChiIds = new List <int>(); int[] selectedRowHandlers = this.gvMain.GetSelectedRows(); if (ArrayUtil.IsEmpty(selectedRowHandlers)) { MessageBox.Show("Xin vui lòng chọn Mã loại chi", "Chọn Mã loại chi", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (chkTon.Checked && StringUtil.IsEmpty(txtTon.Text)) { MessageBox.Show("Xin vui lòng nhập số tiền tồn tháng trước", "Nhập số tiền tồn tháng trước", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (int rowHandler in selectedRowHandlers) { int phanLoaiChiId = (int)this.gvMain.GetRowCellValue(rowHandler, "PhanLoaiChiId"); phanLoaiChiIds.Add(phanLoaiChiId); } DateTime fromDate = DateTimeUtil.StartOfDate(this.dateTuNgay.DateTime); DateTime toDate = DateTimeUtil.EndOfDate(this.dateDenNgay.DateTime); UnknownColumnViewTableAdapter unknownColumnViewTableAdapter = (UnknownColumnViewTableAdapter)StaticDataFacade.Get(StaticDataKeys.AdapterUnknownColumnView); RptTinhHinhThuChi rpt = new RptTinhHinhThuChi(); rpt.TuNgay.Value = fromDate; rpt.DenNgay.Value = toDate; rpt.TongThu.Value = unknownColumnViewTableAdapter.GetSumSoTienThuByDateRange(fromDate, toDate, StringUtil.JoinWithCommas(phanLoaiThuIds)); rpt.TongChi.Value = unknownColumnViewTableAdapter.GetSumSoTienChiByDateRange(fromDate, toDate, StringUtil.JoinWithCommas(phanLoaiChiIds)); rpt.Ton.Value = findSoTienTonDauKy(toDate); rpt.ChenhLech.Value = (decimal)rpt.Ton.Value + (decimal)rpt.TongThu.Value - (decimal)rpt.TongChi.Value; PhieuThuService phieuThuService = new PhieuThuService(); rpt.thuDataSource.DataSource = phieuThuService.LoadPhieuThuByDateRangeWithGroupPhanLoaiThu(fromDate, toDate, phanLoaiThuIds); PhieuChiService phieuChiService = new PhieuChiService(); rpt.chiDataSource.DataSource = phieuChiService.LoadPhieuChiByDateRangeWithGroupPhanLoaiChi(fromDate, toDate, phanLoaiChiIds); FormMainFacade.ShowReport(rpt); }