public void loaddata(tbPRO_CUS_CID_Rpt006_Info[] data) { try { Boolean cb = false; int sec = 0; foreach (var item in data) { item.RptSecuencia = ++sec; if (!String.IsNullOrEmpty(item.CodigoBarra)) { item.dm_cantidad = 1; cb = true; } } if (cb == false) { lblCodBarra.Visible = false; lblEtiqCB.Visible = false; lblEtiqProd.WidthF = 867; lblProd.WidthF = 867; } cl_parametrosGenerales_Bus param = cl_parametrosGenerales_Bus.Instance; this.xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); DataSource = data; } catch (Exception ex) { } }
public tb_Empresa_Info Get_Info_Empresa(int IdEmpresa) { try { EntitiesGeneral OEselecEmpresa = new EntitiesGeneral(); var selectEmpresa = from C in OEselecEmpresa.tb_empresa where C.IdEmpresa == IdEmpresa select C; tb_Empresa_Info Cbt = new tb_Empresa_Info(); foreach (var item in selectEmpresa) { Cbt.IdEmpresa = item.IdEmpresa; Cbt.em_nombre = item.em_nombre; Cbt.em_gerente = item.em_gerente; Cbt.em_ruc = item.em_ruc; Cbt.em_telefonos = item.em_telefonos; Cbt.em_fax = item.em_fax; Cbt.em_notificacion = Convert.ToInt32(item.em_notificacion); Cbt.em_direccion = item.em_direccion; Cbt.em_contador = item.em_contador; Cbt.em_tel_int = item.em_tel_int; Cbt.em_logo = item.em_logo; //Cbt.em_fondo = item.em_fondo; NO OPTENGO EL FONDO POR Q ES PESADO Cbt.em_fechaInicioContable = item.em_fechaInicioContable; Cbt.Estado = item.Estado; Cbt.codigo = item.codigo; Cbt.em_logo_Image = Funciones.ArrayAImage(item.em_logo); Cbt.em_fondo_Image = Funciones.ArrayAImage(item.em_fondo); Cbt.RazonSocial = item.RazonSocial; Cbt.NombreComercial = item.NombreComercial; Cbt.ContribuyenteEspecial = item.ContribuyenteEspecial; Cbt.ObligadoAllevarConta = item.ObligadoAllevarConta; Cbt.cod_entidad_dinardap = item.cod_entidad_dinardap; Cbt.em_Email = item.em_Email; Cbt.em_fax = item.em_fax; Cbt.em_Email = item.em_Email; Cbt.em_tel_int = item.em_tel_int; Cbt.em_telefonos = item.em_telefonos; Cbt.em_gerente = item.em_gerente; } return(Cbt); } 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 List <tb_sis_reporte_Info> Get_List_reporte(Boolean _se_Muestra_Admin_Reporte) { try { List <tb_sis_reporte_Info> Lst = new List <tb_sis_reporte_Info>(); EntitiesGeneral oEnti = new EntitiesGeneral(); var Query = from q in oEnti.tb_sis_reporte where q.se_Muestra_Admin_Reporte == _se_Muestra_Admin_Reporte select q; foreach (var item in Query) { tb_sis_reporte_Info Obj = new tb_sis_reporte_Info(); Obj.CodReporte = item.CodReporte; Obj.Nombre = item.Nombre; Obj.NombreCorto = item.NombreCorto; Obj.Modulo = item.Modulo; Obj.VistaRpt = item.VistaRpt; Obj.Formulario = item.Formulario; Obj.Orden = item.Orden; Obj.Class_NomReporte = item.Class_NomReporte; Obj.Observacion = item.Observacion; Obj.imgByt = item.imagen; Obj.imagen = Funciones.ArrayAImage(item.imagen); Obj.nom_Asembly = item.nom_Asembly; Obj.VersionActual = Convert.ToInt32(item.VersionActual); Obj.Estado = item.Estado; Obj.se_Muestra_Admin_Reporte = Convert.ToBoolean(item.se_Muestra_Admin_Reporte); Obj.Tipo_Balance = item.Tipo_Balance; Obj.SQuery = item.SQuery; Obj.Class_Info = item.Class_Info; Obj.Class_Bus = item.Class_Bus; Obj.Class_Data = item.Class_Data; Obj.Store_proce_rpt = item.Store_proce_rpt; Obj.Disenio_reporte = item.Disenio_reporte; Obj.Se_Muestra_Icono = true; Lst.Add(Obj); } return(Lst); } 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()); } }
private void XCXP_NATU_Rpt008_rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { try { xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); xrL_Empresa.Text = param.InfoEmpresa.em_nombre; XCXP_NATU_Rpt008_Bus rptBus = new XCXP_NATU_Rpt008_Bus(); List <XCXP_NATU_Rpt008_Info> lstInfo = new List <XCXP_NATU_Rpt008_Info>(); string mensaje = ""; int IdEmpresa = 0; DateTime FechaIni; DateTime FechaFin; string S_FechaIni = ""; string S_FechaFin = ""; bool Mostrar_saldo_cero = false; decimal IdProveedorClaseIni = 0; decimal IdProveedorClaseFin = 0; string S_ProveedorClase = ""; decimal IdProveedorIni = 0; decimal IdProveedorFin = 0; IdEmpresa = Convert.ToInt32(Parameters["IdEmpresa"].Value); FechaIni = Convert.ToDateTime(Parameters["FechaIni"].Value); FechaFin = Convert.ToDateTime(Parameters["FechaFin"].Value); IdProveedorClaseIni = Convert.ToInt32(Parameters["IdProveedorClaseIni"].Value); IdProveedorClaseFin = Convert.ToInt32(Parameters["IdProveedorClaseFin"].Value); S_ProveedorClase = Convert.ToString(Parameters["S_ProveedorClase"].Value); IdProveedorIni = Convert.ToDecimal(P_IdProveedorIni.Value); IdProveedorFin = Convert.ToDecimal(P_IdProveedorFin.Value); S_FechaIni = Convert.ToString(Parameters["S_FechaIni"].Value); S_FechaFin = Convert.ToString(Parameters["S_FechaFin"].Value); Mostrar_saldo_cero = Convert.ToBoolean(P_Mostrar_saldo_cero.Value); lstInfo = rptBus.consultar_Data(IdEmpresa, IdProveedorClaseIni, IdProveedorClaseFin, IdProveedorIni, IdProveedorFin, FechaIni, FechaFin, Mostrar_saldo_cero, ref mensaje); this.DataSource = lstInfo.ToArray(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); 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("", "XCXP_NATU_Rpt008_rpt_BeforePrint", ex.Message), ex) { EntityType = typeof(XCXP_NATU_Rpt008_rpt) }; } }
public List <tb_Empresa_Info> Get_List_Empresa_x_Usuario(string IdUsuario) { try { List <tb_Empresa_Info> lM = new List <tb_Empresa_Info>(); EntitiesGeneral OEselecEmpresa = new EntitiesGeneral(); var selectEmpresa = from C in OEselecEmpresa.vwtb_empresa_x_Usuario where C.IdUsuario == IdUsuario select C; foreach (var item in selectEmpresa) { tb_Empresa_Info Cbt = new tb_Empresa_Info(); Cbt.IdEmpresa = item.IdEmpresa; Cbt.em_nombre = item.em_nombre; Cbt.em_nombre2 = "[" + item.IdEmpresa + "]-" + item.em_nombre; Cbt.em_gerente = item.em_gerente; Cbt.em_ruc = item.em_ruc; Cbt.em_telefonos = item.em_telefonos; Cbt.em_notificacion = Convert.ToInt32(item.em_notificacion); Cbt.em_direccion = item.em_direccion; Cbt.em_tel_int = item.em_tel_int; Cbt.em_logo = item.em_logo; // Cbt.em_fondo = item.em_fondo; Cbt.em_fechaInicioContable = item.em_fechaInicioContable; Cbt.em_rucContador = item.em_rucContador; Cbt.em_contador = item.em_contador; Cbt.Estado = item.Estado; Cbt.codigo = item.codigo; Cbt.em_logo_Image = Funciones.ArrayAImage(item.em_logo); Cbt.em_fondo_Image = Funciones.ArrayAImage(item.em_fondo); Cbt.RazonSocial = item.RazonSocial; Cbt.NombreComercial = item.NombreComercial; Cbt.ContribuyenteEspecial = item.ContribuyenteEspecial; Cbt.ObligadoAllevarConta = item.ObligadoAllevarConta; Cbt.cod_entidad_dinardap = item.cod_entidad_dinardap; lM.Add(Cbt); } return(lM); } 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 void loadData(tbPRO_CUS_CID_Rpt003_Info[] Data) { try { cl_parametrosGenerales_Bus param = cl_parametrosGenerales_Bus.Instance; this.xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); DataSource = Data; } catch (Exception ex) { } }
private bool ValidarIngreso() { try { FrmSeg_Login login = new FrmSeg_Login(); login.ShowDialog(this); if (param.IdUsuario == null) { Application.Exit(); return(false); } FrmSeg_Login_x_Empresas frm_login_x_empresas = new FrmSeg_Login_x_Empresas(); frm_login_x_empresas.ShowDialog(this); InfoEmpresa = param.InfoEmpresa; InfoUsuario = param.InfoUsuario; tb_Empresa_Bus BusEmpresa = new tb_Empresa_Bus(); byte[] fondo = BusEmpresa.Get_Fondo_Pantalla_x_Empresa(param.InfoEmpresa.IdEmpresa); if (fondo != null) { this.BackgroundImage = Funciones.ArrayAImage(fondo); this.BackgroundImageLayout = ImageLayout.Stretch; } bei_logo.EditValue = InfoEmpresa.em_logo; switch (param.IdCliente_Ven_x_Default) { case Cl_Enumeradores.eCliente_Vzen.FJ: blcApariencia.Visibility = BarItemVisibility.Never; break; default: blcApariencia.Visibility = BarItemVisibility.Always; break; } return(true); } 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()); return(false); } }
//public void loadData(tbPRD_Rpt_RPRD001_Info[] Data) //{ // try // { // this.DataSource = Data; // } // catch (Exception ex) // { // } //} public void loadData(in_movi_inve_detalle_x_Producto_CusCider_Info[] Data) { try { cl_parametrosGenerales_Bus param = cl_parametrosGenerales_Bus.Instance; this.xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); this.DataSource = Data; } catch (Exception ex) { } }
public tb_sis_reporte_Info Get_Info_reporte(string CodReporte) { EntitiesGeneral oEnti = new EntitiesGeneral(); try { tb_sis_reporte_Info Info = new tb_sis_reporte_Info(); var Objeto = oEnti.tb_sis_reporte.FirstOrDefault(var => var.CodReporte == CodReporte); if (Objeto != null) { Info.CodReporte = Objeto.CodReporte; Info.Nombre = Objeto.Nombre; Info.NombreCorto = Objeto.NombreCorto; Info.Modulo = Objeto.Modulo; Info.VistaRpt = Objeto.VistaRpt; Info.Formulario = Objeto.Formulario; Info.Orden = Objeto.Orden; Info.Class_NomReporte = Objeto.Class_NomReporte; Info.Observacion = Objeto.Observacion; Info.imgByt = Objeto.imagen; Info.imagen = Funciones.ArrayAImage(Objeto.imagen); Info.VersionActual = Convert.ToInt32(Objeto.VersionActual); Info.Estado = Objeto.Estado; Info.se_Muestra_Admin_Reporte = Convert.ToBoolean(Objeto.se_Muestra_Admin_Reporte); Info.Tipo_Balance = Objeto.Tipo_Balance; Info.nom_Asembly = Objeto.nom_Asembly; Info.SQuery = Objeto.SQuery; Info.Class_Info = Objeto.Class_Info; Info.Class_Bus = Objeto.Class_Bus; Info.Class_Data = Objeto.Class_Data; Info.Store_proce_rpt = Objeto.Store_proce_rpt; Info.Se_Muestra_Icono = true; } return(Info); } 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()); } }
private bool ValidarIngreso() { try { FrmSeg_Login login = new FrmSeg_Login(); login.ShowDialog(this); if (param.IdUsuario == null) { Application.Exit(); return(false); } FrmSeg_Login_x_Empresas frm_login_x_empresas = new FrmSeg_Login_x_Empresas(); frm_login_x_empresas.ShowDialog(this); InfoEmpresa = param.InfoEmpresa; InfoUsuario = param.InfoUsuario; tb_Empresa_Bus BusEmpresa = new tb_Empresa_Bus(); byte[] fondo = BusEmpresa.Get_Fondo_Pantalla_x_Empresa(param.InfoEmpresa.IdEmpresa); if (fondo != null) { this.BackgroundImage = Funciones.ArrayAImage(fondo); } if (InfoEmpresa.em_nombre.Equals("DESARROLLO") || InfoEmpresa.em_nombre.Equals("DESarrollo") || InfoEmpresa.em_nombre.Equals("desARROllo") || InfoEmpresa.em_nombre.Equals("desarroLLO")) { LBLMENSAJE.Visible = true; } return(true); } 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()); return(false); } }
public void loadData(List <XPRO_CUS_CID_Rpt003_Info> data) { try { cl_parametrosGenerales_Bus param = cl_parametrosGenerales_Bus.Instance; this.xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); DataSource = data; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); 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("", "loadData", ex.Message), ex) { EntityType = typeof(XPRO_CUS_CID_Rpt003) }; } }
private void XCXP_NATU_Rpt004_Rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { try { XCXP_NATU_Rpt004_Bus repbus = new XCXP_NATU_Rpt004_Bus(); List <XCXP_NATU_Rpt004_Info> ListDataRpt = new List <XCXP_NATU_Rpt004_Info>(); //lbl_Fecha_impresion.Text = DateTime.Now.ToLongDateString(); xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); lblEmpresa.Text = param.NombreEmpresa; int IdEmpresa = 0; int IdClaseProveedor = 0; Decimal IdProveedorIni = 0; Decimal IdProveedorFin = 0; DateTime co_fechaOg_Ini = DateTime.Now; DateTime co_fechaOg_Fin = DateTime.Now; String mensaje = ""; IdEmpresa = Convert.ToInt32(Parameters["IdEmpresa"].Value); IdProveedorIni = Convert.ToDecimal(Parameters["IdProveedorIni"].Value); IdProveedorFin = Convert.ToDecimal(Parameters["IdProveedorFin"].Value); co_fechaOg_Ini = Convert.ToDateTime(Parameters["FechaIni"].Value); co_fechaOg_Fin = Convert.ToDateTime(Parameters["FechaFin"].Value); IdClaseProveedor = Convert.ToInt32(P_IdClaseProveedor.Value); ListDataRpt = repbus.consultar_Data(IdEmpresa, IdProveedorIni, IdProveedorFin, co_fechaOg_Ini, co_fechaOg_Fin, ref mensaje, IdClaseProveedor, param.IdUsuario); this.DataSource = ListDataRpt.ToArray(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); 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("", "XCXP_NATU_Rpt004_Rpt_BeforePrint", ex.Message), ex) { EntityType = typeof(XCXP_NATU_Rpt004_Rpt) }; } }
public void loaddata(tbPRO_CUS_CID_Rpt007_Info[] data) { try { int sec = 0; foreach (var item in data) { item.RptSecuencia = ++sec; item.dm_cantidad = 1; } cl_parametrosGenerales_Bus param = cl_parametrosGenerales_Bus.Instance; this.xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); DataSource = data; } catch (Exception ex) { } }
public void loadData(tbPRO_CUS_CID_Rpt008_Info [] data) { try { foreach (var item in data) { if (!String.IsNullOrEmpty(item.CodigoBarra)) { item.dm_cantidad = 1; } } cl_parametrosGenerales_Bus param = cl_parametrosGenerales_Bus.Instance; this.xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); DataSource = data; } catch (Exception ex) { } }
public void loadData(tbPRO_CUS_CID_Rpt010_Info[] data) { try { double total = 0; foreach (var item in data) { total = total + item.PorcentajeEtapa; } foreach (var item in data) { item.totalporcentaje = total; } cl_parametrosGenerales_Bus param = cl_parametrosGenerales_Bus.Instance; this.xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); DataSource = data; } catch (Exception ex) { } }
private void XBAN_Rpt008_rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { try { this.xrL_Fecha.Text = DateTime.Now.ToString("dddd, dd' de 'MMMM' de 'yyyy HH:mm:ss"); xrPictureBox1.Image = Funciones.ArrayAImage(param.InfoEmpresa.em_logo); xrL_Empresa.Text = param.InfoEmpresa.em_nombre; XBAN_Rpt008_Bus rptBus = new XBAN_Rpt008_Bus(); List <XBAN_Rpt008_Info> lstInfo = new List <XBAN_Rpt008_Info>(); int IdEmpresa = 0; DateTime FechaIni; DateTime FechaFin; string S_FechaIni = ""; string S_FechaFin = ""; IdEmpresa = Convert.ToInt32(Parameters["IdEmpresa"].Value); FechaIni = Convert.ToDateTime(Parameters["FechaIni"].Value); FechaFin = Convert.ToDateTime(Parameters["FechaFin"].Value); S_FechaIni = Convert.ToString(Parameters["S_FechaIni"].Value); S_FechaFin = Convert.ToString(Parameters["S_FechaFin"].Value); lstInfo = rptBus.get_ReporteFlujoCajaResumido(IdEmpresa, FechaIni, FechaFin); this.DataSource = lstInfo.ToArray(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); 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("", "XBAN_Rpt008_rpt_BeforePrint", ex.Message), ex) { EntityType = typeof(XBAN_Rpt008_rpt) }; } }
public List <tb_sis_iconos_Info> Get_List_iconos() { try { List <tb_sis_iconos_Info> lM = new List <tb_sis_iconos_Info>(); EntitiesGeneral OEselecEmpresa = new EntitiesGeneral(); var selectEmpresa = from C in OEselecEmpresa.tb_sis_iconos select C; foreach (var item in selectEmpresa) { tb_sis_iconos_Info Cbt = new tb_sis_iconos_Info(); Cbt.IdIcono = item.IdIcono; Cbt.Icono = item.Icono; Cbt.Icono_image = Funciones.ArrayAImage(item.Icono); Cbt.descripcion = item.descripcion; Cbt.DirectoryName = item.DirectoryName; Cbt.Extencion = item.Extencion; Cbt.FullName = item.FullName; Cbt.Length = item.Length; lM.Add(Cbt); } return(lM); } 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()); } }
private void cargar_empresas() { try { listEm = BusEmp.Get_List_Empresa(); foreach (var item in listEm) { if (item.em_logo != null) { item.em_logo_Image = Funciones.ArrayAImage(item.em_logo); } } ListaBin = new BindingList <tb_Empresa_Info>(listEm); gridControlEmpresa.DataSource = ListaBin.OrderByDescending(x => x.IdEmpresa); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmEmisor_Load(object sender, EventArgs e) { try { carga_Combos(); List <tb_Empresa_Info> lista = new List <tb_Empresa_Info>(); lista = busEmpresa.GetEmpresas(ref MensajeErrorOut); foreach (var item in lista) { if (item.logo != null) { item.imagen = Funciones.ArrayAImage(item.logo); } } listAUX = new List <tb_Empresa_Info>(); listAUX = busEmpresa.GetEmpresas(ref MensajeErrorOut); foreach (var item in listAUX) { if (item.logo != null) { item.imagen = Funciones.ArrayAImage(item.logo); } } ListaBin = new BindingList <tb_Empresa_Info>(lista); gridControlEmisor.DataSource = ListaBin.OrderByDescending(x => x.IdEmpresa); } catch (Exception ex) { } }
public DevExpress.XtraReports.UI.XtraReport Optener_reporte(tb_Comprobante_Info InfoCbte, ref string mensajeErrorOut) { try { // consulto si hay reporte guardado para esa empresa por documento Info = data_.consultar_tipo(InfoCbte.IdEmpresa, Convert.ToString(InfoCbte.IdTipoDocumento), ref mensajeErrorOut); //********************** tb_Comprobante_Data DataCbte = new tb_Comprobante_Data(); XtraReport Reporte = new XtraReport(); Image Logo = null; Instanciando_clases_reporte(InfoCbte.IdEmpresa, ref mensajeErrorOut); #region Opteniendo Logo var q = from c in listEmpresa where c.IdEmpresa == InfoCbte.IdEmpresa select c; foreach (var item in q) { Logo = Funciones.ArrayAImage(item.logo); } #endregion switch (InfoCbte.IdTipoDocumento) { case "01": factura_Ride_Info InfoFactura = new factura_Ride_Info(); // si no esta guardado el reporte en la bd if (Info.ReporteBy == null) { InfoFactura = DataCbte.consultar_Factura_ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoFactura.Logo = Logo; InfoFactura.numeros_en_letras = funciones.NumeroALetras(InfoFactura.factura.infoFactura.importeTotal.ToString()); Reporte = OBusReporteFactura.Optener_reporte(InfoFactura); using (MemoryStream stream = new MemoryStream()) { byte[] data; Reporte.SaveLayout(stream); data = stream.ToArray(); // grabar bd InfoComprobanteem.IdEmpresa = InfoCbte.IdEmpresa; InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento; InfoComprobanteem.File_disenio_rpt = data; IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut); } } else { InfoFactura = DataCbte.consultar_Factura_ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoFactura.Logo = Logo; InfoFactura.numeros_en_letras = funciones.NumeroALetras(InfoFactura.factura.infoFactura.importeTotal.ToString()); File.WriteAllBytes(Ruta_Reporte_Fac, Info.ReporteBy); Reporte = OBusReporteFactura.Optener_reporte(InfoFactura); Reporte.LoadLayout(Ruta_Reporte_Fac); } break; case "04": notaCredito_Ride_Info InfoNotaCred = new notaCredito_Ride_Info(); // si no esta guardado el reporte en la bd if (Info.ReporteBy == null) { InfoNotaCred = DataCbte.consultar_NotaCredito_Ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoNotaCred.numeros_en_letras = funciones.NumeroALetras(InfoNotaCred.notaCredito.infoNotaCredito.valorModificacion.ToString()); InfoNotaCred.Logo = Logo; Reporte = OBusReporteNotaCred.Optener_reporte(InfoNotaCred); using (MemoryStream stream = new MemoryStream()) { byte[] data; Reporte.SaveLayout(stream); data = stream.ToArray(); // grabar bd InfoComprobanteem.IdEmpresa = InfoCbte.IdEmpresa; InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento; InfoComprobanteem.File_disenio_rpt = data; IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut); } } else { InfoNotaCred = DataCbte.consultar_NotaCredito_Ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoNotaCred.Logo = Logo; InfoNotaCred.numeros_en_letras = funciones.NumeroALetras(InfoNotaCred.notaCredito.infoNotaCredito.valorModificacion.ToString()); File.WriteAllBytes(Ruta_Reporte_NC, Info.ReporteBy); Reporte = OBusReporteNotaCred.Optener_reporte(InfoNotaCred); Reporte.LoadLayout(Ruta_Reporte_NC); } break; case "05": notaDebito_Ride_Info InfoNotaDeb = new notaDebito_Ride_Info(); // si no esta guardado el reporte en la bd if (Info.ReporteBy == null) { InfoNotaDeb = DataCbte.consultar_NotaDebito(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoNotaDeb.numeros_en_letras = funciones.NumeroALetras(InfoNotaDeb.notaDebito.infoNotaDebito.valorTotal.ToString()); InfoNotaDeb.Logo = Logo; Reporte = OBusReporteNotaDeb.Optener_reporte(InfoNotaDeb); using (MemoryStream stream = new MemoryStream()) { byte[] data; Reporte.SaveLayout(stream); data = stream.ToArray(); // grabar bd InfoComprobanteem.IdEmpresa = InfoCbte.IdEmpresa; InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento; InfoComprobanteem.File_disenio_rpt = data; IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut); } } else { InfoNotaDeb = DataCbte.consultar_NotaDebito(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoNotaDeb.Logo = Logo; InfoNotaDeb.numeros_en_letras = funciones.NumeroALetras(InfoNotaDeb.notaDebito.infoNotaDebito.valorTotal.ToString()); File.WriteAllBytes(Ruta_Reporte_ND, Info.ReporteBy); Reporte = OBusReporteNotaDeb.Optener_reporte(InfoNotaDeb); Reporte.LoadLayout(Ruta_Reporte_ND); } break; case "06": guiaRemision_Ride_Info InfoGuia = new guiaRemision_Ride_Info(); // si no esta guardado el reporte en la bd if (Info.ReporteBy == null) { InfoGuia = DataCbte.consultar_Guia(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoGuia.Logo = Logo; Reporte = OBusReporteGuia_Remi.Optener_reporte(InfoGuia); using (MemoryStream stream = new MemoryStream()) { byte[] data; Reporte.SaveLayout(stream); data = stream.ToArray(); // grabar bd InfoComprobanteem.IdEmpresa = InfoCbte.IdEmpresa; InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento; InfoComprobanteem.File_disenio_rpt = data; IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut); } } else { InfoGuia = DataCbte.consultar_Guia(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoGuia.Logo = Logo; File.WriteAllBytes(Ruta_Reporte_Guia, Info.ReporteBy); Reporte = OBusReporteGuia_Remi.Optener_reporte(InfoGuia); Reporte.LoadLayout(Ruta_Reporte_Guia); } break; case "07": comprobanteRetencion_Ride_Info InfoCbteRet = new comprobanteRetencion_Ride_Info(); // si no esta guardado el reporte en la bd if (Info.ReporteBy == null) { InfoCbteRet = DataCbte.consultar_Retencion(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoCbteRet.Logo = Logo; Reporte = OBusReporteRetencion.Optener_reporte(InfoCbteRet); using (MemoryStream stream = new MemoryStream()) { byte[] data; Reporte.SaveLayout(stream); data = stream.ToArray(); // grabar bd InfoComprobanteem.IdEmpresa = InfoCbte.IdEmpresa; InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento; InfoComprobanteem.File_disenio_rpt = data; IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut); } } else { InfoCbteRet = DataCbte.consultar_Retencion(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut); InfoCbteRet.Logo = Logo; File.WriteAllBytes(Ruta_Reporte_Ret, Info.ReporteBy); Reporte = OBusReporteRetencion.Optener_reporte(InfoCbteRet); Reporte.LoadLayout(Ruta_Reporte_Ret); } break; } return(Reporte); } catch (Exception ex) { return(new XtraReport()); } }
public void CargarDatos() { try { //txtEmpresa.Text = Convert.ToString(info_contacto.IdEmpresa); txtIdPersona.Text = Convert.ToString(info_contacto.IdPersona); txt_idContacto.Text = Convert.ToString(info_contacto.IdContacto); txt_codigoContacto.Text = info_contacto.CodContacto; txtOrganizacion.Text = info_contacto.Organizacion; txtCargo.Text = info_contacto.Cargo; txtMostrar_como.Text = info_contacto.Mostrar_como; txtNotas.Text = info_contacto.Notas; txtPaginaweb.Text = info_contacto.Pagina_Web; txtCodigoPostal.Text = info_contacto.Codigo_postal; txtMostrar_como.Text = info_contacto.Mostrar_como; ucGe_PaisProvinciaCiudad.set_InfoCiudad(info_contacto.IdCiudad.ToString()); ucGe_PaisProvinciaCiudad.set_InfoProvincia(info_contacto.IdProvincia.ToString()); ucGe_PaisProvinciaCiudad.set_InfoPais(info_contacto.IdPais.ToString()); cmbNacionalidad.SelectedValue = info_contacto.IdNacionalidad.ToString(); txtIdPersona.Text = Convert.ToString(info_contacto.Persona_Info.IdPersona); txtApellido.Text = info_contacto.Persona_Info.pe_apellido; txt_nombresContacto.Text = info_contacto.Persona_Info.pe_nombre; txt_celular.Text = info_contacto.Persona_Info.pe_celular; txt_telefono.Text = info_contacto.Persona_Info.pe_telefonoCasa; txt_Direccion.Text = info_contacto.Persona_Info.pe_direccion; txt_cedulaRucContacto.Text = info_contacto.Persona_Info.pe_cedulaRuc; txtRazonSocial.Text = info_contacto.Persona_Info.pe_razonSocial; if (info_contacto.Persona_Info.pe_Naturaleza != null) { this.ucGe_NaturalezaPersona1.set_Naturaleza(info_contacto.Persona_Info.pe_Naturaleza); } ucGe_Docu_PerIdentificacion.cmb_Docum_perso.SelectedValue = (info_contacto.Persona_Info.IdTipoDocumento == null) ? "CED" : info_contacto.Persona_Info.IdTipoDocumento; if (info_contacto.Fecha_alta != null && info_contacto.Fecha_alta != DateTime.MinValue) { dT_FechaContacto.Value = Convert.ToDateTime((info_contacto.Fecha_alta != DateTime.MinValue) ? Convert.ToDateTime(info_contacto.Fecha_alta) : DateTime.Now.AddYears(-200)); dT_FechaContacto.Checked = (info_contacto.Fecha_alta != DateTime.MinValue) ? true : false; } if (info_contacto.Persona_Info.pe_fechaNacimiento != null) { dt_fechaNacimiento.Value = Convert.ToDateTime((info_contacto.Persona_Info.pe_fechaNacimiento != DateTime.MinValue) ? Convert.ToDateTime(info_contacto.Persona_Info.pe_fechaNacimiento) : DateTime.Now.AddYears(-200)); dt_fechaNacimiento.Checked = (info_contacto.Persona_Info.pe_fechaNacimiento != DateTime.MinValue) ? true : false; } else { dt_fechaNacimiento.Checked = false; } if (info_contacto.Fecha_Ult_Contacto != null && info_contacto.Fecha_Ult_Contacto != DateTime.MinValue) { dt_fechaUltimaContacto.Value = Convert.ToDateTime((info_contacto.Fecha_Ult_Contacto != DateTime.MinValue) ? Convert.ToDateTime(info_contacto.Fecha_Ult_Contacto) : DateTime.Now.AddYears(-200)); dt_fechaUltimaContacto.Checked = (info_contacto.Fecha_Ult_Contacto != DateTime.MinValue) ? true : false; } chkEstado.Checked = (info_contacto.Estado == "A") ? true : false; if (info_contacto.Estado == "A") { lblAnulado.Visible = false; } else { if (info_contacto.Estado != null) { lblAnulado.Visible = true; } } if (info_contacto.foto == null) { tb_contacto_Bus BusConta = new tb_contacto_Bus(); byte[] foto = null; foto = BusConta.Get_Image_x_contacto(info_contacto.IdEmpresa, info_contacto.IdContacto, ref MensajeError); if (foto != null) { pic_foto.Image = Funciones.ArrayAImage(foto); } } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.Message); } }