public static void PrintReportRetenciones(long IdRetencion, Form parent) { FrmPreviewReport preview2 = new FrmPreviewReport(); DataSet data = tpu_Retenciones.GetList(IdRetencion); DataTable table = data.Tables[0]; string nombreEmpresa = Variables.GetValueString("Sistema.NombreEmpresa"); table = mz.erp.commontypes.AddColumn.AddColumnToTable(table, "NombreEmpresa", nombreEmpresa); string domicilioEmpresa = Variables.GetValueString("Sistema.DireccionEmpresa"); table = mz.erp.commontypes.AddColumn.AddColumnToTable(table, "DomicilioEmpresa", domicilioEmpresa); string cuitEmpresa = Variables.GetValueString("Sistema.CUITEmpresa"); table = mz.erp.commontypes.AddColumn.AddColumnToTable(table, "CUITEmpresa", cuitEmpresa); string IdTipoDeRetencion = (string)table.Rows[0]["IdTipoDeRetencion"]; if (IdTipoDeRetencion.Equals("G")) { preview2.ShowReport(table, "ReportRetencionGanancias.RPX", parent, new object [] {}); } else { preview2.ShowReport(table, "ReportRetencionIIBB.RPX", parent, new object [] {}); } }
private void button1_Click(object sender, EventArgs e) { DateTime fromDate = dtpFrom.Value; DateTime toDate = dtpTo.Value; List <tblTrain> listTrain = TrainFactory.SearchTrain("", Convert.ToInt16(((ComboBoxItem)ddlTypeName.SelectedItem).Value), true, fromDate, toDate); try { var report = new ReportPassengerTrain(); var txtType = (TextObject)report.Section1.ReportObjects["txtType"]; var txtFrom = (TextObject)report.Section1.ReportObjects["txtFrom"]; var txtTo = (TextObject)report.Section1.ReportObjects["txtTo"]; txtType.Text = ("HÀNH KHÁCH " + ddlTypeName.Text + " BẰNG ĐƯỜNG SẮT").ToUpper(); txtFrom.Text = txtFrom.Text + " " + dtpFrom.Text; txtTo.Text = txtTo.Text + " " + dtpTo.Text; DataSet1 dataset = new DataSet1(); DataTable dt = dataset.tblTrain; foreach (tblTrain train in listTrain) { dt.Rows.Add(train.TrainID, train.Number, train.Type, train.DateImportExport, train.Jounery, train.PassengerVN, train.PassengerForegin, train.Staff, train.CreatedDate, train.CreatedByName, train.ModifiedDate, train.ModifiedByName); } report.SetDataSource(dataset); FrmPreviewReport frmReport = new FrmPreviewReport(report); frmReport.MdiParent = this.MdiParent; frmReport.Show(); } catch (Exception ex) { } }
public static void PrintReportCierreCaja(string IdInstanciaCaja, Form parent) { FrmPreviewReport frmPR = new FrmPreviewReport(); DataTable table = mz.erp.businessrules.reportes.StatementSQLFactory.GetSQLForCierreCajaReport(IdInstanciaCaja); frmPR.ShowReport(table, "ReportCierreCaja.RPX", parent, new object [] {}); }
private void btnLihatContohNotaPenjualan_Click(object sender, EventArgs e) { var jualProdukId = string.Empty; using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { ICetakNotaBll bll = new CetakNotaDummyBll(); var listOfJual = bll.GetNotaPenjualan(jualProdukId); if (listOfJual.Count > 0) { var reportDataSource = new ReportDataSource { Name = "NotaPenjualan", Value = listOfJual }; var parameters = new List <ReportParameter>(); parameters.Add(new ReportParameter("header1", txtHeader1.Text)); parameters.Add(new ReportParameter("header2", txtHeader2.Text)); parameters.Add(new ReportParameter("header3", txtHeader3.Text)); parameters.Add(new ReportParameter("header4", txtHeader4.Text)); parameters.Add(new ReportParameter("header5", txtHeader5.Text)); var dt = DateTime.Now; var kotaAndTanggal = string.Format("{0}, {1}", MainProgram.profil.kota, dt.Day + " " + DayMonthHelper.GetBulanIndonesia(dt.Month) + " " + dt.Year); parameters.Add(new ReportParameter("kota", kotaAndTanggal)); parameters.Add(new ReportParameter("footer", MainProgram.pengguna.nama_pengguna)); var frmPreviewReport = new FrmPreviewReport("Contoh Nota Penjualan", "RvNotaPenjualanProduk2", reportDataSource, parameters); frmPreviewReport.ShowDialog(); } } }
private void btnLihatContohNotaPenjualanMiniPOS_Click(object sender, EventArgs e) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { var parameters = new List <ReportParameter>(); var index = 1; foreach (var txtHeaderNota in _listOfTxtHeaderNotaMiniPOS) { var paramName = string.Format("header{0}", index); parameters.Add(new ReportParameter(paramName, txtHeaderNota.Text)); index++; } index = 1; foreach (var txtFooterNota in _listOfTxtFooterNotaMiniPOS) { var paramName = string.Format("footer{0}", index); parameters.Add(new ReportParameter(paramName, txtFooterNota.Text)); index++; } var reportName = "RvNotaPenjualanMiniPOSTanpaCustomer"; if (chkCetakCustomer.Checked) { reportName = "RvNotaPenjualanMiniPOS"; } var frmPreviewReport = new FrmPreviewReport("Contoh Nota Penjualan MINI POS", reportName, new ReportDataSource(), parameters); frmPreviewReport.ShowDialog(); } }
public static void PrintReportImpuestos(DateTime fechaDesde, DateTime fechaHasta, ArrayList impuestos, Form parent) { DataTable table = mz.erp.businessrules.reportes.StatementSQLFactory.GetSQLForImpuestosReport(fechaDesde, fechaHasta, impuestos, Variables.GetValueString("Comprobantes.ComprobantesDeVenta")); // System.Data.DataSet data = mz.erp.businessrules.reportes.tsa_ReporteImpuestos.GetList(fechaDesde, fechaHasta, impuestos); FrmPreviewReport preview = new FrmPreviewReport(); preview.ShowReport(table, "ReportImpuestos.RPX", parent, new object [] { impuestos }); }
public static void PrintReportComprobantesCompras(string IdComprobante, string idTipoDecomprobante, Form parent) { string family = string.Empty; DataRow rowTipoComp = mz.erp.businessrules.tsy_TiposDeComprobantes.GetByPk(idTipoDecomprobante); if (rowTipoComp != null) { family = Convert.ToString(rowTipoComp["Familia"]); bool impresionHabilitada = Variables.GetValueBool("Comprobantes." + family + ".ImpresionManualHabilitada"); ArrayList tiposcomp = mz.erp.systemframework.Util.Parse(Variables.GetValueString("Reportes.TiposDeComprobantesCompras." + family), ","); if (impresionHabilitada) { if (tiposcomp.Contains(idTipoDecomprobante)) { FrmPreviewReport preview2 = new FrmPreviewReport(); ReportParameterCollection datos = new ReportParameterCollection(); datos.Add(new ReportParameter("DireccionEmpresa", Variables.GetValueString("Sistema.DireccionEmpresa"))); datos.Add(new ReportParameter("CategoriaIvaEmpresa", Variables.GetValueString("Sistema.CategoriaDeIvaEmpresa"))); datos.Add(new ReportParameter("TelefonoEmpresa", Variables.GetValueString("Sistema.TelefonosEmpresa"))); datos.Add(new ReportParameter("CUITEmpresa", Variables.GetValueString("Sistema.CUITEmpresa"))); datos.Add(new ReportParameter("IngresosBrutosEmpresa", Variables.GetValueString("Sistema.IngresosBrutosEmpresa"))); datos.Add(new ReportParameter("InicioActividadesEmpresa", Variables.GetValueString("Sistema.InicioActividadesEmpresa"))); datos.Add(new ReportParameter("Logo", Variables.GetValueString("Reportes.Logo"))); /* * datos.Add(new ReportParameter("Etiqueta1",Variables.GetValueString("Cuentas.CampoAuxiliar1.Etiqueta"))); * datos.Add(new ReportParameter("Etiqueta2",Variables.GetValueString("Cuentas.CampoAuxiliar2.Etiqueta"))); * datos.Add(new ReportParameter("Etiqueta3",Variables.GetValueString("Cuentas.CampoAuxiliar3.Etiqueta"))); */ string IdVariablesAuxiliares = Variables.GetValueString("Reportes.Comprobantes." + family + ".VariablesAuxiliares"); //los id de variables ArrayList ids = mz.erp.systemframework.Util.Parse(IdVariablesAuxiliares, ","); VariablesAuxiliares varAuxs = new VariablesAuxiliares(IdComprobante, idTipoDecomprobante); foreach (VariableAuxiliar var in varAuxs.VariablesDeUsuario) { if (ids.Contains(var.Id)) { string valor = var.Descripcion + ": " + var.Valor; datos.Add(new ReportParameter("Param" + var.Id, valor)); } } DataTable table = mz.erp.businessrules.reportes.StatementSQLFactory.GetSQLForComprobantesComprasReport(IdComprobante, family); preview2.ShowReport(table, "ReportComprobantesCompras" + family + ".RPX", parent, datos); } } else { MessageBox.Show(parent, "No esta habilitada la impresion para este tipo de comprobante", "Informacion", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information); } } }
public static void PrintReportLibroDeIVA(Form parent) { FrmPreviewReport preview2 = new FrmPreviewReport(); ArrayList impuestos = new ArrayList(); impuestos.Add("IVA"); impuestos.Add("IVADIF"); DataTable table = mz.erp.businessrules.reportes.StatementSQLFactory.GetSQLForImpuestosReport(DateTime.MinValue, DateTime.MinValue, 0, impuestos, Variables.GetValueString("Reportes.SubdiarioVentas.Comprobantes")); preview2.ShowReport(table, "ReportImpuestos.RPX", parent, new object [] { impuestos }); }
private void btnLihatContohNotaPenjualan_Click(object sender, EventArgs e) { var jualProdukId = string.Empty; using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { ICetakNotaBll bll = new CetakNotaDummyBll(); var listOfJual = bll.GetNotaPenjualan(jualProdukId); if (listOfJual.Count > 0) { var reportDataSource = new ReportDataSource { Name = "NotaPenjualan", Value = listOfJual }; var parameters = new List <ReportParameter>(); var index = 1; foreach (var txtHeaderNota in _listOfTxtHeaderNota) { var paramName = string.Format("header{0}", index); parameters.Add(new ReportParameter(paramName, txtHeaderNota.Text)); index++; } foreach (var item in listOfJual) { item.label_dari1 = txtDari1.Text; item.label_dari2 = txtDari2.Text; item.label_dari3 = txtDari3.Text; if (_pengaturanUmum.is_singkat_penulisan_ongkir) { item.ongkos_kirim /= 1000; } } var dt = DateTime.Now; var kotaAndTanggal = string.Format("{0}, {1}", MainProgram.profil.kota, dt.Day + " " + DayMonthHelper.GetBulanIndonesia(dt.Month) + " " + dt.Year); parameters.Add(new ReportParameter("kota", kotaAndTanggal)); parameters.Add(new ReportParameter("footer", MainProgram.pengguna.nama_pengguna)); var frmPreviewReport = new FrmPreviewReport("Contoh Nota Penjualan", "RvNotaPenjualanProdukLabel", reportDataSource, parameters); frmPreviewReport.ShowDialog(); } } }
public static void PrintReportCuentaCorriente(mz.erp.businessrules.comprobantes.CuentaCorriente _ctaCte, Form parent, string _process, bool soloPendientes, bool SoloFacturas, bool SoloNotasDeCreditos) { FrmPreviewReport frmpr = new FrmPreviewReport(); string ComprobantesCtaCte = Variables.GetValueString("Momentos." + _process + ".Comprobantes"); ArrayList FacturasList = new ArrayList(); ArrayList NotasDeCreditosList = new ArrayList(); if (SoloFacturas) { string Facturas = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Facturas"); FacturasList = mz.erp.systemframework.Util.Parse(Facturas, ","); string FacturasDV = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Facturas DV"); FacturasList.AddRange(mz.erp.systemframework.Util.Parse(FacturasDV, ",")); } if (SoloNotasDeCreditos) { string NotasDeCreditos = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Notas de Crédito"); NotasDeCreditosList = mz.erp.systemframework.Util.Parse(NotasDeCreditos, ","); string NotasDeCreditosDV = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Notas de Crédito DV"); FacturasList.AddRange(mz.erp.systemframework.Util.Parse(NotasDeCreditosDV, ",")); } //string ComprobantesCtaCte = Variables.GetValueString("Cuentas.CuentaCorriente.Comprobantes"); /* * table = mz.erp.businessrules.reportes.StatementSQLFactory.GetSQLForCuentaCorrienteReport(_ctaCte.FechaDesde, _ctaCte.FechaHasta, _ctaCte.IdCuenta, ComprobantesCtaCte, _ctaCte.OrderBy); * frmpr.ShowReport(table, "ReportCuentaCorriente.RPX", parent, new object []{}); */ ArrayList aux = new ArrayList(); foreach (DetalleCuentaCorriente dcc in _ctaCte.Detalle) { bool cond1 = !SoloNotasDeCreditos && !SoloFacturas; bool cond2 = SoloFacturas && FacturasList.Contains(dcc.IdTipoDeComprobante); bool cond3 = SoloNotasDeCreditos && NotasDeCreditosList.Contains(dcc.IdTipoDeComprobante); if (cond1 || cond2 || cond3) { DetalleCuentaCorrienteView dccw = new DetalleCuentaCorrienteView(dcc, _ctaCte.SaldoAnterior, _ctaCte.SaldoPosterior, soloPendientes, _ctaCte.Cuenta, _ctaCte.FechaDesde, _ctaCte.FechaHasta); aux.Add(dccw); } } DataTable table = (new mz.erp.commontypes.DataTableConverter()).GetDataTable(aux); FrmPreviewReport frmpr1 = new FrmPreviewReport(); frmpr1.ShowReport(table, "ReportCuentaCorriente.RPX", parent, new object [] {}); }
public static void PrintReportCuentaCorriente(ArrayList array, Form parent, string _process, bool soloPendientes, bool SoloFacturas, bool SoloNotasDeCreditos, decimal SaldoAnterior, decimal SaldoPosterior, DateTime FechaDesde, DateTime FechaHasta, string Codigo) { /*FrmPreviewReport frmpr = new FrmPreviewReport(); * string ComprobantesCtaCte = Variables.GetValueString("Momentos."+ _process+ ".Comprobantes"); * ArrayList FacturasList = new ArrayList(); * ArrayList NotasDeCreditosList = new ArrayList(); * if(SoloFacturas) * { * string Facturas = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Facturas"); * FacturasList = mz.erp.systemframework.Util.Parse(Facturas,","); * string FacturasDV = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Facturas DV"); * FacturasList.AddRange( mz.erp.systemframework.Util.Parse(FacturasDV,",")); * } * * if(SoloNotasDeCreditos) * { * string NotasDeCreditos = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Notas de Crédito"); * NotasDeCreditosList = mz.erp.systemframework.Util.Parse(NotasDeCreditos,","); * string NotasDeCreditosDV = Variables.GetValueString("Comprobantes.TiposDeComprobantes.Notas de Crédito DV"); * FacturasList.AddRange( mz.erp.systemframework.Util.Parse(NotasDeCreditosDV,",")); * }*/ ArrayList aux = new ArrayList(); foreach (ItemCuentaCorriente icc in array) { /*bool cond1 = !SoloNotasDeCreditos && !SoloFacturas; * bool cond2 = SoloFacturas && FacturasList.Contains(dcc.IdTipoDeComprobante); * bool cond3 = SoloNotasDeCreditos && NotasDeCreditosList.Contains(dcc.IdTipoDeComprobante);*/ //if(cond1 || cond2 || cond3) //{ DetalleCuentaCorrienteView dccw = new DetalleCuentaCorrienteView(icc, SaldoAnterior, SaldoPosterior, soloPendientes, Codigo, FechaDesde, FechaHasta); aux.Add(dccw); //} } DataTable table = (new mz.erp.commontypes.DataTableConverter()).GetDataTable(aux); FrmPreviewReport frmpr1 = new FrmPreviewReport(); frmpr1.ShowReport(table, "ReportCuentaCorriente.RPX", parent, new object [] {}); }
private void button1_Click(object sender, EventArgs e) { List <ViewListHanoverReply> listViewListHanoverReply = HandoverReplyFactory.search("", "", true, dtpFrom.Value, dtpTo.Value); var report = new ReportSoTheoDoiBangKeHoiBao(); var txtFrom = (TextObject)report.Section1.ReportObjects["txtFrom"]; var txtTo = (TextObject)report.Section1.ReportObjects["txtTo"]; txtFrom.Text = txtFrom.Text + " " + dtpFrom.Text; txtTo.Text = txtTo.Text + " " + dtpTo.Text; DataSet1 dataset = new DataSet1(); DataTable dt = dataset.BangKeHoiBao; foreach (ViewListHanoverReply obj in listViewListHanoverReply) { dt.Rows.Add(obj.ID, obj.ListReplyNumber, obj.ListReplyDate, obj.CustomsReceiverName, obj.Note); } report.SetDataSource(dataset); FrmPreviewReport frmReport = new FrmPreviewReport(report); frmReport.MdiParent = this.MdiParent; frmReport.Show(); }
private void PreviewReportHeader() { var periode = string.Empty; IReportBeliProdukBll reportBll = new ReportBeliProdukBll(_log); IList <BeliProduk> listOfBeli = new List <BeliProduk>(); var listOfSupplierId = new List <string>(); if (chkBoxTitle.Checked) { for (int i = 0; i < chkListBox.Items.Count; i++) { if (chkListBox.GetItemChecked(i)) { var supplier = _listOfSupplier[i]; listOfSupplierId.Add(supplier.supplier_id); } } if (listOfSupplierId.Count == 0) { MsgHelper.MsgWarning("Minimal 1 supplier harus dipilih"); return; } } if (rdoTanggal.Checked) { if (!DateTimeHelper.IsValidRangeTanggal(dtpTanggalMulai.Value, dtpTanggalSelesai.Value)) { MsgHelper.MsgNotValidRangeTanggal(); return; } if (dtpTanggalMulai.Value == dtpTanggalSelesai.Value) { periode = string.Format("Periode : {0}", DateTimeHelper.DateToString(dtpTanggalMulai.Value)); } else { periode = string.Format("Periode : {0} s.d {1}", DateTimeHelper.DateToString(dtpTanggalMulai.Value), DateTimeHelper.DateToString(dtpTanggalSelesai.Value)); } listOfBeli = reportBll.GetByTanggal(dtpTanggalMulai.Value, dtpTanggalSelesai.Value); } else { periode = string.Format("Periode : {0} {1}", cmbBulan.Text, cmbTahun.Text); var bulan = cmbBulan.SelectedIndex + 1; var tahun = int.Parse(cmbTahun.Text); listOfBeli = reportBll.GetByBulan(bulan, tahun); } if (listOfSupplierId.Count > 0 && listOfBeli.Count > 0) { listOfBeli = listOfBeli.Where(f => f.Supplier != null && listOfSupplierId.Contains(f.supplier_id)) .ToList(); } if (listOfBeli.Count > 0) { var listOfSupplier = listOfBeli.Select(f => f.Supplier).ToList() .GroupBy(gb => gb.supplier_id).Select(g => g.First()).ToList(); var listOfPengguna = listOfBeli.Select(f => f.Supplier).ToList() .GroupBy(gb => gb.supplier_id).Select(g => g.First()).ToList(); var listOfBeliDto = Mapper.Map <IList <BeliProdukDto> >(listOfBeli); var rpt = new CrPembelianProdukHeader(); rpt.Database.Tables["Supplier"].SetDataSource(listOfSupplier); rpt.Database.Tables["Pengguna"].SetDataSource(listOfPengguna); rpt.Database.Tables["BeliProduk"].SetDataSource(listOfBeliDto); rpt.SetParameterValue("periode", periode); var frmPreview = new FrmPreviewReport(this.Text, rpt); frmPreview.ShowDialog(); } else { MsgHelper.MsgInfo("Maaf data pembelian tidak ditemukan"); } }
private void printBBBG() { try { var reportHandOver = new ReportHandOver(); var txtNumberHandover = (TextObject)reportHandOver.Section1.ReportObjects["txtNumberHandover"]; var ddlGaDenDi = (TextObject)reportHandOver.Section1.ReportObjects["ddlGaDenDi"]; var dtpHandover = (TextObject)reportHandOver.Section1.ReportObjects["dtpHandover"]; //Khong dung //var txtSummary = (TextObject)reportHandOver.Section1.ReportObjects["txtSummary"]; var txtStatusVehicle = (TextObject)reportHandOver.Section1.ReportObjects["txtStatusVehicle"]; var txtStatusGoods = (TextObject)reportHandOver.Section1.ReportObjects["txtStatusGoods"]; var txtCustoms = (TextObject)reportHandOver.Section1.ReportObjects["txtCustoms"]; //var txtPath = (TextObject)reportHandOver.Section1.ReportObjects["txtPath"]; //var txtConfirmOfToStation = (TextObject)reportHandOver.Section1.ReportObjects["txtConfirmOfToStation"]; var txtToStation = (TextObject)reportHandOver.Section1.ReportObjects["txtToStation"]; var txtFromStation = (TextObject)reportHandOver.Section1.ReportObjects["txtFromStation"]; long handoverId = _handover.ID; //1L; tblHandover handover = TrainFactory.FindHandoverByID(handoverId); if (handover != null) { if (handover.tblHandoverResources.IsLoaded == false) { handover.tblHandoverResources.Load(); } List <tblHandoverResource> listTblHandoverResources = TrainFactory.FindHandoverResourceByHandoverID(handoverId); //List<tblHandoverResource> listTblHandoverResources = handover.tblHandoverResources.ToList(); ; List <tblToaTau> listToaTau = new List <tblToaTau>(); foreach (tblHandoverResource obj in listTblHandoverResources) { if (obj.tblToaTauReference.IsLoaded == false) { obj.tblToaTauReference.Load(); } if (obj.tblToaTau != null) { listToaTau.Add(obj.tblToaTau); } } DataSet1 dataset = new DataSet1(); DataTable dt = dataset.tblToaTau; //dt = ListToDataTable.ToDataTable(listToaTau); foreach (tblToaTau toaTau in listToaTau) { if (toaTau.tblChuyenTauReference.IsLoaded == false) { toaTau.tblChuyenTauReference.Load(); } dt.Rows.Add(toaTau.ToaTauID, toaTau.Ma_ToaTau , toaTau.So_VanTai_Don , toaTau.Ngay_VanTai_Don , toaTau.Ten_DoiTac , toaTau.Ma_DoanhNghiep , toaTau.Ten_Hang , toaTau.Trong_Luong , toaTau.Don_Vi_Tinh , toaTau.Seal_VanTai , toaTau.Seal_VanTai2 , toaTau.Seal_HaiQuan , toaTau.Seal_HaiQuan2 , toaTau.Ghi_Chu , toaTau.CreatedDate , toaTau.CreatedBy , toaTau.ModifiedDate , toaTau.ModifiedBy , toaTau.tblChuyenTau.TrainID); } reportHandOver.SetDataSource(dataset); String fromStation = CustomsFacory.FindByCode(handover.CodeStation).CustomsName; String toStation = CustomsFacory.FindByCode(handover.CodeStationFromTo).CustomsName; //if (handover.DateHandover != null) //{ // String dateString = "Hồi " + handover.DateHandover.Value.Hour + " giờ " + handover.DateHandover.Value.Minute + " phút, ngày " + handover.DateHandover.Value.Day + " tháng " + handover.DateHandover.Value.Month + " năm " + handover.DateHandover.Value.Year; // txtSummary.Text = dateString + " " + fromStation + " bàn giao cho Chi nhánh vận tải hàng hóa đường sắt Đồng Đăng" + // " lô hàng nhập khẩu chuyển cảng vận chuyển từ " + fromStation + " đến " + toStation + "."; //} //txtNumberHandover.Text = "Số: " + handover.NumberHandover + "/BBBG-HQGA"; txtNumberHandover.Text = "Số: " + handover.NumberHandover; // Ten hai quan den ddlGaDenDi.Text = "Kính gửi: " + toStation; if (handover.DateHandover != null) { dtpHandover.Text = "Thời gian chuyển: hồi " + handover.DateHandover.Value.Hour + " giờ ngày " + handover.DateHandover.Value.Day + " tháng " + handover.DateHandover.Value.Month + " năm " + handover.DateHandover.Value.Year; } txtStatusVehicle.Text = handover.StatusVehicle; txtStatusGoods.Text = handover.StatusGoods; txtCustoms.Text = fromStation.ToUpper(); //txtPath.Text = "Từ " + fromStation + " đến " + toStation; //txtConfirmOfToStation.Text = "5. Xác nhận của " + toStation + ":"; txtFromStation.Text = fromStation; txtToStation.Text = toStation; } reportHandOver.Section3.SectionFormat.EnableUnderlaySection = true; reportHandOver.Section3.SectionFormat.EnableKeepTogether = true; FrmPreviewReport frmReport = new FrmPreviewReport(reportHandOver); frmReport.MdiParent = this.MdiParent; frmReport.Show(); } catch (Exception ex) { throw ex; } }
private void button1_Click(object sender, EventArgs e) { try { Int32 countTrain = 0, countToaTau = 0, countHandoder = 0, countDeclaration = 0, countEmpty = 0; int importExportTypeSearch = Convert.ToInt32(((ComboBoxItem)ddlImportExportType.SelectedItem).Value); List <tblChuyenTau> listTrain = TrainFactory.SearchChuyenTau("", Convert.ToInt32(((ComboBoxItem)ddlTypeName.SelectedItem).Value), true, dtpFrom.Value, dtpTo.Value); //if(importExportTypeSearch == 0) //chi list ke toa rong //{ // listTrain = listTrain.Where(x => x.tblToaTaus.Where( y => y.LoaiToaTau == (short)LoaiToaTau.ToaRong)).ToList(); //} DataSet1 dataset = new DataSet1(); DataTable dt = dataset.ViewToaTau; foreach (tblChuyenTau train in listTrain) { countTrain++; if (train.tblToaTaus.IsLoaded == false) { train.tblToaTaus.Load(); } List <tblToaTau> listToaTau = train.tblToaTaus.ToList(); foreach (tblToaTau toaTau in listToaTau) { countToaTau++; string loaiToa = ""; string loaiHinh = ""; string soBBBG = ""; string tenNguoiGui = ""; string tenNguoiNhan = ""; if (importExportTypeSearch == 0) //chi list ke toa rong { if (toaTau.LoaiToaTau != (short)LoaiToaTau.ToaRong) { continue; } } if (importExportTypeSearch == (int)ToaTauImportType.TaiCho) //chi list ke toa co loai hinh "tai cho" { if (toaTau.ImportExportType != (short)ToaTauImportType.TaiCho) { continue; } } if (importExportTypeSearch == (int)ToaTauImportType.ChuyenCang) //chi list ke toa co loai hinh "chuyen cang" { if (toaTau.ImportExportType != (short)ToaTauImportType.ChuyenCang) { continue; } } switch (toaTau.LoaiToaTau) { case (short)LoaiToaTau.ToaKin: loaiToa = "Toa kín"; break; case (short)LoaiToaTau.ToaRong: loaiToa = "Toa rỗng"; countEmpty++; break; case (short)LoaiToaTau.ToaTran: loaiToa = "Toa trần"; break; default: break; } switch (toaTau.ImportExportType) { case (short)ToaTauImportType.ChuyenCang: loaiHinh = "Chuyển cảng"; try { if (toaTau.tblHandoverResources.IsLoaded == false) { toaTau.tblHandoverResources.Load(); } tblHandoverResource handoverResource = toaTau.tblHandoverResources.FirstOrDefault(); if (handoverResource != null) { if (handoverResource.tblHandoverReference.IsLoaded == false) { handoverResource.tblHandoverReference.Load(); } soBBBG = handoverResource.tblHandover.NumberHandover; } } catch (Exception ex) { soBBBG = ""; } countHandoder++; break; case (short)ToaTauImportType.TaiCho: loaiHinh = "Tại chỗ"; try { if (toaTau.tblToKhaiTauResources.IsLoaded == false) { toaTau.tblToKhaiTauResources.Load(); } tblToKhaiTauResource toKhaiTauResources = toaTau.tblToKhaiTauResources.FirstOrDefault(); if (toKhaiTauResources != null) { if (toKhaiTauResources.tblToKhaiTauReference.IsLoaded == false) { toKhaiTauResources.tblToKhaiTauReference.Load(); } soBBBG = toKhaiTauResources.tblToKhaiTau.Number + ""; } } catch (Exception ex) { soBBBG = ""; } countDeclaration++; break; default: break; } if (train.Type == 0) //xuat { tenNguoiGui = toaTau.Ten_DoanhNghiep; tenNguoiNhan = toaTau.Ten_DoiTac; } else //nhap { tenNguoiGui = toaTau.Ten_DoiTac; tenNguoiNhan = toaTau.Ten_DoanhNghiep; } dt.Rows.Add(toaTau.ToaTauID, train.Ma_Chuyen_Tau, train.Ngay_XNC, toaTau.Ma_ToaTau, toaTau.So_VanTai_Don, tenNguoiGui, tenNguoiNhan, toaTau.Ten_Hang, toaTau.Don_Vi_Tinh, toaTau.Trong_Luong, soBBBG, toaTau.Seal_VanTai, toaTau.Seal_VanTai2, toaTau.Seal_HaiQuan, toaTau.Seal_HaiQuan2, loaiToa, loaiHinh, toaTau.Ghi_Chu); } } var report = new ReportTrainImportExport(); var txtType = (TextObject)report.Section1.ReportObjects["txtType"]; var txtFrom = (TextObject)report.Section1.ReportObjects["txtFrom"]; var txtTo = (TextObject)report.Section1.ReportObjects["txtTo"]; var txtCountTrain = (TextObject)report.Section1.ReportObjects["txtCountTrain"]; var txtCountToaTau = (TextObject)report.Section1.ReportObjects["txtCountToaTau"]; var txtCountHandover = (TextObject)report.Section1.ReportObjects["txtCountHandover"]; var txtCountDeclaration = (TextObject)report.Section1.ReportObjects["txtCountDeclaration"]; var txtCountEmpty = (TextObject)report.Section1.ReportObjects["txtCountEmpty"]; txtType.Text = ("SỔ THEO DÕI TÀU HÀNG " + ddlTypeName.Text).ToUpper(); txtFrom.Text = txtFrom.Text + " " + dtpFrom.Text; txtTo.Text = txtTo.Text + " " + dtpTo.Text; txtCountTrain.Text = txtCountTrain.Text + " " + (countTrain != 0?countTrain.ToString("#.###"):"0"); txtCountToaTau.Text = txtCountToaTau.Text + " " + (countToaTau != 0?countToaTau.ToString("#.###"):"0"); txtCountHandover.Text = txtCountHandover.Text + " " + (countHandoder != 0? countHandoder.ToString("#.###"):"0"); txtCountDeclaration.Text = txtCountDeclaration.Text + " " + (countDeclaration != 0?countDeclaration.ToString("#.###"):"0"); txtCountEmpty.Text = txtCountEmpty.Text + " " + (countEmpty != 0 ? countEmpty.ToString("#.###") : "0"); report.SetDataSource(dataset); FrmPreviewReport frmReport = new FrmPreviewReport(report); frmReport.MdiParent = this.MdiParent; frmReport.Show(); } catch (Exception ex) { } }
private void button1_Click(object sender, EventArgs e) { String replyType = ((ComboBoxItem)cbType.SelectedItem).Value.ToString(); Nullable <Boolean> replyStatus = null; if (((ComboBoxItem)cbReplyStatus.SelectedItem).Value != null) { replyStatus = (Boolean)(((ComboBoxItem)cbReplyStatus.SelectedItem).Value); } List <tblHandover> listHandover = TrainFactory.SearchBBBG("", true, dtpFrom.Value, dtpTo.Value, replyStatus, replyType, false); DataSet1 dataset = new DataSet1(); DataTable dt = dataset.BBBG; foreach (tblHandover handover in listHandover) { string tenHaiQuanChuyenDen = ""; string tenHaiQuanChuyenDi = ""; if (replyType == "0") //BBBG den { tenHaiQuanChuyenDen = CustomsFacory.FindByCode(handover.CodeStation).CustomsName; tenHaiQuanChuyenDi = CustomsFacory.FindByCode(handover.CodeStationFromTo).CustomsName; } else if (replyType == "1") //BBBG di { tenHaiQuanChuyenDen = CustomsFacory.FindByCode(handover.CodeStationFromTo).CustomsName; tenHaiQuanChuyenDi = CustomsFacory.FindByCode(handover.CodeStation).CustomsName; } dt.Rows.Add(handover.ID, handover.NumberHandover, handover.DateHandover, tenHaiQuanChuyenDi, tenHaiQuanChuyenDen, handover.StatusVehicle, handover.StatusGoods, handover.DateReply, handover.Note); } if (replyType == "0") //BBBG den { var report = new ReportHandoverComeIn(); var txtType = (TextObject)report.Section1.ReportObjects["txtType"]; var txtFrom = (TextObject)report.Section1.ReportObjects["txtFrom"]; var txtTo = (TextObject)report.Section1.ReportObjects["txtTo"]; txtFrom.Text = txtFrom.Text + " " + dtpFrom.Text; txtTo.Text = txtTo.Text + " " + dtpTo.Text; txtType.Text = ("SỔ THEO DÕI BBBG HÀNG CHUYỂN CẢNG ĐẾN").ToUpper(); report.SetDataSource(dataset); FrmPreviewReport frmReport = new FrmPreviewReport(report); frmReport.MdiParent = this.MdiParent; frmReport.Show(); } else if (replyType == "1") //BBBG di { var report = new ReportHandoverOut(); var txtType = (TextObject)report.Section1.ReportObjects["txtType"]; var txtFrom = (TextObject)report.Section1.ReportObjects["txtFrom"]; var txtTo = (TextObject)report.Section1.ReportObjects["txtTo"]; txtFrom.Text = txtFrom.Text + " " + dtpFrom.Text; txtTo.Text = txtTo.Text + " " + dtpTo.Text; txtType.Text = ("SỔ THEO DÕI BBBG HÀNG CHUYỂN CẢNG ĐI").ToUpper(); report.SetDataSource(dataset); FrmPreviewReport frmReport = new FrmPreviewReport(report); frmReport.MdiParent = this.MdiParent; frmReport.Show(); } }
public static void PrintReportComprobantes(string IdComprobante, string idTipoDecomprobante, Form parent) { string family = string.Empty; DataRow rowTipoComp = mz.erp.businessrules.tsy_TiposDeComprobantes.GetByPk(idTipoDecomprobante); if (rowTipoComp != null) { family = Convert.ToString(rowTipoComp["Familia"]); bool impresionHabilitada = Variables.GetValueBool("Comprobantes." + family + ".ImpresionManualHabilitada"); ArrayList tiposcomp = mz.erp.systemframework.Util.Parse(Variables.GetValueString("Reportes.TiposDeComprobantes." + family), ","); if (impresionHabilitada) { if (tiposcomp.Contains(idTipoDecomprobante)) { /* Silvina 20110223 - Tarea 36 */ ArrayList compPagos = mz.erp.systemframework.Util.Parse(Variables.GetValueString("Comprobantes.ComprobantesDePago"), ","); if (compPagos.Contains(idTipoDecomprobante)) { FrmPreviewReport preview2 = new FrmPreviewReport(); ReportParameterCollection datos = new ReportParameterCollection(); tsa_ComprobantesDataset.tsa_ComprobantesRow comp = mz.erp.businessrules.tsa_Comprobantes.GetByPk(IdComprobante); decimal Total = comp.Total; DataTable table = mz.erp.businessrules.tsa_Comprobantes.GetComprobanteDePagoView(IdComprobante); string moneda = mz.erp.businessrules.tfi_Monedas.GetDescripcionMoneda(comp.IdMonedaCierre); string textoNumeros = NumberToText.NumberToWords(Total, moneda); string nombreEmpresa = Variables.GetValueString("Sistema.NombreEmpresa"); table = AddColumn.AddColumnToTable(table, "NombreEmpresa", nombreEmpresa); string domicilioEmpresa = Variables.GetValueString("Sistema.DireccionEmpresa"); table = AddColumn.AddColumnToTable(table, "DomicilioEmpresa", domicilioEmpresa); string cuitEmpresa = Variables.GetValueString("Sistema.CUITEmpresa"); table = AddColumn.AddColumnToTable(table, "CUITEmpresa", cuitEmpresa); foreach (DataRow row in table.Rows) { row["TextoTotal"] = textoNumeros; } preview2.ShowReport(table, "ReportComprobantes" + family + ".RPX", parent, datos); } else { /* Fin Silvina */ FrmPreviewReport preview2 = new FrmPreviewReport(); ReportParameterCollection datos = new ReportParameterCollection(); datos.Add(new ReportParameter("DireccionEmpresa", Variables.GetValueString("Sistema.DireccionEmpresa"))); datos.Add(new ReportParameter("CategoriaIvaEmpresa", Variables.GetValueString("Sistema.CategoriaDeIvaEmpresa"))); datos.Add(new ReportParameter("TelefonoEmpresa", Variables.GetValueString("Sistema.TelefonosEmpresa"))); datos.Add(new ReportParameter("CUITEmpresa", Variables.GetValueString("Sistema.CUITEmpresa"))); datos.Add(new ReportParameter("IngresosBrutosEmpresa", Variables.GetValueString("Sistema.IngresosBrutosEmpresa"))); datos.Add(new ReportParameter("InicioActividadesEmpresa", Variables.GetValueString("Sistema.InicioActividadesEmpresa"))); datos.Add(new ReportParameter("Logo", Variables.GetValueString("Reportes.Logo"))); datos.Add(new ReportParameter("Etiqueta1", Variables.GetValueString("Cuentas.CampoAuxiliar1.Etiqueta"))); datos.Add(new ReportParameter("Etiqueta2", Variables.GetValueString("Cuentas.CampoAuxiliar2.Etiqueta"))); datos.Add(new ReportParameter("Etiqueta3", Variables.GetValueString("Cuentas.CampoAuxiliar3.Etiqueta"))); string IdVariablesAuxiliares = Variables.GetValueString("Reportes.Comprobantes." + family + ".VariablesAuxiliares"); //los id de variables ArrayList ids = mz.erp.systemframework.Util.Parse(IdVariablesAuxiliares, ","); VariablesAuxiliares varAuxs = new VariablesAuxiliares(IdComprobante, idTipoDecomprobante); foreach (VariableAuxiliar var in varAuxs.VariablesDeUsuario) { if (ids.Contains(var.Id)) { string valor = var.Descripcion + ": " + var.Valor; datos.Add(new ReportParameter("Param" + var.Id, valor)); } } DataTable table = mz.erp.businessrules.reportes.StatementSQLFactory.GetSQLForComprobantesReport(IdComprobante, family); preview2.ShowReport(table, "ReportComprobantes" + family + ".RPX", parent, datos); } } } else { MessageBox.Show(parent, "No esta habilitada la impresion para este tipo de comprobante", "Informacion", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information); } } }
public static void PrintReportConsultaCobranzas(DataTable Data, Form parent) { FrmPreviewReport preview2 = new FrmPreviewReport(); preview2.ShowReport(Data, "ReportConsultarCobranzas.RPX", parent, new object[] { }); }
private void print() { try { long replyId = _tblListHandoverReply.ID; tblListHandoverReply handoverReply = HandoverReplyFactory.FindByID(replyId); if (handoverReply == null) { MessageBox.Show("Không kết nối được với CSDL hoặc Bảng kê hồi báo này không còn tồn tại. Xin kiểm tra lại "); return; } var report = new ReportListHanoverReply(); var txtNumber = (TextObject)report.Section1.ReportObjects["txtNumber"]; var txtReplyDate = (TextObject)report.Section1.ReportObjects["txtReplyDate"]; var txtReceiverCustomsName = (TextObject)report.Section1.ReportObjects["txtReceiverCustomsName"]; var txtSummary = (TextObject)report.Section1.ReportObjects["txtSummary"]; var txtGoodsStatus = (TextObject)report.Section4.ReportObjects["txtGoodsStatus"]; var txtNote = (TextObject)report.Section4.ReportObjects["txtNote"]; txtNumber.Text = "Số: " + handoverReply.ListReplyNumber; txtReplyDate.Text = "Lạng Sơn, ngày " + handoverReply.ListReplyDate.GetValueOrDefault().Day + " tháng " + handoverReply.ListReplyDate.GetValueOrDefault().Month + " năm " + handoverReply.ListReplyDate.GetValueOrDefault().Year; txtReceiverCustomsName.Text = "Kính gửi: " + CustomsFacory.FindByCode(handoverReply.CustomsCodeReceiver).CustomsName; String fromDate = handoverReply.ReportFromDate.GetValueOrDefault().ToString("dd/MM/yyyy"); String toDate = handoverReply.ReportToDate.GetValueOrDefault().ToString("dd/MM/yyyy"); txtSummary.Text = " " + "Chi cục Hải quan ga ĐSQT Đồng đăng đã nhận được hàng và Biên bản bàn giao hàng nhập khẩu của chi cục từ ngày " + fromDate + " đến ngày " + toDate; txtGoodsStatus.Text = " " + "Tình trạng hàng hóa: " + handoverReply.ReplyStatusGoods; txtNote.Text = " " + handoverReply.Note; //fill table BBBG DataSet1 dataset = new DataSet1(); DataTable dt = dataset.tblHandover; if (handoverReply != null && handoverReply.tblHandovers.IsLoaded == false) { handoverReply.tblHandovers.Load(); } List <tblHandover> listHandover = handoverReply.tblHandovers.ToList(); foreach (tblHandover obj in listHandover) { if (obj.IsDeleted.GetValueOrDefault() != true) { dt.Rows.Add(obj.ID, obj.NumberHandover, obj.DateHandover, obj.CodeStation, obj.CodeStationFromTo, obj.StatusGoods, obj.StatusVehicle, obj.CreatedDate, obj.CreatedBy, obj.ModifiedDate, obj.ModifiedBy, obj.NumberReply, obj.DateReply, obj.NoteReply, obj.IsDeleted, obj.IsReplied, obj.Note, obj.Type, obj.ReplyStatusGoods, null); } } report.SetDataSource(dataset); FrmPreviewReport frmReport = new FrmPreviewReport(report); frmReport.MdiParent = this.MdiParent; frmReport.Show(); } catch (Exception ex) { } }