From d5235cde01a0344dac231d51ea62353e3907c0d9 Mon Sep 17 00:00:00 2001 From: rrene Date: Sun, 10 Dec 2023 15:12:47 -0700 Subject: [PATCH] - mejora vista --- Ventas/ActualizarPrecios.aspx | 6 ++-- Ventas/ActualizarPrecios.aspx.vb | 48 +++++++++++++++----------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx index 7c1468631..cb1701089 100644 --- a/Ventas/ActualizarPrecios.aspx +++ b/Ventas/ActualizarPrecios.aspx @@ -96,8 +96,8 @@
- - + +
@@ -285,7 +285,7 @@ - + diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index f1c53bda8..f9dc35076 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -114,37 +114,35 @@ Partial Class Ventas_ActualizarPrecios If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista - Dim ObjVta As New ClsVentas - Dim primerItem As String = "" - If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then - DtListasPrecios = ObjVta.DtResultados.Copy() - DdlPrecioLista.DataSource = DtListasPrecios - DdlPrecioListaCarga.DataSource = DtListasPrecios - DdlMultiplePrecioLista.DataSource = DtListasPrecios - primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista") - End If - ObjVta.Dispose() - - + Dim primerItem As String = "" + + DtListasPrecios = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).Copy() + DdlPrecioLista.DataSource = DtListasPrecios + DdlPrecioListaCarga.DataSource = DtListasPrecios + DdlMultiplePrecioLista.DataSource = DtListasPrecios + primerItem = DtListasPrecios.FiltroPrimeroValor("CvePrecioLista") + DdlPrecioLista.DataBind() DdlPrecioListaCarga.DataBind() DdlMultiplePrecioLista.DataBind() Dim SeleccionMaxima As Integer = 14 - If (DtListasPrecios.Rows.Count - 1) < 14 Then - SeleccionMaxima = DtListasPrecios.Rows.Count - 1 - End If - - Dim sbMultiple As New StringBuilder - For Each Row As DataRow In DtListasPrecios.FiltraPorIndices(0, SeleccionMaxima).Rows - sbMultiple.AppendFormat("{0},", Row("CvePrecioLista")) - Next + If DtListasPrecios IsNot Nothing Then + If (DtListasPrecios.Rows.Count - 1) < 14 Then + SeleccionMaxima = DtListasPrecios.Rows.Count - 1 + End If + + Dim sbMultiple As New StringBuilder + For Each Row As DataRow In DtListasPrecios.FiltraPorIndices(0, SeleccionMaxima).Rows + sbMultiple.AppendFormat("{0},", Row("CvePrecioLista")) + Next + DdlMultiplePrecioLista.SelectedValuesIfExistM(sbMultiple.ToString(), True) + + If (DdlPrecioLista.Items.Count = 1) Then + DdlPrecioLista.Items.FindByValue(primerItem).Selected = True + End If + End If - DdlMultiplePrecioLista.SelectedValuesIfExistM(sbMultiple.ToString(), True) - - If (DdlPrecioLista.Items.Count = 1) Then - DdlPrecioLista.Items.FindByValue(primerItem).Selected = True - End If Else DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2")) DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2"))