public Boolean ModificarDatos(tb_sis_Documento_Tipo_Reporte_x_Empresa_Info Info, ref string msjError) { try { using (EntitiesGeneral context = new EntitiesGeneral()) { var contact = context.tb_sis_Documento_Tipo_Reporte_x_Empresa.FirstOrDefault(af => af.IdEmpresa == Info.IdEmpresa && af.codDocumentoTipo == Info.codDocumentoTipo); if (contact != null) { contact.File_Disenio_Reporte = Info.File_Disenio_Reporte; contact.IdUsuarioUltMod = Info.IdUsuario; contact.Fecha_UltMod = DateTime.Now; context.SaveChanges(); } } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GuardarDatos(tb_sis_Documento_Tipo_Reporte_x_Empresa_Info Info, ref string msjError) { try { using (EntitiesGeneral context = new EntitiesGeneral()) { var Address = new tb_sis_Documento_Tipo_Reporte_x_Empresa(); Address.IdEmpresa = Info.IdEmpresa; Address.codDocumentoTipo = Info.codDocumentoTipo; Address.File_Disenio_Reporte = Info.File_Disenio_Reporte; Address.Fecha_Transac = DateTime.Now; Address.IdUsuario = Info.IdUsuario; context.tb_sis_Documento_Tipo_Reporte_x_Empresa.Add(Address); context.SaveChanges(); } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public tb_sis_Documento_Tipo_Reporte_x_Empresa_Info get_DisenioRpt(int IdEmpresa, string codDocumentoTipo) { try { tb_sis_Documento_Tipo_Reporte_x_Empresa_Info InfoRpt = new tb_sis_Documento_Tipo_Reporte_x_Empresa_Info(); using (EntitiesGeneral listado = new EntitiesGeneral()) { var select = from q in listado.tb_sis_Documento_Tipo_Reporte_x_Empresa where q.IdEmpresa == IdEmpresa && q.codDocumentoTipo == codDocumentoTipo select q; foreach (var item in select) { InfoRpt.IdEmpresa = item.IdEmpresa; InfoRpt.codDocumentoTipo = item.codDocumentoTipo; InfoRpt.File_Disenio_Reporte = item.File_Disenio_Reporte; } } return(InfoRpt); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GuardarDatos(tb_sis_Documento_Tipo_Reporte_x_Empresa_Info Info, ref string msjError) { try { Info.IdUsuario = param.IdUsuario; Info.IdUsuarioUltMod = param.IdUsuario; if (dataDoc.ValidarExistencia(Info.IdEmpresa, Info.codDocumentoTipo)) { return(dataDoc.GuardarDatos(Info, ref msjError)); } else { return(dataDoc.ModificarDatos(Info, ref msjError)); } } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GuardarDatos", ex.Message), ex) { EntityType = typeof(tb_sis_Documento_Tipo_Reporte_x_Empresa_Bus) }; } }
public XCXP_Rpt015_frm(vwtb_sis_Documento_Tipo_x_Disenio_Report_Info Info) { InitializeComponent(); commandBarItem31.PerformClick(); XCXP_Rpt015_rpt reporte = new XCXP_Rpt015_rpt(); InfoDoc_x_Emp = busDoc_x_Emp.get_DisenioRpt(Info.IdEmpresa, Info.codDocumentoTipo); if (InfoDoc_x_Emp.File_Disenio_Reporte != null) { File.WriteAllBytes(RootReporte, InfoDoc_x_Emp.File_Disenio_Reporte); reporte.LoadLayout(RootReporte); } InfoDoc_x_Emp.IdEmpresa = Info.IdEmpresa; InfoDoc_x_Emp.codDocumentoTipo = Info.codDocumentoTipo; xrDesignDockManager1.XRDesignPanel.OpenReport(reporte); }
private void imprimir_reporte() { try { XFAC_FJ_Rpt014_Rpt rptSoporte = new XFAC_FJ_Rpt014_Rpt(); tb_sis_Documento_Tipo_Reporte_x_Empresa_Bus busDoc_x_Emp = new tb_sis_Documento_Tipo_Reporte_x_Empresa_Bus(); tb_sis_Documento_Tipo_Reporte_x_Empresa_Info InfoDoc_x_Emp = new tb_sis_Documento_Tipo_Reporte_x_Empresa_Info(); InfoDoc_x_Emp = busDoc_x_Emp.get_DisenioRpt(param.IdEmpresa, Cl_Enumeradores.eTipoDocumento_Talonario.FACT.ToString()); if (InfoDoc_x_Emp.File_Disenio_Reporte != null) { File.WriteAllBytes(RootReporte, InfoDoc_x_Emp.File_Disenio_Reporte); rptSoporte.LoadLayout(RootReporte); } XFAC_FJ_Rpt014_Bus busRpt = new XFAC_FJ_Rpt014_Bus(); List <XFAC_FJ_Rpt014_Info> lstRpt = new List <XFAC_FJ_Rpt014_Info>(); rptSoporte.RequestParameters = false; /* * rptSoporte.P_IdSucursal.Value = info_factura.IdSucursal; * rptSoporte.P_IdSucursal.Visible = false; * * rptSoporte.P_IdBodega.Value = info_factura.IdBodega; * rptSoporte.P_IdBodega.Visible = false; * * rptSoporte.P_IdCbteVta.Value = info_factura.IdCbteVta; * rptSoporte.P_IdCbteVta.Visible = false; * * rptSoporte.P_Numero_lineas.Value = Info_Param_fact.NumeroDeItemFact; * rptSoporte.P_Numero_lineas.Visible = false; */ rptSoporte.CreateDocument(); rptSoporte.ShowPreviewDialog(); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
private void imprimir() { try { XFAC_Rpt008_rpt rptSoporte = new XFAC_Rpt008_rpt(param.IdUsuario); tb_sis_Documento_Tipo_Reporte_x_Empresa_Bus busDoc_x_Emp = new tb_sis_Documento_Tipo_Reporte_x_Empresa_Bus(); tb_sis_Documento_Tipo_Reporte_x_Empresa_Info InfoDoc_x_Emp = new tb_sis_Documento_Tipo_Reporte_x_Empresa_Info(); InfoDoc_x_Emp = busDoc_x_Emp.get_DisenioRpt(param.IdEmpresa, Cl_Enumeradores.eTipoDocumento_Talonario.FACT.ToString()); if (InfoDoc_x_Emp.File_Disenio_Reporte != null) { File.WriteAllBytes(RootReporte, InfoDoc_x_Emp.File_Disenio_Reporte); rptSoporte.LoadLayout(RootReporte); } XFAC_Rpt008_Bus busRpt = new XFAC_Rpt008_Bus(); List <XFAC_Rpt008_Info> lstRpt = new List <XFAC_Rpt008_Info>(); rptSoporte.RequestParameters = false; var io = lst_termino_pago.FirstOrDefault(q => q.IdTerminoPago == info_factura.vt_tipo_venta); bool mostrar_cuotas = false; if (io.Num_Cuotas > 0) { if (MessageBox.Show("Desea mostrar el detalle de las cuotas al imprimir", param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { mostrar_cuotas = true; } } lstRpt = busRpt.get_ImpresionFactura(info_factura.IdEmpresa, info_factura.IdSucursal, info_factura.IdBodega, info_factura.IdCbteVta, mostrar_cuotas); rptSoporte.lstRpt = lstRpt; rptSoporte.CreateDocument(); rptSoporte.ShowPreviewDialog(); } catch (Exception ex) { string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name; NameMetodo = NameMetodo + " - " + ex.ToString(); MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString()); } }
private void Imprimir_Reporte_Ret(string EstaImpresa) { try { XCXP_Rpt015_rpt reportes = new XCXP_Rpt015_rpt(); string RootReporte = System.IO.Path.GetTempPath() + "reporteRetencionComprobante..repx"; tb_sis_Documento_Tipo_Reporte_x_Empresa_Bus busDoc_x_Emp = new tb_sis_Documento_Tipo_Reporte_x_Empresa_Bus(); tb_sis_Documento_Tipo_Reporte_x_Empresa_Info InfoDoc_x_Emp = new tb_sis_Documento_Tipo_Reporte_x_Empresa_Info(); InfoDoc_x_Emp = busDoc_x_Emp.get_DisenioRpt(Info_Retencion.IdEmpresa, Cl_Enumeradores.eTipoDocumento_Talonario.RETEN.ToString()); if (InfoDoc_x_Emp.IdEmpresa != 0 && InfoDoc_x_Emp.File_Disenio_Reporte != null) { if (EstaImpresa == "N") { if (!txtNumRetencion_Validating()) { Actualizar_Retencion_y_Documento_Talonario(); File.WriteAllBytes(RootReporte, InfoDoc_x_Emp.File_Disenio_Reporte); reportes.LoadLayout(RootReporte); reportes.set_parametros(Convert.ToInt32(Info_Retencion.IdEmpresa_Ogiro), Convert.ToDecimal(Info_Retencion.IdCbteCble_Ogiro), Convert.ToInt32(Info_Retencion.IdTipoCbte_Ogiro)); reportes.RequestParameters = true; reportes.ShowPreviewDialog(); } } else { File.WriteAllBytes(RootReporte, InfoDoc_x_Emp.File_Disenio_Reporte); reportes.LoadLayout(RootReporte); reportes.set_parametros(Convert.ToInt32(Info_Retencion.IdEmpresa_Ogiro), Convert.ToDecimal(Info_Retencion.IdCbteCble_Ogiro), Convert.ToInt32(Info_Retencion.IdTipoCbte_Ogiro)); reportes.RequestParameters = true; reportes.ShowPreviewDialog(); } } else { if (EstaImpresa == "N") { if (!txtNumRetencion_Validating()) { Actualizar_Retencion_y_Documento_Talonario(); XCXP_Rpt023_Rpt rpt = new XCXP_Rpt023_Rpt(); rpt.RequestParameters = true; int IdEmpresa = 0; decimal IdOrdenPago = 0; IdEmpresa = param.IdEmpresa; IdOrdenPago = Convert.ToDecimal(Info_Retencion.IdCbteCble_Ogiro); rpt.Parameters["idOrdenGiro"].Value = IdOrdenPago; rpt.Print(); this.Close(); } } else { XCXP_Rpt023_Rpt rpt = new XCXP_Rpt023_Rpt(); rpt.RequestParameters = true; int IdEmpresa = 0; decimal IdOrdenPago = 0; IdEmpresa = param.IdEmpresa; IdOrdenPago = Convert.ToDecimal(Info_Retencion.IdCbteCble_Ogiro); rpt.Parameters["idOrdenGiro"].Value = IdOrdenPago; rpt.Print(); this.Close(); } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }