private void iPCXemTruoc_ItemClick(object sender, ItemClickEventArgs e) { if (this.isPhieuChiTab() && this.phieuchiBindingSource.Current != null) { if (this.ValidatePhieuChiFields()) { RptPhieuChi rpt = new RptPhieuChi(); this.fillReportPhieuChi(rpt); this.ucReport1.printControl1.PrintingSystem = rpt.PrintingSystem; rpt.CreateDocument(); this.xtraTabControl1.SelectedTabPageIndex = 3; this.xtraTabControl1.TabPages[3].Text = "Xem trước Phiếu chi"; } } }
private void iPCIn_ItemClick(object sender, ItemClickEventArgs e) { if (this.isPhieuChiTab() && this.phieuchiBindingSource.Current != null) { if (this.ValidatePhieuChiFields()) { RptPhieuChi rpt = new RptPhieuChi(); this.fillReportPhieuChi(rpt); this.ucReport1.printControl1.PrintingSystem = rpt.PrintingSystem; try { rpt.Print(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void fillReportPhieuChi(RptPhieuChi rpt) { QLCMND.CMND.phieuchiRow row = (QLCMND.CMND.phieuchiRow)((DataRowView)this.phieuchiBindingSource.Current).Row; rpt.lblHoTen.Text = row.hoten.ToUpper(); rpt.lblCMND.Text = row.cmnd; if (!row.IscapngayNull()) { rpt.lblCapNgay.Text = string.Format("{0:d}", row.capngay); } else { rpt.lblCapNgay.Text = ""; } if (!row.IsnoicapNull()) { rpt.lblNoiCap.Text = row.noicap; } else { rpt.lblNoiCap.Text = ""; } if (!row.IsdiachiNull()) { rpt.lblDiaChi.Text = row.diachi; } else { rpt.lblDiaChi.Text = ""; } if (!row.IslydoNull()) { rpt.lblLyDo.Text = row.lydo; } else { rpt.lblLyDo.Text = ""; } if (!row.IschungtugocNull()) { rpt.lblChungTuGoc.Text = row.chungtugoc; } else { rpt.lblChungTuGoc.Text = ""; } if (!row.IskemtheoNull()) { rpt.lblKemTheo.Text = row.kemtheo; } else { rpt.lblKemTheo.Text = ""; } rpt.lblSoTien.Text = string.Format("{0:n0}, đồng", row.sotien); rpt.lblSoTienChu.Text = " " + VNCurrency.ToString((double)row.sotien); if (!row.IsngaylapNull()) { rpt.lblNgayLap.Text = string.Format("Ngày {0} tháng {1} năm {2}", row.ngaylap.Day, row.ngaylap.Month, row.ngaylap.Year); } else { rpt.lblNgayLap.Text = ""; } if (!row.IsnotkNull()) { rpt.lblNoTK.Text = row.notk; } else { rpt.lblNoTK.Text = ""; } }