--Subproyectos en catalogo de precios de lista
This commit is contained in:
@@ -2158,6 +2158,49 @@ Public Class ClsVentas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "V E N T A S - P R E C I O L I S T A S" 'Hecho por Charlie 1/9/2016
|
#Region "V E N T A S - P R E C I O L I S T A S" 'Hecho por Charlie 1/9/2016
|
||||||
|
|
||||||
|
Public Function GetPreciosListasSubProyecto(CvePrecioLista As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_PrecioListaSubProyectosGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el Catálogo de Listas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function UpdatePreciosListasSubProyecto(CvePrecioLista As Integer, CveSubProyecto As Integer, Permitir As Boolean, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
|
DataAdapter("PA_Vta_PrecioListaSubProyectosUpdate")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||||
|
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||||
|
.Add("@Permitir", SqlDbType.Bit).Value = Permitir
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el Catálogo de Listas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function GetPrecioListas(Optional CveEmpresa As Integer = -1) As Boolean
|
Public Function GetPrecioListas(Optional CveEmpresa As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
@@ -2177,7 +2220,7 @@ Public Class ClsVentas
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1, Optional UpdateFranquicia As Boolean = False) As Integer
|
Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Restringida As Boolean, Porcentaje As Double, Optional CvePrecioListaClonar As Integer = -1, Optional UpdateFranquicia As Boolean = False) As Integer
|
||||||
Dim Retorno As Integer = -1
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
DataAdapter("PA_Vta_PrecioListaAdd")
|
DataAdapter("PA_Vta_PrecioListaAdd")
|
||||||
@@ -2188,6 +2231,7 @@ Public Class ClsVentas
|
|||||||
.Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista
|
.Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista
|
||||||
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
||||||
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
||||||
|
.Add("@Restringida", SqlDbType.Bit).Value = Restringida
|
||||||
.Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar
|
.Add("@CvePrecioListaClonar", SqlDbType.Int).Value = CvePrecioListaClonar
|
||||||
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
||||||
.Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output
|
.Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
@@ -2210,7 +2254,7 @@ Public Class ClsVentas
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function UpdatePrecioLista(PrecioLista As String, Estatus As Boolean, CveUsuario As Integer, Porcentaje As Double,
|
Public Function UpdatePrecioLista(PrecioLista As String, Estatus As Boolean, CveUsuario As Integer, Porcentaje As Double,
|
||||||
Predeterminada As Boolean, CvePrecioLista As Integer, Optional UpdateFranquicia As Boolean = False) As Boolean
|
Predeterminada As Boolean, Restringida As Boolean, CvePrecioLista As Integer, Optional UpdateFranquicia As Boolean = False) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_Vta_PrecioListaUpdate")
|
DataAdapter("PA_Vta_PrecioListaUpdate")
|
||||||
@@ -2221,6 +2265,7 @@ Public Class ClsVentas
|
|||||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
.Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje
|
||||||
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
.Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada
|
||||||
|
.Add("@Restringida", SqlDbType.Bit).Value = Restringida
|
||||||
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
|
||||||
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
.Add("@UpdateFranquicia", SqlDbType.Bit).Value = UpdateFranquicia
|
||||||
End With
|
End With
|
||||||
|
|||||||
@@ -1,108 +1,125 @@
|
|||||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPreciosLista.aspx.vb" Inherits="Ventas_CatPreciosLista" %>
|
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPreciosLista.aspx.vb" Inherits="Ventas_CatPreciosLista" %>
|
||||||
|
|
||||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
Catálogo de Precios de Lista
|
Catálogo de Precios de Lista
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
<li>
|
<li>
|
||||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar Precio de Lista</asp:LinkButton>
|
<asp:LinkButton runat="server" ID="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar Precio de Lista</asp:LinkButton>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</li>
|
</li>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px;text-align: right;margin-right: 5px;" align="left">
|
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CvePrecioLista, PrecioLista, Estatus,Predeterminada" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CvePrecioLista, PrecioLista, Estatus,Predeterminada,Restringuida" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField DataField="PrecioLista" ItemStyle-Width="50%" HeaderText="Precio de lista" ItemStyle-HorizontalAlign="Left" />
|
<asp:BoundField DataField="PrecioLista" ItemStyle-Width="50%" HeaderText="Precio de lista" ItemStyle-HorizontalAlign="Left" />
|
||||||
<asp:TemplateField HeaderText="Predeterminada" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField HeaderText="Predeterminada" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LblPred" runat="server" Text='<%#If(Eval("Predeterminada").ToString = "True", "Si", "") %>'></asp:Label>
|
<asp:Label ID="LblPred" runat="server" Text='<%#If(Eval("Predeterminada").ToString = "True", "Si", "") %>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Crédito" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField HeaderText="Crédito" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LblCred" runat="server" Text='<%#If(Eval("Credito").ToString = "True", "Si", "") %>'></asp:Label>
|
<asp:Label ID="LblCred" runat="server" Text='<%#If(Eval("Credito").ToString = "True", "Si", "") %>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="20%" HeaderText="Fecha Ing" ItemStyle-HorizontalAlign="center" />
|
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="20%" HeaderText="Fecha Ing" ItemStyle-HorizontalAlign="center" />
|
||||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="myModalLabel">Guardar Precio de Lista</h4>
|
<h4 class="modal-title" id="myModalLabel">Guardar Precio de Lista</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<asp:UpdatePanel ID="UpBodyCo" UpdateMode="Conditional" runat="server">
|
<asp:UpdatePanel ID="UpBodyCo" UpdateMode="Conditional" runat="server">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtPrecioLista" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
<asp:TextBox ID="TxtPrecioLista" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVNombrePlantilla" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioLista" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio de Lista''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVNombrePlantilla" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPrecioLista" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Precio de Lista''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||||
<label for="<%= TxtPrecioLista.ClientID.ToString()%>">Precio de Lista:</label>
|
<label for="<%= TxtPrecioLista.ClientID.ToString()%>">Precio de Lista:</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:CheckBox ID="ChkPredeterminada" runat="server" Text="Predeterminada" CausesValidation="true"></asp:CheckBox>
|
<asp:CheckBox ID="ChkPredeterminada" runat="server" Text="Predeterminada" CausesValidation="true"></asp:CheckBox>
|
||||||
</div>
|
</div>
|
||||||
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||||
<label>Activo: </label>
|
<label>Activo: </label>
|
||||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
<asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||||
</asp:Checkbox>
|
</div>
|
||||||
</div>
|
<div id="divPermiso" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
|
||||||
</ContentTemplate>
|
<label>Restringida a permiso: </label>
|
||||||
</asp:UpdatePanel>
|
<asp:CheckBox ID="ChkRestringida" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||||
<div class="modal-footer">
|
</div>
|
||||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
<div class="row">
|
||||||
<ContentTemplate>
|
<div class="col-md-12">
|
||||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
<asp:GridView ID="GvSubProyectos" runat="server" GridLines="None" DataKeyNames="CveSubProyecto,SubProyecto,Permitir" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default" >Cancelar</button>
|
<Columns>
|
||||||
</ContentTemplate>
|
<asp:BoundField DataField="SubProyecto" ItemStyle-Width="80%" HeaderText="Sucursal" ItemStyle-HorizontalAlign="Left" />
|
||||||
</asp:UpdatePanel>
|
<asp:TemplateField HeaderText="Permitir" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%">
|
||||||
</div>
|
<ItemTemplate>
|
||||||
</div>
|
<asp:CheckBox ID="ChkPermitir" runat="server" Checked='<%# Eval("Permitir") %>' />
|
||||||
</ContentTemplate>
|
</ItemTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:TemplateField>
|
||||||
</div>
|
</Columns>
|
||||||
</div>
|
</asp:GridView>
|
||||||
</asp:Content>
|
</div>
|
||||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
</div>
|
||||||
</asp:Content>
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||||
|
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ Partial Class Ventas_CatPreciosLista
|
|||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
CvePrecioLista = -1
|
CvePrecioLista = -1
|
||||||
EsEditar = 0
|
EsEditar = 0
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
|
divPermiso.Visible = True
|
||||||
|
End If
|
||||||
dvEstatus.Visible = False
|
dvEstatus.Visible = False
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
End If
|
End If
|
||||||
@@ -56,9 +59,19 @@ Partial Class Ventas_CatPreciosLista
|
|||||||
TxtPrecioLista.Text = GvRow.DataKey("PrecioLista").ToString
|
TxtPrecioLista.Text = GvRow.DataKey("PrecioLista").ToString
|
||||||
ChkPredeterminada.Checked = GvRow.DataKey("Predeterminada") = "True"
|
ChkPredeterminada.Checked = GvRow.DataKey("Predeterminada") = "True"
|
||||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||||
|
ChkRestringida.Checked = CBool(GvRow.DataKey("Restringuida"))
|
||||||
|
|
||||||
EsEditar = 1
|
EsEditar = 1
|
||||||
BtnAgregarCatalogo.Text = "Actualizar"
|
BtnAgregarCatalogo.Text = "Actualizar"
|
||||||
dvEstatus.Visible = True
|
dvEstatus.Visible = True
|
||||||
|
|
||||||
|
Using ObjVenta As New ClsVentas
|
||||||
|
If ObjVenta.GetPreciosListasSubProyecto(CvePrecioLista, UsuarioActual.CveEmpresa) Then
|
||||||
|
GvSubProyectos.DataSource = ObjVenta.DtResultados.Copy()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
GvSubProyectos.DataBind()
|
||||||
|
|
||||||
UpBodyCo.Update()
|
UpBodyCo.Update()
|
||||||
UpFooter.Update()
|
UpFooter.Update()
|
||||||
RegistraScript("$('#divAgregar').modal()")
|
RegistraScript("$('#divAgregar').modal()")
|
||||||
@@ -76,19 +89,46 @@ Partial Class Ventas_CatPreciosLista
|
|||||||
Dim TieneError As Boolean = False
|
Dim TieneError As Boolean = False
|
||||||
Try
|
Try
|
||||||
If EsEditar = 0 Then
|
If EsEditar = 0 Then
|
||||||
If ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, ChkPredeterminada.Checked, 0, UpdateFranquicia:=ActualizarFranquicias) > 0 Then
|
Dim CvePrecioLista As Integer = ObjVta.AddPrecioLista(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtPrecioLista.Text, ChkPredeterminada.Checked, ChkRestringida.Checked, 0, UpdateFranquicia:=ActualizarFranquicias)
|
||||||
Alert("El Precio de Lista se agregó correctamente", TipoMensaje.MsgInformacion)
|
If Not CvePrecioLista > 0 Then
|
||||||
Else
|
|
||||||
Alert("Ocurrió un error al agregar el Precio de Lista", TipoMensaje.MsgError)
|
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not TieneError Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
|
For Each GvRow As GridViewRow In GvSubProyectos.Rows
|
||||||
|
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||||
|
Dim Permitir As Boolean = GvRow.FCCheckBox("ChkPermitir").Checked
|
||||||
|
Dim CveSubProyecto As Integer = GvRow.DataKey("CveSubProyecto").ToEntero()
|
||||||
|
If Not ObjVta.UpdatePreciosListasSubProyecto(CvePrecioLista, CveSubProyecto, Permitir, UsuarioActual.CveEmpresa) Then
|
||||||
|
TieneError = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
ElseIf EsEditar = 1 Then
|
ElseIf EsEditar = 1 Then
|
||||||
If ObjVta.UpdatePrecioLista(TxtPrecioLista.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, 0, ChkPredeterminada.Checked, CvePrecioLista, UpdateFranquicia:=ActualizarFranquicias) Then
|
If Not ObjVta.UpdatePrecioLista(TxtPrecioLista.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, 0, ChkPredeterminada.Checked, ChkRestringida.Checked, CvePrecioLista, UpdateFranquicia:=ActualizarFranquicias) Then
|
||||||
Alert("El Precio de Lista se editó correctamente", TipoMensaje.MsgInformacion)
|
|
||||||
Else
|
|
||||||
Alert("Ocurrió un error al editar al Precio de Lista", TipoMensaje.MsgError)
|
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not TieneError Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
|
||||||
|
For Each GvRow As GridViewRow In GvSubProyectos.Rows
|
||||||
|
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||||
|
Dim Permitir As Boolean = GvRow.FCCheckBox("ChkPermitir").Checked
|
||||||
|
Dim CveSubProyecto As Integer = GvRow.DataKey("CveSubProyecto").ToEntero()
|
||||||
|
If Not ObjVta.UpdatePreciosListasSubProyecto(Me.CvePrecioLista, CveSubProyecto, Permitir, UsuarioActual.CveEmpresa) Then
|
||||||
|
TieneError = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
EsEditar = 0
|
EsEditar = 0
|
||||||
dvEstatus.Visible = False
|
dvEstatus.Visible = False
|
||||||
BtnAgregarCatalogo.Text = "Agregar"
|
BtnAgregarCatalogo.Text = "Agregar"
|
||||||
@@ -100,8 +140,10 @@ Partial Class Ventas_CatPreciosLista
|
|||||||
|
|
||||||
If TieneError Then
|
If TieneError Then
|
||||||
ObjVta.RollBack()
|
ObjVta.RollBack()
|
||||||
|
Alert("Ocurrió un error al guardar el precio de lista", TipoMensaje.MsgError)
|
||||||
Else
|
Else
|
||||||
ObjVta.Commit()
|
ObjVta.Commit()
|
||||||
|
Alert("El precio de lista se guardo correctamente", TipoMensaje.MsgInformacion)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
RegistraScript("$('#divAgregar').modal('hide')")
|
RegistraScript("$('#divAgregar').modal('hide')")
|
||||||
|
|||||||
Reference in New Issue
Block a user