--SMS-- Actualizacion de multiples listas de precios, limitado a 15
This commit is contained in:
@@ -1811,12 +1811,13 @@ Public Class ClsProductosServicios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetPSMultiplesPreciosLista(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1,
|
||||
Public Function GetPSMultiplesPreciosLista(CveEmpresa As Integer, Optional ListasPrecios As String = "-1", Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1,
|
||||
Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_PSPrecioListaMultipleGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@ListasPrecios", SqlDbType.VarChar).Value = ListasPrecios
|
||||
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
|
||||
|
||||
@@ -42,52 +42,57 @@
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row v-center">
|
||||
<label class="col-md-1 v-center truncate" runat="server" visible="false">Modalidad:</label>
|
||||
<div class="col-md-1 v-center" runat="server" visible="false">
|
||||
<asp:DropDownList ID="DdlModalidad" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me">
|
||||
<label class="col-md-1 v-center truncate" runat="server" id="LblModalidad" visible="false" style="width: 80px;">Modalidad:</label>
|
||||
<div class="col-md-2 v-center" runat="server" id="DivModalidad" visible="false">
|
||||
<asp:DropDownList ID="DdlModalidad" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlModalidad_SelectedIndexChanged">
|
||||
<asp:ListItem Selected="True" Value="1" Text="Por lista de precio"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Multiples listas de precio"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">Precio de Lista:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" Width="100%" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
|
||||
<label class="col-md-1 v-center truncate" style="width: 80px;">PS:</label>
|
||||
<div class="col-md-2 v-center">
|
||||
<ADS:Dropdownlost ID="DDlPs" AutoPostBack="false" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width:250px;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">Clasificación:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<div class="col-md-2 v-center">
|
||||
<asp:DropDownList ID="DDlClasificacion" runat="server" Width="100%" CssClass="select2me" OnSelectedIndexChanged="DDlClasificacion_SelectedIndexChanged" AutoPostBack="True" DataValueField="CveClasificacion" DataTextField="Clasificacion"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">PS:</label>
|
||||
<div class="col-md-2 v-center">
|
||||
<ADS:Dropdownlost ID="DDlPs" AutoPostBack="false" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width:200px;"></ADS:Dropdownlost>
|
||||
<label class="col-md-1 v-center truncate">Precio de Lista:</label>
|
||||
<div class="col-md-2 v-center" id="DivPrecioLista" runat="server">
|
||||
<asp:DropDownList ID="DdlPrecioLista" runat="server" AppendDataBoundItems="true" Width="220px" CssClass="select2me" DataValueField="CvePrecioLista" DataTextField="PrecioLista"></asp:DropDownList>
|
||||
</div>
|
||||
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate">Marca:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:ListBox ID="DdlMarca" Visible="false" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 50%; height: 50px !important;"></asp:ListBox>
|
||||
<div class="col-md-2 v-center" id="DivMultiplePrecioLista" runat="server" visible="false">
|
||||
<asp:ListBox ID="DdlMultiplePrecioLista" runat="server" DataTextField="PrecioLista" DataValueField="CvePrecioLista" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width:200px; height: 50px !important;"></asp:ListBox>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<label class="col-md-1 v-center" id="LblProveedorCompra" runat="server" visible="false">Proveedor:</label>
|
||||
<div class="col-md-1 v-center" id="DivProveedorCompra" runat="server" visible="false">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlProveedor" Width="100%" data-metodo="getproveedores" runat="server" DataTextField="RazonSocial" DataValueField="CveProveedor" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
<label class="col-md-1 v-center truncate">Estado:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<label class="col-md-1 v-center truncate" style="width: 80px;">Estado:</label>
|
||||
<div class="col-md-2 v-center">
|
||||
<asp:DropDownList ID="DdlEstado" runat="server" Width="100%" CssClass="select2me">
|
||||
<asp:ListItem Value="-1">Todos</asp:ListItem>
|
||||
<asp:ListItem Value="1" Selected="True">Activos</asp:ListItem>
|
||||
<asp:ListItem Value="0">Incativos</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label id="LblMarca" runat="server" visible="false" class="col-md-1 v-center truncate" style="width: 80px;">Marca:</label>
|
||||
<div class="col-md-2 v-center" id="DivMarca" runat="server" visible="false">
|
||||
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width:250px; height: 50px !important;"></asp:ListBox>
|
||||
</div>
|
||||
<label id="lblModelo" runat="server" class="col-md-1 v-center truncate" visible="false">Modelo:</label>
|
||||
<div class="col-md-1 v-center">
|
||||
<asp:DropDownList ID="DdlModelo" Visible="false" runat="server" Width="100%" CssClass="select2me" DataTextField="Modelo" DataValueField="CveModelo">
|
||||
<div class="col-md-2 v-center" id="DivModelo" runat="server" visible="false">
|
||||
<asp:DropDownList ID="DdlModelo" runat="server" Width="100%" CssClass="select2me" DataTextField="Modelo" DataValueField="CveModelo">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 v-center" id="LblProveedorCompra" runat="server" visible="false">Proveedor:</label>
|
||||
<div class="col-md-2 v-center" id="DivProveedorCompra" runat="server" visible="false">
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlProveedor" Width="100%" data-metodo="getproveedores" runat="server" DataTextField="RazonSocial" DataValueField="CveProveedor" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -238,7 +243,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<asp:GridView ID="GvMultiple" runat="server" GridLines="None" AutoGenerateColumns="true" ClientIDMode="Static"
|
||||
<asp:GridView ID="GvMultiple" runat="server" GridLines="None" ClientIDMode="Static" AutoGenerateColumns="false"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" EmptyDataText="No se encontraron registros"
|
||||
OnRowCreated="GvMultiple_RowCreated" OnRowDataBound="GvMultiple_RowDataBound">
|
||||
<Columns>
|
||||
@@ -247,6 +252,127 @@
|
||||
<asp:CheckBox runat="server" ID="chkPS" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="CodigoPS" HeaderText="Producto/Servicio" />
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_1" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_1" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_2" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_2" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_3" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_3" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_4" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_4" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_5" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_5" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_6" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_6" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_7" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_7" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_8" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_8" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_9" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_9" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_10" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_10" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_11" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_11" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_12" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_12" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_13" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_13" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_14" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_14" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField Visible="false">
|
||||
<HeaderTemplate>
|
||||
<asp:Label ID="LtlLista_15" runat="server"></asp:Label>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtPrecio_15" runat="server" CssClass="CssCamviaPrecio" MaxLength="39" Width="90%" onkeypress="return onlyNumberKey(event)"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -400,7 +526,7 @@
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
|
||||
function convertirTabla(){
|
||||
function convertirTabla() {
|
||||
let json = tableToJson($('#GvMultiple').get(0));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,16 @@ Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class Ventas_ActualizarPrecios
|
||||
Inherits ClsPaginas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtListasPrecios As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DtListasPrecios")), Nothing, CType(ViewState("DtListasPrecios"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtListasPrecios") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtSubProyectos As DataTable
|
||||
Get
|
||||
@@ -78,6 +87,10 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
If UsuarioActual.CveEmpresa = 186 Then
|
||||
LblModalidad.Visible = True
|
||||
DivModalidad.Visible = True
|
||||
End If
|
||||
CargaCombos()
|
||||
End If
|
||||
End Sub
|
||||
@@ -99,12 +112,15 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
DdlPrecioLista.Items.Clear()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'si manneja precios de lista
|
||||
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
|
||||
DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy()
|
||||
DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy()
|
||||
DtListasPrecios = ObjVta.DtResultados.Copy()
|
||||
DdlPrecioLista.DataSource = DtListasPrecios
|
||||
DdlPrecioListaCarga.DataSource = DtListasPrecios
|
||||
DdlMultiplePrecioLista.DataSource = DtListasPrecios
|
||||
primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista")
|
||||
End If
|
||||
ObjVta.Dispose()
|
||||
@@ -112,6 +128,19 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
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
|
||||
|
||||
DdlMultiplePrecioLista.SelectedValuesIfExistM(sbMultiple.ToString(), True)
|
||||
|
||||
If (DdlPrecioLista.Items.Count = 1) Then
|
||||
DdlPrecioLista.Items.FindByValue(primerItem).Selected = True
|
||||
@@ -158,7 +187,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
DdlMarca.DataBind()
|
||||
|
||||
LblMarca.Visible = True
|
||||
DdlMarca.Visible = True
|
||||
DivMarca.Visible = True
|
||||
End If
|
||||
|
||||
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
@@ -166,7 +195,7 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Private Sub CargarModelos()
|
||||
If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then
|
||||
lblModelo.Visible = True
|
||||
DdlModelo.Visible = True
|
||||
DivModelo.Visible = True
|
||||
Dim ObjGeneral As New ClsGenerales
|
||||
If ObjGeneral.GetModelos(UsuarioActual.CveEmpresa) Then
|
||||
DdlModelo.DataSource = ObjGeneral.DtResultados
|
||||
@@ -217,8 +246,11 @@ Partial Class Ventas_ActualizarPrecios
|
||||
|
||||
'MULTIPLE LISTAS DE PRECIO
|
||||
If DdlModalidad.SelectedValue = "2" Then
|
||||
|
||||
Dim ListasPrecios As String = If(DdlMultiplePrecioLista.GetSelectedValuesM = "", "-1", DdlMultiplePrecioLista.GetSelectedValuesM)
|
||||
|
||||
Dim objPS As New ClsProductosServicios
|
||||
If objPS.GetPSMultiplesPreciosLista(UsuarioActual.CveEmpresa, CveClasificacion:=DDlClasificacion.SelectedValue.ToEntero, CvePS:=CvePS,
|
||||
If objPS.GetPSMultiplesPreciosLista(UsuarioActual.CveEmpresa, ListasPrecios:=ListasPrecios, CveClasificacion:=DDlClasificacion.SelectedValue.ToEntero, CvePS:=CvePS,
|
||||
CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then
|
||||
DtPreciosMultiple = objPS.DtResultados.Copy()
|
||||
GvMultiple.DataSource = DtPreciosMultiple
|
||||
@@ -229,6 +261,14 @@ Partial Class Ventas_ActualizarPrecios
|
||||
dvMultiple.Visible = True
|
||||
DivActualizarPrecio.Visible = False
|
||||
|
||||
For colIndex = 2 To GvMultiple.Columns.Count - 1
|
||||
If colIndex <= DtPreciosMultiple.Columns.Count - 1 Then
|
||||
GvMultiple.Columns(colIndex).Visible = True
|
||||
Else
|
||||
GvMultiple.Columns(colIndex).Visible = False
|
||||
End If
|
||||
Next
|
||||
|
||||
GvMultiple.DataBind()
|
||||
End If
|
||||
|
||||
@@ -779,42 +819,76 @@ Partial Class Ventas_ActualizarPrecios
|
||||
End Sub
|
||||
Protected Sub GvMultiple_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||
'QUITAR COLUMNA "CvePS"
|
||||
e.Row.Cells(1).Visible = False
|
||||
'e.Row.Cells(1).Visible = False
|
||||
|
||||
'If e.Row.RowType = DataControlRowType.Header Then
|
||||
' For colIndex = 2 To e.Row.Cells.Count - 1
|
||||
|
||||
' Dim indiceColumna As Integer = (colIndex)
|
||||
' Dim LtlId = "LtlLista" + (colIndex - 1).ToString()
|
||||
' Dim Dr = DtPreciosMultiple.Rows(e.Row.RowIndex)
|
||||
' If Dr IsNot Nothing Then
|
||||
' 'VERIFICA QUE EL INDICE DE LA COLUMNA DEL DT NO SEA MAYOR A LA DEL GRIDVIEW
|
||||
' If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
|
||||
' Dim cell = e.Row.Cells(colIndex)
|
||||
|
||||
' Dim text = cell.Text
|
||||
' Dim splitValues = text.Split("|"c)
|
||||
|
||||
' If splitValues.Length > 1 Then
|
||||
' Dim CvePrecioLista = splitValues(0)
|
||||
' Dim PrecioLista = splitValues(1)
|
||||
' e.Row.FCLiteral(LtlId).Text = PrecioLista
|
||||
' cell.Attributes.Add("cvepreciolista", CvePrecioLista)
|
||||
' End If
|
||||
|
||||
' End If
|
||||
|
||||
' End If
|
||||
|
||||
' Next
|
||||
'End If
|
||||
End Sub
|
||||
Protected Sub GvMultiple_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.Header Then
|
||||
For index = 0 To e.Row.Cells.Count - 1
|
||||
Dim cell = e.Row.Cells(index)
|
||||
For colIndex = 2 To e.Row.Cells.Count - 1
|
||||
|
||||
Dim text = cell.Text
|
||||
Dim indiceColumna As Integer = (colIndex)
|
||||
Dim LtlId = "LtlLista_" + (colIndex - 1).ToString()
|
||||
|
||||
Dim splitValues = text.Split("|"c)
|
||||
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
|
||||
|
||||
If splitValues.Length > 1 Then
|
||||
Dim CvePrecioLista = splitValues(0)
|
||||
Dim PrecioLista = splitValues(1)
|
||||
Dim text = DtPreciosMultiple.Columns(indiceColumna).ColumnName
|
||||
Dim splitValues = text.Split("|"c)
|
||||
|
||||
If splitValues.Length > 1 Then
|
||||
Dim CvePrecioLista = splitValues(0)
|
||||
Dim PrecioLista = splitValues(1)
|
||||
e.Row.FCLabel(LtlId).Text = PrecioLista
|
||||
e.Row.FCLabel(LtlId).Attributes.Add("cvepreciolista", CvePrecioLista)
|
||||
End If
|
||||
|
||||
cell.Text = PrecioLista
|
||||
cell.Attributes.Add("cvepreciolista", CvePrecioLista)
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvMultiple_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
For index = 3 To e.Row.Cells.Count - 1
|
||||
Dim valor = e.Row.Cells(index).Text.ToDecimal()
|
||||
For colIndex = 2 To e.Row.Cells.Count - 1
|
||||
|
||||
Dim CvePS = DtPreciosMultiple.Rows(e.Row.RowIndex)("CvePS").ToString()
|
||||
Dim indiceColumna As Integer = (colIndex)
|
||||
Dim TxtId = "TxtPrecio_" + (colIndex - 1).ToString()
|
||||
Dim Dr = DtPreciosMultiple.Rows(e.Row.RowIndex)
|
||||
If Dr IsNot Nothing Then
|
||||
|
||||
Dim idTxt = "txt" + CvePS + "_" + index.ToString()
|
||||
'VERIFICA QUE EL INDICE DE LA COLUMNA DEL DT NO SEA MAYOR A LA DEL GRIDVIEW
|
||||
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
|
||||
Dim Valor = DtPreciosMultiple.Rows(e.Row.RowIndex)(indiceColumna).ToString().ToDecimal()
|
||||
|
||||
e.Row.Cells(index).EnableViewState = True
|
||||
e.Row.Cells(index).ViewStateMode = ViewStateMode.Enabled
|
||||
e.Row.FCTextBox(TxtId).Text = Valor.FormatoNumero(2)
|
||||
End If
|
||||
|
||||
Dim textBox = New TextBox() With {.ID = idTxt, .Text = valor.FormatoNumero(2), .Width = 100, .AutoCompleteType = AutoCompleteType.Disabled}
|
||||
|
||||
e.Row.Cells(index).Controls.Add(textBox)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
@@ -824,29 +898,30 @@ Partial Class Ventas_ActualizarPrecios
|
||||
Dim ObjPS As New ClsProductosServicios
|
||||
ObjPS.IniciaTransacSQL()
|
||||
Try
|
||||
For Each row As GridViewRow In GvMultiple.Rows
|
||||
For Each GvRow As GridViewRow In GvMultiple.Rows
|
||||
|
||||
If row.FCCheckBox("chkPS").Checked Then
|
||||
For index = 3 To row.Cells.Count - 1
|
||||
Dim cell = row.Cells(index)
|
||||
If GvRow.FCCheckBox("chkPS").Checked Then
|
||||
For colIndex = 2 To GvRow.Cells.Count - 1
|
||||
|
||||
Dim valor = cell.Text.ToDecimal()
|
||||
Dim indiceColumna As Integer = (colIndex)
|
||||
|
||||
Dim CvePS = DtPreciosMultiple.Rows(row.RowIndex)("CvePS").ToString().ToEntero()
|
||||
Dim LtlId = "LtlLista_" + (colIndex - 1).ToString()
|
||||
Dim TxtId = "TxtPrecio_" + (colIndex - 1).ToString()
|
||||
|
||||
Dim CvePrecioLista = GvMultiple.HeaderRow.Cells(index).Attributes("cvepreciolista").ToEntero()
|
||||
If indiceColumna <= DtPreciosMultiple.Columns.Count - 1 Then
|
||||
|
||||
Dim idTxt = "txt" + CvePS.ToString() + "_" + index.ToString()
|
||||
Dim CvePrecioLista As Integer = GvMultiple.HeaderRow.FCLabel(LtlId).Attributes().Item("cvepreciolista").ToEntero()
|
||||
Dim CvePS = DtPreciosMultiple.Rows(GvRow.RowIndex)("CvePS").ToString().ToEntero()
|
||||
|
||||
Dim TxtPrecio = cell.Controls.Cast(Of Control).First(Function(x) x.ID = idTxt)
|
||||
Dim Precio = GvRow.FCTextBox(TxtId).Text.ToDecimal()
|
||||
|
||||
Dim Precio As Decimal = DirectCast(TxtPrecio, TextBox).Text.ToDecimal()
|
||||
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
||||
|
||||
TieneError = Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLista, 0, CvePS, UsuarioActual.CveUsuario, NowADS(), True)
|
||||
|
||||
If TieneError Then
|
||||
Exit For
|
||||
If TieneError Then
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -876,4 +951,23 @@ Partial Class Ventas_ActualizarPrecios
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub DdlModalidad_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
DivPrecioLista.Visible = DdlModalidad.SelectedValue = "1"
|
||||
DivMultiplePrecioLista.Visible = DdlModalidad.SelectedValue = "2"
|
||||
|
||||
|
||||
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
|
||||
|
||||
DdlMultiplePrecioLista.SelectedValuesIfExistM(sbMultiple.ToString(), True)
|
||||
|
||||
UpEncabezado.Update()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user