public List <ColorBE> ListarDatosIniciales(SqlConnection cnBD, string usuario, out List <ReporteColumnas> loColumns, out List <ColorExportBE> loExport) { List <ColorBE> lobe = new List <ColorBE>(); ColorBE obe = new ColorBE(); loExport = new List <ColorExportBE>(); ColorExportBE obeX = new ColorExportBE(); //listado - columnas loColumns = new List <ReporteColumnas>(); ReporteColumnas obeColumns = new ReporteColumnas(); using (SqlCommand cmd = new SqlCommand("[dbo].[USP_Ajustes_Color_Lista]", cnBD)) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 0; cmd.Parameters.Add("@Usuario", SqlDbType.VarChar, 50).Value = usuario; using (SqlDataReader drd = cmd.ExecuteReader()) { if (drd.HasRows) { int pos_Id = drd.GetOrdinal("Id"); int pos_Nombre = drd.GetOrdinal("Nombre"); int pos_IdCliente = drd.GetOrdinal("IdCliente"); int pos_DesCliente = drd.GetOrdinal("DesCliente"); int pos_Estado = drd.GetOrdinal("Estado"); int pos_UsrCreador = drd.GetOrdinal("UsrCreador"); int pos_FchCreacion = drd.GetOrdinal("FchCreacion"); int pos_UsrModificador = drd.GetOrdinal("UsrModificador"); int pos_FchModificacion = drd.GetOrdinal("FchModificacion"); lobe = new List <ColorBE>(); loExport = new List <ColorExportBE>(); while (drd.Read()) { obe = new ColorBE(); obe.Id = drd.GetInt32(pos_Id); obe.Nombre = drd.GetString(pos_Nombre); obe.IdCliente = drd.GetInt32(pos_IdCliente); obe.DesCliente = drd.GetString(pos_DesCliente); obe.Estado = drd.GetBoolean(pos_Estado); obe.UsrCreador = drd.GetString(pos_UsrCreador); obe.FchCreacion = drd.GetString(pos_FchCreacion); obe.UsrModificador = drd.GetString(pos_UsrModificador); obe.FchModificacion = drd.GetString(pos_FchModificacion); lobe.Add(obe); obeX = new ColorExportBE(); obeX.Id = drd.GetInt32(pos_Id); obeX.Nombre = drd.GetString(pos_Nombre); obeX.Estado = drd.GetBoolean(pos_Estado)?"Activo":"Inactivo"; obeX.UsrCreador = drd.GetString(pos_UsrCreador); obeX.FchCreacion = drd.GetString(pos_FchCreacion); obeX.UsrModificador = drd.GetString(pos_UsrModificador); obeX.FchModificacion = drd.GetString(pos_FchModificacion); loExport.Add(obeX); } } drd.NextResult(); if (drd.HasRows) { #region ColumnasLista - columnas int pos_field = drd.GetOrdinal("field"); int pos_header = drd.GetOrdinal("header"); int pos_width = drd.GetOrdinal("width"); #endregion ColumnasLista - columnas loColumns = new List <ReporteColumnas>(); while (drd.Read()) { #region ColumnasLista - campos obeColumns = new ReporteColumnas(); obeColumns.field = drd.GetString(pos_field); obeColumns.header = drd.GetString(pos_header); obeColumns.width = drd.GetInt32(pos_width); loColumns.Add(obeColumns); #endregion ColumnasLista - campos } } } } return(lobe); }
public CajaBE ReporteCajaDia(SqlConnection cnBD, string usuario, int idCliente, string fechaInicio, List <ListaComboBE> loTienda) { //LISTADO List <ReporteCajaBE> listado = new List <ReporteCajaBE>(); ReporteCajaBE obe = new ReporteCajaBE(); //LISTADO - COLUMNAS List <ReporteColumnas> loColumns = new List <ReporteColumnas>(); ReporteColumnas obeColumns = new ReporteColumnas(); //INGRESOS List <DashBoardBE> loGraficoIngreso = new List <DashBoardBE>(); DashBoardBE obeGraficoIngreso = new DashBoardBE(); //EGRESOS List <DashBoardBE> loGraficoEgreso = new List <DashBoardBE>(); DashBoardBE obeGraficoEgreso = new DashBoardBE(); CajaBE lobe = new CajaBE(); using (SqlCommand cmd = new SqlCommand("[dbo].[USP_ReporteCaja_Dia]", cnBD)) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 0; cmd.Parameters.Add("@Usuario", SqlDbType.VarChar, 50).Value = usuario; cmd.Parameters.Add("@IdCliente", SqlDbType.VarChar, 50).Value = idCliente; cmd.Parameters.Add("@FechaInicio", SqlDbType.VarChar, 10).Value = fechaInicio; cmd.Parameters.Add("@loTienda", SqlDbType.Structured).Value = CrearEstructura(loTienda); using (SqlDataReader drd = cmd.ExecuteReader()) { lobe = new CajaBE(); loGraficoIngreso = new List <DashBoardBE>(); loGraficoEgreso = new List <DashBoardBE>(); if (drd.HasRows) { int pos_CajaAnterior = drd.GetOrdinal("CajaAnterior"); while (drd.Read()) { lobe.CajaAnterior = drd.GetDecimal(pos_CajaAnterior); } } drd.NextResult(); if (drd.HasRows) { #region Lista - columnas int pos_IdTienda = drd.GetOrdinal("IdTienda"); int pos_DesTienda = drd.GetOrdinal("DesTienda"); int pos_Clase = drd.GetOrdinal("Clase"); int pos_NombreProducto = drd.GetOrdinal("NombreProducto"); int pos_Descripcion = drd.GetOrdinal("Descripcion"); int pos_Cantidad = drd.GetOrdinal("Cantidad"); int pos_Precio = drd.GetOrdinal("Precio"); //int pos_PrecioCosto = drd.GetOrdinal("PrecioCosto"); int pos_Tipo = drd.GetOrdinal("Tipo"); int pos_FechaInicioReporte = drd.GetOrdinal("FechaInicioReporte"); #endregion Lista - columnas listado = new List <ReporteCajaBE>(); while (drd.Read()) { obe = new ReporteCajaBE(); #region Lista - campos obe.IdTienda = drd.GetInt32(pos_IdTienda); obe.DesTienda = drd.GetString(pos_DesTienda); obe.Clase = drd.GetString(pos_Clase); obe.NombreProducto = drd.GetString(pos_NombreProducto); obe.Descripcion = drd.GetString(pos_Descripcion); obe.Cantidad = drd.GetInt32(pos_Cantidad); obe.Precio = drd.GetDecimal(pos_Precio); //obe.PrecioCosto = drd.GetDecimal(pos_PrecioCosto); obe.Tipo = drd.GetString(pos_Tipo); obe.FechaInicioReporte = drd.GetString(pos_FechaInicioReporte); listado.Add(obe); #endregion Lista - campos } } drd.NextResult(); if (drd.HasRows) { #region ColumnasLista - columnas int pos_field = drd.GetOrdinal("field"); int pos_header = drd.GetOrdinal("header"); int pos_width = drd.GetOrdinal("width"); #endregion ColumnasLista - columnas loColumns = new List <ReporteColumnas>(); while (drd.Read()) { #region ColumnasLista - campos obeColumns = new ReporteColumnas(); obeColumns.field = drd.GetString(pos_field); obeColumns.header = drd.GetString(pos_header); obeColumns.width = drd.GetInt32(pos_width); loColumns.Add(obeColumns); #endregion ColumnasLista - campos } } //GRAFICOS drd.NextResult(); if (drd.HasRows) { #region columnas int pos_Serie = drd.GetOrdinal("serie"); int pos_Label = drd.GetOrdinal("label"); #endregion columnas //loGraficoDia = new List<DashBoardBE>(); obeGraficoIngreso = new DashBoardBE(); List <Decimal> serie = new List <Decimal>(); List <String> label = new List <String>(); while (drd.Read()) { #region cargarData serie.Add(drd.GetDecimal(pos_Serie)); label.Add(drd.GetString(pos_Label)); #endregion cargarData } obeGraficoIngreso.serie = serie; obeGraficoIngreso.label = label; loGraficoIngreso.Add(obeGraficoIngreso); } drd.NextResult(); if (drd.HasRows) { #region columnas int pos_Serie = drd.GetOrdinal("serie"); int pos_Label = drd.GetOrdinal("label"); #endregion columnas //loGraficoSemana = new List<DashBoardBE>(); obeGraficoEgreso = new DashBoardBE(); List <Decimal> serie = new List <Decimal>(); List <String> label = new List <String>(); while (drd.Read()) { #region cargarData serie.Add(drd.GetDecimal(pos_Serie)); label.Add(drd.GetString(pos_Label)); #endregion cargarData } obeGraficoEgreso.serie = serie; obeGraficoEgreso.label = label; loGraficoEgreso.Add(obeGraficoEgreso); } } } lobe.listado = listado; lobe.loColumns = loColumns; lobe.loGraficoIngreso = loGraficoIngreso; lobe.loGraficoEgreso = loGraficoEgreso; return(lobe); }
public ControlStockGBE ListaProductoXTienda(SqlConnection cnBD, string usuario, int idCliente, int idAlmacen, int idTienda) { ControlStockGBE obeCS = new ControlStockGBE(); List <ControlStockBE> lobe = new List <ControlStockBE>(); ControlStockBE obe = new ControlStockBE(); List <ControlStockBEReporte> lobeR = new List <ControlStockBEReporte>(); ControlStockBEReporte obeR = new ControlStockBEReporte(); List <ReporteColumnas> loColumns = new List <ReporteColumnas>(); ReporteColumnas obeColumns = new ReporteColumnas(); using (SqlCommand cmd = new SqlCommand("[dbo].[USP_ControlStock_Productos]", cnBD)) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 0; cmd.Parameters.Add("@IdCliente", SqlDbType.Int).Value = idCliente; cmd.Parameters.Add("@IdAlmacen", SqlDbType.Int).Value = idAlmacen; cmd.Parameters.Add("@IdTienda", SqlDbType.Int).Value = idTienda; cmd.Parameters.Add("@UsrCreador", SqlDbType.VarChar, 50).Value = usuario; using (SqlDataReader drd = cmd.ExecuteReader()) { if (drd.HasRows) { int pos_IdProductoAlmacen = drd.GetOrdinal("IdProductoAlmacen"); int pos_IdAlmacen = drd.GetOrdinal("IdAlmacen"); int pos_IdTienda = drd.GetOrdinal("IdTienda"); int pos_IdProducto = drd.GetOrdinal("IdProducto"); int pos_CodProducto = drd.GetOrdinal("CodProducto"); int pos_NombreProducto = drd.GetOrdinal("NombreProducto"); int pos_idProductoBase = drd.GetOrdinal("idProductoBase"); int pos_StockTotal = drd.GetOrdinal("StockTotal"); int pos_Stock = drd.GetOrdinal("Stock"); int pos_Precio = drd.GetOrdinal("Precio"); int pos_PrecioBlister = drd.GetOrdinal("PrecioBlister"); int pos_IdTipo = drd.GetOrdinal("IdTipo"); int pos_DesTipo = drd.GetOrdinal("DesTipo"); int pos_CodProdLaboratorio = drd.GetOrdinal("CodProdLaboratorio"); int pos_DesProdLaboratorio = drd.GetOrdinal("DesProdLaboratorio"); int pos_CodProdTipoPresentacion = drd.GetOrdinal("CodProdTipoPresentacion"); int pos_DesProdTipoPresentacion = drd.GetOrdinal("DesProdTipoPresentacion"); int pos_RegistroSanitario = drd.GetOrdinal("RegistroSanitario"); int pos_Cantidad = drd.GetOrdinal("Cantidad"); int pos_CantidadCaja = drd.GetOrdinal("CantidadCaja"); int pos_PrecioCosto = drd.GetOrdinal("PrecioCosto"); int pos_FecVencimiento = drd.GetOrdinal("FecVencimiento"); int pos_DetalleStock = drd.GetOrdinal("DetalleStock"); int pos_StockN = drd.GetOrdinal("StockN"); int pos_PrecioN = drd.GetOrdinal("PrecioN"); int pos_PrecioBlisterN = drd.GetOrdinal("PrecioBlisterN"); int pos_RecetaMedica = drd.GetOrdinal("RecetaMedica"); int pos_Val1 = drd.GetOrdinal("Val1"); int pos_Val2 = drd.GetOrdinal("Val2"); int pos_Val3 = drd.GetOrdinal("Val3"); lobe = new List <ControlStockBE>(); while (drd.Read()) { obe = new ControlStockBE(); obe.IdProductoAlmacen = drd.GetInt64(pos_IdProductoAlmacen); obe.IdAlmacen = drd.GetInt32(pos_IdAlmacen); obe.IdTienda = drd.GetInt32(pos_IdTienda); obe.IdProducto = drd.GetInt32(pos_IdProducto); obe.CodProducto = drd.GetString(pos_CodProducto); obe.NombreProducto = drd.GetString(pos_NombreProducto); obe.idProductoBase = drd.GetInt32(pos_idProductoBase); obe.StockTotal = drd.GetInt32(pos_StockTotal); obe.Stock = drd.GetInt32(pos_Stock); obe.Precio = drd.GetDecimal(pos_Precio); obe.PrecioBlister = drd.GetDecimal(pos_PrecioBlister); obe.IdTipo = drd.GetInt32(pos_IdTipo); obe.DesTipo = drd.GetString(pos_DesTipo); obe.CodProdLaboratorio = drd.GetString(pos_CodProdLaboratorio); obe.DesProdLaboratorio = drd.GetString(pos_DesProdLaboratorio); obe.CodProdTipoPresentacion = drd.GetString(pos_CodProdTipoPresentacion); obe.DesProdTipoPresentacion = drd.GetString(pos_DesProdTipoPresentacion); obe.RegistroSanitario = drd.GetString(pos_RegistroSanitario); obe.Cantidad = drd.GetInt32(pos_Cantidad); obe.CantidadCaja = drd.GetInt32(pos_CantidadCaja); obe.PrecioCosto = drd.GetDecimal(pos_PrecioCosto); obe.FecVencimiento = drd.GetString(pos_FecVencimiento); obe.DetalleStock = drd.GetString(pos_DetalleStock); obe.StockN = drd.GetInt32(pos_StockN); obe.PrecioN = drd.GetDecimal(pos_PrecioN); obe.PrecioBlisterN = drd.GetDecimal(pos_PrecioBlisterN); obe.RecetaMedica = drd.GetString(pos_RecetaMedica); obe.Val1 = drd.GetBoolean(pos_Val1); obe.Val2 = drd.GetBoolean(pos_Val2); obe.Val3 = drd.GetBoolean(pos_Val3); lobe.Add(obe); } obeCS.listado = lobe; } drd.NextResult(); if (drd.HasRows) { int pos_IdProductoAlmacen = drd.GetOrdinal("IdProductoAlmacen"); int pos_IdAlmacen = drd.GetOrdinal("IdAlmacen"); int pos_IdTienda = drd.GetOrdinal("IdTienda"); int pos_IdProducto = drd.GetOrdinal("IdProducto"); int pos_CodProducto = drd.GetOrdinal("CodProducto"); int pos_NombreProducto = drd.GetOrdinal("NombreProducto"); int pos_StockTotal = drd.GetOrdinal("StockTotal"); int pos_IdTipo = drd.GetOrdinal("IdTipo"); int pos_DesTipo = drd.GetOrdinal("DesTipo"); int pos_CodProdLaboratorio = drd.GetOrdinal("CodProdLaboratorio"); int pos_DesProdLaboratorio = drd.GetOrdinal("DesProdLaboratorio"); int pos_CodProdTipoPresentacion = drd.GetOrdinal("CodProdTipoPresentacion"); int pos_DesProdTipoPresentacion = drd.GetOrdinal("DesProdTipoPresentacion"); int pos_RegistroSanitario = drd.GetOrdinal("RegistroSanitario"); int pos_Precio = drd.GetOrdinal("Precio"); int pos_PrecioBlister = drd.GetOrdinal("PrecioBlister"); int pos_PrecioCosto = drd.GetOrdinal("PrecioCosto"); int pos_FecVencimiento = drd.GetOrdinal("FecVencimiento"); lobeR = new List <ControlStockBEReporte>(); while (drd.Read()) { obeR = new ControlStockBEReporte(); obeR.IdProductoAlmacen = drd.GetInt64(pos_IdProductoAlmacen); obeR.IdAlmacen = drd.GetInt32(pos_IdAlmacen); obeR.IdTienda = drd.GetInt32(pos_IdTienda); obeR.IdProducto = drd.GetInt32(pos_IdProducto); obeR.CodProducto = drd.GetString(pos_CodProducto); obeR.NombreProducto = drd.GetString(pos_NombreProducto); obeR.StockTotal = drd.GetInt32(pos_StockTotal); obeR.IdTipo = drd.GetInt32(pos_IdTipo); obeR.DesTipo = drd.GetString(pos_DesTipo); obeR.CodProdLaboratorio = drd.GetString(pos_CodProdLaboratorio); obeR.DesProdLaboratorio = drd.GetString(pos_DesProdLaboratorio); obeR.CodProdTipoPresentacion = drd.GetString(pos_CodProdTipoPresentacion); obeR.DesProdTipoPresentacion = drd.GetString(pos_DesProdTipoPresentacion); obeR.RegistroSanitario = drd.GetString(pos_RegistroSanitario); obeR.Precio = drd.GetDecimal(pos_Precio); obeR.PrecioBlister = drd.GetDecimal(pos_PrecioBlister); obeR.PrecioCosto = drd.GetDecimal(pos_PrecioCosto); obeR.FecVencimiento = drd.GetString(pos_FecVencimiento); lobeR.Add(obeR); } obeCS.listadoReporte = lobeR; } drd.NextResult(); if (drd.HasRows) { #region ColumnasLista - columnas int pos_field = drd.GetOrdinal("field"); int pos_header = drd.GetOrdinal("header"); int pos_width = drd.GetOrdinal("width"); #endregion ColumnasLista - columnas loColumns = new List <ReporteColumnas>(); while (drd.Read()) { #region ColumnasLista - campos obeColumns = new ReporteColumnas(); obeColumns.field = drd.GetString(pos_field); obeColumns.header = drd.GetString(pos_header); obeColumns.width = drd.GetInt32(pos_width); loColumns.Add(obeColumns); #endregion ColumnasLista - campos } obeCS.columnas = loColumns; } } } return(obeCS); }
public List <AdministrarProductoBE> ListaProducto(SqlConnection cnBD, string usuario, out List <ReporteColumnas> loColumns, out List <AdministrarProductoExportBE> loExport) { List <AdministrarProductoBE> lobe = new List <AdministrarProductoBE>(); AdministrarProductoBE obe = new AdministrarProductoBE(); ListaArchivosAdjuntos obeArch = null; loExport = new List <AdministrarProductoExportBE>(); AdministrarProductoExportBE obeX = new AdministrarProductoExportBE(); //listado - columnas loColumns = new List <ReporteColumnas>(); ReporteColumnas obeColumns = new ReporteColumnas(); using (SqlCommand cmd = new SqlCommand("[dbo].[USP_AdministrarProducto_Listado]", cnBD)) { cmd.CommandType = CommandType.StoredProcedure; cmd.CommandTimeout = 0; cmd.Parameters.Add("@Usuario", SqlDbType.VarChar, 50).Value = usuario; using (SqlDataReader drd = cmd.ExecuteReader()) { if (drd.HasRows) { #region parametros int pos_Id = drd.GetOrdinal("Id"); int pos_CodProducto = drd.GetOrdinal("CodProducto"); int pos_NombreProducto = drd.GetOrdinal("NombreProducto"); int pos_Descripcion = drd.GetOrdinal("Descripcion"); int pos_IdTalla = drd.GetOrdinal("IdTalla"); int pos_DesTalla = drd.GetOrdinal("DesTalla"); int pos_IdColor = drd.GetOrdinal("IdColor"); int pos_DesColor = drd.GetOrdinal("DesColor"); int pos_IdTipo = drd.GetOrdinal("IdTipo"); int pos_DesTipo = drd.GetOrdinal("DesTipo"); int pos_IdUnidad = drd.GetOrdinal("IdUnidad"); int pos_DesUnidad = drd.GetOrdinal("DesUnidad"); int pos_IdSegmento = drd.GetOrdinal("IdSegmento"); int pos_IdFamilia = drd.GetOrdinal("IdFamilia"); int pos_IdClase = drd.GetOrdinal("IdClase"); int pos_IdProducto = drd.GetOrdinal("IdProducto"); int pos_CodUNSPSC = drd.GetOrdinal("CodUNSPSC"); int pos_Estatus = drd.GetOrdinal("Estatus"); int pos_UsrCreador = drd.GetOrdinal("UsrCreador"); int pos_FechaCreacion = drd.GetOrdinal("FchCreacion"); int pos_UsrModificador = drd.GetOrdinal("UsrModificador"); int pos_FechaModificacion = drd.GetOrdinal("FchModificacion"); int pos_IdProductoBase = drd.GetOrdinal("IdProductoBase"); int pos_NombreProductoBase = drd.GetOrdinal("NombreProductoBase"); //int pos_isFecVencimiento = drd.GetOrdinal("isFecVencimiento"); int pos_IdProdLaboratorio = drd.GetOrdinal("IdProdLaboratorio"); int pos_DesProdLaboratorio = drd.GetOrdinal("DesProdLaboratorio"); int pos_IdProdGrupo = drd.GetOrdinal("IdProdGrupo"); int pos_DesProdGrupo = drd.GetOrdinal("DesProdGrupo"); int pos_IdProdTipoPresentacion = drd.GetOrdinal("IdProdTipoPresentacion"); int pos_DesProdTipoPresentacion = drd.GetOrdinal("DesProdTipoPresentacion"); int pos_DesNombreGenerico = drd.GetOrdinal("DesNombreGenerico"); int pos_DesTipoProducto = drd.GetOrdinal("DesTipoProducto"); int pos_DesComposicion = drd.GetOrdinal("DesComposicion"); int pos_DesIndicaciones = drd.GetOrdinal("DesIndicaciones"); int pos_DesContraIndicaciones = drd.GetOrdinal("DesContraIndicaciones"); int pos_RecetaMedica = drd.GetOrdinal("RecetaMedica"); int pos_isGenerico = drd.GetOrdinal("isGenerico"); int pos_RegSanitario = drd.GetOrdinal("RegSanitario"); #endregion parametros lobe = new List <AdministrarProductoBE>(); loExport = new List <AdministrarProductoExportBE>(); while (drd.Read()) { #region variables obe = new AdministrarProductoBE(); obe.Id = drd.GetInt32(pos_Id); obe.CodProducto = drd.GetString(pos_CodProducto); obe.NombreProducto = drd.GetString(pos_NombreProducto); obe.Descripcion = drd.GetString(pos_Descripcion); obe.IdTalla = drd.GetInt32(pos_IdTalla); obe.IdColor = drd.GetInt32(pos_IdColor); obe.IdTipo = drd.GetInt32(pos_IdTipo); obe.IdUnidad = drd.GetString(pos_IdUnidad); obe.IdSegmento = drd.GetString(pos_IdSegmento); obe.IdFamilia = drd.GetString(pos_IdFamilia); obe.IdClase = drd.GetString(pos_IdClase); obe.IdProducto = drd.GetString(pos_IdProducto); obe.CodUNSPSC = drd.GetString(pos_CodUNSPSC); obe.Estatus = drd.GetBoolean(pos_Estatus); obe.UsrCreador = drd.GetString(pos_UsrCreador); obe.FchCreacion = drd.GetString(pos_FechaCreacion); obe.UsrModificador = drd.GetString(pos_UsrModificador); obe.FchModificacion = drd.GetString(pos_FechaModificacion); obe.IdProductoBase = drd.GetInt32(pos_IdProductoBase); obe.NombreProductoBase = drd.GetString(pos_NombreProductoBase); //obe.isFechaVencimiento = drd.GetBoolean(pos_isFecVencimiento); obe.IdProdLaboratorio = drd.GetInt32(pos_IdProdLaboratorio); obe.IdProdGrupo = drd.GetInt32(pos_IdProdGrupo); obe.IdProdTipoPresentacion = drd.GetInt32(pos_IdProdTipoPresentacion); obe.DesNombreGenerico = drd.GetString(pos_DesNombreGenerico); obe.DesTipoProducto = drd.GetString(pos_DesTipoProducto); obe.DesComposicion = drd.GetString(pos_DesComposicion); obe.DesIndicaciones = drd.GetString(pos_DesIndicaciones); obe.DesContraIndicaciones = drd.GetString(pos_DesContraIndicaciones); obe.RecetaMedica = drd.GetString(pos_RecetaMedica); obe.isGenerico = drd.GetString(pos_isGenerico); obe.RegSanitario = drd.GetString(pos_RegSanitario); obe.loarchivos = new List <ListaArchivosAdjuntos>(); lobe.Add(obe); #endregion variables obeX = new AdministrarProductoExportBE(); obeX.CodProducto = drd.GetString(pos_CodProducto); obeX.CodUNSPSC = drd.GetString(pos_CodUNSPSC); obeX.NombreProducto = drd.GetString(pos_NombreProducto); obeX.Descripcion = drd.GetString(pos_Descripcion); //obeX.IdUnidad = drd.GetString(pos_IdUnidad); //obe.DesUnidad = drd.GetString(pos_DesUnidad); obeX.DesUnidad = drd.GetString(pos_IdUnidad) + " - " + drd.GetString(pos_DesUnidad); //""; //obeX.IdTalla = drd.GetInt32(pos_IdTalla); //obe.DesTalla = drd.GetString(pos_DesTalla); obeX.DesTalla = drd.GetInt32(pos_IdTalla).ToString() + " - " + drd.GetString(pos_DesTalla); //""; //obeX.IdColor = drd.GetInt32(pos_IdColor); //obe.DesColor = drd.GetString(pos_DesColor); obeX.DesColor = drd.GetInt32(pos_IdColor).ToString() + " - " + drd.GetString(pos_DesColor); //""; //obeX.IdTipo = drd.GetInt32(pos_IdTipo); //obe.DesTipo = drd.GetString(pos_DesTipo); obeX.DesTipo = drd.GetInt32(pos_IdTipo).ToString() + " - " + drd.GetString(pos_DesTipo); // ""; //--- obeX.DesProdLaboratorio = drd.GetInt32(pos_IdProdLaboratorio).ToString() + " - " + drd.GetString(pos_DesProdLaboratorio); //obe.DesProdLaboratorio = drd.GetString(pos_DesProdLaboratorio); obeX.DesProdGrupo = drd.GetInt32(pos_IdProdGrupo).ToString() + " - " + drd.GetString(pos_DesProdGrupo); //obe.DesProdGrupo = drd.GetString(pos_DesProdGrupo); obeX.DesProdTipoPresentacion = drd.GetInt32(pos_IdProdTipoPresentacion).ToString() + " - " + drd.GetString(pos_DesProdTipoPresentacion); //obe.DesProdTipoPresentacion = drd.GetString(pos_DesProdTipoPresentacion); obeX.DesNombreGenerico = drd.GetString(pos_DesNombreGenerico); obeX.isGenerico = drd.GetString(pos_isGenerico); obeX.RegSanitario = drd.GetString(pos_RegSanitario); obeX.DesTipoProducto = drd.GetString(pos_DesTipoProducto); obeX.DesComposicion = drd.GetString(pos_DesComposicion); obeX.DesIndicaciones = drd.GetString(pos_DesIndicaciones); obeX.DesContraIndicaciones = drd.GetString(pos_DesContraIndicaciones); obeX.RecetaMedica = drd.GetString(pos_RecetaMedica); //--- obeX.Estatus = drd.GetBoolean(pos_Estatus) ? "Activo" : "Inactivo"; obeX.UsrCreador = drd.GetString(pos_UsrCreador); obeX.FchCreacion = drd.GetString(pos_FechaCreacion); obeX.UsrModificador = drd.GetString(pos_UsrModificador); obeX.FchModificacion = drd.GetString(pos_FechaModificacion); loExport.Add(obeX); } } drd.NextResult(); if (drd.HasRows) { int pos_Id = drd.GetOrdinal("Id"); int pos_IdProducto = drd.GetOrdinal("IdProducto"); int pos_URLProducto = drd.GetOrdinal("URLProducto"); while (drd.Read()) { obeArch = new ListaArchivosAdjuntos(); int idProducto = drd.GetInt32(pos_IdProducto); obeArch.Id = drd.GetInt32(pos_Id); obeArch.URL = drd.GetString(pos_URLProducto); int index = lobe.FindIndex(det => det.Id == idProducto); if (index != -1) { lobe[index].loarchivos.Add(obeArch); } } } drd.NextResult(); if (drd.HasRows) { #region ColumnasLista - columnas int pos_field = drd.GetOrdinal("field"); int pos_header = drd.GetOrdinal("header"); int pos_width = drd.GetOrdinal("width"); #endregion ColumnasLista - columnas loColumns = new List <ReporteColumnas>(); while (drd.Read()) { #region ColumnasLista - campos obeColumns = new ReporteColumnas(); obeColumns.field = drd.GetString(pos_field); obeColumns.header = drd.GetString(pos_header); obeColumns.width = drd.GetInt32(pos_width); loColumns.Add(obeColumns); #endregion ColumnasLista - campos } } } } return(lobe); }