Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCategorias.aspx.vb" Inherits="General_CatCategorias" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Categorías
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li><asp:LinkButton ID="HlAgregarCategoria" runat="server"><i class="fa fa-plus"></i> Agregar Categoría</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCategoria, Categoria, Estatus" EmptyDataText="No se encontraron Categorías Registradas" ToolTip="Listado de Categorias" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Categoría">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCategoria" runat="server" Text='<%# Eval("Categoria", "{0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaCategoria" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" 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>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpModal">
<ContentTemplate>
<div id="ModalCategorias" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalCategoria" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModal" runat="server">Agregar Categoría</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCategoria" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCategoria" runat="server" ControlToValidate="TxtCategoria" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Categoría''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="<%= TxtCategoria.ClientID.ToString()%>">Categoría:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:CheckBox runat="server" ID="ChkEstatus" Checked="true"/>
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LbAgregar" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardar" />
<button id="BtnCancelarProyecto" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HdnModalidadCategoria" runat="server" Value="A" ClientIDMode="Static" />
<asp:HiddenField ID="HdnIDCategoria" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,119 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class General_CatCategorias
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub RecargaGlobal()
Dim ObjCategorias As New ClsGenerales
If ObjCategorias.GetCategorias(-1) Then
GlobalDTGralCategorias(-1) = ObjCategorias.DtResultados
End If
ObjCategorias.Dispose()
End Sub
Public Sub CargaDatos()
Dim ObjCategorias As New ClsGenerales
If ObjCategorias.GetCategorias(UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjCategorias.DtResultados
GvDatos.DataBind()
Else
GvDatos.DataSource = Nothing
End If
UpDatos.Update()
ObjCategorias.Dispose()
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjCategorias As New ClsGenerales
If HdnModalidadCategoria.Value = "A" Then
If ObjCategorias.AddCategorias(TxtCategoria.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCategoria.Text = ""
Alert("El nueva Categoría se guardó correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf HdnModalidadCategoria.Value = "U" Then
If ObjCategorias.UpdateCategoria(TxtCategoria.Text.Trim, ChkEstatus.Checked, HdnIDCategoria.Value.ToEntero) Then
TxtCategoria.Text = ""
ChkEstatus.Checked = True
Alert("La Categoría se actualizó correctamente.", TipoMensaje.MsgInformacion)
End If
End If
CargaDatos()
RecargaGlobal()
UpModal.Update()
ObjCategorias.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjCategorias As New ClsGenerales
If ObjCategorias.RemoveCategorias(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
CargaDatos()
RecargaGlobal()
Alert("La Categoría se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjCategorias.Dispose()
End Sub
Private Sub HlAgregarCategorias(sender As Object, e As EventArgs) Handles HlAgregarCategoria.Click
TxtCategoria.Text = ""
LtlTituloModal.Text = "Agregar Categoría"
LbAgregar.Text = "Agregar"
HdnModalidadCategoria.Value = "A"
UpModal.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalCategorias"))
End Sub
Public Sub ActualizaCategoria(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveCategoria As String = GvRow.DataKey("CveCategoria").ToString
Dim Categoria As String = GvRow.DataKey("Categoria").ToString
Dim Estatus As String = GvRow.DataKey("Estatus").ToString
If Estatus = "Activo" Then ChkEstatus.Checked = True Else ChkEstatus.Checked = False
TxtCategoria.Text = Categoria
HdnIDCategoria.Value = CveCategoria
HdnModalidadCategoria.Value = "U"
LtlTituloModal.Text = "Actualizar Categoría"
LbAgregar.Text = "Actualizar"
UpModal.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalCategorias"))
End Sub
#End Region
End Class

View File

@@ -0,0 +1,309 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" ValidateRequest="false" EnableEventValidation="false" CodeFile="CatClasificaciones.aspx.vb" Inherits="AF_CatClasificacionesCaracteristicas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel ID="UpLinks" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="HLAgregarClasificacion" runat="server"><i class="fa fa-plus"></i> Agregar Clasificación</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="HLAgregarCaracteristica" runat="server"><i class="fa fa-plus"></i> Agregar Caracteristica</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="HLAgregarOpciones" runat="server"><i class="fa fa-plus"></i> Agregar Opciones</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Clasificaciones y Caracteristicas Generales
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer runat="server" ID="TabPanel" ActiveTabIndex="1">
<ajax:TabPanel runat="server" HeaderText="Clasificaciones" ID="TabClasificaciones">
<ContentTemplate>
<asp:GridView runat="server" ID="GvClasificaciones" DataKeyNames="CveCaracteristicaClasificacion, Estatus, CaracteristicaClasificacion, Orden" GridLines="None" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="CaracteristicaClasificacion" HeaderText="Clasificación" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" />
<asp:TemplateField ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="ActualizaModalClasif" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:LinkButton ID="imgD" 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="¿Desea Elminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" HeaderText="Caracteristicas" ID="TabCaracteristicas" TabIndex="1">
<ContentTemplate>
<asp:GridView runat="server" ID="GvCaracteristicas" DataKeyNames="CveCaracteristica, CveCaracteristicaClasificacion, Caracteristica, CveCaracteristicaModulo, TipoCampo, Estatus, Requerido, EsSeparador, Orden, Longitud" GridLines="None" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="CaracteristicaClasificacion" HeaderText="Clasificación" />
<asp:BoundField DataField="Caracteristica" HeaderText="Caracteristica" />
<asp:BoundField DataField="CaracteristicaModulo" HeaderText="Módulo" />
<asp:BoundField DataField="TipoCampo" HeaderText="Tipo" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Requerido" HeaderText="Requerido" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Longitud" HeaderText="Longitud" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="EsSeparador" HeaderText="Separador" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" HeaderText="Fecha" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" />
<asp:TemplateField ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" Onclick="ActualizaModalCaracteristicas" AlternateText="Editar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:LinkButton ID="imgD" 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="¿Desea Elminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" HeaderText="Opciones" ID="TabOpciones">
<ContentTemplate>
<asp:GridView runat="server" ID="GvOpciones" DataKeyNames="CveCaracteristicaOpcion, Caracteristica, Orden, CaracteristicaOpcion, Estatus" GridLines="None" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Caracteristica" HeaderText="Caracteristica" />
<asp:BoundField DataField="CaracteristicaOpcion" HeaderText="Caracteristica Opción" />
<asp:BoundField DataField="CaracteristicaModulo" HeaderText="Módulo" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" />
<asp:TemplateField ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="ActualizaModalOpciones" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:LinkButton ID="imgD" 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="¿Desea Elminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalClasificaciones" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalClasificaciones" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModal" runat="server">Agregar Clasificaciones</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtClasificaciones" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true" ValidationGroup="Clasif"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCampaña" runat="server" ControlToValidate="TxtClasificaciones" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtClasificaciones.ClientID.ToString()%>">Clasificación:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtOrdenClasif" CssClass="form-control " runat="server" MaxLength="5" TextMode="Number" CausesValidation="true" ValidationGroup="Clasif"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrden" runat="server" ControlToValidate="TxtOrdenClasif" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtOrdenClasif.ClientID.ToString()%>">Orden:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarClasificacion" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="Clasif" />
<button id="BtnCancelarCampaña" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HdnModalidadClasificacion" runat="server" Value="I" ClientIDMode="Static" />
<asp:HiddenField ID="HdnIDClasificacion" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalCaracteristicas" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalCaracteristicas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal1" runat="server">Agregar Caracteristicas</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModulo" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CaracteristicaModulo" DataValueField="CveCaracteristicaModulo" Width="240px"></asp:DropDownList>
<label for="<%= DdlModulo.ClientID.ToString()%>">Módulo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlCaracteristica" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CaracteristicaClasificacion" DataValueField="CveCaracteristicaClasificacion" Width="240px" ValidationGroup="GrpPregunta"></asp:DropDownList>
<label for="<%= DdlCaracteristica.ClientID.ToString()%>">Clasificación:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoCampo" runat="server" AppendDataBoundItems="true" Class="form-control input-sm select2me js-cuenta-programmatic" Width="240px">
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Radio" Value="2"></asp:ListItem>
<asp:ListItem Text="Fecha" Value="3"></asp:ListItem>
<asp:ListItem Text="Multiline" Value="4"></asp:ListItem>
<asp:ListItem Text="Checkbox" Value="5"></asp:ListItem>
<asp:ListItem Text="Numerico" Value="6"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipoCampo.ClientID.ToString()%>">Tipo Campo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCaracteristica" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true" ValidationGroup="Caracteristicas"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtCaracteristica" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtCaracteristica.ClientID.ToString()%>">Caracteristica:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtOrdenCaracteristica" CssClass="form-control " runat="server" MaxLength="5" TextMode="Number" CausesValidation="true" ValidationGroup="Caracteristicas"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrdenCaracteristica" runat="server" ControlToValidate="TxtOrdenCaracteristica" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtOrdenCaracteristica.ClientID.ToString()%>">Orden:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtLongitud" CssClass="form-control " runat="server" MaxLength="5" TextMode="Number" CausesValidation="true" ValidationGroup="Caracteristicas"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVLongitud" runat="server" ControlToValidate="TxtLongitud" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtLongitud.ClientID.ToString()%>">Longitud:</label>
</div>
<div class="form-group form-md-line-input input-iconright" style="display: inline-block;">
<asp:CheckBox runat="server" ID="ChkRequerido" Checked="true" />
<label for="<%= ChkRequerido.ClientID.ToString()%>">Requerido</label>
</div>
<div class="form-group form-md-line-input input-iconright" style="display: inline-block; margin-left: 50px;">
<asp:CheckBox runat="server" ID="ChkEsSeparador" Checked="true" />
<label for="<%= ChkEsSeparador.ClientID.ToString()%>">Separador</label>
</div>
<div class="form-group form-md-line-input input-iconright" style="display: inline-block; margin-left: 50px;">
<asp:CheckBox runat="server" ID="ChkEstatusCaracteristica" Checked="true" />
<label for="<%= ChkEstatusCaracteristica.ClientID.ToString()%>">Estatus</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarCaracteristica" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="Caracteristicas" />
<button id="LbCancelarCaracteristica" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HFModalidadCaracteristica" runat="server" Value="I" ClientIDMode="Static" />
<asp:HiddenField ID="HFIdCaracteristica" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalOpciones" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalOpciones" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal2" runat="server">Agregar Opciones</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlCaracteristicasOpciones" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="Caracteristica" DataValueField="CveCaracteristica" Width="240px" ValidationGroup="Opciones"></asp:DropDownList>
<label for="<%= DdlCaracteristicasOpciones.ClientID.ToString()%>">Caracteristica:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtOpcion" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true" ValidationGroup="Opciones"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcion" runat="server" ControlToValidate="TxtOpcion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtOpcion.ClientID.ToString()%>">Opción:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtOrdenOpciones" CssClass="form-control " runat="server" MaxLength="5" TextMode="Number" CausesValidation="true" ValidationGroup="Caracteristicas"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvOrdenOpciones" runat="server" ControlToValidate="TxtOrdenOpciones" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtOrdenOpciones.ClientID.ToString()%>">Orden:</label>
</div>
<div class="form-group form-md-line-input input-iconright" style="display: inline-block;">
<asp:CheckBox runat="server" ID="ChkEstatusOpcion" Checked="true" />
<label for="<%= ChkEstatusOpcion.ClientID.ToString()%>">Estatus:</label>
</div>
<div runat="server" id="DivChkSeguir">
<div class="form-group form-md-line-input input-iconright" style="display: inline-block; margin-left: 350px;">
<asp:CheckBox runat="server" ID="ChkSeguirRegistrando" Checked="true" />
<label for="<%= ChkSeguirRegistrando.ClientID.ToString()%>">Seguir Registrando</label>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarOpciones" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="Opciones" />
<button id="LbCancelarOpciones" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HdnModalidadOpciones" runat="server" Value="I" ClientIDMode="Static" />
<asp:HiddenField ID="HdnIdOpciones" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,275 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class AF_CatClasificacionesCaracteristicas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaGridClasificaciones()
CargaGridCaracteristicas()
CargaDdlCaracteristica()
CargaDdlModulo()
CargaDdlCaracteristicaOpciones()
CargaGridOpciones()
End If
End Sub
#Region " C L A S I F I C A C I O N E S"
Protected Sub CargaGridClasificaciones()
Dim Objeto As New ClsGenerales
If Objeto.GetCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) Then
GvClasificaciones.DataSource = Objeto.DtResultados
GvClasificaciones.DataBind()
End If
Objeto.Dispose()
End Sub
Private Sub LbAgregarClasificacion_Click(sender As Object, e As EventArgs) Handles LbAgregarClasificacion.Click
Dim Objeto As New ClsGenerales
If HdnModalidadClasificacion.Value = "I" Then
If Objeto.AddClasificacionesCaracteristicas(TxtClasificaciones.Text, TxtOrdenClasif.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("La clasificación se agregó correctamente.")
OcultaDiv("ModalClasificaciones")
CargaGridClasificaciones()
CargaDdlCaracteristica()
UpDatos.Update()
End If
Else
If Objeto.UpdateClasificacionesCaracteristicas(HdnIDClasificacion.Value.ToEntero, TxtClasificaciones.Text, TxtOrdenClasif.Text.ToEntero, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa) Then
Alert("Se Actualizó correctamente.")
OcultaDiv("ModalClasificaciones")
CargaGridClasificaciones()
CargaDdlCaracteristica()
UpDatos.Update()
End If
End If
Objeto.Dispose()
End Sub
Protected Sub GvClasificaciones_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvClasificaciones.RowDeleting
Dim Objeto As New ClsGenerales
If Objeto.RemoveClasificacionesCaracteristicas(GvClasificaciones.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
CargaGridClasificaciones()
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
End Sub
Protected Sub GvClasificaciones_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvClasificaciones.RowUpdating
Dim Objeto As New ClsGenerales
Dim Clave = GvClasificaciones.DataKeys(e.RowIndex).Value.ToString.ToEntero
End Sub
Public Sub ActualizaModalClasif(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnModalidadClasificacion.Value = "U"
TxtClasificaciones.Text = GvRow.DataKey("CaracteristicaClasificacion")
TxtOrdenClasif.Text = GvRow.DataKey("Orden")
RegistraScript(String.Format("$('#{0}').modal();", "ModalClasificaciones"))
HdnIDClasificacion.Value = GvRow.DataKey("CveCaracteristicaClasificacion")
UpModalClasificaciones.Update()
End Sub
#End Region
#Region "C A R A C T E R I S T I C A"
Private Sub CargaDdlCaracteristica()
Dim Objeto As New ClsGenerales
If Objeto.GetCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) Then
DdlCaracteristica.Items.Clear()
DdlCaracteristica.DataSource = Objeto.DtResultados
DdlCaracteristica.DataBind()
DdlCaracteristica.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
Objeto.Dispose()
End Sub
Private Sub LbAgregarCaracteristica_Click(sender As Object, e As EventArgs) Handles LbAgregarCaracteristica.Click
Dim Objeto As New ClsGenerales
If HFModalidadCaracteristica.Value = "I" Then
If Objeto.AddCaracteristica(TxtCaracteristica.Text, DdlCaracteristica.SelectedValue.ToEntero, DdlTipoCampo.SelectedValue.ToEntero, DdlModulo.SelectedValue.ToEntero,
ChkRequerido.Checked, ChkEsSeparador.Checked, ChkEstatusCaracteristica.Checked, TxtOrdenCaracteristica.Text.ToEntero, TxtLongitud.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("La Caracteristica se agregó correctamente.")
OcultaDiv("ModalCaracteristicas")
CargaGridCaracteristicas()
CargaDdlCaracteristicaOpciones()
UpDatos.Update()
End If
Else
If Objeto.UpdateCaracteristica(HFIdCaracteristica.Value.ToEntero, TxtCaracteristica.Text, DdlCaracteristica.SelectedValue.ToEntero, DdlTipoCampo.SelectedValue.ToEntero, DdlModulo.SelectedValue.ToEntero,
ChkRequerido.Checked, ChkEsSeparador.Checked, ChkEstatusCaracteristica.Checked, TxtOrdenCaracteristica.Text.ToEntero, TxtLongitud.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("La Caracteristica se actualizó correctamente.")
OcultaDiv("ModalCaracteristicas")
CargaGridCaracteristicas()
CargaDdlCaracteristicaOpciones()
UpDatos.Update()
End If
End If
Objeto.Dispose()
End Sub
Private Sub CargaDdlModulo()
Dim Objeto As New ClsGenerales
If Objeto.GetCaracteristicasModulos() Then
DdlModulo.DataSource = Objeto.DtResultados
DdlModulo.DataBind()
DdlModulo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
Objeto.Dispose()
End Sub
Private Sub CargaGridCaracteristicas()
Dim Objeto As New ClsGenerales
If Objeto.GetCaracteristicas(-1, -1, UsuarioActual.CveEmpresa) Then
GvCaracteristicas.DataSource = Objeto.DtResultados
GvCaracteristicas.DataBind()
End If
Objeto.Dispose()
End Sub
Protected Sub GvCaracteristicas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvCaracteristicas.RowDeleting
Dim Objeto As New ClsGenerales
If Objeto.RemoveCaracteristica(GvCaracteristicas.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
Alert("La Caracteristica se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
CargaGridCaracteristicas()
UpDatos.Update()
Objeto.Dispose()
End Sub
Public Sub ActualizaModalCaracteristicas(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HFModalidadCaracteristica.Value = "U"
HFIdCaracteristica.Value = GvRow.DataKey("CveCaracteristica")
DdlModulo.SelectedValueExist(GvRow.DataKey("CveCaracteristicaModulo"))
TxtLongitud.Text = GvRow.DataKey("Longitud")
DdlCaracteristica.SelectedValueExist(GvRow.DataKey("CveCaracteristicaClasificacion"))
ChkEstatusCaracteristica.Checked = CBool(IIf(GvRow.DataKey("Estatus").ToString = "Activo", True, False))
ChkRequerido.Checked = CBool(IIf(GvRow.DataKey("Requerido").ToString = "SI", True, False))
ChkEsSeparador.Checked = CBool(IIf(GvRow.DataKey("EsSeparador").ToString = "SI", True, False))
DdlTipoCampo.SelectedValueExist(GvRow.DataKey("TipoCampo"))
TxtCaracteristica.Text = GvRow.DataKey("Caracteristica")
TxtOrdenCaracteristica.Text = GvRow.DataKey("Orden")
RegistraScript(String.Format("$('#{0}').modal();", "ModalCaracteristicas"))
UpModalCaracteristicas.Update()
End Sub
#End Region
#Region "O P C I O N E S "
Private Sub CargaDdlCaracteristicaOpciones()
Dim Objeto As New ClsGenerales
If Objeto.GetCaracteristicas(-1, -1, UsuarioActual.CveEmpresa) Then
DdlCaracteristicasOpciones.Items.Clear()
DdlCaracteristicasOpciones.DataSource = Objeto.DtResultados
DdlCaracteristicasOpciones.DataBind()
DdlCaracteristicasOpciones.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
Objeto.Dispose()
End Sub
Private Sub LbAgregarOpciones_Click(sender As Object, e As EventArgs) Handles LbAgregarOpciones.Click
Dim Objeto As New ClsGenerales
If HdnModalidadOpciones.Value = "I" Then
If ChkSeguirRegistrando.Checked = True Then
If Objeto.AddCaracteristicasOpciones(TxtOpcion.Text, DdlCaracteristicasOpciones.SelectedValue.ToEntero,
TxtOrdenOpciones.Text.ToEntero, ChkEstatusOpcion.Checked, UsuarioActual.CveUsuario) Then
Alert("Se agregó correctamente la opción.")
CargaGridOpciones()
TxtOpcion.Text = ""
DdlCaracteristicasOpciones.SelectedIndex = 0
TxtOrdenOpciones.Text = ""
UpModalOpciones.Update()
End If
Else
If Objeto.AddCaracteristicasOpciones(TxtOpcion.Text, DdlCaracteristicasOpciones.SelectedValue.ToEntero,
TxtOrdenOpciones.Text.ToEntero, ChkEstatusOpcion.Checked, UsuarioActual.CveUsuario) Then
Alert("Se agregó correctamente la opción.")
CargaGridOpciones()
OcultaDiv("ModalOpciones")
End If
End If
Else
If Objeto.UpdateCaracteristicasOpciones(HdnIdOpciones.Value.ToEntero, TxtOpcion.Text, DdlCaracteristicasOpciones.SelectedValue.ToEntero,
TxtOrdenOpciones.Text.ToEntero, ChkEstatusOpcion.Checked, UsuarioActual.CveUsuario) Then
Alert("Se actualizó correctamente la opción.")
CargaGridOpciones()
OcultaDiv("ModalOpciones")
End If
End If
Objeto.Dispose()
End Sub
Private Sub CargaGridOpciones()
Dim Objeto As New ClsGenerales
If Objeto.GetCaracteristicasOpciones(UsuarioActual.CveEmpresa) Then
GvOpciones.DataSource = Objeto.DtResultados
GvOpciones.DataBind()
End If
Objeto.Dispose()
UpDatos.Update()
End Sub
Protected Sub GvOpciones_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvOpciones.RowDeleting
Dim Objeto As New ClsGenerales
If Objeto.RemoveCaracteristicasOpciones(GvOpciones.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
Alert("La Opción se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
CargaGridOpciones()
UpDatos.Update()
Objeto.Dispose()
End Sub
Public Sub ActualizaModalOpciones(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnModalidadOpciones.Value = "U"
HdnIdOpciones.Value = GvRow.DataKey("CveCaracteristicaOpcion")
DdlCaracteristicasOpciones.SelectedValueExist(GvRow.DataKey("CveCaracteristicaOpcion"))
TxtOrdenOpciones.Text = GvRow.DataKey("Orden")
ChkEstatusOpcion.Checked = CBool(IIf(GvRow.DataKey("Estatus").ToString = "Activo", True, False))
TxtOpcion.Text = GvRow.DataKey("CaracteristicaOpcion")
ChkSeguirRegistrando.Checked = False
DivChkSeguir.Visible = False
RegistraScript(String.Format("$('#{0}').modal();", "ModalOpciones"))
UpModalOpciones.Update()
End Sub
#End Region
#Region " E X T R A S "
Private Sub OcultaDiv(Modal As String)
RegistraScript(String.Format("$('#{0}').modal('hide');", Modal))
End Sub
Private Sub HLAgregarClasificacion_Click(sender As Object, e As EventArgs) Handles HLAgregarClasificacion.Click
TxtClasificaciones.Text = ""
TxtOrdenClasif.Text = ""
HdnModalidadClasificacion.Value = "I"
UpModalClasificaciones.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalClasificaciones"))
End Sub
Private Sub HLAgregarCaracteristica_Click(sender As Object, e As EventArgs) Handles HLAgregarCaracteristica.Click
HFModalidadCaracteristica.Value = "I"
TxtCaracteristica.Text = ""
TxtOrdenCaracteristica.Text = ""
DdlModulo.SelectedIndex = 0
DdlCaracteristica.SelectedIndex = 0
DdlTipoCampo.SelectedIndex = 0
TxtLongitud.Text = ""
ChkEsSeparador.Checked = True
ChkEstatusCaracteristica.Checked = True
ChkEsSeparador.Checked = True
UpModalCaracteristicas.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalCaracteristicas"))
End Sub
Private Sub HLAgregarOpciones_Click(sender As Object, e As EventArgs) Handles HLAgregarOpciones.Click
HdnModalidadOpciones.Value = "I"
DdlCaracteristicasOpciones.SelectedIndex = 0
TxtOrdenOpciones.Text = ""
ChkEstatusOpcion.Checked = True
ChkSeguirRegistrando.Checked = True
TxtOpcion.Text = ""
ChkSeguirRegistrando.Checked = True
DivChkSeguir.Visible = True
UpModalOpciones.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalOpciones"))
End Sub
#End Region
End Class

View File

@@ -0,0 +1,94 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCompuestos.aspx.vb" Inherits="General_CatCompuestos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Compuestos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" UpdateMode="conditional">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<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">
<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>
</div>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveCompuesto,Compuesto,Estatus" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
<Columns>
<asp:BoundField DataField="Compuesto" ItemStyle-Width="20%" HeaderText="Conductor" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="20%" HeaderText="Vencimiento Licencia" ItemStyle-HorizontalAlign="center" />
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
<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>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
<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" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="divAgregar" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">Guardar Compuesto</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyCompuesto" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCompuesto" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombrePlantilla" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCompuesto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtCompuesto.ClientID.ToString()%>">Nombre Compuesto:</label>
</div>
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
<label>Activo: </label>
<asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
</div>
</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>

View File

@@ -0,0 +1,135 @@
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class General_CatCompuestos
Inherits ClsPaginas
#Region "Propiedades"
Public Property CveCompuesto As Integer
Get
Return ViewState("CveCompuesto").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCompuesto") = value
End Set
End Property
Public Property EsEditar As Integer
Get
Return ViewState("EsEditar").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("EsEditar") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CveCompuesto = -1
EsEditar = 0
dvEstatus.Visible = False
CargaDatos(-1)
End If
End Sub
Private Sub CargaDatos(CveConductor As Integer)
Dim PS As New ClsProductosServicios
If PS.GetCompuestosActivos(UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = PS.DtResultados
Else
GvDatos.DataSource = Nothing
End If
PS.Dispose()
GvDatos.DataBind()
End Sub
Protected Sub imgE_Click(sender As Object, e As EventArgs)
Dim Boton = CType(sender, LinkButton)
CveCompuesto = Boton.CommandArgument.ToEntero
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
TxtCompuesto.Text = GvRow.DataKey("Compuesto").ToString
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
EsEditar = 1
BtnAgregarCatalogo.Text = "Actualizar"
dvEstatus.Visible = True
UpBodyCompuesto.Update()
UpFooter.Update()
RegistraScript("$('#divAgregar').modal()")
End Sub
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
Dim PS As New ClsProductosServicios
If EsEditar = 0 Then
If PS.AddCompuestoActivo(TxtCompuesto.Text, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("El compuesto se agregó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al agregar el compuesto", TipoMensaje.MsgError)
End If
ElseIf EsEditar = 1 Then
If PS.UpdateCompuestoActivo(TxtCompuesto.Text, CveCompuesto, chkEstatus.Checked) Then
Alert("El compuesto se editó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al editar al compuesto", TipoMensaje.MsgError)
End If
EsEditar = 0
dvEstatus.Visible = False
BtnAgregarCatalogo.Text = "Agregar"
End If
RegistraScript("$('#divAgregar').modal('hide')")
PS.Dispose()
TxtCompuesto.Text = ""
CargaDatos(-1)
UpDatos.Update()
UpBodyCompuesto.Update()
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim PS As New ClsProductosServicios
Dim CveCompuesto As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveCompuesto").ToEntero
If PS.RemoveCompuestoActivo(CveCompuesto) Then
Alert("El Compuesto se eliminó correctamente", TipoMensaje.MsgInformacion)
End If
PS.Dispose()
CargaDatos(-1)
UpDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.VerticalAlign = VerticalAlign.Middle
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveCompuesto").ToString
If CBool(e.Row.DBCampo("Estatus")) = True Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
Else
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
End If
End If
End Sub
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
EsEditar = 0
RegistraScript("$('#divAgregar').modal()")
BtnAgregarCatalogo.Text = "Agregar"
TxtCompuesto.Text = ""
dvEstatus.Visible = False
UpBodyCompuesto.Update()
UpFooter.Update()
End Sub
End Class

View File

@@ -0,0 +1,133 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDiasInhabiles.aspx.vb" Inherits="General_CatDiasInhabiles" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
CATALOGO DE DIAS INHABILES
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkDiaInhabil" runat="server" Text="Agregar" class="fa fa-plus-circle"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveDiasInhabiles" Value="-1" />
<div class="row" style="margin-right: 10px; margin-top: 18px;text-align:right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDiasInhabiles.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDiasInhabiles.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvDiasInhabiles" runat="server" GridLines="None" DataKeyNames="CveUsuario,CveEmpresa,DiaInhabil,FechaIng,Nombre,Estatus,Descripcion,FechaInhabil,CveDiaInhabil" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Dias Inhabiles">
<Columns>
<asp:BoundField DataField="DiaInhabil" HeaderText="Dia Inhabil" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaInhabil" HeaderText="Fecha Inhabil" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Nombre" HeaderText="Usuario" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" 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>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<%--POPUP AGREGAR--%>
<div id="divAddDiasInhabiles" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpAddDiasInhabiles" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">Agregar Dias Inhabiles</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyDiasInhabiles" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-4">
<label class="input input-sm truncate">Fecha inhabil:</label>
</div>
<div class="col-md-6">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 130px !important; padding: 0px;">
<asp:TextBox Width="90%" ID="TxtFechaInhabil" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton></span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaInhabil" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioInicio" runat="server" TargetControlID="TxtFechaInhabil" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvTxtFechaInhabil" runat="server" ControlToValidate="TxtFechaInhabil" Display="None" ErrorMessage="El campo <b>''Fecha De Dia Inhabil''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="clTxtFechaInhabil" runat="server" ControlToValidate="TxtFechaInhabil" Display="None" ErrorMessage="En el campo <b>''Fecha De Dia Inhabil''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="crfvTxtFechaN" runat="server" HighlightCssClass="vco" TargetControlID="rfvTxtFechaInhabil" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="cclTxtFechaN" runat="server" HighlightCssClass="vco" TargetControlID="clTxtFechaInhabil" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDiaInhabil" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDiaInhabil" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDiaInhabil" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dia inhabil''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtDiaInhabil.ClientID.ToString()%>">Dia Inhabil:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDescripcion" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="70"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDescripcion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripcion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripcion:</label>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="BtnAgregarDiaInhabil" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,101 @@
Option Strict On
Imports Extensiones
Partial Class General_CatDiasInhabiles
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjGrl As New ClsGenerales()
If ObjGrl.DiasInhabiles_Get(-1, -1, UsuarioActual.Empresa.CveEmpresa) Then
GvDiasInhabiles.DataSource = ObjGrl.DtResultados
GvDiasInhabiles.DataBind()
End If
ObjGrl.Dispose()
UpDatos.Update()
End Sub
Private Sub BtnAgregarDiaInhabil_Click(sender As Object, e As EventArgs) Handles BtnAgregarDiaInhabil.Click
Dim ObjGrl As New ClsGenerales
Dim Estatus As Integer = 0
If ChkEstatus.Checked Then Estatus = 1
If HdnModalidad.Value = "A" Then
If ObjGrl.DiasInhabiles_Add(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, TxtDiaInhabil.Text, TxtDescripcion.Text, Estatus, TxtFechaInhabil.Text.ToDate) Then
CargaDatos()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf HdnModalidad.Value = "U" Then
If ObjGrl.DiasInhabiles_Update(HdnID.Value.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, TxtDiaInhabil.Text, TxtDescripcion.Text, Estatus, Date.Now, TxtFechaInhabil.Text.ToDate) Then
CargaDatos()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
End If
End If
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddDiasInhabiles"))
ObjGrl.Dispose()
UpDatos.Update()
End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnModalidad.Value = "U"
HdnID.Value = GvRow.DataKey("CveDiaInhabil")
UpDatos.Update()
BtnAgregarDiaInhabil.Text = "Actualizar"
TxtDiaInhabil.Text = GvRow.DataKey("DiaInhabil")
TxtDescripcion.Text = GvRow.DataKey("Descripcion")
ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
TxtFechaInhabil.Text = (GvRow.DataKey("FechaInhabil"))
UpAddDiasInhabiles.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddDiasInhabiles"))
End Sub
Private Sub LnkDiaInhabil_Click(sender As Object, e As EventArgs) Handles LnkDiaInhabil.Click
Agregar()
End Sub
Public Sub Delete_Click(sender As Object, e As EventArgs)
Dim ObjGrl As New ClsGenerales()
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnID.Value = GvRow.DataKey("CveDiaInhabil")
UpDatos.Update()
If ObjGrl.DiasInhabiles_Remove(HdnID.Value.ToEntero) Then
CargaDatos()
End If
ObjGrl.Dispose()
UpDatos.Update()
End Sub
Public Sub Agregar()
HdnModalidad.Value = "A"
UpDatos.Update()
BtnAgregarDiaInhabil.Text = "Agregar"
TxtDiaInhabil.Text = ""
TxtDescripcion.Text = ""
ChkEstatus.Checked = False
UpAddDiasInhabiles.Update()
TxtFechaInhabil.Text = Date.Now.ToString
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddDiasInhabiles"))
End Sub
Private Sub GvDiasInhabiles_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDiasInhabiles.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Estatus") = True.ToString Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
Else
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
End If
End If
End Sub
End Class

View File

@@ -0,0 +1,132 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentacionTipo.aspx.vb" Inherits="General_CatDocumentacionTipo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Catalogo Documentacion Tipo
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="H" Runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li >
<asp:LinkButton ID = "LnkAgregarEdoc_DocumentacionTipo" OnClick ="LnkAgregarEdoc_Click" runat = "server" ><i class="fa fa-plus"></i>Documentacion Tipo</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="upDatosEdoc" runat ="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:GridView ID="GVEdoc_DocumentacionTipo" runat="server" GridLines="None" CssClass ="table table-hover table-striped ScrollAD" AutoGenerateColumns="False"
datakeynames="CveDocumentacionTipo,DocumentacionTipo,Modulo,Estatus,Fecha,FechaIng,CveUsuario,Usuario,CveEmpresa">
<Columns>
<asp:TemplateField HeaderText="Documentacion Tipo">
<ItemTemplate>
<asp:Label ID="lbldocumentacionTipo" runat="server" Text='<%# Eval("DocumentacionTipo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Modulo">
<ItemTemplate>
<asp:Label ID="lblmodulo" runat="server" Text='<%# Eval("SModulo")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Label ID="lblestatus" runat="server" Text='<%# Eval("SEstatus")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Label ID="lblfecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario">
<ItemTemplate>
<asp:Label ID="lblusuario" runat="server" Text='<%# Eval("Usuario")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditarEdoc_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" OnClick="LnkEliminarEdoc_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar el Edoc_DocumentacionTipo?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalEdoc_DocumentacionTipo" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UPModalEdoc" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlModalTitleUploadDocumentoTipo" runat="server">Documento Tipo </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEdocdocumentacionTipo" CssClass="form-control" MaxLength="50" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvEdocdocumentacionTipo" runat="server" ControlToValidate="TxtEdocdocumentacionTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Documentacion Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEdoc"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoEdocdocumentacionTipo" runat="server" HighlightCssClass="vco" TargetControlID="RfvEdocdocumentacionTipo"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtEdocdocumentacionTipo.ClientID.ToString()%>">Modulo:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEdocmodulo" CssClass="form-control select2me" runat="server" Width="200px">
<asp:ListItem Selected="True" Value="-1">Seleccione uno</asp:ListItem>
<asp:ListItem Value="1">Recursos Humanos</asp:ListItem>
<asp:ListItem Value="2">Clientes</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvEdocmodulo" InitialValue="-1" runat="server" ControlToValidate="DdlEdocmodulo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modulo''</b> es necesario, por favor ingréselo." ValidationGroup="VGMEdoc"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoEdocmodulo" runat="server" HighlightCssClass="vco" TargetControlID="RfvEdocmodulo"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlEdocmodulo.ClientID.ToString()%>">Modulo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkEdocestatus" Text="Activo" TextAlign="Left" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnEdocADD" OnClick="BtnEdocADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMEdoc" />
<asp:Button ID="BtnEdocEdit" OnClick="BtnEdocEdit_Click" runat="server" Text="Actualizar" CssClass="btn btn-primary" ValidationGroup="VGMEdoc" ></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,163 @@
Option Strict On
Imports System.Data
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class General_CatDocumentacionTipo
Inherits ClsPaginas
#Region "Propiedades"
Private Property RcveDocumentacionTipo As Integer
Get
If ViewState("RcveDocumentacionTipo") Is Nothing Then
Return -1
Else
Return ViewState("RcveDocumentacionTipo").ToString.ToEntero
End If
End Get
Set
ViewState("RcveDocumentacionTipo") = Value
End Set
End Property
Private Property CcveDocumentacionTipo As Integer
Get
If ViewState("CcveDocumentacionTipo") Is Nothing Then
Return -1
Else
Return ViewState("CcveDocumentacionTipo").ToString.ToEntero
End If
End Get
Set
ViewState("CcveDocumentacionTipo") = Value
End Set
End Property
Private Property RcveUsuario As Integer
Get
If ViewState("RcveUsuario") Is Nothing Then
Return -1
Else
Return ViewState("RcveUsuario").ToString.ToEntero
End If
End Get
Set
ViewState("RcveUsuario") = Value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaEdoc_DocumentacionTipo()
End If
End Sub
Protected Sub CargaEdoc_DocumentacionTipo()
Dim ObjEdoc As New ClsGenerales()
ObjEdoc.GetEdoc_DocumentacionTipo(RcveDocumentacionTipo, UsuarioActual.CveEmpresa, -1, 1, Modulo:=-1)
GVEdoc_DocumentacionTipo.DataSource = ObjEdoc.DtResultados
ObjEdoc.Dispose()
GVEdoc_DocumentacionTipo.DataBind()
upDatosEdoc.Update()
End Sub
Protected Sub LimpiaEdoc_DocumentacionTipo()
TxtEdocdocumentacionTipo.Text = ""
DdlEdocmodulo.SelectedIndex = 0
ChkEdocestatus.Checked = True
UPModalEdoc.Update()
End Sub
Protected Sub LnkEditarEdoc_Click(sender As Object, e As EventArgs)
LimpiaEdoc_DocumentacionTipo()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CcveDocumentacionTipo = gvRow.DataKey("CveDocumentacionTipo").ToEntero()
Dim documentacionTipo As String = gvRow.DataKey("DocumentacionTipo")
Dim modulo As Int32 = gvRow.DataKey("Modulo").ToEntero()
Dim estatus As Boolean = Boolean.Parse(gvRow.DataKey("Estatus"))
Dim fecha As DateTime = gvRow.DataKey("Fecha").ToDate()
Dim fechaIng As DateTime = gvRow.DataKey("FechaIng").ToDate()
Dim cveUsuario As Int32 = gvRow.DataKey("CveUsuario").ToEntero()
Dim cveEmpresa As Int32 = gvRow.DataKey("CveEmpresa").ToEntero()
TxtEdocdocumentacionTipo.Text = documentacionTipo.ToString()
DdlEdocmodulo.SelectedValueExist(modulo.ToString())
ChkEdocestatus.Checked = estatus
RegistraScript("$('#DModalEdoc_DocumentacionTipo').modal()")
BtnEdocADD.Visible = False
BtnEdocEdit.Visible = True
UPModalEdoc.Update()
End Sub
Protected Sub LnkAgregarEdoc_Click(sender As Object, e As EventArgs)
RegistraScript("$('#DModalEdoc_DocumentacionTipo').modal()")
LimpiaEdoc_DocumentacionTipo()
BtnEdocADD.Visible = True
BtnEdocEdit.Visible = False
UPModalEdoc.Update()
End Sub
Protected Sub BtnEdocADD_Click(sender As Object, e As EventArgs)
Dim documentacionTipo As String = TxtEdocdocumentacionTipo.Text
Dim modulo As Integer = DdlEdocmodulo.SelectedValue.ToEntero
Dim estatus As Boolean = ChkEdocestatus.Checked
Dim ObjEdoc As New ClsGenerales()
Dim Continuar As Boolean = ObjEdoc.AddUpdateEdoc_DocumentacionTipo(-1, documentacionTipo, modulo, estatus, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
ObjEdoc.Dispose()
If (Continuar) Then
RegistraScript("$('#DModalEdoc_DocumentacionTipo').modal('hide')")
LimpiaEdoc_DocumentacionTipo()
CargaEdoc_DocumentacionTipo()
UPModalEdoc.Update()
Alert("El Edoc_Documentacion_Tipo Se ha agregado")
End If
End Sub
Protected Sub BtnEdocEdit_Click(sender As Object, e As EventArgs)
Dim documentacionTipo As String = TxtEdocdocumentacionTipo.Text
Dim modulo As Integer = DdlEdocmodulo.SelectedValue.ToEntero
Dim estatus As Boolean = ChkEdocestatus.Checked
Dim ObjEdoc As New ClsGenerales()
Dim Continuar As Boolean = ObjEdoc.AddUpdateEdoc_DocumentacionTipo(CcveDocumentacionTipo, documentacionTipo, modulo, estatus, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
ObjEdoc.Dispose()
If (Continuar) Then
RegistraScript("$('#DModalEdoc_DocumentacionTipo').modal('hide')")
LimpiaEdoc_DocumentacionTipo()
CargaEdoc_DocumentacionTipo()
UPModalEdoc.Update()
Alert("El Edoc_Documentacion_Tipo Se ha actualizado")
End If
End Sub
Protected Sub LnkEliminarEdoc_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CcveDocumentacionTipo = gvRow.DataKey("CveDocumentacionTipo").ToEntero()
Dim ObjEdoc As New ClsGenerales()
Dim Continuar As Boolean = ObjEdoc.RemoveEdoc_DocumentacionTipo(CcveDocumentacionTipo, UsuarioActual.CveEmpresa)
ObjEdoc.Dispose()
If (Continuar) Then
CargaEdoc_DocumentacionTipo()
Alert("El Edoc_Documentacion_Tipo Se ha Eliminado")
End If
End Sub
End Class

73
General/CatMarcas.aspx Normal file
View File

@@ -0,0 +1,73 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMarcas.aspx.vb" Inherits="General_CatMarcas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Marcas
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarMarca" OnClick="LnkAgregarMarca_Click" runat="server"><i class="fa fa-plus"></i>Agregar Marca</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
<li>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Genera Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpGvMarcas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvMarcas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMarca,Marca,Estatus" EmptyDataText="No se encontraron Marcas" ToolTip="Listado de Caracteristicas de Productos o Servicios" CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<asp:BoundField DataField="Marca" HeaderText="Marca" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la marca?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModalMarca" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Marca" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMarca" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVLimite" runat="server" ControlToValidate="TxtMarca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Marca''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOLimite" runat="server" HighlightCssClass="vco" TargetControlID="RFVLimite" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtMarca.ClientID.ToString()%>">Marca:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkEstatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

112
General/CatMarcas.aspx.vb Normal file
View File

@@ -0,0 +1,112 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class General_CatMarcas
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveMarca() As Integer
Get
Return If(IsNothing(ViewState("CveMarca")), -1, CInt(ViewState("CveMarca")))
End Get
Set
ViewState("CveMarca") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatos()
End If
End Sub
#Region "CARGAS"
Private Sub CargaDatos()
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
GvMarcas.DataSource = ObjPS.DtResultados
End If
ObjPS.Dispose()
GvMarcas.DataBind()
UpGvMarcas.Update()
End Sub
#End Region
#Region "BOTONES"
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveMarca = gvRow.DataKey("CveMarca").ToEntero()
TxtMarca.Text = gvRow.DataKey("Marca")
ChkEstatus.Checked = CBool(gvRow.DataKey("Estatus"))
Modalidad = "U"
BtnGuardar.Text = "Actualizar"
DivEstatus.Visible = True
RegistraScript("$('#DModalMarca').modal()")
UpModal.Update()
End Sub
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim ObjPS As New ClsProductosServicios
Dim CveMarca = gvRow.DataKey("CveMarca").ToEntero
If ObjPS.RemoveMarca(CveMarca) Then
Alert("Se borró correctamente de la base de Datos.", TipoMensaje.MsgInformacion)
Else
Alert("La marca esta siendo utilizada por un Producto", TipoMensaje.MsgError)
End If
ObjPS.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregarMarca_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
DivEstatus.Visible = False
UpModal.Update()
RegistraScript("$('#DModalMarca').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim ObjPS As New ClsProductosServicios
If Modalidad = "A" Then
If ObjPS.AddMarcas(TxtMarca.Text, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
RegistraScript("$('#DModalMarca').modal('hide')")
Alert("La Marca se agregó correctamente.", TipoMensaje.MsgInformacion)
CargaDatos()
End If
ElseIf Modalidad = "U" Then
If ObjPS.UpdateMarca(TxtMarca.Text, CveMarca, ChkEstatus.Checked) Then
RegistraScript("$('#DModalMarca').modal('hide')")
Alert("La Marca se actualizo correctamente.", TipoMensaje.MsgInformacion)
CargaDatos()
End If
End If
ObjPS.Dispose()
End Sub
#End Region
#Region "LIMPIAR"
Protected Sub LimpiaModal()
TxtMarca.Text = ""
End Sub
#End Region
#Region "GRIDVIEW"
Protected Sub GvMarcas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvMarcas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Estatus") = "True" Then
e.Row.Cells(1).ForeColor = Drawing.Color.Green

85
General/CatMedidas.aspx Normal file
View File

@@ -0,0 +1,85 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMedidas.aspx.vb" Inherits="General_CatMedidas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Medidas
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar Medida</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveMedida,CveClasificacion,Medida,Codigo"
EmptyDataText="No se encontraron Modelos" ToolTip="Listado de Modelos"
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Medida" HeaderText="Medida" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la marca?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModal" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Medida" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodigo" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFCCodigo" runat="server" ControlToValidate="TxtCodigo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFCCodigo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCodigo.ClientID.ToString()%>">Código:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtMedida" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVModelo" runat="server" ControlToValidate="TxtMedida" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Medida''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFVModelo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtMedida.ClientID.ToString()%>">Medida:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacion" CssClass="form-control marginFixRow select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="DdlClasificacion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificación:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

114
General/CatMedidas.aspx.vb Normal file
View File

@@ -0,0 +1,114 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class General_CatMedidas
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveMedida() As Integer
Get
Return If(IsNothing(ViewState("CveMedida")), -1, CInt(ViewState("CveMedida")))
End Get
Set
ViewState("CveMedida") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
CargaDatos()
End If
End Sub
#Region "CARGAS"
Private Sub CargaCombos()
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()
UpModal.Update()
End Sub
Private Sub CargaDatos()
Dim ObjGral As New ClsGenerales
If ObjGral.GetMedidas(UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjGral.DtResultados
End If
ObjGral.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
#Region "BOTONES"
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveMedida = gvRow.DataKey("CveMedida").ToEntero()
TxtMedida.Text = gvRow.DataKey("Medida")
TxtCodigo.Text = gvRow.DataKey("Codigo")
DdlClasificacion.SelectedValueExist(gvRow.DataKey("CveClasificacion"))
Modalidad = "U"
BtnGuardar.Text = "Actualizar"
ltlMotititulo.Text = "Actualizar Medida"
RegistraScript("$('#DModal').modal('show')")
UpModal.Update()
End Sub
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim ObjGral As New ClsGenerales
Dim CveMedida = gvRow.DataKey("CveMedida").ToEntero()
If ObjGral.RemoveMedidas(CveMedida) Then
Alert("La medida se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("La medida esta siendo utilizada por un Producto", TipoMensaje.MsgError)
End If
ObjGral.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
ltlMotititulo.Text = "Agregar Medida"
UpModal.Update()
RegistraScript("$('#DModal').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim ObjPS As New ClsGenerales
If Modalidad = "A" Then
If ObjPS.AddMedidas(DdlClasificacion.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtMedida.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("La medida se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf Modalidad = "U" Then
If ObjPS.UpdateMedidas(CveMedida, DdlClasificacion.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtMedida.Text.Trim()) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("La medida se actualizo correctamente.", TipoMensaje.MsgInformacion)
End If
End If
ObjPS.Dispose()
CargaDatos()
End Sub
#End Region
#Region "LIMPIAR"
Protected Sub LimpiaModal()
TxtMedida.Text = ""
TxtCodigo.Text = ""
DdlClasificacion.SelectedValueExist("-1")
End Sub
#End Region

87
General/CatModelos.aspx Normal file
View File

@@ -0,0 +1,87 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatModelos.aspx.vb" Inherits="General_CatModelos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Modelos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar Modelo</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveModelo,CveMarca,Modelo,Codigo,Estatus"
EmptyDataText="No se encontraron Modelos" ToolTip="Listado de Modelos"
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Modelo" HeaderText="Modelo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la marca?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModal" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Modelo" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodigo" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFCCodigo" runat="server" ControlToValidate="TxtCodigo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFCCodigo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCodigo.ClientID.ToString()%>">Código:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtModelo" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVModelo" runat="server" ControlToValidate="TxtModelo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modelo''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFVModelo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtModelo.ClientID.ToString()%>">Modelo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlMarca" CssClass="form-control marginFixRow select2me" runat="server" AppendDataBoundItems="true" DataTextField="Marca" DataValueField="CveMarca">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlMarca.ClientID.ToString()%>">Marca:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
<asp:CheckBox ID="ChkEstatus" runat="server" />
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

120
General/CatModelos.aspx.vb Normal file
View File

@@ -0,0 +1,120 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class General_CatModelos
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveModelo() As Integer
Get
Return If(IsNothing(ViewState("CveModelo")), -1, CInt(ViewState("CveModelo")))
End Get
Set
ViewState("CveModelo") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
CargaDatos()
End If
End Sub
#Region "CARGAS"
Private Sub CargaCombos()
Dim ObjPS As New ClsProductosServicios()
If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarca.DataSource = ObjPS.DtResultados
End If
ObjPS.Dispose()
DdlMarca.DataBind()
UpModal.Update()
End Sub
Private Sub CargaDatos()
Dim ObjGral As New ClsGenerales
If ObjGral.GetModelos(UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjGral.DtResultados
End If
ObjGral.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
#Region "BOTONES"
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveModelo = gvRow.DataKey("CveModelo").ToEntero()
TxtModelo.Text = gvRow.DataKey("Modelo")
TxtCodigo.Text = gvRow.DataKey("Codigo")
DdlMarca.SelectedValueExist(gvRow.DataKey("CveMarca"))
ChkEstatus.Checked = CBool(gvRow.DataKey("Estatus"))
Modalidad = "U"
BtnGuardar.Text = "Actualizar"
ltlMotititulo.Text = "Actualizar Modelo"
DivEstatus.Visible = True
RegistraScript("$('#DModal').modal('show')")
UpModal.Update()
End Sub
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim ObjPS As New ClsGenerales
Dim CveMarca = gvRow.DataKey("CveModelo").ToEntero
If ObjPS.RemoveModelos(CveMarca) Then
Alert("El modelo se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("El modelo esta siendo utilizada por un Producto", TipoMensaje.MsgError)
End If
ObjPS.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
ltlMotititulo.Text = "Agregar Modelo"
DivEstatus.Visible = False
UpModal.Update()
RegistraScript("$('#DModal').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim ObjPS As New ClsGenerales
If Modalidad = "A" Then
If ObjPS.AddModelos(DdlMarca.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtModelo.Text.Trim(), True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("El modelo se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf Modalidad = "U" Then
If ObjPS.UpdateModelos(CveModelo, DdlMarca.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtModelo.Text.Trim(), ChkEstatus.Checked, UsuarioActual.CveUsuario) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("El modelo se actualizo correctamente.", TipoMensaje.MsgInformacion)
End If
End If
ObjPS.Dispose()
CargaDatos()
End Sub
#End Region
#Region "LIMPIAR"
Protected Sub LimpiaModal()
TxtModelo.Text = ""
TxtCodigo.Text = ""
DdlMarca.SelectedValueExist("-1")
End Sub

View File

@@ -0,0 +1,280 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPSCaracteristicas.aspx.vb" Inherits="General_CATPSCaracteristicas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Caracteristicas de Productos y Servicios
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<ajax:TabContainer ID="TabPS" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabCarateristicas" runat="server" HeaderText="Caracteristicas de Productos y Servicios">
<ContentTemplate>
<asp:UpdatePanel ID="UpCaracteristicas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosLimites" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover widthall">
<thead>
<tr class="Titulos">
<th width="200px">
<asp:LinkButton ID="LbLimite" runat="server" CausesValidation="false" Text="" CommandArgument="LimiteMaximo;0">
Caracteristica
<asp:Literal ID="ImgLimiteMaximo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px">
<asp:LinkButton ID="LbComision" runat="server" CausesValidation="false" Text="" CommandArgument="Comision;0">
Es Opción
<asp:Literal ID="ImgComision" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px">
<asp:LinkButton ID="LbImporte" runat="server" CausesValidation="false" Text="" CommandArgument="ImporteFijo;0">
Fecha Ing.
<asp:Literal ID="ImgImporte" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px">
<asp:LinkButton ID="LbEsquema" runat="server" CausesValidation="false" Text="" CommandArgument="EsquemaComision;0">
Usuario
<asp:Literal ID="ImgEsquemaComision" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtCaracteristica" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVLimite" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardarCaracteristicas"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOLimite" runat="server" HighlightCssClass="vco" TargetControlID="RFVLimite" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td align="center">
<asp:CheckBox ID="ChkEsOpcion" runat="server" CssClass="md-checksd2" Checked="true" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarC" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarCaracteristicas"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosLimites" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosCaracteristicas" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePSCaracteristica" EmptyDataText="No se encontraron Característica de Productos o Servicios" ToolTip="Listado de Caracteristicas de Productos o Servicios" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="200px">
<ItemTemplate>
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Caracteristica")%>' Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="200px">
<ItemTemplate>
<asp:Label ID="LtlEsOpcion" runat="server" Text='<%# Eval("EsOpcion") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsOpcion" CssClass="md-checksd2" runat="server" Checked='<%# If (Eval("EsOpcion").ToString = "Sí", True, False) %>' />
<asp:HiddenField ID="hdnEsOpcion" Value='<%# Eval("EsOpcion") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="200px">
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="193px">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="89px">
<EditItemTemplate>
<center>
<asp:LinkButton ID="ImageButton1" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>"/>
&nbsp;<asp:LinkButton ID="ImageButton2" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="ImageButton3" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="83px">
<ItemTemplate>
<asp:LinkButton ID="ImageButton4" 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>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabOpciones" runat="server" HeaderText="Opciones para Caracteristicas de Productos o Servicios">
<ContentTemplate>
<asp:UpdatePanel ID="UpOpciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" class="">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosO" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<th width="200px">
<asp:LinkButton ID="LbCaracteristica1" runat="server" CausesValidation="false" Text="" CommandArgument="Caracteristica1;1">
Característica
<asp:Literal ID="ImgCaracteristica1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px">
<asp:LinkButton ID="LbOpcion1" runat="server" CausesValidation="false" Text="" CommandArgument="Opcion1;1">
Opción
<asp:Literal ID="ImgOpcion1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng1" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng1;1">
Fecha Ing.
<asp:Literal ID="ImgFechaIng1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario1" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario1;1">
Usuario
<asp:Literal ID="ImgUsuario1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:DropDownList ID="DdlCaracteristica" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CvePSCaracteristica" Class="select2me" Style="width: 184px !important;" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCaracteristicaO" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaO" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaO" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtOpcion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarO" Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcionO" runat="server" ControlToValidate="TxtOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOpcionO" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcionO" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarO" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarO"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosOpciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosOpciones" runat="server" AutoGenerateColumns="False" DataKeyNames="CveOpcionCaracteristica" EmptyDataText="No se encontraron Opciones para Características y/o Equipos Registrados" ToolTip="Listado de Opciones para Caracteristicas de Productos o Servicios" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="200px">
<ItemTemplate>
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="200px">
<ItemTemplate>
<asp:Literal ID="LtlOpcion" runat="server" Text='<%# Eval("Opcion", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOpcionEdit" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Opcion")%>' Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcion" runat="server" ControlToValidate="TxtOpcionEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOpcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcion" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="100px">
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="93px">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="89px">
<EditItemTemplate>
<center>
<asp:LinkButton ID="ImageButton5" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" />
&nbsp;<asp:LinkButton ID="ImageButton6" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="ImageButton7" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="83px">
<ItemTemplate>
<asp:LinkButton ID="ImageButton8" 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>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
</script>
</asp:Content>

View File

@@ -0,0 +1,233 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class General_CatPSCaracteristicas
Inherits ClsPaginas
#Region "PROPIEDADES"
#End Region
Private Sub General_CatPSCaracteristicas_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatos()
CargaDDLCaracteristicas()
End If
End Sub
#Region " CARGAS "
Private Sub CargaDatos()
Dim Objeto As New ClsGralProductosServiciosCaracteristicas
If Objeto.GetPSCaracteristicas(UsuarioActual.CveEmpresa) Then
GvDatosCaracteristicas.DataSource = Objeto.DtResultados
End If
GvDatosCaracteristicas.DataBind()
Objeto.Dispose()
End Sub
Private Sub CargaDatosOpciones(Caracteristica As Integer)
Dim Objeto As New ClsGralProductosServiciosCaracteristicas
If Objeto.GetPSCaracteristicasOpciones(Caracteristica) Then
GvDatosOpciones.DataSource = Objeto.DtResultados
End If
GvDatosOpciones.DataBind()
Objeto.Dispose()
End Sub
Public Sub CargaDDLCaracteristicas()
DdlCaracteristica.Items.Clear()
Dim Objeto As New ClsGralProductosServiciosCaracteristicas
If Objeto.GetPSCaracteristicas(UsuarioActual.CveEmpresa) Then
DdlCaracteristica.DataSource = Objeto.DtResultados
End If
DdlCaracteristica.DataBind()
Objeto.Dispose()
End Sub
Private Sub DdlCaracteristica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCaracteristica.SelectedIndexChanged
CargaDatosOpciones(DdlCaracteristica.SelectedValue.ToEntero)
End Sub
#End Region
#Region " GV CARACTERISTICAS Y AGREGAR "
Private Sub LbAgregarC_Click(sender As Object, e As EventArgs) Handles LbAgregarC.Click
Dim Objeto As New ClsGralProductosServiciosCaracteristicas
Dim Caracteristica = TxtCaracteristica.Text
Dim EsOpcion = ChkEsOpcion.Checked
If Objeto.AddPSCaracteristicas(Caracteristica, EsOpcion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCaracteristica.Text = ""
CargaDatos()
CargaDDLCaracteristicas()
UpCaracteristicas.Update()
End If
Objeto.Dispose()
Alert("La Caracteristica se agregó correctamente.", TipoMensaje.MsgInformacion)
End Sub
Protected Sub GvDatosCaracteristicas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCaracteristicas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'ESTATUS NORMAL
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
If e.Row.DBCampo("EsOpcion") = "True" Then
e.Row.FCLabel("LtlEsOpcion").ForeColor = Drawing.Color.Green
e.Row.FCLabel("LtlEsOpcion").Font.Bold = True
e.Row.FCLabel("LtlEsOpcion").Text = "Si"
Else
e.Row.FCLabel("LtlEsOpcion").Text = "No"
e.Row.FCLabel("LtlEsOpcion").ForeColor = Drawing.Color.Red
e.Row.FCLabel("LtlEsOpcion").Font.Bold = True
End If
End If
'ESTATUS EDICION
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
If e.Row.DBCampo("EsOpcion") = "True" Then
e.Row.FCCheckBox("ChkEsOpcion").Checked = True
Else
e.Row.FCCheckBox("ChkEsOpcion").Checked = False
End If
End If
End If
End Sub
Protected Sub GVCarac_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCaracteristicas.RowEditing
GvDatosCaracteristicas.EditIndex = e.NewEditIndex
CargaDatos()
End Sub
Protected Sub GvDatosCaracteristicas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCaracteristicas.RowUpdating
Dim Update As New ClsGralProductosServiciosCaracteristicas
Dim Caracteristica = GvDatosCaracteristicas.Rows(e.RowIndex).FCTextBox("TxtCaracteristica").Text.Trim
Dim EsOpcion = GvDatosCaracteristicas.Rows(e.RowIndex).FCCheckBox("ChkEsOpcion").Checked
Dim Clave = GvDatosCaracteristicas.Rows(e.RowIndex).DataKey("CvePSCaracteristica").ToEntero
If Update.UpdatePSCaracteristicas(Caracteristica, Clave, EsOpcion) Then
Alert("Se actualizó correctamente.", TipoMensaje.MsgInformacion)
End If
GvDatosCaracteristicas.EditIndex = -1
CargaDatos()
UpCaracteristicas.Update()
End Sub
Protected Sub GvDatosCaracteristicas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCaracteristicas.RowCancelingEdit
GvDatosCaracteristicas.EditIndex = -1
CargaDatos()
Alert("Se canceló la edición de los campos.")
End Sub
Protected Sub GvDatosCaracteristicas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCaracteristicas.RowDeleting
Dim Objeto As New ClsGralProductosServiciosCaracteristicas
Dim Clave = GvDatosCaracteristicas.Rows(e.RowIndex).DataKey("CvePSCaracteristica").ToEntero
If Objeto.RemovePSCaracteristica(Clave) Then
Alert("Se borró correctamente de la base de Datos.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
GvDatosCaracteristicas.EditIndex = -1
CargaDatos()
CargaDDLCaracteristicas()
UpDatosOpciones.Update()
End Sub
#End Region
#Region " GV OPCIONES Y AGREGAR "
Protected Sub GvDatosOpciones_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosOpciones.RowDeleting
Dim Objeto As New ClsGralProductosServiciosCaracteristicas
Dim Clave = GvDatosOpciones.Rows(e.RowIndex).DataKey("CveOpcion").ToEntero
Objeto.RemovePSCaracteristicaOpciones(Clave)
GvDatosOpciones.EditIndex = -1
CargaDatosOpciones(DdlCaracteristica.SelectedValue.ToEntero)
UpDatosOpciones.Update()
Alert("Se borró correctamente de la base de Datos.", TipoMensaje.MsgInformacion)
End Sub
Private Sub LbAgregarO_Click(sender As Object, e As EventArgs) Handles LbAgregarO.Click
Dim Objeto As New ClsGralProductosServiciosCaracteristicas
Dim Opcion = TxtOpcion.Text
If Objeto.AddPSCaracteristicasOpciones(Opcion, DdlCaracteristica.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
End If
TxtOpcion.Text = ""
CargaDatosOpciones(DdlCaracteristica.SelectedValue.ToEntero)
UpDatosOpciones.Update()
UpTitulosO.Update()
Objeto.Dispose()
Alert("El valor de la caracteristica se agregó correctamente.", TipoMensaje.MsgInformacion)
End Sub
Protected Sub GvDatosOpciones_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosOpciones.RowUpdating
Dim Update As New ClsGralProductosServiciosCaracteristicas
Dim Caracteristica = GvDatosOpciones.Rows(e.RowIndex).FCDropDownList("DdlCaracteristicaEdit").ToEntero
Dim Opcion = GvDatosOpciones.Rows(e.RowIndex).FCTextBox("TxtOpcionEdit").Text.Trim
Dim Clave = GvDatosOpciones.Rows(e.RowIndex).DataKey("CveOpcion").ToEntero
If Update.UpdatePSCaracteristicasOpciones(Opcion, Clave) Then
Alert("Se actualizó correctamente.", TipoMensaje.MsgInformacion)
End If
GvDatosOpciones.EditIndex = -1
CargaDatosOpciones(DdlCaracteristica.SelectedValue.ToEntero)
UpDatosOpciones.Update()
End Sub
Protected Sub GvDatosOpciones_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosOpciones.RowCancelingEdit
GvDatosOpciones.EditIndex = -1
CargaDatosOpciones(DdlCaracteristica.SelectedValue.ToEntero)
UpDatosOpciones.Update()
Alert("Se canceló la edición de los campos.")
End Sub
Protected Sub GVOpc_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosOpciones.RowEditing
GvDatosOpciones.EditIndex = e.NewEditIndex
CargaDatosOpciones(DdlCaracteristica.SelectedValue.ToEntero)
End Sub
#End Region
End Class

106
General/CatPaqueterias.aspx Normal file
View File

@@ -0,0 +1,106 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPaqueterias.aspx.vb" Inherits="Inventarios_CatPaqueterias" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Paqueterías
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkPaqueteria" runat="server" ><i class="fa fa-plus"></i> Agregar Paquetería</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
<br /> <br />
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePaqueteria,Paqueteria,Liga,Estatus" EmptyDataText="No se encontraron Paqueterias" CssClass="table table-striped table-hover Widthall scrollAD mysmallbtn" data-heighterror="300px" data-freezerows="1" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="25%" HeaderText="Paqueteria" >
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlPaqueteria" runat="server" Text='<%# Eval("Paqueteria") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="20%" HeaderText="Liga">
<ItemTemplate>
<asp:Literal ID="LtlLiga" runat="server" Text='<%# Eval("Liga") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Estatus">
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Fecha Ingreso">
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" 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>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<div id="divAddPaqueteria" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpAddPaqueteria" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel" runat="server">Agregar Paquetería</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyPaqueteria" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPaqueteria" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPaqueteria" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPaqueteria" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Paqueteria''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtPaqueteria.ClientID.ToString()%>">Paqueteria:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtLiga" runat="server" CssClass="form-control" CausesValidation="true" ></asp:TextBox>
<label for="<%= TxtLiga.ClientID.ToString()%>">Liga:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="divEstatus" runat="server">
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="form-control" />
<label for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="BtnAgregarPaqueteria" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,117 @@
Imports Extensiones
Partial Class Inventarios_CatPaqueterias
Inherits ClsPaginas
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjGral As New ClsGenerales
' Dim dt As Data.DataTable
If ObjGral.GetGralPaqueterias() Then
GvDatos.DataSource = ObjGral.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Else
GvDatos.DataSource = Nothing
End If
ObjGral.Dispose()
GvDatos.DataBind()
End Sub
Public Sub Delete_Click(sender As Object, e As EventArgs)
Dim ObjGral As New ClsGenerales
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnID.Value = GvRow.DataKey("CvePaqueteria")
UpDatos.Update()
If ObjGral.RemoveGralPaqueterias(HdnID.Value.ToEntero, UsuarioActual.CveEmpresa) Then
CargaDatos()
End If
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
ObjGral.Dispose()
UpDatos.Update()
End Sub
Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnModalidad.Value = "U"
HdnID.Value = GvRow.DataKey("CvePaqueteria")
UpDatos.Update()
BtnAgregarPaqueteria.Text = "Actualizar"
myModalLabel.InnerText = "Actualizar Paqueteria"
'DdlSucursal.SelectedValueExist(GvRow.DataKey("CveSucursal"))
'DdlTipoPaqueteria.SelectedValueExist(GvRow.DataKey("CveTipoPaqueteria"))
TxtPaqueteria.Text = GvRow.DataKey("Paqueteria")
TxtLiga.Text = GvRow.DataKey("Liga")
divEstatus.Visible = True
ChkEstatus.Checked = If((GvRow.DataKey("Estatus")) = "Activo", True, False)
UpAddPaqueteria.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddPaqueteria"))
End Sub
Private Sub LnkPaqueteria_Click(sender As Object, e As EventArgs) Handles LnkPaqueteria.Click
Agregar()
End Sub
Public Sub Agregar()
HdnModalidad.Value = "A"
UpDatos.Update()
BtnAgregarPaqueteria.Text = "Agregar"
myModalLabel.InnerText = "Agregar Paquetería"
TxtPaqueteria.Text = ""
TxtLiga.Text = ""
ChkEstatus.Checked = True
divEstatus.Visible = False
UpAddPaqueteria.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddPaqueteria"))
End Sub
Private Sub BtnAgregarPaqueteria_Click(sender As Object, e As EventArgs) Handles BtnAgregarPaqueteria.Click
Dim ObjGral As New ClsGenerales
Dim TieneError = False
Dim Estatus = 0
If ChkEstatus.Checked Then Estatus = 1
If HdnModalidad.Value = "A" Then
If ObjGral.AddGralPaqueterias(TxtPaqueteria.Text.Trim, TxtLiga.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("Se guardó correctamente la paquetería.", TipoMensaje.MsgInformacion)
UpDatos.Update()
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddPaqueteria"))
Else
TieneError = True
End If
ElseIf ObjGral.UpdateGralPaqueterias(TxtPaqueteria.Text.Trim, TxtLiga.Text.Trim, Estatus, HdnID.Value.ToEntero) Then
Alert("El Paqueteria se actualizo correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddPaqueteria"))
End If
ObjGral.Dispose()
RecargaGlobal()
CargaDatos()
End Sub
#Region "G L O B L A L"
Private Sub RecargaGlobal()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
Hilo.Start()
End Sub
Private Sub GeneraGlobalDT()
Dim ObjGenerales As New ClsGenerales
If ObjGenerales.GetGralPaqueterias(-1) Then
Application("GlobalDTPaqueterias") = ObjGenerales.DtResultados
End If
ObjGenerales.Dispose()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,279 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCaracteristicasProductosServicios.aspx.vb" Inherits="GRAL_CatCaracteristicasProductosServicios" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
Catálogo de Caracteristicas de Productos y Servicios
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<script language="javascript" type="text/javascript">
function CC() {
return confirm('¿Está seguro que desea eliminar la Caracteristica del Producto y/o Servicio?');
}
function CO() {
return confirm('¿Está seguro que desea eliminar la Opcion para Caracteristica del Producto y/o Servicio?');
}
function Up() {
if ($("#ChkEsOpcion").Checked == false && $("hdnEsOpcion").value == 'Sí')
return confirm('¿Está cambiando la Caracteristica para NO tener Opciones, eso generara que sus Opciones sean Eliminadas. Esta Seguro de Continuar?');
else
return true;
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top:20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabCaracteristicas" runat="server" HeaderText="Caracteristicas de Productos y Servicios">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="200px"><asp:LinkButton ID="LbPSC" runat="server" CausesValidation="false" Text="Producto o Servicio"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPSC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="200px"><asp:LinkButton ID="LbCaracteristicaC" runat="server" CausesValidation="false" Text="Caracteristica"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbEsOpcionC" runat="server" CausesValidation="false" Text="Es Opcion"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEsOpcionC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbFechaIngC" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioC" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px">Comandos</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlPS" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="PS" DataValueField="CvePS" Width="200px" ValidationGroup="GrpGuardarC">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPSC" runat="server" ControlToValidate="DdlPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVPSC" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarC" Width="197px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td align="center"><asp:CheckBox ID="ChkEsOpcion" runat="server" Checked="true" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><asp:LinkButton ID="LbAgregarC" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarC"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosCaracteristicas" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePSCaracteristica" EmptyDataText="No se encontraron Caracteristica de Productos o Servicios" ToolTip="Listado de Caracteristicas de Productos o Servicios">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="Literal1" runat="server" Text='<%# Eval("PS", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlPSEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="PS" DataValueField="CvePS" Width="100px" ValidationGroup="GrpGuardarC">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Caracteristica")%>' ValidationGroup="GrpEditGuardarC" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEsOpcion" runat="server" Text='<%# Eval("EsOpcion") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsOpcion" runat="server" Checked='<%# If (Eval("EsOpcion").ToString = "Sí", True, False) %>' />
<asp:HiddenField ID="hdnEsOpcion" ClientIDMode="Static" Value='<%# Eval("EsOpcion") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="javascript:return Up();" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton3" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="ImageButton4" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return CC();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCaracteristicasOpciones" runat="server" HeaderText="Opciones para Caracteristicas de Productos o Servicios">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosO" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="200px"><asp:LinkButton ID="LbPS" runat="server" Enabled="false" CausesValidation="false" Text="Producto o Servicio"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPSO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="200px"><asp:LinkButton ID="LbCaracteristicaO" runat="server" CausesValidation="false" Text="Caracteristica"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="200px"><asp:LinkButton ID="LbOpcionO" runat="server" CausesValidation="false" Text="Opcion"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOpcionO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbFechaIngO" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioO" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px">Comandos</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlPSO" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="PS" DataValueField="CvePS" Width="200px" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPSO" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPSO" runat="server" HighlightCssClass="vco" TargetControlID="RFVPSO" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DdlCaracteristica" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CvePSCaracteristica" Width="200px" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCaracteristicaO" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaO" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaO" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtOpcion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarO" Width="195px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcionO" runat="server" ControlToValidate="TxtOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOpcionO" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcionO" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><asp:LinkButton ID="LbAgregarO" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarO"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosO" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosOpciones" runat="server" AutoGenerateColumns="False" DataKeyNames="CveOpcion" EmptyDataText="No se encontraron Opciones para Caracteristicas y/o Equipos Registrados" ToolTip="Listado de Opciones para Caracteristicas de Productos o Servicios">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("PS", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlCaracteristicaEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CvePSCaracteristica" Width="200px" ValidationGroup="GrpGuardarO">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOpcion" runat="server" Text='<%# Eval("Opcion", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOpcion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Opcion")%>' ValidationGroup="GrpEditGuardarO" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcion" runat="server" ControlToValidate="TxtOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOpcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcion" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="ImageButton5" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="ImageButton6" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton7" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="ImageButton8" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return CO();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<br />
<asp:UpdateProgress ID="upProgress" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="overlay">
<div id="modalprogress">
<div id="theprogress">
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>La información se está procesando...</td>
</tr>
<tr>
<td><img src="/Imagenes/Cargando.gif" style="border-width: 0px;" alt="" /></td>
</tr>
</table>
</center>
</div>
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>

View File

@@ -0,0 +1,321 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProductosServiciosCaracteristicas.aspx.vb" Inherits="GRAL_CatCaracteristicasProductosServicios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Características de Productos y Servicios
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top: 20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%" CssClass="tabBodyOverride">
<ajax:TabPanel ID="TabCaracteristicas" runat="server" HeaderText="Características de Productos y Servicios">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="200px">
<asp:LinkButton ID="LbPS0" runat="server" CausesValidation="false" Text="" CommandArgument="PS0;0" OnClick="LbOrden_Click">
Producto o Servicio
<asp:Literal ID="ImgPS0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px">
<asp:LinkButton ID="LbCaracteristica0" runat="server" CausesValidation="false" Text="" CommandArgument="Caracteristica0;0" OnClick="LbOrden_Click">
Característica
<asp:Literal ID="ImgCaracteristica0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEsOpcion0" runat="server" CausesValidation="false" Text="" CommandArgument="EsOpcion0;0" OnClick="LbOrden_Click">
Es Opción
<asp:Literal ID="ImgEsOpcion0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng0" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng0;0" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario0" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario0;0" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:DropDownList ID="DdlPS" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 184px !important;" ValidationGroup="GrpGuardarC">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPSC" runat="server" ControlToValidate="DdlPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVPSC" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarC" Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td align="center">
<asp:CheckBox ID="ChkEsOpcion" runat="server" Checked="true" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarC" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarC"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosCaracteristicas" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePSCaracteristica" EmptyDataText="No se encontraron Característica de Productos o Servicios" ToolTip="Listado de Caracteristicas de Productos o Servicios" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="Literal1" runat="server" Text='<%# Eval("PS", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlPSEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 184px !important;" ValidationGroup="GrpGuardarC">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Caracteristica")%>' ValidationGroup="GrpEditGuardarC" Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEsOpcion" runat="server" Text='<%# Eval("EsOpcion") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsOpcion" runat="server" Checked='<%# If (Eval("EsOpcion").ToString = "Sí", True, False) %>' />
<asp:HiddenField ID="hdnEsOpcion" ClientIDMode="Static" Value='<%# Eval("EsOpcion") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="ImageButton1" runat="server" OnClientClick="javascript:return Up();" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="ImageButton2" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="ImageButton3" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="ImageButton4" 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" OnClientClick="javascript:return CC();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCaracteristicasOpciones" runat="server" HeaderText="Opciones para Características de Productos o Servicios">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosO" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="200px">
<asp:LinkButton ID="LbPS1" runat="server" Enabled="false" CausesValidation="false" Text="" CommandArgument="PS1;1" OnClick="LbOrden_Click">
Producto o Servicio
<asp:Literal ID="ImgPS1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px">
<asp:LinkButton ID="LbCaracteristica1" runat="server" CausesValidation="false" Text="" CommandArgument="Caracteristica1;1" OnClick="LbOrden_Click">
Característica
<asp:Literal ID="ImgCaracteristica1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px">
<asp:LinkButton ID="LbOpcion1" runat="server" CausesValidation="false" Text="" CommandArgument="Opcion1;1" OnClick="LbOrden_Click">
Opción
<asp:Literal ID="ImgOpcion1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng1" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng1;1" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario1" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario1;1" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:DropDownList ID="DdlPSO" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="PS" DataValueField="CvePS" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 184px !important;" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPSO" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto o Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPSO" runat="server" HighlightCssClass="vco" TargetControlID="RFVPSO" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlCaracteristica" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CvePSCaracteristica" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 184px !important;" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCaracteristicaO" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaO" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaO" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtOpcion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarO" Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcionO" runat="server" ControlToValidate="TxtOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOpcionO" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcionO" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarO" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarO"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosO" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosOpciones" runat="server" AutoGenerateColumns="False" DataKeyNames="CveOpcion" EmptyDataText="No se encontraron Opciones para Características y/o Equipos Registrados" ToolTip="Listado de Opciones para Caracteristicas de Productos o Servicios" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("PS", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlCaracteristicaEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CvePSCaracteristica" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 184px !important;" ValidationGroup="GrpGuardarO">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOpcion" runat="server" Text='<%# Eval("Opcion", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOpcion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Opcion")%>' ValidationGroup="GrpEditGuardarO" Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcion" runat="server" ControlToValidate="TxtOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOpcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcion" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="ImageButton5" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="ImageButton6" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="ImageButton7" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="ImageButton8" 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" OnClientClick="javascript:return CO();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function CC() {
return confirm('¿Está seguro que desea eliminar la Caracteristica del Producto y/o Servicio?');
}
function CO() {
return confirm('¿Está seguro que desea eliminar la Opcion para Caracteristica del Producto y/o Servicio?');
}
function Up() {
if ($("#ChkEsOpcion").Checked == false && $("hdnEsOpcion").value == 'Sí')
return confirm('¿Está cambiando la Caracteristica para NO tener Opciones, eso generara que sus Opciones sean Eliminadas. Esta Seguro de Continuar?');
else
return true;
}
</script>
</asp:Content>

View File

@@ -0,0 +1,370 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class GRAL_CatCaracteristicasProductosServicios
Inherits ClsPaginas
Public Property PuedeEditar As Boolean
Get
Return CBool(ViewState("PuedeEditar"))
End Get
Set(value As Boolean)
ViewState("PuedeEditar") = value
End Set
End Property
Public Property PuedeEliminar As Boolean
Get
Return CBool(ViewState("PuedeEditar"))
End Get
Set(value As Boolean)
ViewState("PuedeEditar") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaProductosServicios()
CargaDatos()
ViewState("OrdenO") = ""
CargaProductosServiciosCaracteristicas()
CargaDatosO()
End If
End Sub
Public Sub CargaDatos()
Dim ObjCaracteristicas As New ClsGralProductosServiciosCaracteristicas
If ObjCaracteristicas.GetProductosServiciosCaracteristicas() Then
ViewState("DTProductosServiciosCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
Else
Me.GvDatosCaracteristicas.DataSource = Nothing
End If
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Public Sub CargaDatosO()
Dim ObjOpciones As New ClsGralProductosServiciosCaracteristicas
If ObjOpciones.GetProductosServiciosCaracteristicasOpciones() Then
ViewState("DTProductosServiciosCaracteristicasOpciones") = ObjOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados
Else
GvDatosOpciones.DataSource = Nothing
End If
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenO").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
#Region "C A R G A S"
Private Sub CargaProductosServicios()
Dim ObjPS As New ClsProductosServicios()
If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then
ViewState("DTPS") = ObjPS.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa & " AND Estado = 'Activo'", "PS")
DdlPS.Items.Clear()
DdlPS.DataSource = ViewState("DTPS")
DdlPS.DataBind()
DdlPSO.Items.Clear()
DdlPSO.DataSource = ViewState("DTPS")
DdlPSO.DataBind()
End If
ObjPS.Dispose()
End Sub
Private Sub CargaProductosServiciosCaracteristicas()
DdlCaracteristica.Items.Clear()
DdlCaracteristica.DataSource = GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("EsOpcion = 'Sí' AND CvePS = " + DdlPSO.SelectedItem.Value.ToString)
DdlCaracteristica.DataBind()
End Sub
Protected Sub DdlPS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPS.SelectedIndexChanged
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Protected Sub DdlCaracteristica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCaracteristica.SelectedIndexChanged
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenO").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
Protected Sub DdlPSO_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPSO.SelectedIndexChanged
CargaProductosServiciosCaracteristicas()
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenO").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
Protected Sub CambioProductosServiciosCaracteristicas()
CargaProductosServiciosCaracteristicas()
UpTitulosC.Update()
CargaDatos()
CambioProductosServiciosCaracteristicasOpciones()
End Sub
Protected Sub CambioProductosServiciosCaracteristicasOpciones()
UpTitulosO.Update()
CargaDatosO()
End Sub
#End Region
Protected Sub LbAgregarC_Click(sender As Object, e As System.EventArgs) Handles LbAgregarC.Click
Dim ObjCaracteristicas As New ClsGralProductosServiciosCaracteristicas
If ObjCaracteristicas.AddProductosServiciosCaracteristicas(TxtCaracteristica.Text.Trim, DdlPS.SelectedValue.ToEntero, ChkEsOpcion.Checked, UsuarioActual.CveUsuario) Then
TxtCaracteristica.Text = ""
Alert("La nueva Característica de Producto o Servicio se guardó correctamente.", TipoMensaje.MsgInformacion)
ViewState("DTProductosServiciosCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
CambioProductosServiciosCaracteristicas()
End If
ObjCaracteristicas.Dispose()
End Sub
Protected Sub LbAgregarO_Click(sender As Object, e As System.EventArgs) Handles LbAgregarO.Click
Dim ObjOpciones As New ClsGralProductosServiciosCaracteristicas
If ObjOpciones.AddProductosServiciosCaracteristicasOpciones(TxtOpcion.Text.Trim, DdlCaracteristica.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtOpcion.Text = ""
Alert("La nueva Opción para Característica de Producto o Servicio se guardó correctamente.", TipoMensaje.MsgInformacion)
ViewState("DTProductosServiciosCaracteristicasOpciones") = ObjOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados
CambioProductosServiciosCaracteristicasOpciones()
End If
ObjOpciones.Dispose()
End Sub
#Region "G V - C A R A C T E R I S T I C A S"
Protected Sub GvDatosCaracteristicas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCaracteristicas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).Width = Unit.Pixel(200)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlPSEdit").DataSource = ViewState("DTPS")
e.Row.FCDropDownList("DdlPSEdit").DataBind()
e.Row.FCDropDownList("DdlPSEdit").SelectedValue = e.Row.DBCampo("CvePS")
End If
End If
End Sub
Protected Sub GvDatosCaracteristicas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCaracteristicas.RowDeleting
Dim ObjCaracteristicas As New ClsGralProductosServiciosCaracteristicas
If ObjCaracteristicas.RemoveProductosServiciosCaracteristica(GvDatosCaracteristicas.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosCaracteristicas.EditIndex = -1
ViewState("DTProductosServiciosCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
Alert("La Característica del Producto o Servicio se eliminó correctamente.", TipoMensaje.MsgInformacion)
CambioProductosServiciosCaracteristicas()
End If
ObjCaracteristicas.Dispose()
End Sub
Protected Sub GvDatosCaracteristicas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCaracteristicas.RowCancelingEdit
GvDatosCaracteristicas.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Protected Sub GvDatosCaracteristicas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCaracteristicas.RowEditing
GvDatosCaracteristicas.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Protected Sub GvDatosCaracteristicas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCaracteristicas.RowUpdating
Dim ObjCaracteristicas As New ClsGralProductosServiciosCaracteristicas
Dim CvePS As Integer = DirectCast(GvDatosCaracteristicas.Rows(e.RowIndex).FindControl("DdlPSEdit"), DropDownList).SelectedValue.ToEntero
Dim CveCaracteristica As Integer = GvDatosCaracteristicas.DataKeys(e.RowIndex).Value.ToString.ToEntero
Dim Caracteristica As String = DirectCast(GvDatosCaracteristicas.Rows(e.RowIndex).FindControl("TxtCaracteristica"), TextBox).Text.Trim
Dim EsOpcion As Boolean = GvDatosCaracteristicas.Rows(e.RowIndex).FCCheckBox("ChkEsOpcion").Checked
If ObjCaracteristicas.UpdateProductosServiciosCaracteristica(Caracteristica, CvePS, EsOpcion, CveCaracteristica) Then
GvDatosCaracteristicas.EditIndex = -1
ViewState("DTProductosServiciosCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CambioProductosServiciosCaracteristicas()
End If
ObjCaracteristicas.Dispose()
End Sub
#End Region
#Region "G V - C A R A C T E R I S T I C A S O P C I O N E S"
Protected Sub GvDatosOpciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosOpciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).Width = Unit.Pixel(200)
e.Row.Cells(2).Width = Unit.Pixel(200)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlCaracteristicaEdit").DataSource = GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlCaracteristicaEdit").DataBind()
e.Row.FCDropDownList("DdlCaracteristicaEdit").SelectedValue = e.Row.DBCampo("CvePS")
End If
End If
End Sub
Protected Sub GvDatosOpciones_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosOpciones.RowDeleting
Dim ObjOpciones As New ClsGralProductosServiciosCaracteristicas
If ObjOpciones.RemoveProductosServiciosCaracteristicasOpciones(GvDatosOpciones.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosOpciones.EditIndex = -1
ViewState("DTProductosServiciosCaracteristicasOpciones") = ObjOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados
Alert("La Opción para Característica del Producto o Servicio se eliminó correctamente.", TipoMensaje.MsgInformacion)
CambioProductosServiciosCaracteristicasOpciones()
End If
ObjOpciones.Dispose()
End Sub
Protected Sub GvDatosOpciones_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosOpciones.RowCancelingEdit
GvDatosOpciones.EditIndex = -1
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenO").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
Protected Sub GvDatosOpciones_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosOpciones.RowUpdating
Dim ObjOpciones As New ClsGralProductosServiciosCaracteristicas
Dim CveCaracteristica As Integer = DirectCast(GvDatosOpciones.Rows(e.RowIndex).FindControl("DdlCaracteristicaEdit"), DropDownList).SelectedValue.ToEntero
Dim CveOpcion As Integer = GvDatosOpciones.DataKeys(e.RowIndex).Value.ToString.ToEntero
Dim Opcion As String = DirectCast(GvDatosOpciones.Rows(e.RowIndex).FindControl("TxtOpcion"), TextBox).Text.Trim
If ObjOpciones.UpdateProductosServiciosCaracteristicasOpciones(Opcion, CveCaracteristica, CveOpcion) Then
GvDatosOpciones.EditIndex = -1
ViewState("DTProductosServiciosCaracteristicasOpciones") = ObjOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa) = ObjOpciones.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CambioProductosServiciosCaracteristicasOpciones()
End If
ObjOpciones.Dispose()
End Sub
Protected Sub GvDatosOpciones_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosOpciones.RowEditing
GvDatosOpciones.EditIndex = e.NewEditIndex
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenO").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim gvi As Integer = 0
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
gvi = Arg(1).ToEntero
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
Campo = Campo.Substring(0, Campo.Length - 1)
If ViewState(String.Format("O{0}", Campo, gvi)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo, gvi)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo, gvi)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo, gvi)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden, gvi)
End Sub
Private Sub CargaGrid(Orden As String, gvi As Integer)
Dim Filtro As String = ""
If gvi = 0 Then
Filtro = "CvePS = " + DdlPS.SelectedItem.Value.ToString
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTProductosServiciosCaracteristicas"), DataTable), Filtro, Orden, DataViewRowState.CurrentRows)
GvDatosCaracteristicas.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosCaracteristicas.DataSource = New DataView(GlobalDTProductosServiciosCaracteristicas(UsuarioActual.CveEmpresa), Filtro, "", DataViewRowState.CurrentRows)
End If
GvDatosCaracteristicas.DataBind()
UpDatosC.Update()
ElseIf gvi = 1 Then
If Not DdlCaracteristica.SelectedItem Is Nothing Then
Filtro = "CvePSCaracteristica = " + DdlCaracteristica.SelectedItem.Value.ToString
Else
Filtro = "1 = 2"
End If
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTProductosServiciosCaracteristicasOpciones"), DataTable), Filtro, Orden, DataViewRowState.CurrentRows)
GvDatosOpciones.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosOpciones.DataSource = New DataView(GlobalDTProductosServiciosCaracteristicasOpciones(UsuarioActual.CveEmpresa), Filtro, "", DataViewRowState.CurrentRows)
End If
GvDatosOpciones.DataBind()
UpDatosO.Update()
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,84 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatRimTamanios.aspx.vb" Inherits="General_CatRimTamanios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tamaños de Rin
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar Tamaño de Rin</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveRinTamaño,CveClasificacion,RinTamaño,Codigo"
EmptyDataText="No se encontraron Modelos" ToolTip="Listado de Modelos"
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="RinTamaño" HeaderText="Tamaño de Rin" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la marca?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModal" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Medida" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodigo" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFCCodigo" runat="server" ControlToValidate="TxtCodigo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFCCodigo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCodigo.ClientID.ToString()%>">Código:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRin" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVModelo" runat="server" ControlToValidate="TxtRin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tamaño de Rin''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFVModelo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtRin.ClientID.ToString()%>">Tamaño de Rin:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacion" CssClass="form-control marginFixRow select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="DdlClasificacion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificación:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,114 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class General_CatRimTamanios
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveRinTamaño() As Integer
Get
Return If(IsNothing(ViewState("CveRinTamaño")), -1, CInt(ViewState("CveRinTamaño")))
End Get
Set
ViewState("CveRinTamaño") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
CargaDatos()
End If
End Sub
#Region "CARGAS"
Private Sub CargaCombos()
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()
UpModal.Update()
End Sub
Private Sub CargaDatos()
Dim ObjGral As New ClsGenerales
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjGral.DtResultados
End If
ObjGral.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
#Region "BOTONES"
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveRinTamaño = gvRow.DataKey("CveRinTamaño").ToEntero()
TxtRin.Text = gvRow.DataKey("RinTamaño")
TxtCodigo.Text = gvRow.DataKey("Codigo")
DdlClasificacion.SelectedValueExist(gvRow.DataKey("CveClasificacion"))
Modalidad = "U"
BtnGuardar.Text = "Actualizar"
ltlMotititulo.Text = "Actualizar Tamaño de Rin"
RegistraScript("$('#DModal').modal('show')")
UpModal.Update()
End Sub
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim ObjGral As New ClsGenerales
Dim CveRinTamaño = gvRow.DataKey("CveRinTamaño").ToEntero()
If ObjGral.RemoveRimTamanio(CveRinTamaño) Then
Alert("El Tamaño de Rin se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("El Tamaño de Rin esta siendo utilizada por un Producto", TipoMensaje.MsgError)
End If
ObjGral.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
ltlMotititulo.Text = "Agregar Tamaño de Rin"
UpModal.Update()
RegistraScript("$('#DModal').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim ObjPS As New ClsGenerales
If Modalidad = "A" Then
If ObjPS.AddRimTamanios(DdlClasificacion.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtRin.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("El Tamaño de Rin se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf Modalidad = "U" Then
If ObjPS.UpdateRimTamanios(CveRinTamaño, DdlClasificacion.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtRin.Text.Trim()) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("El Tamaño de Rin se actualizo correctamente.", TipoMensaje.MsgInformacion)
End If
End If
ObjPS.Dispose()
CargaDatos()
End Sub
#End Region
#Region "LIMPIAR"
Protected Sub LimpiaModal()
TxtRin.Text = ""
TxtCodigo.Text = ""
DdlClasificacion.SelectedValueExist("-1")
End Sub
#End Region

View File

@@ -0,0 +1,84 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatRinTamanios.aspx.vb" Inherits="General_CatRinTamanios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tamaños de Rin
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregar" OnClick="LnkAgregar_Click" runat="server"><i class="fa fa-plus"></i>Agregar Tamaño de Rin</asp:LinkButton></li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveRinTamaño,CveClasificacion,RinTamaño,Codigo"
EmptyDataText="No se encontraron Modelos" ToolTip="Listado de Modelos"
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns>
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="RinTamaño" HeaderText="Tamaño de Rin" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Clasificacion" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="LnkEditar_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la marca?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DModal" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Medida" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCodigo" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFCCodigo" runat="server" ControlToValidate="TxtCodigo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Código''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFCCodigo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtCodigo.ClientID.ToString()%>">Código:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRin" runat="server" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVModelo" runat="server" ControlToValidate="TxtRin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tamaño de Rin''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModelo" runat="server" HighlightCssClass="vco" TargetControlID="RFVModelo" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtRin.ClientID.ToString()%>">Tamaño de Rin:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlClasificacion" CssClass="form-control marginFixRow select2me" runat="server" AppendDataBoundItems="true" DataTextField="Clasificacion" DataValueField="CveClasificacion">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVClasificacion" runat="server" ControlToValidate="DdlClasificacion" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor seleccione uno." ValidationGroup="VgmGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificación:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VgmGuardar" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,114 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class General_CatRinTamanios
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveRinTamaño() As Integer
Get
Return If(IsNothing(ViewState("CveRinTamaño")), -1, CInt(ViewState("CveRinTamaño")))
End Get
Set
ViewState("CveRinTamaño") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
CargaDatos()
End If
End Sub
#Region "CARGAS"
Private Sub CargaCombos()
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()
UpModal.Update()
End Sub
Private Sub CargaDatos()
Dim ObjGral As New ClsGenerales
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjGral.DtResultados
End If
ObjGral.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
#Region "BOTONES"
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
CveRinTamaño = gvRow.DataKey("CveRinTamaño").ToEntero()
TxtRin.Text = gvRow.DataKey("RinTamaño")
TxtCodigo.Text = gvRow.DataKey("Codigo")
DdlClasificacion.SelectedValueExist(gvRow.DataKey("CveClasificacion"))
Modalidad = "U"
BtnGuardar.Text = "Actualizar"
ltlMotititulo.Text = "Actualizar Tamaño de Rin"
RegistraScript("$('#DModal').modal('show')")
UpModal.Update()
End Sub
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim ObjGral As New ClsGenerales
Dim CveRinTamaño = gvRow.DataKey("CveRinTamaño").ToEntero()
If ObjGral.RemoveRimTamanio(CveRinTamaño) Then
Alert("El Tamaño de Rin se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("El Tamaño de Rin esta siendo utilizada por un Producto", TipoMensaje.MsgError)
End If
ObjGral.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
ltlMotititulo.Text = "Agregar Tamaño de Rin"
UpModal.Update()
RegistraScript("$('#DModal').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim ObjPS As New ClsGenerales
If Modalidad = "A" Then
If ObjPS.AddRimTamanios(DdlClasificacion.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtRin.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("El Tamaño de Rin se agregó correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf Modalidad = "U" Then
If ObjPS.UpdateRimTamanios(CveRinTamaño, DdlClasificacion.SelectedValue.ToEntero(), TxtCodigo.Text.Trim(), TxtRin.Text.Trim()) Then
RegistraScript("$('#DModal').modal('hide')")
Alert("El Tamaño de Rin se actualizo correctamente.", TipoMensaje.MsgInformacion)
End If
End If
ObjPS.Dispose()
CargaDatos()
End Sub
#End Region
#Region "LIMPIAR"
Protected Sub LimpiaModal()
TxtRin.Text = ""
TxtCodigo.Text = ""
DdlClasificacion.SelectedValueExist("-1")
End Sub
#End Region

View File

@@ -0,0 +1,122 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSatListado69B.aspx.vb" Inherits="General_CatSatListado69B" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
SAT Listado EFOS
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkActualizarListado69B" runat="server" Visible="true" OnClick="LnkActualizarListado69B_Click" data-toggle="confirmation" data-popout="true" data-original-title="Actualizar Listado 69B" data-btn-ok-label="si"><i class="fa fa-file-alt"></i> Actualizar Listado EFOS (69B)</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkListado69BExcel" runat="server" Visible="true" OnClick="LnkListado69BExcel_Click"><i class="fa fa-ad-excel"></i> Exporta Excel General</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkListado69BExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline text-size-12">
<li>Tipo:
<asp:DropDownList ID="DdlTipo" runat="server">
<asp:ListItem Value="1" Selected="True" >En sistema</asp:ListItem>
<asp:ListItem Value="2">Todos</asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
<%--<a href="javascript:;" class="expand"></a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload"></a>--%>
</div>
</div>
<div class="portlet-body" style="display: none;">
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row col-md-12" style="text-align:right;margin-right:10px!important">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatosGeneral.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatosGeneral.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<br />
<br />
<asp:UpdatePanel ID="UpDatosGeneral" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVDatosGeneral" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros"
DataKeyNames="NombreContribuyente,CveProveedor"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-rows="1" data-cols="1" data-heightmenos="100" data-heightfijo="600" GridLines="None" >
<Columns>
<asp:BoundField HeaderText="Numero" DataField="No" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" Visible="false" />
<asp:BoundField HeaderText="RFC" DataField="RFC" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="300px" ItemStyle-HorizontalAlign="Left" ControlStyle-Width="301px" HeaderStyle-Width="300px">
<ItemTemplate >
<asp:Label ID="LblNombre" runat="server" Text ='<%# Eval("NombreContribuyente") %>' Width="300px" CssClass="truncate" ></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Situación" DataField="Situacion" ItemStyle-HorizontalAlign="Left" ControlStyle-CssClass="truncate" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="NoFechaOficioGlobalPresuncion" DataField="NoFechaOficioGlobalPresuncion" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="390px" />
<asp:BoundField HeaderText="PublicacionPaginaSATPresuntos" DataField="PublicacionPaginaSATPresuntos" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" ItemStyle-Width="240px" />
<asp:BoundField HeaderText="NoFechaOficioGlobalPresuncion2" DataField="NoFechaOficioGlobalPresuncion2" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="390px" />
<asp:BoundField HeaderText="PublicacionDOFPresuntos" DataField="PublicacionDOFPresuntos" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="PublicacionPaginaSATDesvirtuados" DataField="PublicacionPaginaSATDesvirtuados" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="PublicacionPaginaSATDesvirtuados" DataField="PublicacionPaginaSATDesvirtuados" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="NoFechaOficioGlobalContribuyentesDesvirtuaron" DataField="NoFechaOficioGlobalContribuyentesDesvirtuaron" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="PublicacionDOFDesvirtuados" DataField="PublicacionDOFDesvirtuados" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="NoFechaOficioGlobalDefinitivos" DataField="NoFechaOficioGlobalDefinitivos" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="PublicacionPaginaSATDefinitivos" DataField="PublicacionPaginaSATDefinitivos" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="PublicacionDOFDefinitivos" DataField="PublicacionDOFDefinitivos" DataFormatString="{0:d}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,109 @@
Option Strict On
Imports System.Net
Imports System.Data
Imports System.IO
Imports Extensiones
Imports System.Data.OleDb
Imports System.Globalization
Imports GemBox.Spreadsheet
Partial Class General_CatSatListado69B
Inherits ClsPaginas
Private Sub General_CatSatListado69B_Load(sender As Object, e As EventArgs) Handles Me.Load
If Request("Accion") IsNot Nothing Then
Dim Accion As Integer = Request("Accion").ToString.ToEntero
Select Case Accion
Case 101
Dim ObjSAT As New ClsSAT
' ObjSAT.ActualizarListado69B(Server.MapPath("~"))
'ObjSAT.EnviaCorreoReporteListado69B()
ObjSAT.Dispose()
Exit Select
End Select
Else
If Not Page.IsPostBack Then
'GVDatosGeneral.Columns(4).Visible = False
'GVDatosGeneral.Columns(6).Visible = False
'GVDatosGeneral.Columns(7).Visible = False
'GVDatosGeneral.Columns(8).Visible = False
'GVDatosGeneral.Columns(9).Visible = False
'GVDatosGeneral.Columns(10).Visible = False
'GVDatosGeneral.Columns(11).Visible = False
'GVDatosGeneral.Columns(12).Visible = False
'GVDatosGeneral.Columns(13).Visible = False
'GVDatosGeneral.Columns(14).Visible = False
CargaDatos()
End If
End If
End Sub
Private Sub CargaDatos()
Dim ObjSAT As New ClsSAT
If ObjSAT.GetListado69B(DdlTipo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GVDatosGeneral.DataSource = ObjSAT.DtResultados
GVDatosGeneral.DataBind()
Else
GVDatosGeneral.DataSource = Nothing
End If
UpDatosGeneral.Update()
End Sub
Protected Sub LnkListado69BExcel_Click(sender As Object, e As EventArgs)
If GVDatosGeneral.Rows.Count > 0 Then
GVDatosGeneral.ExportToExcel($"Reporte_{Now.ToString("yyyyMMddhhmmss")}")
End If
End Sub
Protected Sub LnkActualizarListado69B_Click(sender As Object, e As EventArgs)
Dim ObjSAT As New ClsSAT
Dim Contador As Integer = 0
Dim Mensaje As String = ""
ObjSAT.ActualizarListado69B(Server.MapPath("~"))
ObjSAT.Dispose()
CargaDatos()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Private Sub GVDatosGeneral_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVDatosGeneral.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If DdlTipo.SelectedValue.ToEntero = 1 Then
e.Row.Cells(2).Text = $"<div class='truncate' style='width:300px!important'><a href='../Compras/Proveedores.aspx?CveProveedor={e.Row.DataKey("CveProveedor")}' target='_blank' style='width:300px!important'>{e.Row.DataKey("NombreContribuyente")}</a></div>"
End If
End If
End Sub
End Class

205
General/CatTipoCambio.aspx Normal file
View File

@@ -0,0 +1,205 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTipoCambio.aspx.cs" Inherits="General_CatTipoCambio" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tipos de Cambio
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:UpdatePanel ID="UpLnkAgregar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="linkAgregar" runat="server" OnClick="linkAgregar_Click" Visible="false"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate>
<%--Consulta--%>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle " style="">
<div class="tools">
<asp:Button ID="BtnConsulta" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsulta_Click" ValidationGroup="GrpObligatorio" />
</div>
<div class="titlefiltros caption">
<div class="row" style="margin-left: 10px; text-align: center;">
<h4 class="col-md-1 col-centered" style="display: inline-block;">Fecha Inicial:</h4>
<div class="col-md-1" style="display: inline-block;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox ID="txtFechaI" runat="server" Style="width: 90px;" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn" style="margin-left:-20px">
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
</div>
</div>
<h4 class="col-md-1 col-centered" style="display: inline-block;">Fecha Final:</h4>
<div class="col-md-1" style="display: inline-block;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox ID="txtFechaF" runat="server" Style="width: 90px;" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn" style="margin-left:-20px">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
</div>
</div>
</div>
</div>
</div>
</div>
<%--Seccion lista resultados--%>
<div class="row">
<div class="col-md-6">
<div class="portlet light ">
<%-- <div class="portlet-title">
<div class="caption" >
<i style="font-size: larger" class="fa fa-money font-green"></i>
<span class="caption-subject font-green bold uppercase" >Tipos de Cambio Disponibles</span>
</div>
<div class="actions">
</div>
</div>--%>
<div class="portlet-body">
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right">
<div style="margin-right: 15px">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTiposCambio.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTiposCambio.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GvTiposCambio" runat="server" GridLines="None" OnRowDataBound="GvTiposCambio_RowDataBound" DataKeyNames="CveTipoCambio, TipoCambio, TipoCambioEuro, Fecha, TipoCambioFIX" CssClass=" table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" OnRowDeleting="GvTiposCambio_RowDeleting">
<Columns>
<asp:BoundField DataField="Fecha" DataFormatString="{0:d}" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="TipoCambio" HeaderText="Tipo Cambio" DataFormatString="{0:N4}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="TipoCambioEuro" HeaderText="Tipo Cambio Euro" DataFormatString="{0:N4}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="TipoCambioFIX" HeaderText="Tipo Cambio FIX" DataFormatString="{0:N4}" ItemStyle-HorizontalAlign="Right" />
<asp:TemplateField ItemStyle-Width="120px" HeaderText="Acciones" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" Visible="false" OnClick="imgE_Click" AlternateText="Editar" CommandArgument='<%# Eval("CveTipoCambio")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<asp:LinkButton ID="imgD" runat="server" Visible="false" 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="¿Desea eliminar este tipo de cambio?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%-- MODAL AGREGAR-EDITAR --%>
<div id="DvModalTipoCambio" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UPModalTipoCambio" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel2" runat="server">Tipo de Cambio</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalBody" UpdateMode="conditional">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<label for="<%= txtFecha.ClientID.ToString() %>" style="font-size: 13px; color: #888888;">Fecha:</label>
<div class="row">
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox ID="txtFecha" runat="server" Style="width: 90px;" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="txtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFecha" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFecha" runat="server" ControlToValidate="txtFecha" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorioTipoCambio"></asp:RequiredFieldValidator>
</div>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipoCambio" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true" Style="width: 90px;text-align:right;"></asp:TextBox>
<label style="margin-top: -6px" for="<%= TxtTipoCambio.ClientID.ToString()%>">Tipo de Cambio:</label>
<%-- <ajax:MaskedEditExtender ID="MEETxtTipoCambio" runat="server" TargetControlID="TxtTipoCambio" Mask="999.9999" MessageValidatorTip="true" MaskType="Number" DisplayMoney="Left"></ajax:MaskedEditExtender> --%>
<asp:RequiredFieldValidator ID="RFVTipoCambio" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTipoCambio" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioTipoCambio"></asp:RequiredFieldValidator>
<ajax:FilteredTextBoxExtender TargetControlID="TxtTipoCambio" runat="server" FilterType="Numbers,Custom" ValidChars="." InvalidChars ="-/*" />
<asp:RegularExpressionValidator ID="REGTxtTipoCambio" runat="server" ControlToValidate="TxtTipoCambio" ValidationExpression="\d+(\.\d{1,4})?" CssClass="help-block errorimput"
ErrorMessage="El campo <b>''Cambio FIX''</b> tiene un formato incorrecto (##.####)." ValidationGroup="GrpObligatorioTipoCambio"></asp:RegularExpressionValidator>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipoCambioEuro" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true" Style="width: 90px; text-align:right;"></asp:TextBox>
<label style="margin-top: -6px" for="<%= TxtTipoCambioEuro.ClientID.ToString()%>">Tipo de Cambio Euro:</label>
<%-- <asp:RequiredFieldValidator ID="RFVTipoCambioEuro" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTipoCambioEuro" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio Euro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioTipoCambio"></asp:RequiredFieldValidator>--%>
<ajax:FilteredTextBoxExtender TargetControlID="TxtTipoCambioEuro" runat="server" FilterType="Numbers,Custom" ValidChars="." InvalidChars ="-/*" />
<asp:RegularExpressionValidator ID="RETxtTipoCambioEuro" runat="server" ControlToValidate="TxtTipoCambioEuro" ValidationExpression="\d+(\.\d{1,4})?" CssClass="help-block errorimput"
ErrorMessage="El campo <b>''Cambio FIX''</b> tiene un formato incorrecto (##.####)." ValidationGroup="GrpObligatorioTipoCambio"></asp:RegularExpressionValidator>
<%-- <ajax:MaskedEditExtender ID="MEETxtTipoCambioEuro" runat="server" TargetControlID="TxtTipoCambioEuro" Mask="999.9999" MaskType="Number" DisplayMoney="Left"></ajax:MaskedEditExtender> --%>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipoCambioFIX" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true" Style="width: 90px;text-align:right;"></asp:TextBox>
<label style="margin-top: -6px" for="<%= TxtTipoCambioFIX.ClientID.ToString()%>">Tipo de Cambio FIX:</label>
<ajax:FilteredTextBoxExtender TargetControlID="TxtTipoCambioFIX" runat="server" FilterType="Numbers,Custom" ValidChars="." InvalidChars ="-/*" />
<asp:RegularExpressionValidator ID="RGEXValidator" runat="server" ControlToValidate="TxtTipoCambioFIX" ValidationExpression="\d+(\.\d{1,4})?" CssClass="help-block errorimput"
ErrorMessage="El campo <b>''Cambio FIX''</b> tiene un formato incorrecto (##.####)." ValidationGroup="GrpObligatorioTipoCambio"></asp:RegularExpressionValidator>
<%-- <ajax:MaskedEditExtender ID="MEETxtTipoCambioFIX" runat="server" TargetControlID="TxtTipoCambioFIX" Mask="999.9999" MessageValidatorTip="true" MaskType="Number" DisplayMoney="Left"></ajax:MaskedEditExtender> --%>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:LinkButton ID="BtnGuardarTC" runat="server" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnGuardarTC_Click" ValidationGroup="GrpObligatorioTipoCambio"></asp:LinkButton>
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="https://use.fontawesome.com/c5bb48e43a.js"></script>
</asp:Content>

View File

@@ -0,0 +1,230 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class General_CatTipoCambio : ClsPaginas
{
#region "Propiedades"
private DateTime FechaInicio
{
get
{
return (DateTime)ViewState["FechaInicio"];
}
set
{
ViewState["FechaInicio"] = value;
}
}
private DateTime FechaFin
{
get
{
return (DateTime)ViewState["FechaFin"];
}
set
{
ViewState["FechaFin"] = value;
}
}
private int EsEditar
{
get
{
return ViewState["EsEditar"].ToString().ToEntero();
}
set
{
ViewState["EsEditar"] = value;
}
}
private int CveTipoCambio
{
get
{
return ViewState["CveTipoCambio"].ToString().ToEntero();
}
set
{
ViewState["CveTipoCambio"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
FechaInicio = DateTime.Now.AddDays(-30);
FechaFin = DateTime.Today;
txtFechaI.Text = FechaInicio.ToString("dd/MM/yyyy");
txtFechaF.Text = FechaFin.ToString("dd/MM/yyyy");
CargaDatos();
}
if (UsuarioActual.TienePermisoProceso(210))
{
linkAgregar.Visible = true;
}
}
protected void CargaDatos()
{
ClsGenerales ObjGeneral = new ClsGenerales();
if (ObjGeneral.GetTiposCambio(FechaInicio, FechaFin))
{
GvTiposCambio.DataSource = ObjGeneral.DtResultados;
}
ObjGeneral.Dispose();
GvTiposCambio.DataBind();
UpDatos.Update();
}
protected void linkAgregar_Click(object sender, EventArgs e)
{
limpiarCamposModal();
EsEditar = 0;
BtnGuardarTC.Text = "Guardar";
UPModalTipoCambio.Update();
this.RegistraScript("$('#DvModalTipoCambio').modal('show');");
}
protected void limpiarCamposModal()
{
TxtTipoCambio.Text = "";
TxtTipoCambioEuro.Text = "";
TxtTipoCambioFIX.Text = "";
txtFecha.Text = DateTime.Today.ToString("dd/MM/yyyy");
}
protected void imgE_Click(object sender, EventArgs e)
{
limpiarCamposModal();
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveTipoCambio = GvRow.DataKey("CveTipoCambio").ToEntero();
EsEditar = 1;
TxtTipoCambio.Text = GvRow.DataKey("TipoCambio").ToString();
TxtTipoCambioEuro.Text = GvRow.DataKey("TipoCambioEuro").ToString();
TxtTipoCambioFIX.Text = GvRow.DataKey("TipoCambioFIX").ToString();
txtFecha.Text = GvRow.DataKey("Fecha").ToString();
BtnGuardarTC.Text = "Actualizar";
UPModalTipoCambio.Update();
this.RegistraScript("$('#DvModalTipoCambio').modal('show');");
}
protected void GvTiposCambio_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
ClsGenerales ObjGenerales = new ClsGenerales();
ObjGenerales.IniciaTransacSQL();
int CveTipoCambio = GvTiposCambio.Rows[e.RowIndex].DataKey("CveTipoCambio").ToEntero();
bool TieneError = !ObjGenerales.RemoveTipoCambio(CveTipoCambio);
if (TieneError)
{
ObjGenerales.RollBack();
Alert("Error al eliminar el tipo de cambio.", ModExtensiones.TipoMensaje.MsgError);
}
else
{
ObjGenerales.Commit();
Alert("El tipo de cambio ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion);
}
ObjGenerales.Dispose();
CargaDatos();
}
protected void BtnGuardarTC_Click(object sender, EventArgs e)
{
ClsGenerales ObjGeneral = new ClsGenerales();
double TipoCambio = TxtTipoCambio.Text.ToDouble();
double TipoCambioEuro = TxtTipoCambioEuro.Text.ToDouble();
var TipoCambioFIX = 0.0;
if (TxtTipoCambioFIX.Text != "")
{
TipoCambioFIX = TxtTipoCambioFIX.Text.ToDouble();
}
if (EsEditar == 0)
{
if (ObjGeneral.AddTipoCambio(TipoCambio, txtFecha.Text.ToDate(), TipoCambioEuro, TipoCambioFIX))
{
Alert("El Tipo de Cambio fue creado correctamente para la fecha " + txtFecha.Text + ".", ModExtensiones.TipoMensaje.MsgInformacion);
}
}
// EDITA TIPO DE CAMBIO
else
{
if (ObjGeneral.UpdateTipoCambio(CveTipoCambio, TipoCambio, TipoCambioEuro, TipoCambioFIX, txtFecha.Text.ToDate()))
{
Alert("El Tipo de Cambio fue actualizado correctamente para la fecha " + txtFecha.Text + ".", ModExtensiones.TipoMensaje.MsgInformacion);
}
else
{
Alert("Se presento un error al actualizar el tipo de cambio.", ModExtensiones.TipoMensaje.MsgError);
}
}
ObjGeneral.Dispose();
limpiarCamposModal();
this.RegistraScript("$('#DvModalTipoCambio').modal('hide');");
CargaDatos();
}
protected void BtnConsulta_Click(object sender, EventArgs e)
{
FechaInicio = txtFechaI.Text.ToDate();
FechaFin = txtFechaF.Text.ToDate();
CargaDatos();
}
protected void GvTiposCambio_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (UsuarioActual.TienePermisoProceso(212))
{
e.Row.FCLinkButton("imgD").Visible = true;
}
if (UsuarioActual.TienePermisoProceso(211))
{
e.Row.FCLinkButton("imgE").Visible = true;
}
}
}
}

195
General/Colectivas.aspx Normal file
View File

@@ -0,0 +1,195 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Colectivas.aspx.vb" Inherits="General_Colectivas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<img alt="Nueva Colectiva" onclick="document.location.href='/General/ColectivasDetalle.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer" />&nbsp;
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Colectivas
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="100px">
<asp:LinkButton ID="LbColectiva" runat="server" CausesValidation="false" Text="" CommandArgument="Colectiva" OnClick="LbOrden_Click">
Colectiva
<asp:Literal ID="ImgColectiva" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbCodigo" runat="server" CausesValidation="false" Text="" CommandArgument="Codigo" OnClick="LbOrden_Click">
Código
<asp:Literal ID="ImgCodigo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbRFC" runat="server" CausesValidation="false" Text="" CommandArgument="RFC" OnClick="LbOrden_Click">
RFC
<asp:Literal ID="ImgRFC" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbDireccion" runat="server" CausesValidation="false" Text="" CommandArgument="Direccion" OnClick="LbOrden_Click">
Dirección
<asp:Literal ID="ImgDireccion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbTelefono" runat="server" CausesValidation="false" Text="" CommandArgument="Telefono" OnClick="LbOrden_Click">
Teléfono
<asp:Literal ID="ImgTelefono" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbCorreo" runat="server" CausesValidation="false" Text="" CommandArgument="Correo" OnClick="LbOrden_Click">
Correo
<asp:Literal ID="ImgCorreo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbTipo" runat="server" CausesValidation="false" Text="" CommandArgument="TipoTexto" OnClick="LbOrden_Click">
Tipo
<asp:Literal ID="ImgTipoTexto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbIdCtaContable" runat="server" CausesValidation="false" Text="" CommandArgument="IdCtaContable" OnClick="LbOrden_Click">
Id Cta.
<asp:Literal ID="ImgIdCtaContable" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbCtaContable" runat="server" CausesValidation="false" Text="" CommandArgument="CtaContable" OnClick="LbOrden_Click">
Cta Cont.
<asp:Literal ID="ImgCtaContable" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estado" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="100px">
<asp:LinkButton ID="LbFecha" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<%--<td width="100px"><asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuario" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>--%>
<%--<td width="103">Comandos</td>--%>
</tr>
</thead>
<%--<tr>
<td>
<asp:TextBox ID="TxtColectiva" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="244px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVColectiva" runat="server" ControlToValidate="TxtColectiva" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Colectiva''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCColectiva" runat="server" HighlightCssClass="vco" TargetControlID="RFVColectiva" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>--%>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="1100px" DataKeyNames="CveColectiva" EmptyDataText="No se encontraron Colectivas Registrados" ToolTip="Listado de Colectivas" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlColectiva" runat="server" Text='<%# Eval("Colectiva", "{0}") %>'></asp:Literal>
</ItemTemplate>
<%--<EditItemTemplate>
<asp:TextBox ID="TxtColectiva" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Colectiva") %>' ValidationGroup="GrpGV" Width="244px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVColectiva" runat="server" ControlToValidate="TxtColectiva" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Colectiva''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCColectiva" runat="server" HighlightCssClass="vco" TargetControlID="RFVColectiva" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>--%>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlDireccion" runat="server" Text='<%# Eval("Direccion")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlTipo" runat="server" Text='<%# Eval("TipoTexto")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlIdCtaContable" runat="server" Text='<%# Eval("IdCtaContable")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCtaContable" runat="server" Text='<%# Eval("CtaContable")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estado")%>'></asp:Literal>
</ItemTemplate>
<%-- <EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>--%>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%-- <asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>--%>
<%--<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>--%>
<%--<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>--%>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que desea eliminar el Colectiva?');
}
</script>
</asp:Content>

172
General/Colectivas.aspx.vb Normal file
View File

@@ -0,0 +1,172 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class General_Colectivas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjColectiva As New ClsGenerales
If ObjColectiva.GetColectivas(-1, "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
ViewState("DTColectivas") = ObjColectiva.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjColectiva.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
''Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
'' Dim ObjColectiva As New ClsGenerales
'' ' '' '' ''If ObjColectiva.AddColectivas(TxtColectiva.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
'' ' '' '' '' TxtColectiva.Text = ""
'' ' '' '' '' Alert("El nuevo Colectiva se guardó correctamente.", TipoMensaje.MsgInformacion)
'' ' '' '' '' UpTitulos.Update()
'' ' '' '' '' ViewState("DTColectivas") = ObjColectiva.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
'' ' '' '' '' GlobalDTGralColectivas = ObjColectiva.DtResultados
'' ' '' '' '' If ViewState("Orden").ToString() <> String.Empty Then
'' ' '' '' '' CargaGrid(ViewState("Orden").ToString())
'' ' '' '' '' Else
'' ' '' '' '' CargaGrid("")
'' ' '' '' '' End If
'' ' '' '' ''End If
'' ObjColectiva.Dispose()
''End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(100)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.Cells(9).Width = Unit.Pixel(100)
e.Row.Cells(10).Width = Unit.Pixel(100)
'e.Row.Cells(11).Width = Unit.Pixel(100)
'e.Row.Cells(12).Width = Unit.Pixel(100)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.FCLiteral("LtlColectiva").Text = "<a class=""Texto"" href=""/General/ColectivasDetalle.aspx?CveColectiva=" & e.Row.DBCampo("CveColectiva") & """>" & e.Row.FCLiteral("LtlColectiva").Text & "</a>"
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjColectiva As New ClsGenerales
If ObjColectiva.RemoveColectivas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.EditIndex = -1
ViewState("DTColectivas") = ObjColectiva.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTGralColectivas(-1) = ObjColectiva.DtResultados
Alert("La Colectiva se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjColectiva.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjColectiva As New ClsGenerales
Dim Colectiva As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtColectiva"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveColectiva As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
' '' '' ''If ObjColectiva.UpdateColectiva(Colectiva, Estatus, CveColectiva) Then
' '' '' '' GvDatos.EditIndex = -1
' '' '' '' ViewState("DTColectivas") = ObjColectiva.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
' '' '' '' GlobalDTGralColectivas = ObjColectiva.DtResultados
' '' '' '' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
' '' '' ''End If
ObjColectiva.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTColectivas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTColectivas"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,435 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ColectivasDetalle.aspx.vb" Inherits="General_ColectivasDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
<img id="ImgAddCompra" runat="server" alt="Registrar Nueva Compra" style="cursor: pointer;" src="/Imagenes/Nota.gif" width="20" height="25" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Colectivas"></asp:Literal>&nbsp;<asp:Literal ID="LtlColectiva" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<script type="text/javascript">
function SetText(ObjFrom, ObjTo) {
ObjTo.value = ObjFrom.value;
}
//this pageLoad will only works if you are using ASP.Net AJAX
//if you're not, you can use the other way.
function CargaCuentas(op) {
$get("HdnCuenta").value = op;
$("#BtnCargarCuentas").click();
}
function fnCxP() {
$("#BtnRecargaCxP").click();
}
function pageLoad() {
var isAsyncPostback = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();
if (isAsyncPostback) {
tb_init('a.thickbox');
}
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top:20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Información General">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<fieldset>
<legend><b>Datos</b></legend>
<table border="0">
<tr>
<td>Colectiva:</td>
<td>
<asp:TextBox ID="TxtColectiva" runat="server" MaxLength="200" Width="400px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVColectiva" runat="server" ControlToValidate="TxtColectiva" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Razón Social''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCallOutExtender ID="VCEColectiva" runat="server" HighlightCssClass="vco" TargetControlID="RFVColectiva" Width="300px" Enabled="True"></ajax:ValidatorCallOutExtender>
</td>
</tr>
<tr>
<td>Código:</td>
<td>
<asp:TextBox ID="TxtCodigo" runat="server" MaxLength="10" Width="100px"></asp:TextBox>
</td>
</tr>
<tr>
<td>RFC:</td>
<td>
<asp:TextBox ID="TxtRFC" runat="server" MaxLength="13" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRFC" runat="server" ControlToValidate="TxtRFC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCallOutExtender ID="VCERFC" runat="server" HighlightCssClass="vco" TargetControlID="RFVRFC" Width="300px" Enabled="True"></ajax:ValidatorCallOutExtender>
</td>
</tr>
<tr>
<td>Dirección:</td>
<td><asp:TextBox ID="TxtDireccion" runat="server" Width="400px"></asp:TextBox></td>
</tr>
<tr>
<td>Teléfono:</td>
<td><asp:TextBox ID="TxtTelefono" runat="server" MaxLength="10" Width="100px" ValidationGroup="GrpGuardar"></asp:TextBox></td>
</tr>
<tr>
<td>Correo:</td>
<td>
<asp:TextBox ID="TxtCorreo" runat="server" MaxLength="50" Width="200px"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVCorreo" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="TxtCorreo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Contacto - Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardar"></asp:RegularExpressionValidator>
<ajax:ValidatorCallOutExtender ID="VCOContactoMail" runat="server" HighlightCssClass="vco" TargetControlID="REVCorreo" Width="300px" Enabled="True"></ajax:ValidatorCallOutExtender>
</td>
</tr>
<tr>
<td>Tipo:</td>
<td>
<asp:DropDownList ID="DdlTipo" runat="server">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Impuestos y Derechos" Value="1"></asp:ListItem>
<asp:ListItem Text="Deudores" Value="2"></asp:ListItem>
<asp:ListItem Text="Acreedores" Value="3"></asp:ListItem>
<asp:ListItem Text="Documentos" Value="4"></asp:ListItem>
<asp:ListItem Text="Institucioneles Financieras" Value="5"></asp:ListItem>
<asp:ListItem Text="Socios" Value="6"></asp:ListItem>
</asp:DropDownList></td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UPPContable" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnCargarCuentas" runat="server" ClientIDMode="Static" Text="CargaCuentas" style="display: none;" />
<asp:HiddenField ID="HdnCuenta" runat="server" ClientIDMode="Static" Value="0" />
<div>
<fieldset>
<legend><b>Contable</b></legend>
<table border="0">
<tr>
<td>Cuenta Contable:</td>
<td>
<ajax:ListSearchExtender ID="LSECtaContColectivas" runat="server" TargetControlID="DdlCtaContColectivas" PromptCssClass="Titulos" PromptText="Escriba el Nombre o código del proveedor" QueryPattern="Contains" PromptPosition="Top" IsSorted="false" QueryTimeout="0"></ajax:ListSearchExtender>
<asp:DropDownList ID="DdlCtaContColectivas" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="206px">
<asp:ListItem Selected="True" Text="Seleccione" Value="0"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</fieldset>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabBancos" runat="server" HeaderText="Bancos">
<ContentTemplate>
<div>
<fieldset>
<legend><b>Cuentas Bancarias</b></legend>
<asp:UpdatePanel ID="UpTitulosCuentasBancos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="105px">
<asp:LinkButton ID="LbBancoNombre" runat="server" CausesValidation="false" Text="NombreBanco" OnClick="LbOrden_Click" CommandArgument="BancoNombre"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgBancoNombre" OnClick="LbOrden_Click" CommandArgument="BancoNombre" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="105px">
<asp:LinkButton ID="LbSucursal2" runat="server" CausesValidation="false" Text="Num Sucursal" OnClick="LbOrden_Click" CommandArgument="Sucursal"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgSucursal" OnClick="LbOrden_Click" CommandArgument="Sucursal" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="105px">
<asp:LinkButton ID="LbCuenta" runat="server" CausesValidation="false" Text="Num Cuenta" OnClick="LbOrden_Click" CommandArgument="Cuenta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCuenta" OnClick="LbOrden_Click" CommandArgument="Cuenta" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="125px">
<asp:LinkButton ID="LbCLABE" runat="server" CausesValidation="false" Text="CLABE" OnClick="LbOrden_Click" CommandArgument="CLABE"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCLABE" OnClick="LbOrden_Click" CommandArgument="CLABE" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="105px">
<asp:LinkButton ID="LbSWIFT" runat="server" CausesValidation="false" Text="SWIFT" OnClick="LbOrden_Click" CommandArgument="SWIFT"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgSWIFT" OnClick="LbOrden_Click" CommandArgument="SWIFT" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="105px">
<asp:LinkButton ID="LbPlaza" runat="server" CausesValidation="false" Text="Plaza" OnClick="LbOrden_Click" CommandArgument="Plaza"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPlaza" OnClick="LbOrden_Click" CommandArgument="Plaza" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="105px">
<asp:LinkButton ID="LbCIE" runat="server" CausesValidation="false" Text="Convenio CIE" OnClick="LbOrden_Click" CommandArgument="CIE"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCIE" OnClick="LbOrden_Click" CommandArgument="CIE" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="105px">
<asp:LinkButton ID="LbReferencia" runat="server" CausesValidation="false" Text="Referencia" OnClick="LbOrden_Click" CommandArgument="Referencia"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgReferencia" OnClick="LbOrden_Click" CommandArgument="Referencia" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="85px">Comandos</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreBanco" runat="server" CausesValidation="true" MaxLength="100" ValidationGroup="GrpAgregarBanco" Width="90px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreBanco" runat="server" ControlToValidate="TxtNombreBanco" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''NombreBanco''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarBanco"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENombreBanco" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombreBanco" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtNumeroSucursal" runat="server" CausesValidation="true" MaxLength="100" ValidationGroup="GrpAgregarBanco" Width="90px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TxtNumeroCuenta" runat="server" CausesValidation="true" MaxLength="100" ValidationGroup="GrpAgregarBanco" Width="90px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TxtCLABE" runat="server" CausesValidation="true" MaxLength="120" ValidationGroup="GrpAgregarBanco" Width="110px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TxtSWIFT" runat="server" CausesValidation="true" MaxLength="100" ValidationGroup="GrpAgregarBanco" Width="90px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TxtPlaza" runat="server" CausesValidation="true" MaxLength="100" ValidationGroup="GrpAgregarBanco" Width="90px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TxtConvenioCIE" runat="server" CausesValidation="true" MaxLength="80" ValidationGroup="GrpAgregarBanco" Width="90px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TxtReferencia" runat="server" CausesValidation="true" MaxLength="100" ValidationGroup="GrpAgregarBanco" Width="90px"></asp:TextBox>
</td>
<td>
<asp:LinkButton ID="LbAgregarCuentaBanco" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpAgregarBanco" OnClick="LbAgregarCuentaBanco_Click"></asp:LinkButton>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpCuentasBancos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvBancosCuentas" runat="server" DataKeyNames="CveCuentaDeposito" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Cuentas Bancarias" Width="955px">
<Columns>
<asp:TemplateField ItemStyle-Width="105px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtNombreBanco" runat="server" Text='<%# Eval("BancoNombre")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtNombreBanco" runat="server" CausesValidation="true" MaxLength="100" Text='<%# Eval("BancoNombre")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombreBanco" runat="server" ControlToValidate="TxtNombreBanco" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''NombreBanco''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditarCuentaBanco"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENombreBanco" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombreBanco" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="110px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtNumeroSucursal" runat="server" Text='<%# Eval("Sucursal")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtNumeroSucursal" runat="server" CausesValidation="true" MaxLength="100" Text='<%# Eval("Sucursal")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="110px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtNumeroCuenta" runat="server" Text='<%# Eval("Cuenta")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtNumeroCuenta" runat="server" CausesValidation="true" MaxLength="100" Text='<%# Eval("Cuenta")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="130px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtCLABE" runat="server" Text='<%# Eval("CLABE")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCLABE" runat="server" CausesValidation="true" MaxLength="120" Text='<%# Eval("CLABE")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="110px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtSWIFT" runat="server" Text='<%# Eval("SWIFT")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtSWIFT" runat="server" CausesValidation="true" MaxLength="100" Text='<%# Eval("SWIFT")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="110px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtPlaza" runat="server" Text='<%# Eval("Plaza")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtPlaza" runat="server" CausesValidation="true" MaxLength="100" Text='<%# Eval("Plaza")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="90px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtConvenioCIE" runat="server" Text='<%# Eval("CIE")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtConvenioCIE" runat="server" CausesValidation="true" MaxLength="80" Text='<%# Eval("CIE")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="110px">
<ItemTemplate>
&nbsp;<asp:Literal ID="LtReferencia" runat="server" Text='<%# Eval("Referencia")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtReferencia" runat="server" CausesValidation="true" MaxLength="100" Text='<%# Eval("Referencia")%>' ValidationGroup="GrpEditarCuentaBanco" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpEditarCuentaBanco" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</fieldset>
</div>
<div>
<fieldset>
<legend><b>Pagos Realizados</b></legend>
<table border="0">
<tr>
<td>
<asp:GridView ID="GvBancos" EnableViewState="False" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró Historial de Cuentas X Pagar">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplFactura" CssClass="Texto" runat="server" Text='<%# Eval("SerieFolio")%>' NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Compra</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Vencimiento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaVenci" runat="server" Text='<%# Eval("FechaVencimiento", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Cheque</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplCheque" Visible="False" runat="server" CssClass="Texto" Text='<%# Eval("FolioPago") %>' NavigateUrl='<%# Eval("CveIE","/Bancos/IE.aspx?CveIE={0}") %>'></asp:HyperLink>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Monto Compra (Saldo Orig)</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSaldoOriginal" runat="server" Text='<%# Eval("Original", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Abonado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbonado" runat="server" Text='<%# Eval("Abonado", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>% Pagado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPorRecuperado" runat="server" Text='<%# Eval("PorPagado", "{0:N2}%") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Auxiliar</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAux" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</td>
</tr>
</table>
</fieldset>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabSistema" runat="server" HeaderText="Sistema">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td valign="top">
<div>
<fieldset>
<legend><b>Sistema</b></legend>
<table border="0">
<tr>
<td>Estado:</td>
<td><asp:CheckBox ID="ChkEstado" runat="server" Text="(Activado = Si, Desactivado = No)" /></td>
</tr>
<tr>
<td>Fecha de Captura:</td>
<td><asp:Label ID="LblFechaCaptura" runat="server"></asp:Label></td>
</tr>
<tr>
<td>Usuario:</td>
<td><asp:Label ID="LblUsuarioCapturo" runat="server"></asp:Label></td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="center">
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnCancelar" runat="server" Text="Regresar" OnClientClick="javascript:document.location.href='/General/Colectivas.aspx';" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<asp:UpdateProgress ID="upProgress" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="overlay">
<div id="modalprogress">
<div id="theprogress">
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>La información se está procesando...</td>
</tr>
<tr>
<td><img src="/Imagenes/Cargando.gif" style="border-width: 0px;" alt="" /></td>
</tr>
</table>
</center>
</div>
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>

View File

@@ -0,0 +1,341 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports System.Xml
Imports System.Linq
Partial Class General_ColectivasDetalle
Inherits ClsPaginas
'Configuración
#Region "P R O P I E D A D E S"
Private Property DtCuentasContables As Data.DataTable
Get
Return CType(ViewState("DtCuentasContables"), DataTable)
End Get
Set(value As Data.DataTable)
ViewState("DtCuentasContables") = value
End Set
End Property
Private ReadOnly Property CveColectiva As Integer
Get
Return ViewState("CveColectiva").ToString.ToEntero
End Get
End Property
Private Property DTCuentasBancos As DataTable
Get
Return CType(ViewState("DTCuentasBancos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTCuentasBancos") = value
End Set
End Property
Private Property TempDTCuentasBancos As DataTable
Get
Return CType(ViewState("TempDTCuentasBancos"), DataTable)
End Get
Set(value As DataTable)
ViewState("TempDTCuentasBancos") = value
End Set
End Property
#End Region
Private Sub CargaCuentasContables()
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
If ObjContabilidad.GetCuentas(-1, "-1", -1) Then
DtCuentasContables = ObjContabilidad.DtResultados
DdlCtaContColectivas.DataSource = ObjContabilidad.DtResultados
DdlCtaContColectivas.DataBind()
Else
DtCuentasContables = Nothing
End If
ObjContabilidad.Dispose()
End Sub
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
If UsuarioActual.Empresa.UsaContabilidad Then CargaCuentasContables()
If Request("CveColectiva") IsNot Nothing AndAlso IsNumeric(Request("CveColectiva")) AndAlso Request("CveColectiva").ToEntero > 0 Then
ViewState("CveColectiva") = Request("CveColectiva")
CargarDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Colectiva:"
Else
'Configuración de Modalidad Insertf
LblFechaCaptura.Text = Now.ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
ViewState("CveColectiva") = -1
End If
CargaCuentasBancarias()
End If
End Sub
Private Sub CargarDatos()
Dim ObjColectivasDetalle As New ClsGenerales
If ObjColectivasDetalle.GetColectivas(CveColectiva, "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
If ObjColectivasDetalle.DtResultados.Rows.Count > 0 Then
TxtColectiva.Text = ObjColectivasDetalle.Colectiva
TxtCodigo.Text = ObjColectivasDetalle.Codigo
TxtRFC.Text = ObjColectivasDetalle.RFC
TxtDireccion.Text = ObjColectivasDetalle.Direccion
TxtTelefono.Text = ObjColectivasDetalle.Telefono
TxtCorreo.Text = ObjColectivasDetalle.Correo
DdlTipo.SelectedValue = ObjColectivasDetalle.Tipo.ToString
DdlCtaContColectivas.SelectedValue = ObjColectivasDetalle.IdCtaContable.ToString
ChkEstado.Checked = ObjColectivasDetalle.Estatus
LblFechaCaptura.Text = ObjColectivasDetalle.FechaIng.ToString
LblUsuarioCapturo.Text = ObjColectivasDetalle.Usuario
End If
End If
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim ObjColectivasDetalle As New ClsGenerales
Dim ObjCuentasDeposito As New ClsGenerales(ObjColectivasDetalle.IniciaTransacSQL())
Dim ErrorBancos = False
If CveColectiva = -1 Then
If ObjColectivasDetalle.AddColectivas(TxtColectiva.Text.Trim, TxtCodigo.Text.Trim, TxtRFC.Text.Trim, TxtDireccion.Text.Trim, TxtTelefono.Text.Trim, TxtCorreo.Text.Trim, DdlCtaContColectivas.SelectedValue.ToEntero, DdlCtaContColectivas.SelectedItem.ToString, DdlTipo.SelectedValue.ToEntero.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Dim NuevoCveColectiva = ObjColectivasDetalle.CveColectiva
''Agregar Cuentas Bancarias
If TempDTCuentasBancos.Rows.Count > 0 Then
For Each row As DataRow In TempDTCuentasBancos.Rows
If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString, row("Plaza").ToString, row("Sucursal").ToString, row("Cuenta").ToString, row("CLABE").ToString, row("CIE").ToString, row("SWIFT").ToString, row("Referencia").ToString, "", UsuarioActual.CveUsuario, 1, CveColectiva:=NuevoCveColectiva) Then
ErrorBancos = True
End If
Next
End If
If ObjColectivasDetalle.GetColectivas(CveColectiva, "-1", "-1", "-1", -1) Then
GlobalDTGralColectivas(-1) = ObjColectivasDetalle.DtResultados
Else
ErrorBancos = True
End If
If ErrorBancos Then
ObjColectivasDetalle.RollBack()
Alert("Ocurrió un error al registrar las Cuentas Bancarias", TipoMensaje.MsgError)
Else
ObjColectivasDetalle.Commit()
Alert("Se guardó correctamente.", TipoMensaje.MsgInformacion, If(Request("CveFactura") Is Nothing, "document.location.href=""/General/Colectivas.aspx""", "window.opener.location.href = window.opener.location.href; window.close();"))
End If
Alert("El Registro se guardó correctamente.", TipoMensaje.MsgInformacion, If(Request("CveColectiva") Is Nothing, "document.location.href=""/General/Colectivas.aspx""", "window.opener.location.href = window.opener.location.href; window.close();"))
End If
Else
If ObjColectivasDetalle.UpdateColectivas(TxtColectiva.Text.Trim, TxtCodigo.Text.Trim, TxtRFC.Text.Trim, TxtDireccion.Text.Trim, TxtTelefono.Text.Trim, TxtCorreo.Text.Trim, DdlCtaContColectivas.SelectedValue.ToEntero, DdlCtaContColectivas.SelectedItem.ToString, DdlTipo.SelectedValue.ToEntero.ToString, ChkEstado.Checked, CveColectiva) Then
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/General/Colectivas.aspx""")
End If
End If
ObjColectivasDetalle.Dispose()
ObjCuentasDeposito.Dispose()
End Sub
#Region "TAB BANCOS"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Tipo As Integer = 1
Dim Orden As String = ""
Dim Campo As String = ""
Dim gvi As Integer = 0
Dim ImgButon As ImageButton = Nothing
Const OrdenInicial As String = ""
Select Case sender.GetType().Name
Case "LinkButton"
Tipo = 1
Campo = CType(sender, LinkButton).CommandArgument().ToString
ImgButon = CType(CType(sender, LinkButton).BindingContainer.FindControl("Img" & Campo.Replace(",", "_")), ImageButton)
Case "ImageButton"
Tipo = 2
ImgButon = CType(sender, ImageButton)
Campo = CType(sender, ImageButton).CommandArgument().ToString
End Select
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
RegistraScript(String.Format("$get('{0}').src='{1}'", ImgButon.ClientID, "/Imagenes/FlechasArriba.gif"))
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
RegistraScript(String.Format("$get({0}).src='{1}'", ImgButon.ClientID, "/Imagenes/FlechasAbajo.gif"))
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("OrdenCuentasBancos") = Orden
CargaGridCuentasBancos(Orden)
End Sub
Protected Sub LbAgregarCuentaBanco_Click(sender As Object, e As EventArgs)
AgregarCuentaBanco(TxtNombreBanco.Text.Trim, TxtNumeroSucursal.Text.Trim, TxtCLABE.Text.Trim, TxtSWIFT.Text.Trim, TxtPlaza.Text.Trim, TxtNumeroCuenta.Text.Trim, TxtConvenioCIE.Text.Trim, TxtReferencia.Text.Trim)
End Sub
Private Sub CargaGridCuentasBancos(Orden As String)
If CveColectiva > 0 Then
If Orden <> String.Empty Then
Dim DV As New DataView(DTCuentasBancos, "", Orden, DataViewRowState.CurrentRows)
GvBancosCuentas.DataSource = DV.ToTable()
DV.Dispose()
Else
GvBancosCuentas.DataSource = DTCuentasBancos
End If
Else
If Orden <> String.Empty Then
Dim DV As New DataView(TempDTCuentasBancos, "", Orden, DataViewRowState.CurrentRows)
GvBancosCuentas.DataSource = DV.ToTable()
DV.Dispose()
Else
GvBancosCuentas.DataSource = TempDTCuentasBancos
End If
End If
GvBancosCuentas.DataBind()
UpCuentasBancos.Update()
End Sub
Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String)
Dim ObjCuentasBancos As New ClsGenerales
Dim Row As DataRow
If CveColectiva > 0 Then
If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", UsuarioActual.CveUsuario, 1, CveColectiva:=CveColectiva) Then
DTCuentasBancos.Clear()
DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveColectiva = {0}", CveColectiva)))
Alert("Cuenta Bancaria agregada con éxito.", TipoMensaje.MsgInformacion)
End If
Else
Row = TempDTCuentasBancos.NewRow
Row("BancoNombre") = NombreBanco
Row("Sucursal") = NumeroSucursal
Row("CLABE") = CLABE
Row("SWIFT") = SWIFT
Row("Plaza") = Plaza
Row("Cuenta") = NumeroCuenta
Row("CIE") = ConvenioCIE
Row("Referencia") = Referencia
TempDTCuentasBancos.Rows.Add(Row)
End If
ObjCuentasBancos.Dispose()
LimpiaCuentasBancarias()
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
End Sub
Private Sub LimpiaCuentasBancarias()
TxtNombreBanco.Text = ""
TxtNumeroSucursal.Text = ""
TxtCLABE.Text = ""
TxtSWIFT.Text = ""
TxtPlaza.Text = ""
TxtNumeroCuenta.Text = ""
TxtConvenioCIE.Text = ""
TxtReferencia.Text = ""
End Sub
Private Sub CargaCuentasBancarias()
Dim ObjCuentasBancos As New ClsGenerales
ViewState("OrdenCuentasBancos") = ""
DTCuentasBancos = New DataTable
TempDTCuentasBancos = New DataTable
If ObjCuentasBancos.GetCuentasDepositos(CveColectiva:=CveColectiva) Then
DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados)
Else
Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgAdvertencia)
End If
If CveColectiva < 0 Then
TempDTCuentasBancos = DTCuentasBancos.Clone
End If
ObjCuentasBancos.Dispose()
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
End Sub
#Region "GRIDVIEW - CUENTAS BANCARIAS"
Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If CveColectiva < 0 Then
For index = 1 To TempDTCuentasBancos.Rows.Count
TempDTCuentasBancos.Rows(index - 1)("CveCuentaDeposito") = index
Next
TempDTCuentasBancos.AcceptChanges()
End If
End If
End Sub
Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing
GvBancosCuentas.EditIndex = e.NewEditIndex
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
End Sub
Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit
GvBancosCuentas.EditIndex = -1
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
End Sub
Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating
Dim NombreBanco = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim
Dim NumeroSucursal = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroSucursal").Text.Trim
Dim CLABE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtCLABE").Text.Trim
Dim SWIFT = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtSWIFT").Text.Trim
Dim Plaza = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtPlaza").Text.Trim
Dim NumeroCuenta = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim
Dim ConvenioCIE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim
Dim Referencia = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim
Dim ObjCuentasBancos As New ClsGenerales
If CveColectiva > 0 Then
If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString.ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", False, True, 1) Then
DTCuentasBancos.Clear()
DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveColectiva = {0}", CveColectiva)))
Alert("Cuenta actualizada con éxito.", TipoMensaje.MsgInformacion)
End If
Else
Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1
Dim Row As DataRow = TempDTCuentasBancos.Rows(index)
Row("BancoNombre") = NombreBanco
Row("Sucursal") = NumeroSucursal
Row("CLABE") = CLABE
Row("SWIFT") = SWIFT
Row("Plaza") = Plaza
Row("Cuenta") = NumeroCuenta
Row("CIE") = ConvenioCIE
Row("Referencia") = Referencia
TempDTCuentasBancos.AcceptChanges()
End If
GvBancosCuentas.EditIndex = -1
ObjCuentasBancos.Dispose()
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
End Sub
Protected Sub GvBancosCuentas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvBancosCuentas.RowDeleting
Dim ObjCuentasBancos As New ClsGenerales
If CveColectiva > 0 Then
If ObjCuentasBancos.RemoveCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString.ToEntero) Then
DTCuentasBancos.Clear()
DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveColectiva = {0}", CveColectiva)))
Alert("Cuenta Bancaria borrada con éxito.", TipoMensaje.MsgInformacion)
End If
Else
Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1
TempDTCuentasBancos.Rows.RemoveAt(index)
End If
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
ObjCuentasBancos.Dispose()
End Sub
#End Region
#End Region
End Class

773
General/Encuestas.aspx Normal file
View File

@@ -0,0 +1,773 @@
<%@ Page EnableEventValidation="false" Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Encuestas.aspx.vb" Inherits="General_Encuestas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style type="text/css">
.nav-pills.nav-wizard > li {
position: relative;
overflow: visible;
border-right: 15px solid transparent !important;
border-left: 15px solid transparent !important;
}
.nav-pills.nav-wizard > li + li {
margin-left: 0;
}
.nav-pills.nav-wizard > li:first-child {
border-left: 0 !important;
}
.nav-pills.nav-wizard > li:first-child a {
border-radius: 5px 0 0 5px !important;
}
.nav-pills.nav-wizard > li:last-child {
border-right: 0 !important;
}
.nav-pills.nav-wizard > li:last-child a {
border-radius: 0 5px 5px 0 !important;
}
.nav-pills.nav-wizard > li a {
border-radius: 0;
background-color: #eee;
}
.nav-pills.nav-wizard > li .nav-arrow {
position: absolute;
top: 0px;
right: -20px;
width: 0px;
height: 0px;
border-style: solid;
border-width: 20px 0 20px 20px;
border-color: transparent transparent transparent #eee;
z-index: 0;
}
.nav-pills.nav-wizard > li .nav-wedge {
position: absolute;
top: 0px;
left: -20px;
width: 0px;
height: 0px;
border-style: solid;
border-width: 20px 0 20px 20px;
border-color: #eee #eee #eee transparent;
z-index: 0;
}
.nav-pills.nav-wizard > li:hover .nav-arrow {
border-color: transparent transparent transparent #aaa;
}
.nav-pills.nav-wizard > li:hover .nav-wedge {
border-color: #aaa #aaa #aaa transparent;
}
.nav-pills.nav-wizard > li:hover a {
background-color: #aaa;
color: #fff;
}
.nav-pills.nav-wizard > li.active .nav-arrow {
border-color: transparent transparent transparent #428bca;
}
.nav-pills.nav-wizard > li.active .nav-wedge {
border-color: #428bca #428bca #428bca transparent;
}
.nav-pills.nav-wizard > li.active a {
background-color: #428bca !important;
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<%-- <li>
<asp:LinkButton ID="HLAgregarEncuesta" runat="server"><i class="fa fa-plus"></i> Agregar Encuesta</asp:LinkButton>
</li>--%>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="portlet light" id="form_wizard_1">
<div class="caption">
<i class=" icon-layers font-red"></i>
<span class="caption-subject font-red bold uppercase">Encuestas -
<span class="step-title">Paso 1 de 5 </span>
</span>
</div>
<div class="portlet-body form">
<form class="form-horizontal" action="#" id="submit_form">
<div class="form-wizard">
<div class="form-body" style="padding: 0px;">
<ul class="nav nav-pills nav-justified steps" style="padding: 0px;">
<li class="active">
<a href="#tab1" data-toggle="tab" class="step">
<span class="number">1 </span>
<span class="desc">
<i class="fa fa-check"></i>Campaña </span>
</a>
</li>
<li>
<a href="#tab2" data-toggle="tab" class="step">
<span class="number">2 </span>
<span class="desc">
<i class="fa fa-check"></i>Tipo Encuesta </span>
</a>
</li>
<li>
<a href="#tab3" data-toggle="tab" class="step active">
<span class="number">3 </span>
<span class="desc">
<i class="fa fa-check"></i>Realizar Encuesta </span>
</a>
</li>
<li>
<a href="#tab4" data-toggle="tab" class="step">
<span class="number">4 </span>
<span class="desc">
<i class="fa fa-check"></i>Agregar Preguntas </span>
</a>
</li>
<li>
<a href="#tab5" data-toggle="tab" class="step">
<span class="number">5 </span>
<span class="desc">
<i class="fa fa-check"></i>Finalizar Encuesta </span>
</a>
</li>
</ul>
<div id="bar" class="progress progress-striped active" role="progressbar" style="margin-bottom: 5px;">
<div class="progress-bar progress-bar-success"></div>
</div>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<asp:UpdatePanel runat="server" ID="UpCampañas" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet smmallpadding light bordered" id="Div2" runat="server">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Campañas</span>
</div>
<div class="actions">
<div class="btn-group">
<a runat="server" id="BtnAgregarCampaña" data-toggle="tooltip" data-placement="bottom" style="margin-left: 10px;" title="Agregar" class="btn btn-circle btn-default"><i class="fa fa-plus"></i></a>
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView runat="server" ID="GvCampañas" GridLines="None" ShowHeader="true" AutoGenerateColumns="false" DataKeyNames="CveCampana, Campana" CssClass="table table-striped table-hover Widthall">
<Columns>
<asp:BoundField DataField="Campana" HeaderText="Campaña" ItemStyle-Width="450px" />
<asp:BoundField DataField="Observaciones" HeaderText="Observaciones" />
<asp:TemplateField ItemStyle-HorizontalAlign="right">
<ItemTemplate>
<asp:LinkButton ID="imgD" 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="¿Desea Elminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="tab-pane" id="tab2">
<asp:UpdatePanel runat="server" ID="UpTipoEncuesta" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet smmallpadding light bordered" id="Div1" runat="server">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Tipo Encuesta</span>
</div>
<div class="actions">
<div class="btn-group">
<a runat="server" id="BtnAgregarTipo" data-toggle="tooltip" data-placement="bottom" style="margin-left: 10px;" title="Agregar" class="btn btn-circle btn-default"><i class="fa fa-plus"></i></a>
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView runat="server" ID="GvTipoEncuesta" DataKeyNames="CveTipoEncuesta, TipoEncuesta" GridLines="None" AutoGenerateColumns="false" CssClass="table table-striped table-hover Widthall">
<Columns>
<asp:BoundField DataField="TipoEncuesta" HeaderText="Tipo Encuesta" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="imgD" 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="¿Desea Elminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="tab-pane" id="tab3">
<asp:UpdatePanel runat="server" ID="UpEncuestas" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet smmallpadding light bordered" id="Div3" runat="server">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Encuesta</span>
</div>
<div class="actions">
<div class="btn-group">
<a runat="server" id="BtnAgregarEncuesta" data-toggle="tooltip" data-placement="bottom" style="margin-left: 10px;" title="Agregar" class="btn btn-circle btn-default"><i class="fa fa-plus"></i></a>
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView runat="server" ID="GvEncuesta" DataKeyNames="CveEncuesta" GridLines="None" AutoGenerateColumns="false" CssClass="table table-striped table-hover Widthall">
<Columns>
<asp:BoundField DataField="NombreEncuesta" HeaderText="Nombre Encuesta" />
<asp:BoundField DataField="Campana" HeaderText="Campaña" />
<asp:BoundField DataField="TipoEncuesta" HeaderText="Tipo Encuesta" />
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Observacion" HeaderText="Observacion" />
<asp:BoundField DataField="Nombre" HeaderText="Usuario" />
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="imgD" 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="¿Desea Elminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="tab-pane" id="tab4">
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel runat="server" ID="UpEstructura" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet smmallpadding light bordered" id="Div7" runat="server">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Temas, Preguntas y Respuestas</span>
</div>
<div class="actions">
<div class="btn-group">
<a runat="server" id="BtnFiltrar" data-toggle="tooltip" data-placement="bottom" style="margin-left: 10px;" title="Filtrar" class="btn btn-circle btn-sm green"><i class="fa fa-search"></i> Filtrar por Encuesta</a>
</div>
<div class="btn-group">
<a runat="server" id="BtnAgregarTema" data-toggle="tooltip" data-placement="bottom" style="margin-left: 10px;" title="Agregar" class="btn btn-circle btn-sm blue"><i class="fa fa-plus"></i> Agregar Tema</a>
</div>
</div>
<div class="tools">
<a href="javascript:;" class="expand"></a>
</div>
</div>
<div class="portlet-body form">
<asp:GridView runat="server" ID="GvEstructura" DataKeyNames="Tipo, CveTema, CvePregunta, CveRespuesta, Respuesta, Pregunta, Tema" GridLines="None" AutoGenerateColumns="false" CssClass="table table-hover Widthall">
<Columns>
<asp:TemplateField HeaderText="Tema">
<ItemTemplate>
<asp:Literal ID="LtlTema" Visible="false" runat="server" Text='<%# Eval("Tema")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Pregunta">
<ItemTemplate>
<asp:Literal ID="LtlPregunta" Visible="False" runat="server" Text='<%# Eval("Pregunta")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Respuesta">
<ItemTemplate>
<asp:Literal ID="LtlRespuesta" Visible="false" runat="server" Text='<%# Eval("Respuesta")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="40px">
<ItemTemplate>
<asp:LinkButton ID="ImgA" Visible="false" runat="server" AlternateText="Agregar" OnClick="AddEstructura" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-plus'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="40px">
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="UpdateEstructura" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="40px">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick= "EliminarEstructura" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Estas seguro que desea eliminar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="tab-pane" id="tab5">
</div>
</div>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-12">
<a href="#" id="globalprevious" style="float: left" class="btn default button-previous">
<i class="fa fa-angle-left"></i>Back </a>
<a id="globalnext" style="float: right" class="btn btn-outline green button-next">Continue
<i class="fa fa-angle-right"></i>
</a>
<a style="display: none; float: right" class="btn green button-submit">Guardar <i class='fa fa-check'></i>
</a>
</div>
</div>
</div>
</form>
</div>
</div>
<%-- M O D A L E S --%>
<div id="ModalCampaña" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalCampaña" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModal" runat="server">Agregar Campaña</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCampaña" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCampaña" runat="server" ControlToValidate="TxtCampaña" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Campaña''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarRegistro"></asp:RequiredFieldValidator>
<label for="<%= TxtCampaña.ClientID.ToString()%>">Campaña:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtObservaciones" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtObservaciones.ClientID.ToString()%>">Observaciones:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarCampaña" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpGuardarRegistro" />
<button id="BtnCancelarCampaña" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HdnModalidadCampaña" runat="server" Value="T" ClientIDMode="Static" />
<asp:HiddenField ID="HdnIDCampaña" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalTipoEncuesta" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTipoEncuesta" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal1" runat="server">Agregar Tipo de Encuesta</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTipo" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTipo" runat="server" ControlToValidate="TxtTipo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTipoEncuesta"></asp:RequiredFieldValidator>
<label for="<%= TxtTipo.ClientID.ToString()%>">Tipo Encuesta:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarTipoEncuesta" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTipoEncuesta" />
<button id="BtnCancelarTipoEncuesa" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HFTipoEncuesta" runat="server" Value="I" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalTema" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTema" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal2" runat="server">Agregar Tema</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEncuestaTema" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="NombreEncuesta" DataValueField="CveEncuesta" Width="240px" ValidationGroup="GrpTema"></asp:DropDownList>
<label for="<%= DdlEncuestaTema.ClientID.ToString()%>">Encuesta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtTema" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTema" runat="server" ControlToValidate="TxtTema" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tema''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTema"></asp:RequiredFieldValidator>
<label for="<%= TxtTema.ClientID.ToString()%>">Tema:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarTema" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTema" />
<button id="LbCancelarTema" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HiddenField1" runat="server" Value="I" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalPreguntas" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalPreguntas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal3" runat="server">Agregar Pregunta</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTemaPregunta" CssClass="form-control input-sm select2me js-cuenta-programmatic" enabled="false" runat="server" AppendDataBoundItems="true" DataTextField="Tema" DataValueField="CveTema" Width="240px" ValidationGroup="GrpPregunta"></asp:DropDownList>
<label for="<%= DdlTemaPregunta.ClientID.ToString()%>">Tema Pregunta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoPregunta" CssClass="form-control input-sm select2me js-movimiento-programmatic" runat="server" AppendDataBoundItems="true" Width="240px" ValidationGroup="GrpPregunta">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Respuesta Abierta" Value="1"></asp:ListItem>
<asp:ListItem Text="Opción Múltiple" Value="2"></asp:ListItem>
<asp:ListItem Text="Lista de Selección" Value="3"></asp:ListItem>
<asp:ListItem Text="Si/No" Value="4"></asp:ListItem>
</asp:DropDownList>
<label for="<%= DdlTipoPregunta.ClientID.ToString()%>">Tipo Pregunta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPregunta" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPregunta" runat="server" ControlToValidate="TxtPregunta" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPregunta"></asp:RequiredFieldValidator>
<label for="<%= TxtPregunta.ClientID.ToString()%>">Pregunta:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarPregunta" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpPregunta" />
<button id="LbCancelarPregunta" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HiddenField2" runat="server" Value="I" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalRespuestas" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalRespuestas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal4" runat="server">Responder una Pregunta</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPregunta" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" enabled="false" AppendDataBoundItems="true" DataTextField="Pregunta" DataValueField="CvePregunta" Width="240px" ValidationGroup="GrpRespuesta"></asp:DropDownList>
<label for="<%= DdlPregunta.ClientID.ToString()%>">Pregunta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRespuesta" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRespuesta" runat="server" ControlToValidate="TxtRespuesta" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Respuesta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRespuesta"></asp:RequiredFieldValidator>
<label for="<%= TxtRespuesta.ClientID.ToString()%>">Respuesta:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarRespuesta" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpRespuesta" />
<button id="LbCancelarRespuesta" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalEncuestas" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalEncuestas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal5" runat="server">Agregar una Encuesta</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlCampana" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="Campana" DataValueField="CveCampana" Width="240px" ValidationGroup="GrpEncuesta"></asp:DropDownList>
<label for="<%= DdlCampana.ClientID.ToString()%>">Campaña:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoEncuesta" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="TipoEncuesta" DataValueField="CveTipoEncuesta" Width="240px" ValidationGroup="GrpEncuesta"></asp:DropDownList>
<label for="<%= DdlTipoEncuesta.ClientID.ToString()%>">Tipo Encuesta:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEncuesta" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEncuesta" runat="server" ControlToValidate="TxtEncuesta" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre Encuesta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEncuesta"></asp:RequiredFieldValidator>
<label for="<%= TxtEncuesta.ClientID.ToString()%>">Nombre Encuesta:</label>
</div>
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="position: relative;">
<asp:TextBox ID="TxtFecha" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEncuesta"></asp:RequiredFieldValidator>
<label for="<%= TxtFecha.ClientID.ToString()%>">Fecha:</label>
<span class="input-group-btn " style="position: absolute; right: 41px; top: 0px;">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFecha" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtObservacionesEncuesta" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtObservacionesEncuesta.ClientID.ToString()%>">Observaciones:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="LbAgregarEncuesta" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpEncuesta" />
<button id="LbCancelarModal" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HiddenField4" runat="server" Value="I" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="ModalFiltroEncuestas" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpFiltroEncuestas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlFiltroEncuestas" runat="server">Filtrar Encuestas</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlFiltroEncuestas" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="NombreEncuesta" DataValueField="CveEncuesta" Width="240px" ValidationGroup="GrpFiltro"></asp:DropDownList>
<label for="<%= DdlFiltroEncuestas.ClientID.ToString()%>">Encuesta:</label>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnFiltrarEncuestas" runat="server" class="btn btn-success" Text="Filtrar" ValidationGroup="GrpFiltro" />
<button id="Button2" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<asp:UpdatePanel ID="UpHdn" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField ID="HdnModalidad" runat="server" Value="I" ClientIDMode="Static" />
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="../Metronic/assets/global/plugins/bootstrap-wizard/jquery.bootstrap.wizard.js"></script>
<script>
var handleTitle = function (tab, navigation, index) {
var total = navigation.find('li').length;
var current = index + 1;
// set wizard title
$('.step-title', $('#form_wizard_1')).text('Paso ' + (index + 1) + ' de ' + total);
// set done steps
jQuery('li', $('#form_wizard_1')).removeClass("done");
var li_list = navigation.find('li');
for (var i = 0; i < index; i++) {
jQuery(li_list[i]).addClass("done");
}
if (current == 1) {
$('#form_wizard_1').find('.button-previous').hide();
$('#globalnext').html("Continuar <i class='fa fa-angle-right'></i>")
} else {
$('#form_wizard_1').find('.button-previous').show();
}
if (current == 2) {
$('#globalprevious').html("<i class='fa fa-angle-left'></i> Regresar ")
$('#globalnext').html("Continuar <i class='fa fa-angle-right'></i>")
}
if (current == 3) {
$('#globalprevious').html("<i class='fa fa-angle-left'></i> Regresar ")
$('#globalnext').html("Continuar <i class='fa fa-angle-right'></i>")
}
if (current >= total) {
$('#globalprevious').html("<i class='fa fa-angle-left'></i> Regresar ")
$('#form_wizard_1').find('.button-next').hide();
// $('#form_wizard_1').find('.button-submit').show();
} else {
$('#form_wizard_1').find('.button-next').show();
$('#form_wizard_1').find('.button-submit').hide();
}
Metronic.scrollTo($('.page-title'));
}
// default form wizard
$(document).ready(function () {
$('#form_wizard_1').bootstrapWizard({
'nextSelector': '.button-next',
'previousSelector': '.button-previous',
onTabClick: function (tab, navigation, index, clickedIndex) {
return false;
/*
success.hide();
error.hide();
if (form.valid() == false) {
return false;
}
handleTitle(tab, navigation, clickedIndex);
*/
},
onNext: function (tab, navigation, index) {
//success.hide();
//error.hide();
handleTitle(tab, navigation, index);
},
onPrevious: function (tab, navigation, index) {
//success.hide();
//error.hide();
handleTitle(tab, navigation, index);
$("#Giro").click()
},
onTabShow: function (tab, navigation, index) {
var total = navigation.find('li').length;
var current = index + 1;
var $percent = (current / total) * 100;
//$('#button-submit').css("display", "none")
handleTitle(tab, navigation, index);
$('#form_wizard_1').find('.progress-bar').css({
width: $percent + '%'
});
}
});
}) </script>
</asp:Content>

499
General/Encuestas.aspx.vb Normal file
View File

@@ -0,0 +1,499 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class General_Encuestas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
InicializaValores()
End If
End Sub
Private Sub InicializaValores()
CargaGridCampañas()
CargaGridTiposEncuestas()
CargaDdlTemaPregunta()
CargaGridEncuestas()
CargaEstructura()
End Sub
#Region " C A M P A Ñ A "
Private Sub CargaGridCampañas()
Dim Objeto As New ClsGralEncuestas
If Objeto.GetCampañas(-1, -1, UsuarioActual.CveEmpresa) Then
GvCampañas.DataSource = Objeto.DtResultados
GvCampañas.DataBind()
UpCampañas.Update()
End If
Objeto.Dispose()
End Sub
Private Sub BtnAgregarCampaña_Click(sender As Object, e As EventArgs) Handles BtnAgregarCampaña.ServerClick
TxtCampaña.Text = ""
TxtObservaciones.Text = ""
UpModalCampaña.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalCampaña"))
End Sub
Private Sub LbAgregarCampaña_Click(sender As Object, e As EventArgs) Handles LbAgregarCampaña.Click
Dim Objeto As New ClsGralEncuestas
If Objeto.AddCampañas(TxtCampaña.Text, TxtObservaciones.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargaGridCampañas()
Alert("Se agregó correctamente la Campaña.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalCampaña")
End If
Objeto.Dispose()
End Sub
Protected Sub GvCampañas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvCampañas.RowDeleting
Dim Objeto As New ClsGralEncuestas
If Objeto.RemoveCampañas(GvCampañas.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
CargaGridCampañas()
Alert("La Campaña se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
End Sub
#End Region
#Region " T i p o E n c u e s t a s"
Private Sub CargaGridTiposEncuestas()
Dim Objeto As New ClsGralEncuestas
If Objeto.GetTiposEncuestas(-1, -1, UsuarioActual.CveEmpresa) Then
GvTipoEncuesta.DataSource = Objeto.DtResultados
GvTipoEncuesta.DataBind()
UpTipoEncuesta.Update()
End If
Objeto.Dispose()
End Sub
Private Sub BtnAgregarTipo_Click(sender As Object, e As EventArgs) Handles BtnAgregarTipo.ServerClick
TxtTipo.Text = ""
UpModalTipoEncuesta.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalTipoEncuesta"))
End Sub
Private Sub LbAgregarTipoEncuesta_Click(sender As Object, e As EventArgs) Handles LbAgregarTipoEncuesta.Click
Dim Objeto As New ClsGralEncuestas
If Objeto.AddTiposEncuestas(TxtTipo.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargaGridTiposEncuestas()
Alert("Se agregó correctamente el Tipo de Encuesta.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalTipoEncuesta")
End If
Objeto.Dispose()
End Sub
Protected Sub GvTipoEncuesta_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvTipoEncuesta.RowDeleting
Dim Objeto As New ClsGralEncuestas
If Objeto.RemoveTiposEncuestas(GvTipoEncuesta.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
CargaGridTiposEncuestas()
Alert("El Tipo de Encuesta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
End Sub
#End Region
#Region " T e m a E n c u e s t a s"
Private Sub CargaDdlTemaPregunta()
Dim Objeto As New ClsGralEncuestas
If Objeto.GetTemasEncuestas(-1, -1, UsuarioActual.CveEmpresa) Then
DdlTemaPregunta.Items.Clear()
DdlTemaPregunta.DataSource = Objeto.DtResultados
DdlTemaPregunta.DataBind()
DdlTemaPregunta.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpModalPreguntas.Update()
End If
Objeto.Dispose()
End Sub
Private Sub BtnAgregarTema_Click(sender As Object, e As EventArgs) Handles BtnAgregarTema.ServerClick
HdnModalidad.Value = "I"
HdnID.Value = "-1"
TxtTema.Text = ""
UpHdn.Update()
UpModalTema.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalTema"))
End Sub
Private Sub ActualizaTema(GvRow As GridViewRow)
HdnModalidad.Value = "U"
HdnID.Value = GvRow.DataKey("CveTema")
CargaPreguntasEnModal()
TxtTema.Text = GvRow.DataKey("Tema")
UpHdn.Update()
UpModalTema.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalTema"))
End Sub
Private Sub LbAgregarTema_Click(sender As Object, e As EventArgs) Handles LbAgregarTema.Click
Dim Objeto As New ClsGralEncuestas
If HdnModalidad.Value = "I" Then
If Objeto.AddTemasEncuestas(TxtTema.Text, DdlEncuestaTema.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargaDdlTemaPregunta()
Alert("Se agregó correctamente el Tema de Encuesta.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalTema")
CargaEstructura()
End If
Else
If HdnID.Value.ToEntero <> -1 Then
If Objeto.UpdateTemasEncuestas(HdnID.Value.ToEntero, TxtTema.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
CargaDdlTemaPregunta()
Alert("Se actualizó correctamente el Tema de Encuesta.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalTema")
CargaEstructura()
End If
End If
End If
Objeto.Dispose()
End Sub
Protected Sub EliminarTema(GvRow As GridViewRow)
Dim Objeto As New ClsGralEncuestas
If Objeto.RemoveTemasEncuestas(GvRow.DataKey("CveTema").ToEntero) Then
CargaEstructura()
Alert("El Tema se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
End Sub
#End Region
#Region " P r e g u n t a s "
Private Sub AgregaPregunta(GvRow As GridViewRow)
HdnModalidad.Value = "I"
HdnID.Value = "-1"
TxtPregunta.Text = ""
DdlTemaPregunta.SelectedValue = GvRow.DataKey("CveTema")
DdlTipoPregunta.SelectedIndex = 0
UpModalPreguntas.Update()
UpHdn.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalPreguntas"))
End Sub
Private Sub ActualizaPregunta(GvRow As GridViewRow)
HdnModalidad.Value = "U"
HdnID.Value = GvRow.DataKey("CvePregunta")
TxtPregunta.Text = GvRow.DataKey("Pregunta")
DdlTemaPregunta.SelectedValue = GvRow.DataKey("CveTema")
DdlTipoPregunta.SelectedIndex = 0
UpModalPreguntas.Update()
UpHdn.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalPreguntas"))
End Sub
Private Sub LbAgregarPregunta_Click(sender As Object, e As EventArgs) Handles LbAgregarPregunta.Click
Dim Objeto As New ClsGralEncuestas
If HdnModalidad.Value = "I" Then
If Objeto.AddPreguntas(TxtPregunta.Text, DdlTipoPregunta.SelectedValue.ToEntero, DdlTemaPregunta.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("La Pregunta se agregó correctamente.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalPreguntas")
CargaEstructura()
End If
Else
If HdnID.Value.ToEntero <> -1 Then
If Objeto.UpdatePreguntas(HdnID.Value.ToEntero, TxtPregunta.Text, DdlTipoPregunta.SelectedValue.ToEntero, DdlTemaPregunta.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("La Pregunta se actualizó correctamente.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalPreguntas")
CargaEstructura()
End If
End If
End If
Objeto.Dispose()
End Sub
Protected Sub EliminarPregunta(GvRow As GridViewRow)
Dim Objeto As New ClsGralEncuestas
If Objeto.RemovePreguntas(GvRow.DataKey("CvePregunta").ToEntero) Then
CargaEstructura()
Alert("La Pregunta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
End Sub
#End Region
#Region " R E S P U E S T A S "
Private Sub CargaPreguntasEnModal()
Dim Objeto As New ClsGralEncuestas
If Objeto.GetPreguntas(-1, -1, -1, UsuarioActual.CveEmpresa) Then
DdlPregunta.DataSource = Objeto.DtResultados
DdlPregunta.Items.Clear()
DdlPregunta.Items.Insert(0, New ListItem("Seleccione (Todos)", "-1"))
DdlPregunta.DataBind()
UpModalRespuestas.Update()
End If
Objeto.Dispose()
End Sub
Private Sub AgregaRespuestas(GvRow As GridViewRow)
HdnModalidad.Value = "I"
HdnID.Value = "-1"
CargaPreguntasEnModal()
DdlPregunta.SelectedValue = GvRow.DataKey("CvePregunta")
TxtRespuesta.Text = ""
UpHdn.Update()
UpModalRespuestas.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalRespuestas"))
End Sub
Private Sub ActualizaRespuestas(GvRow As GridViewRow)
HdnModalidad.Value = "U"
HdnID.Value = GvRow.DataKey("CveRespuesta")
CargaPreguntasEnModal()
DdlPregunta.SelectedValue = GvRow.DataKey("CvePregunta")
TxtRespuesta.Text = GvRow.DataKey("Respuesta")
UpHdn.Update()
UpModalRespuestas.Update()
RegistraScript(String.Format("$('#{0}').modal();", "ModalRespuestas"))
End Sub
Private Sub LbAgregarRespuesta_Click(sender As Object, e As EventArgs) Handles LbAgregarRespuesta.Click
Dim Objeto As New ClsGralEncuestas
If HdnModalidad.Value = "I" Then
If Objeto.AddRespuestas(TxtRespuesta.Text, DdlPregunta.SelectedValue.ToEntero) Then
Alert("La Respuesta se registró correctamente.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalRespuestas")
CargaEstructura()
End If
Else
If HdnID.Value.ToEntero <> -1 Then
If Objeto.UpdateRespuestas(HdnID.Value.ToEntero, TxtRespuesta.Text, DdlPregunta.SelectedValue.ToEntero) Then
Alert("La Respuesta se actualizó correctamente.", TipoMensaje.MsgInformacion)
OcultaDiv("ModalRespuestas")
CargaEstructura()
End If
End If
End If
Objeto.Dispose()
End Sub
Private Sub EliminarRespuesta(GvRow As GridViewRow)
Dim Objeto As New ClsGralEncuestas
If Objeto.RemoveRespuesta(GvRow.DataKey("CveRespuesta").ToEntero) Then
Alert("La respuesta se eliminó correctamente.", TipoMensaje.MsgInformacion)
CargaEstructura()
End If
Objeto.Dispose()
End Sub
#End Region
#Region " E N C U E S T A S "
Private Sub BtnAgregarEncuesta_Click(sender As Object, e As EventArgs) Handles BtnAgregarEncuesta.ServerClick
CargaModalEncuestas()
TxtFecha.Text = ""
TxtEncuesta.Text = ""
TxtObservacionesEncuesta.Text = ""
RegistraScript(String.Format("$('#{0}').modal();", "ModalEncuestas"))
End Sub
Private Sub BtnFiltrar_ServerClick(sender As Object, e As EventArgs) Handles BtnFiltrar.ServerClick
DdlFiltroEncuestas.SelectedIndex = 0
RegistraScript(String.Format("$('#{0}').modal();", "ModalFiltroEncuestas"))
End Sub
Private Sub BtnFiltrarEncuestas_Click(sender As Object, e As EventArgs) Handles BtnFiltrarEncuestas.Click
FiltraEstructura(DdlFiltroEncuestas.SelectedValue.ToEntero)
OcultaDiv("ModalFiltroEncuestas")
End Sub
Private Sub CargaModalEncuestas()
Dim Objeto As New ClsGralEncuestas
If Objeto.GetCampañas(-1, -1, UsuarioActual.CveEmpresa) Then
DdlCampana.DataSource = Objeto.DtResultados
DdlCampana.Items.Clear()
DdlCampana.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCampana.DataBind()
End If
If Objeto.GetTiposEncuestas(-1, -1, UsuarioActual.CveEmpresa) Then
DdlTipoEncuesta.DataSource = Objeto.DtResultados
DdlTipoEncuesta.Items.Clear()
DdlTipoEncuesta.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoEncuesta.DataBind()
End If
Objeto.Dispose()
UpModalEncuestas.Update()
End Sub
Private Sub LbAgregarEncuesta_Click(sender As Object, e As EventArgs) Handles LbAgregarEncuesta.Click
Dim Objeto As New ClsGralEncuestas
If Objeto.AddEncuesta(DdlCampana.SelectedValue.ToEntero, -1, TxtEncuesta.Text, TxtObservacionesEncuesta.Text, -1,
DdlTipoEncuesta.SelectedValue.ToEntero, True, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("La Encuesta se agregó correctamente.", TipoMensaje.MsgInformacion)
CargaGridEncuestas()
OcultaDiv("ModalEncuestas")
End If
Objeto.Dispose()
End Sub
Protected Sub GvEncuesta_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvEncuesta.RowDeleting
Dim Objeto As New ClsGralEncuestas
If Objeto.RemoveEncuestas(GvEncuesta.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
CargaGridEncuestas()
Alert("La Encuesta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
End Sub
Private Sub CargaGridEncuestas()
Dim Objeto As New ClsGralEncuestas
If Objeto.GetEncuestas(UsuarioActual.CveEmpresa) Then
GvEncuesta.DataSource = Objeto.DtResultados
DdlFiltroEncuestas.Items.Clear()
DdlEncuestaTema.Items.Clear()
DdlFiltroEncuestas.DataSource = Objeto.DtResultados
DdlEncuestaTema.DataSource = Objeto.DtResultados
DdlFiltroEncuestas.DataBind()
DdlEncuestaTema.DataBind()
GvEncuesta.DataBind()
End If
Objeto.Dispose()
UpEncuestas.Update()
UpModalTema.Update()
UpFiltroEncuestas.Update()
End Sub
#End Region
#Region " E S T R U C T U R A "
Private Sub CargaEstructura()
Dim Objeto As New ClsGralEncuestas
If Objeto.GetEstructura(-1, UsuarioActual.CveEmpresa) Then
GvEstructura.DataSource = Objeto.DtResultados
GvEstructura.DataBind()
UpEstructura.Update()
End If
Objeto.Dispose()
End Sub
Private Sub FiltraEstructura(CveEncuesta As Integer)
Dim Objeto As New ClsGralEncuestas
If Objeto.GetEstructura(CveEncuesta, UsuarioActual.CveEmpresa) Then
GvEstructura.DataSource = Objeto.DtResultados
GvEstructura.DataBind()
UpEstructura.Update()
End If
End Sub
Protected Sub GvEstructura_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvEstructura.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Tipo = e.Row.DataKey("Tipo").ToString
Select Case Tipo
Case "1"
e.Row.Font.Bold = True
e.Row.ForeColor = Drawing.Color.White
e.Row.BackColor = Drawing.Color.FromArgb(1, 186, 205, 206)
e.Row.FCLiteral("LtlTema").Visible = True
e.Row.FCLinkButton("ImgA").Visible = True
Case "2"
e.Row.BackColor = Drawing.Color.FromArgb(1, 213, 225, 225)
e.Row.FCLiteral("LtlPregunta").Visible = True
e.Row.FCLinkButton("ImgA").Visible = True
Case "3"
e.Row.BackColor = Drawing.Color.White
e.Row.FCLiteral("LtlRespuesta").Visible = True
End Select
End If
End Sub
Protected Sub AddEstructura(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Tipo As Integer = GvRow.DataKey("Tipo").ToString.ToEntero
Select Case Tipo
Case -1
Case 2
AgregaRespuestas(GvRow)
Case 1
AgregaPregunta(GvRow)
End Select
End Sub
Protected Sub EliminarEstructura(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Tipo As Integer = GvRow.DataKey("Tipo").ToString.ToEntero
Select Case Tipo
Case 3
'RESPUESTA
EliminarRespuesta(GvRow)
Case 2
'PREGUNTAS
EliminarPregunta(GvRow)
Case 1
'TEMA
EliminarTema(GvRow)
End Select
End Sub
Protected Sub UpdateEstructura(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Tipo As Integer = GvRow.DataKey("Tipo").ToString.ToEntero
Select Case Tipo
Case 3
ActualizaRespuestas(GvRow)
Case 2
ActualizaPregunta(GvRow)
' ActualizaPregunta(GvRow)
Case 1
'ActualizaTema(GvRow)
ActualizaTema(GvRow)
End Select
End Sub
#End Region
#Region " E X T R A S "
Private Sub OcultaDiv(Modal As String)
RegistraScript(String.Format("$('#{0}').modal('hide');", Modal))
End Sub
#End Region
End Class

View File

@@ -0,0 +1,90 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="JAMComparativos.aspx.vb" Inherits="General_JAMComparativos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
Comparativo de saldos
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabCxC" runat="server" HeaderText="Cuentas x Cobrar">
<ContentTemplate>
<asp:Label ID="LblCxC" runat="server" Text=""></asp:Label><asp:Button ID="BtnExcelCxC" runat="server" Text="Genera Excel" CssClass ="btn btn-primary green btn-sm" />
<asp:RadioButtonList ID="RblCxC" runat="server" RepeatDirection="Horizontal" AutoPostBack ="true">
<asp:ListItem Value="2" Text="Dic 2017"></asp:ListItem>
<asp:ListItem Value="4" Text="Dic 2018" Selected="True"></asp:ListItem>
<asp:ListItem Value="5" Text="Enero"></asp:ListItem>
<asp:ListItem Value="6" Text="Febrero"></asp:ListItem>
</asp:RadioButtonList>
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="RFC" HeaderText="RFC" />
<asp:HyperLinkField DataTextField="NombreComercial" HeaderText="NombreComercial" DataNavigateUrlFormatString="/CxC/RepCxCDetalle.aspx?Op=S&GPO=5&Anio=-1&Mes=-1&AnioMes=-1&Fecha=-1&CveCliente={0}&CveSubProyecto=-1&Vendedor=-1&CveUsuario=-1&CveEstatusFactura=-1&IVA=-1&FechaI=-1&FechaF=-1&CveResponsable=-1&TipoDocto=Ing,Rem,Ant,Egs&TipoCambio=1&TCEspecifico=-1&FechaVI=-1&FechaVF=-1&CveClienteSucursal=0&FechaCorte=31/12/2018&CveCobranzaEstatus=-1" DataNavigateUrlFields="CveCliente" />
<asp:BoundField DataField="SaldoPesosSIG" headertext="SIG Pesos" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="SaldoDolaresSIG" headertext="SIG Dolares" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="saldocifraPesos" HeaderText="Cifra Pesos" DataFormatString="{0:N2}" />
<asp:BoundField DataField="saldocifraDolares" HeaderText="Cifra Dolares" DataFormatString="{0:N2}" />
<asp:BoundField DataField="difPesos" HeaderText="dif Pesos" DataFormatString="{0:N2}" />
<asp:BoundField DataField="difDolares" HeaderText="dif Dolares" DataFormatString="{0:N2}" />
<asp:BoundField DataField="SubProyecto" HeaderText="SubProyecto" />
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCxP" runat="server" HeaderText="Cuentas x Pagar">
<ContentTemplate>
<asp:Label ID="LblCxP" runat="server" Text=""></asp:Label><asp:Button ID="BtnExcelCxP" runat="server" Text="Genera Excel" CssClass ="btn btn-primary green btn-sm" />
<asp:RadioButtonList ID="RBLCxP" runat="server" RepeatDirection="Horizontal" AutoPostBack ="true">
<asp:ListItem Value="3" Text="Dic 2017"></asp:ListItem>
<asp:ListItem Value="8" Text="Dic 2018" Selected="True"></asp:ListItem>
</asp:RadioButtonList>
<asp:GridView ID="GvCxP" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="RFC" HeaderText="RFC" />
<asp:BoundField DataField="NombreComercial" HeaderText="NombreComercial" />
<asp:BoundField DataField="SaldoPesosSIG" headertext="SIG Pesos" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="SaldoDolaresSIG" headertext="SIG Dolares" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="saldocifraPesos" HeaderText="Cifra Pesos" DataFormatString="{0:N2}" />
<asp:BoundField DataField="saldocifraDolares" HeaderText="Cifra Dolares" DataFormatString="{0:N2}" />
<asp:BoundField DataField="Acreedor" HeaderText="Acreedor" />
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabInv" runat="server" HeaderText="Almacén">
<ContentTemplate>
<asp:RadioButtonList ID="RBLInv" runat="server" RepeatDirection="Horizontal" AutoPostBack ="true">
<asp:ListItem Value="7" Text="Dic 2018" Selected="True"></asp:ListItem>
<asp:ListItem Value="1" Text="Actual" ></asp:ListItem>
</asp:RadioButtonList>
<asp:Label ID="LblInv" runat="server" Text=""></asp:Label><asp:Button ID="BtnExcelInv" runat="server" Text="Genera Excel" CssClass ="btn btn-primary green btn-sm" />
<asp:GridView ID="GvI" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:HyperLinkField DataTextField="Codigo" DataNavigateUrlFields="CvePS,CveAlmacen" DataNavigateUrlFormatString="/Inventarios/Kardex.aspx?CvePS={0}&CveAlmacen={1}&FechaI=23/12/2017" HeaderText="Código" />
<asp:BoundField DataField="PS" HeaderText="Producto" />
<asp:BoundField DataField="Almacen" HeaderText="Almacen" />
<asp:BoundField DataField="ExistenciaFinal" headertext="SIG" DataFormatString="{0:N2}"/>
<asp:BoundField DataField="existencia" HeaderText="Cifra" DataFormatString="{0:N2}" />
<asp:BoundField DataField="DifExistencia" HeaderText="Dif Exist" DataFormatString="{0:N2}" />
<asp:BoundField DataField="ValorCifra" HeaderText="Valor Cifra" DataFormatString="{0:#,###,###.##}" />
<asp:BoundField DataField="ValorSIG" HeaderText="Valor SIG" DataFormatString="{0:#,###,###.##}" />
<asp:BoundField DataField="DifValor" HeaderText="Dif Valor" DataFormatString="{0:#,###,###.##}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,61 @@
Imports Extensiones
Partial Class General_JAMComparativos
Inherits ClsPaginas
Private Sub General_JAMComparativos_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim Dif As New ClsGenerales
If Dif.JAMComparativo(RBLInv.SelectedValue.ToEntero) Then
GvI.DataSource = Dif.DtResultados
LblInv.Text = String.Format("{0} Registros", Dif.DtResultados.Rows.Count)
End If
If Dif.JAMComparativo(RblCxC.SelectedValue.ToEntero) Then
GvCxC.DataSource = Dif.DtResultados
LblCxC.Text = String.Format("{0} Registros", Dif.DtResultados.Rows.Count)
End If
If Dif.JAMComparativo(RBLCxP.SelectedValue.ToEntero) Then
GvCxP.DataSource = Dif.DtResultados
LblCxP.Text = String.Format("{0} Registros", Dif.DtResultados.Rows.Count)
End If
Dif.Dispose()
GvI.DataBind()
GvCxC.DataBind()
GvCxP.DataBind()
End Sub
Private Sub BtnExcelCxC_Click(sender As Object, e As EventArgs) Handles BtnExcelCxC.Click
GvCxC.ExportToExcel("CuentasxCobrar")
End Sub
Private Sub BtnExcelCxP_Click(sender As Object, e As EventArgs) Handles BtnExcelCxP.Click
GvCxP.ExportToExcel("CuentasxPagar")
End Sub
Private Sub BtnExcelInv_Click(sender As Object, e As EventArgs) Handles BtnExcelInv.Click
GvI.ExportToExcel("Inventarios")
End Sub
Private Sub RblCxC_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblCxC.SelectedIndexChanged
CargaDatos()
End Sub
Private Sub RBLCxP_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLCxP.SelectedIndexChanged
CargaDatos()
End Sub
Private Sub RblInv_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLInv.SelectedIndexChanged
CargaDatos()
End Sub
End Class

View File

@@ -0,0 +1,231 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="PopUpPaqueteriasGuias.aspx.cs" Inherits="General_PopUpPaqueteriasGuias" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<style>
.MultiLineTextBox {
resize: none;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.posicionvalidation {
left: 530px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Paqueterías Guías
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPGuiasVinculadas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="Widthall">
<tr>
<td class="Titulos">Guías Vinculadas</td>
</tr>
<tr>
<td>
<div id="DivGuiasVinculadas" style="overflow-y: auto; max-height: 110px; padding-top: 3px;">
<asp:GridView ID="GvGuiasVinculadas" runat="server" GridLines="None" DataKeyNames="CvePaqueteriaGuiaDetalle, CvePaqueteriaGuia, Paqueteria, Guia, Fecha, FechaEstimada, CveEstatus, Estatus" CssClass="table table-striped table-advance table-hover Widthall" data-sort="true"
BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros de guías vinculadas."
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDeleting="GvGuiasVinculadas_RowDeleting">
<Columns>
<asp:BoundField DataField="Paqueteria" HeaderText="Paqueteria" HeaderStyle-Width="20%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:BoundField DataField="Guia" HeaderText="Guia" HeaderStyle-Width="20%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:BoundField DataField="Rastreo" HeaderText="Rastreo" HeaderStyle-Width="15%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" HeaderStyle-Width="10%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:BoundField DataField="FechaEstimada" HeaderText="FechaEstimada" DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="10%" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" HeaderStyle-Width="20%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Desvincular" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="imgEliminar" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Esta acción desvinculara la Guía ¿Desea continuar?" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPGuiasPorVincular" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="Widthall" style="margin-top: 3px;">
<tr>
<td class="Titulos" colspan="4">Vinculación de Guías</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<div class="row">
<div>
<asp:RadioButtonList ID="RBLVincularGuia" CssClass="iradio_square-blue" runat="server" RepeatDirection="Horizontal" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="RBLVincularGuia_SelectedIndexChanged">
<asp:ListItem Value="1" Selected="True">Vincular</asp:ListItem>
<asp:ListItem Value="2">Nuevo</asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
</td>
</tr>
</table>
<table class="Widthall">
<tr runat="server" id="RowPaqueteria" align="left" visible="true">
<td class="text-right" style="width: 140px;"><b>Paquetería:</b></td>
<td>
<asp:DropDownList ID="DdlPaqueterias" runat="server" AppendDataBoundItems="true" DataTextField="Paqueteria" DataValueField="CvePaqueteria" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlPaqueterias" runat="server" ControlToValidate="DdlPaqueterias" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Paquetería''</b> es necesario." InitialValue="-1" ValidationGroup="GrpVincularGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDdlPaqueteria" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlPaqueterias" Width="250px"></ajax:ValidatorCalloutExtender>
</td>
<td class="text-right" style="width: 140px"><b>Guía:</b></td>
<td style="width: 200px">
<asp:TextBox ID="TxtGuia" runat="server" CssClass="form-control" Width="200px" Height="30px" Style="padding: 0px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtGuia" runat="server" ControlToValidate="TxtGuia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Guía''</b> es necesario." ValidationGroup="GrpVincularGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtGuia" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtGuia" Width="220px" PopupPosition="Left"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr runat="server" id="RowBtnVincular" align="center" visible="true">
<td style="text-align: center;" colspan="4">
<asp:Button ID="BtnAgregarGuia" runat="server" Text="Vincular Guía" class="btn btn-primary" Width="135px" Visible="true" OnClick="BtnAgregarGuia_Click" ValidationGroup="GrpVincularGuia" />
</td>
</tr>
<tr runat="server" id="RowRastreo" align="left" visible="false">
<td class="text-right"><b>Estatus:</b></td>
<td>
<asp:DropDownList ID="DdlEstatus" runat="server" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px">
<%-- <asp:ListItem Selected="False" Text="Seleccione" Value="-1"></asp:ListItem>--%>
<asp:ListItem Selected="True" Text="En Proceso" Value="1"></asp:ListItem>
<asp:ListItem Selected="False" Text="Confirmado por Proveedor" Value="2"></asp:ListItem>
<asp:ListItem Selected="False" Text="Entregado" Value="3"></asp:ListItem>
<asp:ListItem Selected="False" Text="Confirmado por Cliente" Value="4"></asp:ListItem>
</asp:DropDownList>
<%-- <asp:RequiredFieldValidator ID="RFVDdlEstatus" runat="server" ControlToValidate="DdlEstatus" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario." InitialValue="-1" ValidationGroup="GrpCrearGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDdlEstatus" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlEstatus" Width="250px"></ajax:ValidatorCalloutExtender>--%>
</td>
<td runat="server" id="LblRastreo" class="text-right" style="width: 140px;" visible="true"><b>Rastreo:</b></td>
<td runat="server" id="TDRastreo" style="width: 200px" visible="true">
<asp:TextBox ID="TxtRastreo" runat="server" CssClass="form-control" Width="200px" Height="30px" Style="padding: 0px" Visible="true"></asp:TextBox>
</td>
</tr>
<tr runat="server" id="RowFechas" align="left" visible="false">
<td class="text-right" style="width: 140px"><b>Fecha:</b></td>
<td style="width: 200px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" Width="170px" Height="30px" Style="padding: 0px" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server" Width="30px"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="LnkFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario." ValidationGroup="GrpCrearGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEFecha" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="250px"></ajax:ValidatorCalloutExtender>
</div>
</td>
<td class="text-right" style="width: 140px;"><b>Fecha Estimada:</b></td>
<td style="width: 200px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEstimada" runat="server" CssClass="form-control" Width="170px" Height="30px" Style="padding: 0px"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="LnkFechaEstimada" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server" Width="30px"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEstimada" runat="server" TargetControlID="TxtFechaEstimada" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEstimada" TargetControlID="TxtFechaEstimada" PopupButtonID="LnkFechaEstimada" PopupPosition="BottomLeft" Enabled="True"></ajax:CalendarExtender>
</div>
</td>
</tr>
<tr runat="server" id="RowDimensiones" align="left" visible="false">
<td class="text-right" style="width: 140px"><b>Sucursal:</b></td>
<td>
<asp:DropDownList ID="DdlSucursales" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSucursal" runat="server" ControlToValidate="DdlSucursales" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario." InitialValue="-1" ValidationGroup="GrpCrearGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDdlSucursal" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSucursal" Width="250px"></ajax:ValidatorCalloutExtender>
</td>
<td class="text-right" style="width: 140px"><b>Dimensiones:</b></td>
<td style="width: 200px">
<asp:TextBox ID="TxtDimensiones" runat="server" CssClass="form-control" Width="200px" Height="30px" Style="padding: 0px"></asp:TextBox>
</td>
</tr>
<tr runat="server" id="RowCajas" align="left" visible="false">
<td class="text-right" style="width: 140px"><b># Cajas:</b></td>
<td style="width: 200px">
<asp:TextBox ID="TxtNoCajas" runat="server" CssClass="form-control" Width="200px" Height="30px" Style="padding: 0px"></asp:TextBox>
<ajax:MaskedEditExtender ID="MEENoCajas" runat="server" TargetControlID="TxtNoCajas" Mask="9999" MaskType="Number" AcceptNegative="None"></ajax:MaskedEditExtender>
</td>
<td class="text-right" style="width: 140px;"><b>Peso (kg):</b></td>
<td style="width: 200px">
<asp:TextBox ID="TxtPeso" runat="server" CssClass="form-control" Width="200px" Height="30px" Style="padding: 0px"></asp:TextBox>
<ajax:MaskedEditExtender ID="MEEPeso" runat="server" TargetControlID="TxtPeso" Mask="9999.99" MaskType="Number" AcceptNegative="None"></ajax:MaskedEditExtender>
</td>
</tr>
<tr runat="server" id="RowObservaciones" align="left" visible="false">
<td class="text-right" align="left" valign="top" style="width: 140px; padding-top: 4px;"><b>Observaciones:</b></td>
<td style="width: 200px;">
<asp:TextBox ID="TxtObservaciones" runat="server" CssClass="form-control MultiLineTextBox" Width="200px" Height="60px" Style="padding: 0px" TextMode="MultiLine"></asp:TextBox>
</td>
<td class="text-right" align="left" valign="top" style="width: 140px; padding-top: 4px;"><b>Implica Costo:</b></td>
<td align="left" valign="top" style="width: 200px;">
<asp:CheckBox runat="server" ID="ChkImplicaCosto" Checked="true" CssClass="make-switchsd" data-size="small" Text=" " />
</td>
</tr>
<tr runat="server" id="TrTipo" align="left" visible ="false">
<td class="text-right" align="left" valign="top" style="width: 140px; padding-top: 4px;"><b>Tipo:</b></td>
<td align="left" valign="top" style="width: 200px;">
<asp:DropDownList ID="DdlPaqueteriaGuiaTipo" runat="server" AppendDataBoundItems="true" DataTextField="PaqueteriaGuiaTipo" DataValueField="CvePaqueteriaGuiaTipo" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px"></asp:DropDownList>
</td>
</tr>
<tr></tr>
<tr align="center">
<td style="text-align: right; width: 135px;" colspan="2">
<asp:Button ID="BtnCrearGuia" runat="server" Text="Crear Guía" class="btn btn-primary" Width="135px" Visible="false" OnClick="BtnCrearGuia_Click" ValidationGroup="GrpCrearGuia" />
</td>
<td style="text-align: left; width: 135px;" colspan="2">
<asp:Button ID="BtnLimpiar" runat="server" Text="Limpiar Campos" class="btn btn-warning" Width="135px" Visible="false" OnClick="BtnLimpiar_Click" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,732 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using System.Text;
public partial class General_PopUpPaqueteriasGuias : ClsPaginas
{
#region "PROPIEDADES"
private String OP
{
get
{
return ViewState["OP"].ToString();
}
set
{
ViewState["OP"] = value;
}
}
//V, OC, MOV
private int CveVenta
{
get
{
return ViewState["CveVenta"].ToString().ToEntero();
}
set
{
ViewState["CveVenta"] = value;
}
}
private int CveOC
{
get
{
return ViewState["CveOC"].ToString().ToEntero();
}
set
{
ViewState["CveOC"] = value;
}
}
private int CveMovimiento
{
get
{
return ViewState["CveMovimiento"].ToString().ToEntero();
}
set
{
ViewState["CveMovimiento"] = value;
}
}
private int CveCompra
{
get
{
return ViewState["CveCompra"].ToString().ToEntero();
}
set
{
ViewState["CveCompra"] = value;
}
}
private DataTable DTGuiasVinculadas
{
get
{
return (DataTable)ViewState["DTGuiasVinculadas"];
}
set
{
ViewState["DTGuiasVinculadas"] = value;
}
}
private String SerieFolio
{
get
{
return ViewState["SerieFolio"].ToString();
}
set
{
ViewState["SerieFolio"] = value;
}
}
private String NombreCliente
{
get
{
return ViewState["NombreCliente"].ToString();
}
set
{
ViewState["NombreCliente"] = value;
}
}
private String Pedido
{
get
{
return ViewState["Pedido"].ToString();
}
set
{
ViewState["Pedido"] = value;
}
}
private String OrdenCompra
{
get
{
return ViewState["OrdenCompra"].ToString();
}
set
{
ViewState["OrdenCompra"] = value;
}
}
private String Destinatario
{
get
{
return ViewState["Destinatario"].ToString();
}
set
{
ViewState["Destinatario"] = value;
}
}
private DataTable DTMovimientos
{
get
{
return (DataTable)ViewState["DTMovimientos"];
}
set
{
ViewState["DTMovimientos"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
((BaseMasterPage)this.Master).EsPopup = true;
RecuperaCve();
CargaPaqueterias();
CargaPaqueteriasGuiasTipo();
CargaSucursales();
if (CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0)
{
CargaGuiasVinculadas();
}
else
{
ActivaModoGuiaSinVincular();
}
if (!UsuarioActual.TienePermisoProceso(218))
{
UPGuiasPorVincular.Visible = false;
GvGuiasVinculadas.Columns[6].Visible = false;
}
}
}
#region "CARGA DATOS"
protected void RecuperaCve()
{
//if (Request["OP"] != null && !Request["OP"].ToString().Equals(""))
//{
// ViewState["OP"] = Request["OP"];
//}
//else
//{
// ViewState["OP"] = -1;
//}
if (Request["CveVenta"] != null && !Request["CveVenta"].ToString().Equals("") && Request["CveVenta"].ToEntero() > 0)
{
ViewState["CveVenta"] = Request["CveVenta"];
}
else
{
ViewState["CveVenta"] = -1;
}
if (Request["CveOC"] != null && !Request["CveOC"].ToString().Equals("") && Request["CveOC"].ToEntero() > 0)
{
ViewState["CveOC"] = Request["CveOC"];
}
else
{
ViewState["CveOC"] = -1;
}
if (Request["CveMovimiento"] != null && !Request["CveMovimiento"].ToString().Equals("") && Request["CveMovimiento"].ToEntero() > 0)
{
ViewState["CveMovimiento"] = Request["CveMovimiento"];
}
else
{
ViewState["CveMovimiento"] = -1;
}
if (Request["CveCompra"] != null && !Request["CveCompra"].ToString().Equals("") && Request["CveCompra"].ToEntero() > 0)
{
ViewState["CveCompra"] = Request["CveCompra"];
}
else
{
ViewState["CveCompra"] = -1;
}
}
protected void CargaGuiasVinculadas()
{
ClsGenerales ObjGeneral = new ClsGenerales();
if (ObjGeneral.GetPaqueteriasGuiasDetalles(-1, -1, CveVenta, CveOC, CveMovimiento, CveCompra))
{
DTGuiasVinculadas = ObjGeneral.DtResultados;
GvGuiasVinculadas.DataSource = DTGuiasVinculadas;
GvGuiasVinculadas.DataBind();
}
ObjGeneral.Dispose();
UPGuiasVinculadas.Update();
}
protected void CargaPaqueterias()
{
DdlPaqueterias.Items.Clear();
DdlPaqueterias.DataSource = GlobalDTPaqueterias;
DdlPaqueterias.DataBind();
DdlPaqueterias.Items.Insert(0, new ListItem("Seleccione ", "-1"));
UPGuiasPorVincular.Update();
}
protected void CargaPaqueteriasGuiasTipo()
{
DdlPaqueteriaGuiaTipo.Items.Clear();
DdlPaqueteriaGuiaTipo.DataSource = get_GlobalDTPaqueteriaGuiaTipos(UsuarioActual.CveEmpresa);
DdlPaqueteriaGuiaTipo.DataBind();
DdlPaqueteriaGuiaTipo.Items.Insert(0, new ListItem("Seleccione ", "-1"));
if (CveCompra > 0)
{
//DdlPaqueteriaGuiaTipo.SelectedValueExist(21);
DdlPaqueteriaGuiaTipo.SelectedIndex = DdlPaqueteriaGuiaTipo.Items.IndexOf(DdlPaqueteriaGuiaTipo.Items.FindByText("Compra"));
}
UPGuiasPorVincular.Update();
}
protected void CargaSucursales()
{
DdlSucursales.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1);
DdlSucursales.DataBind();
UPGuiasPorVincular.Update();
}
#endregion
#region "CAMBIO MODALIDAD"
protected void RBLVincularGuia_SelectedIndexChanged(object sender, EventArgs e)
{
if (RBLVincularGuia.SelectedValue == "1")
{
ActivaModoVincularGuia();
}
else
{
ActivaModoNuevaGuia();
}
LimpiaCampos();
}
protected void ActivaModoVincularGuia()
{
RowPaqueteria.Visible = true;
RowBtnVincular.Visible = true;
RowRastreo.Visible = false;
RowFechas.Visible = false;
RowCajas.Visible = false;
RowDimensiones.Visible = false;
RowObservaciones.Visible = false;
TrTipo.Visible = false;
BtnCrearGuia.Visible = false;
BtnLimpiar.Visible = false;
}
protected void ActivaModoNuevaGuia()
{
RowPaqueteria.Visible = true;
RowBtnVincular.Visible = false;
RowRastreo.Visible = true;
RowFechas.Visible = true;
RowCajas.Visible = true;
RowDimensiones.Visible = true;
RowObservaciones.Visible = true;
TrTipo.Visible = true;
BtnCrearGuia.Visible = true;
BtnLimpiar.Visible = true;
}
protected void ActivaModoGuiaSinVincular()
{
UPGuiasVinculadas.Visible = false;
RBLVincularGuia.SelectedIndex = 1;
RBLVincularGuia.Enabled = false;
ActivaModoNuevaGuia();
}
#endregion
#region "REGISTRO Y VINCULACION DE GUIAS"
protected void LimpiaCampos()
{
TxtGuia.Text = "";
TxtRastreo.Text = "";
DdlPaqueterias.SelectedValue = "-1";
DdlEstatus.SelectedValue = "1";
DdlSucursales.SelectedValue = "-1";
TxtFecha.Text = "";
TxtFechaEstimada.Text = "";
TxtNoCajas.Text = "";
TxtPeso.Text = "";
TxtDimensiones.Text = "";
TxtObservaciones.Text = "";
}
protected void AgregarNuevaGuia()
{
//Crear guia y enviar a detalle con Cve
ClsGenerales ObjGeneral = new ClsGenerales();
Boolean TieneError = false;
ObjGeneral.IniciaTransacSQL();
int CvePaqueteria = DdlPaqueterias.SelectedValue.ToEntero();
int CveEstatus = DdlEstatus.SelectedValue.ToEntero();
int CveSucursal = DdlSucursales.SelectedValue.ToEntero();
int CvePaqueteriaGuiaTipo = DdlPaqueteriaGuiaTipo.SelectedValue.ToEntero();
String Fecha = TxtFecha.Text;
String FechaEstimada = TxtFechaEstimada.Text == "" ? "-1" : TxtFechaEstimada.Text;
String Guia = (TxtGuia.Text == "") ? "-1" : TxtGuia.Text;
String Rastreo = TxtRastreo.Text;
String Dimensiones = TxtDimensiones.Text;
int NoCajas = TxtNoCajas.Text.ToEntero();
Double Peso = TxtPeso.Text.ToDouble();
String Observaciones = TxtObservaciones.Text;
Boolean ImplicaCosto = ChkImplicaCosto.Checked;
int CvePaqueteriaGuia = ObjGeneral.AddPaqueteriasGuias(CvePaqueteria, CvePaqueteriaGuiaTipo,CveEstatus, CveSucursal, Fecha, Rastreo, Guia, NoCajas, Peso, Dimensiones, FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ImplicaCosto);
if (CvePaqueteriaGuia > 0)
{
if (CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0)
{
TieneError = !ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVenta, CveOC, CveMovimiento, CveCompra);
}
}
else
{
TieneError = true;
}
if (TieneError)
{
ObjGeneral.RollBack();
}
else
{
ObjGeneral.Commit();
if (Guia == "-1")
{
if (CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0)
{
if (CveVenta > 0) { Alert(String.Format("La Guía se ha generado y se se ha vinculado a la Venta correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
if (CveOC > 0) { Alert(String.Format("La Guía se ha generado y se se ha vinculado a la Orden de Compra correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
if (CveMovimiento > 0) { Alert(String.Format("La Guía se ha generado y se se ha vinculado al Movimiento correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
if (CveCompra > 0) { Alert(String.Format("La Guía se ha generado y se se ha vinculado a la Compra correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
}
else
{
Alert(String.Format("La Guía se ha generado correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion);
}
}
else
{
if (CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0)
{
if (CveVenta > 0)
{
// 04/04/2018 - Recupera Datos Venta y Envia correo de Notificacion
CargaDatosVenta(CveVenta);
//Destinatario = "sig.buzon02@gmail.com"; //vendedor
Boolean NotificacionEnviada = false;
if (DTGuiasVinculadas.Rows.Count > 1)
{
//Mas de dos Guia Vinculada a la Venta
//Notificacion a cliente
NotificacionEnviada = EnviarCorreoNotificacionGuias(1, SerieFolio, NombreCliente, Destinatario, DdlPaqueterias.SelectedItem.Text, Guia, Rastreo,Pedido,OrdenCompra, CveVenta, DTMovimientos);
//Notificaciones a correos Fijos
EnviarCorreoNotificacionGuias(4, SerieFolio, NombreCliente, Destinatario, DdlPaqueterias.SelectedItem.Text, Guia, Rastreo,Pedido,OrdenCompra, CveVenta, DTMovimientos, DTGuiasVinculadas.Rows.Count, CvePaqueteriaGuia);
}
else
{
//Primera Guia Vinculada a la Venta
//Notifica a cliente
NotificacionEnviada = EnviarCorreoNotificacionGuias(1, SerieFolio, NombreCliente, Destinatario, DdlPaqueterias.SelectedItem.Text, Guia, Rastreo,Pedido,OrdenCompra, CveVenta, DTMovimientos);
}
//
if (NotificacionEnviada)
{
Alert(String.Format("La Guía {0} se ha generado y se se ha vinculado a la Venta correctamente.<br><br>Correo enviado exitosamente a {1}.", Guia, Destinatario), ModExtensiones.TipoMensaje.MsgInformacion);
}
else
{
Alert(String.Format("La Guía {0} se ha generado y se se ha vinculado a la Venta correctamente.<br><br>Se presentó un Error al enviar el correo a: {1}.", Guia, Destinatario), ModExtensiones.TipoMensaje.MsgInformacion);
}
}
if (CveOC > 0) { Alert(String.Format("La Guía {0} se ha generado y se se ha vinculado a la Orden de Compra correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
if (CveMovimiento > 0) { Alert(String.Format("La Guía {0} se ha generado y se se ha vinculado al Movimiento correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
}
else
{
Alert(String.Format("La Guía {0} se ha generado correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion);
}
}
LimpiaCampos();
if ((CveVenta > 0 || CveOC > 0 || CveMovimiento > 0 || CveCompra > 0))
{
RBLVincularGuia.SelectedValue = "1";
ActivaModoVincularGuia();
}
}
ObjGeneral.Dispose();
}
protected void VincularGuia()
{
ClsGenerales ObjGeneral = new ClsGenerales();
String Guia = TxtGuia.Text;
int CvePaqueteria = DdlPaqueterias.SelectedValue.ToEntero();
if (ObjGeneral.GetPaqueteriasGuias(-1,-1, CvePaqueteria, -1, -1, UsuarioActual.CveEmpresa, Guia, "-1", "-1") && ObjGeneral.DtResultados.Rows.Count > 0)
{
int CvePaqueteriaGuia = ObjGeneral.DtResultados.Rows[0]["CvePaqueteriaGuia"].ToString().ToEntero();
String Rastreo = ObjGeneral.DtResultados.Rows[0]["Rastreo"].ToString();
String Paqueteria = ObjGeneral.DtResultados.Rows[0]["Paqueteria"].ToString();
ObjGeneral.IniciaTransacSQL();
if (ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVenta, CveOC, CveMovimiento, CveCompra))
{
ObjGeneral.Commit();
TxtGuia.Text = "";
DdlPaqueterias.SelectedValue = "-1";
if (CveVenta > 0)
{
// 04/04/2018 - Recupera Datos Venta y Envia correo de Notificacion
CargaDatosVenta(CveVenta);
// Destinatario = "sig.buzon02@gmail.com"; //Cliente, correo prueba eliminar esta linea
Boolean NotificacionEnviada = false;
if (DTGuiasVinculadas.Rows.Count > 1)
{
//Mas de dos Guia Vinculada a la Venta
//Notifica a cliente
NotificacionEnviada = EnviarCorreoNotificacionGuias(1, SerieFolio, NombreCliente, Destinatario, Paqueteria, Guia, Rastreo,Pedido,OrdenCompra, CveVenta, DTMovimientos);
//Notifica a correos fijos
EnviarCorreoNotificacionGuias(4, SerieFolio, NombreCliente, Destinatario, Paqueteria, Guia, Rastreo,Pedido,OrdenCompra, CveVenta, DTMovimientos, DTGuiasVinculadas.Rows.Count, CvePaqueteriaGuia);
}
else
{
//Primera Guia Vinculada a la Venta
//Notifica a cliente
NotificacionEnviada = EnviarCorreoNotificacionGuias(1, SerieFolio, NombreCliente, Destinatario, Paqueteria, Guia, Rastreo,Pedido,OrdenCompra, CveVenta, DTMovimientos);
}
//
if (NotificacionEnviada)
{
Alert(String.Format("La Venta se ha vinculado a la Guía {0} correctamente.<br><br>Correo enviado exitosamente a {1}", Guia, Destinatario), ModExtensiones.TipoMensaje.MsgInformacion);
}
else
{
Alert(String.Format("La Venta se ha vinculado a la Guía {0} correctamente.<br><br>Se presentó un Error al enviar el correo a: {1}", Guia, Destinatario), ModExtensiones.TipoMensaje.MsgInformacion);
}
}
if (CveOC > 0) { Alert(String.Format("La Orden de Compra se ha vinculado a la Guía {0} correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
if (CveMovimiento > 0) { Alert(String.Format("El Movimiento se ha vinculado a la Guía {0} correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
if (CveCompra > 0) { Alert(String.Format("La Compra se ha vinculado a la Guía {0} correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion); }
}
else
{
ObjGeneral.RollBack();
}
ObjGeneral.Dispose();
}
else
{
Alert(String.Format("No se encontraron registros de la Guía {0}.", Guia), ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
protected void EliminarVinculacion(int CvePaqueteriaGuiaDetalle)
{
ClsGenerales ObjGeneral = new ClsGenerales();
ObjGeneral.IniciaTransacSQL();
if (ObjGeneral.RemovePaqueteriasGuiasDetalles(CvePaqueteriaGuiaDetalle, -1))
{
ObjGeneral.Commit();
Alert(String.Format("La vinculación de la Guía se ha Eliminado correctamente."), ModExtensiones.TipoMensaje.MsgInformacion);
}
else
{
ObjGeneral.RollBack();
}
ObjGeneral.Dispose();
}
#endregion
#region "BOTONES"
protected void BtnLimpiar_Click(object sender, EventArgs e)
{
LimpiaCampos();
}
protected void BtnCrearGuia_Click(object sender, EventArgs e)
{
AgregarNuevaGuia();
CargaGuiasVinculadas();
}
protected void BtnAgregarGuia_Click(object sender, EventArgs e)
{
VincularGuia();
CargaGuiasVinculadas();
}
protected void GvGuiasVinculadas_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int CvePaqueteriaGuiaDetalle = GvGuiasVinculadas.Rows[e.RowIndex].DataKey("CvePaqueteriaGuiaDetalle").ToEntero();
EliminarVinculacion(CvePaqueteriaGuiaDetalle);
CargaGuiasVinculadas();
}
#endregion
#region "CORREO DE NOTIFICACION DE GUIA"
protected Boolean EnviarCorreoNotificacionGuias(int Tipo, String SerieFolio, String NombreCliente, String DestinatarioC, String Paqueteria, String Guia, String Rastreo, String Pedido, String OrdenCompra, int CveVenta, DataTable tDtMovimientos, int CountPaqueteria = 0, int CvePaqueteriaGuia = -1)
{
ClsSisMail Correo = new ClsSisMail();
String Asunto = String.Format("{0} Envio de pedido: {1}", UsuarioActual.Empresa.NombreCorto, SerieFolio);
StringBuilder Cuerpo = new StringBuilder();
Boolean MensajeEnviado = false;
switch (Tipo)
{
//CORREO NORMAL A CLIENTE
case 1:
Cuerpo.AppendLine(String.Format("Estimado {0} le informamos que los productos de la factura {1} han sido enviados mediante la paquetería {2} con Guia {3}, Rastreo {4}, Pedido {5}, Orden de Compra {6}.<br><br>", NombreCliente, SerieFolio, Paqueteria, Guia, Rastreo,Pedido,OrdenCompra));
if (tDtMovimientos.Rows.Count > 0)
{
Cuerpo.AppendLine("<table><tr>");
Cuerpo.AppendLine("<th>Cantidad</th><th>Producto</th>");
foreach (DataRow Drow in tDtMovimientos.Rows)
{
Cuerpo.AppendLine(String.Format("<tr><td>{0}</td><td>{1}</td></tr>", Drow["Cantidad"].ToString().ToEntero(), Drow["PS"].ToString()));
}
Cuerpo.AppendLine("</tr></table>");
}
Cuerpo.AppendLine("<br><br>Dudas y aclaraciones con su coordinador empresarial.");
List<ClsSisMail.ArchivoMail> LSRutasMail = new List<ClsSisMail.ArchivoMail>();
if (UsuarioActual.CveEmpresa.Contiene(1,72, 80))
{
string Ruta = String.Format("{0}Formatos\\{1}.docx", UsuarioActual.Empresa.Ruta, "DocumentoEntregasForaneas");
LSRutasMail.Add(new ClsSisMail.ArchivoMail() { Ruta = Ruta }); ;
}
if (Correo.SendMail(UsuarioActual.Empresa, DestinatarioC, Asunto, Cuerpo.ToString(),Archivos: LSRutasMail))
{
//Alert("Correo enviado exitosamente a " + DestinatarioC);
MensajeEnviado = true;
}
else
{
//Alert("Se presentó un Error al enviar el correo a " + DestinatarioC);
MensajeEnviado = false;
}
break;
case 2:
break;
case 3:
break;
case 4:
// CORREO FIJO CUANDO SON MAS DE 1 GUIA POR VENTA
Cuerpo.AppendLine(String.Format("Se informa que la venta {0} cuenta con {1} paqueteria(s), se agrego la paqueteria {2}, usuario {3}.<br><br>", SerieFolio, CountPaqueteria, Paqueteria, UsuarioActual.Nombre));
//correo a ramón y a luz
if (UsuarioActual.CveEmpresa.Contiene(72, 80))
{
DestinatarioC = "luzdelmarcoeto@compuproveedores.com;ramonmartinez@compuproveedores.com";
if (tDtMovimientos.Rows.Count > 0)
{
Cuerpo.AppendLine("<table><tr>");
Cuerpo.AppendLine("<th>Cantidad</th><th>Producto</th>");
foreach (DataRow Drow in tDtMovimientos.Rows)
{
Cuerpo.AppendLine(String.Format("<tr><td>{0}</td><td>{1}</td></tr>", Drow["Cantidad"].ToString().ToEntero(), Drow["PS"].ToString()));
}
Cuerpo.AppendLine("</tr></table>");
}
if (Correo.SendMail(UsuarioActual.Empresa, DestinatarioC, Asunto, Cuerpo.ToString()))
{
//Alert("Correo enviado exitosamente a " + DestinatarioC);
MensajeEnviado = true;
}
else
{
//Alert("Se presentó un Error al enviar el correo a " + DestinatarioC);
MensajeEnviado = false;
}
}
break;
}
return MensajeEnviado;
}
protected void CargaDatosVenta(int CveVenta)
{
ClsVentas ObjVentas = new ClsVentas();
if (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa))
{
if (ObjVentas.DtResultados.Rows.Count > 0)
{
DataRow DbRowVenta = ObjVentas.DtResultados.Rows[0];
int CveCliente = DbRowVenta["CveCliente"].ToString().ToEntero();
SerieFolio = String.Format("{0}-{1}", DbRowVenta["Serie"].ToString(), DbRowVenta["Folio"].ToString().ToEntero());
NombreCliente = DbRowVenta["ClienteNombre"].ToString();
Pedido = DbRowVenta["PedidoContrato"].ToString();
OrdenCompra = DbRowVenta["OrdenCompra"].ToString();
string CorreoAsistente = "";
if (get_GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo: 3).FiltraParametros($"CveSuperior = {DbRowVenta["CveVendedor"].ToString()}").Rows.Count > 0)
{
foreach (DataRow Dr in get_GlobalDTVendedores(UsuarioActual.CveEmpresa, VendedorTipo: 3).FiltraParametros($"CveSuperior = {DbRowVenta["CveVendedor"].ToString()}").Rows)
{
CorreoAsistente += $";{Dr["Correo"].ToString()}";
}
}
Destinatario = $"{DbRowVenta["Mail"].ToString()};{DbRowVenta["CorreoVendedorVenta"].ToString()}{CorreoAsistente}";
if (ObjVentas.GetVentaDetalle(CveVenta))
{
DTMovimientos = ObjVentas.DtResultados;
}
}
}
}
#endregion
}

View File

@@ -0,0 +1,465 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepPaqueteriasGuias.aspx.cs" Inherits="General_RepPaqueteriasGuias" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<style>
.MultiLineTextBox {
resize: none;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte de Paqueterías Guías
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpLnkAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarGuia" runat="server" OnClick="LnkAgregarGuia_Click" Visible="true"><i class="fa fa-truck"></i><span style="padding: 10px">Agregar Guía </span></asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimirPDF" runat="server" OnClick="LnkImprimirPDF_Click"> <i class="fa fa-ad-pdf"></i><span style="padding: 10px">Generar PDF</span></asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkImprimirExcel" runat="server" OnClick="LnkImprimirExcel_Click"> <i class="fa fa-ad-excel"></i><span style="padding: 10px">Generar Excel</span></asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkImprimirPDF" />
<asp:PostBackTrigger ControlID="LnkImprimirExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="PFiltros" class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" class="btn btn-primary" ValidationGroup="Valida" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row" style="margin-left: 10px;">
<label class="col-md-1 " id="LblDdlSucursal" runat="server" style="width: 90px; margin-top: 5px;">Sucursal:</label>
<div class="col-md-2" id="DivDdlSucursal" runat="server">
<asp:DropDownList ID="DdlSucursales" runat="server" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me">
</asp:DropDownList>
</div>
<label class="col-md-1 " style="width: 80px; margin-top: 5px;">Estatus:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlEstatus" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="EntregaForaneaEstatus" DataValueField="CveEntregaForaneaEstatus" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
</div>
<label class="col-md-1 " style="width: 90px; margin-top: 5px;">Paqueteria:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlPaqueterias" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="Paqueteria" DataValueField="CvePaqueteria" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
</div>
<label class="col-md-1" style="width: 70px; margin-top: 5px;">Tipo:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTipo" runat="server" Width="100%" Class="table-group-action-input form-control input-inline input-small input-sm select2me" AppendDataBoundItems="true" DataTextField="PaqueteriaGuiaTipo" DataValueField="CvePaqueteriaGuiaTipo">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none;">
<div class="row" style="margin-left: 10px; margin-top: 10px;">
<label class="col-md-1 " style="width: 90px;">Fecha Inicial:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 " style="width: 80px;">Fecha Final:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="TxtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<asp:CompareValidator ID="CVFechas" runat="server" ForeColor="#a94442" ControlToCompare="TxtFechaI" ControlToValidate="TxtFechaF" Type="Date" Operator="GreaterThan" Display="None" ErrorMessage="<b><span style='text-decoration: underline;'>ERROR:</span></b><br /><b>''Fecha R.F.''</b> debe ser mayor a Fecha R.I." ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCE2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechas" Width="270px"></ajax:ValidatorCalloutExtender>
<%-- 10/Abril --%>
<label class="col-md-1 " style="width: 90px;">F.I. Ingreso:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFechaInicialIngreso" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioInicialIngreso" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaIIngreso" runat="server" TargetControlID="TxtFechaInicialIngreso" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario3" TargetControlID="TxtFechaInicialIngreso" PopupButtonID="imgCalendarioInicialIngreso" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<%-- <asp:CompareValidator ID="cvFechaIIngreso" runat="server" ControlToValidate="TxtFechaInicialIngreso" Display="None" ErrorMessage="El campo <b>''Fecha Inicial Ingreso''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFIIngreso" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaIIngreso" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaIIngreso" runat="server" ControlToValidate="TxtFechaInicialIngreso" Display="None" ErrorMessage="El campo <b>''Fecha Inicial Ingreso''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFIIngreso" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaIIngreso" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
<label class="col-md-1 " style="width: 90px;">F.F. Ingreso:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
<asp:TextBox ID="TxtFechaFinalIngreso" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioFinalIngreso" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaFIngreso" runat="server" TargetControlID="TxtFechaFinalIngreso" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario4" TargetControlID="TxtFechaFinalIngreso" PopupButtonID="imgCalendarioFinalIngreso" PopupPosition="BottomLeft" Enabled="True"></ajax:CalendarExtender>
<%-- <asp:CompareValidator ID="cvFechaFIngreso" runat="server" ControlToValidate="TxtFechaFinalIngreso" Display="None" ErrorMessage="El campo <b>''Fecha Final Ingreso''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoCvFFIngreso" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaFIngreso" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="rfvFechaFIngreso" runat="server" ControlToValidate="TxtFechaFinalIngreso" Display="None" ErrorMessage="El campo <b>''Fecha Final Ingreso''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFFIngreso" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaFIngreso" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
<div class="row" style="margin-left: 10px; margin-top: 10px;">
<label class="col-md-1" style="width: 90px; margin-top: 5px;">Ordenador:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlFiltro" runat="server" Width="100%" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Value="1" Text="Sucursal"></asp:ListItem>
<asp:ListItem Value="2" Text="Guia Tipo"></asp:ListItem>
<asp:ListItem Value="3" Text="Folio"></asp:ListItem>
<asp:ListItem Value="4" Text="Paqueteria"></asp:ListItem>
<asp:ListItem Value="5" Text="Estatus"></asp:ListItem>
<asp:ListItem Value="6" Text="Guia"></asp:ListItem>
<asp:ListItem Value="7" Text="Rastreo"></asp:ListItem>
<asp:ListItem Value="8" Selected="True" Text="Fecha"></asp:ListItem>
<asp:ListItem Value="9" Text="Fecha Est."></asp:ListItem>
<asp:ListItem Value="10" Text="Fecha Ing."></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-left: 0px; margin-top: 15px; 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;" />
<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>
<asp:GridView ID="GVDatos" runat="server" DataKeyNames="CvePaqueteriaGuia, CveSubProyecto, SubProyecto, CveAgrupador, TipoAgrupador, Folio, CvePaqueteria, Paqueteria, Liga, CveEstatus, Estatus, Rastreo, Guia, NumCajas, Peso, Dimensiones, Fecha, FechaEstimada, CveUsuario, CveEmpresa, FechaIng, Observaciones, ImplicaCosto, CvePaqueteriaGuiaTipo"
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
<Columns>
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="PaqueteriaGuiaTipo" HeaderText="Guía Tipo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="7%">
<ItemTemplate>
<asp:HyperLink runat="server" ID="HLFolio" Text='<%# Eval("Folio")%>' ToolTip='<%# "Ir a " + Eval("TipoAgrupador")%>' Target="_blank" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Paqueteria" HeaderText="Paquetería" ItemStyle-Width="12%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Guia" HeaderText="Guía" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Rastreo" HeaderText="Rastreo" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaEstimada" HeaderText="Fecha Est." ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ing" ItemStyle-Width="4%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" HeaderText="Editar/Liga/Subir">
<ItemTemplate>
<asp:LinkButton ID="imgEditar" runat="server" OnClick="imgEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CommandArgument='<%# Eval("CvePaqueteriaGuia")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<asp:HyperLink ID="BtnLiga" runat="server" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-external-link' aria-hidden='true'></i>" ToolTip="Ir a Paquetería" Target="_blank"></asp:HyperLink>
<asp:LinkButton ID="SubirArchivo" runat="server" OnClick="SubirArchivo_Click" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Subir Documento' class='fa fa-upload' title='Subir Documento' ></i>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivEditarGuia" class="modal fade">
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
<asp:UpdatePanel ID="UPEditarGuia" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<fieldset>
<table border="0" class="portlet light bordered">
<tr>
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-truck font-green"></i>
<span class="caption-subject bold uppercase">Editar Guía</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
</div>
</tr>
<tr>
<div style="padding-left: 20px; padding-right: 20px; padding-top: 10px; padding-bottom: 10px">
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSucursalesEditar" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
<label for="<%= DdlSucursalesEditar.ClientID.ToString()%>">Sucursal:</label>
</div>
<asp:RequiredFieldValidator ID="RFVDdlSucursalesEditar" runat="server" ControlToValidate="DdlSucursalesEditar" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sucursal''</b> es necesario." InitialValue="-1" ValidationGroup="GrpEditarGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDdlSucursalesEditar" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSucursalesEditar" Width="250px" PopupPosition="BottomLeft"></ajax:ValidatorCalloutExtender>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPaqueteriaEditar" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="Paqueteria" DataValueField="CvePaqueteria" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
<label for="<%= DdlPaqueteriaEditar.ClientID.ToString()%>">Paquetería:</label>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEstatusEditar" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="Estatus" DataValueField="CveEstatus" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
<label for="<%= DdlPaqueteriaEditar.ClientID.ToString()%>">Estatus:</label>
</div>
<asp:RequiredFieldValidator ID="RFVDdlEstatus" runat="server" ControlToValidate="DdlEstatusEditar" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus''</b> es necesario." InitialValue="-1" ValidationGroup="GrpEditarGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEDdlEstatus" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlEstatus" Width="250px" PopupPosition="BottomLeft"></ajax:ValidatorCalloutExtender>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:TextBox ID="TxtGuia" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVTxtPuestoContactoProveedor" runat="server" ControlToValidate="TxtPuestoContactoProveedor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarContactoProveedor"></asp:RequiredFieldValidator>--%>
<label for="<%= TxtGuia.ClientID.ToString()%>" style="width: 90%;">Guía:</label>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoEditar" runat="server" Width="100%" Class="table-group-action-input form-control input-inline input-small input-sm select2me" AppendDataBoundItems="true" DataTextField="PaqueteriaGuiaTipo" DataValueField="CvePaqueteriaGuiaTipo">
</asp:DropDownList>
<label for="<%= DdlTipoEditar.ClientID.ToString()%>">Paquetería Guia Tipo:</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:TextBox ID="TxtRastreo" CssClass="form-control " runat="server" CausesValidation="true"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVTxtPuestoContactoProveedor" runat="server" ControlToValidate="TxtPuestoContactoProveedor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarContactoProveedor"></asp:RequiredFieldValidator>--%>
<label for="<%= TxtRastreo.ClientID.ToString()%>" style="width: 90%;">Rastreo:</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding: 0;">
<div runat="server" id="DivFecha" class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 70% !important">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" Width="100%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<label for="<%= DivFecha.ClientID.ToString()%>" style="width: 70%;">Fecha:</label>
</div>
<ajax:MaskedEditExtender ID="MEETxtFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtFecha" TargetControlID="TxtFecha" PopupButtonID="ImgCalendarioFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVTxtFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEditarGuia"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VDETxtFecha" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RFVTxtFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es necesario." ValidationGroup="GrpEditarGuia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFecha" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtFecha" Width="250px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright" style="padding: 0;">
<div runat="server" id="DivFechaEstimada" class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 70% !important">
<asp:TextBox ID="TxtFechaEstimada" runat="server" CssClass="form-control" CausesValidation="true" Width="100%" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioFechaE" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<label for="<%= DivFechaEstimada.ClientID.ToString()%>" style="width: 70%;">Fecha Estimada:</label>
</div>
<ajax:MaskedEditExtender ID="MEETxtFechaE" runat="server" TargetControlID="TxtFechaEstimada" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtFechaE" TargetControlID="TxtFechaEstimada" PopupButtonID="imgCalendarioFechaE" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<%--<asp:CompareValidator ID="CVTxtFechaE" runat="server" ControlToValidate="TxtFechaEstimada" Display="None" ErrorMessage="El campo <b>''Fecha Estimada''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VDETxtFechaE" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaE" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:RequiredFieldValidator ID="RFVTxtFechaE" runat="server" ControlToValidate="TxtFechaEstimada" Display="None" ErrorMessage="El campo <b>''Fecha Estimada''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtFechaE" runat="server" HighlightCssClass="vco" TargetControlID="RFVTxtFechaE" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:TextBox ID="TxtNumCajas" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVTxtPuestoContactoProveedor" runat="server" ControlToValidate="TxtPuestoContactoProveedor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarContactoProveedor"></asp:RequiredFieldValidator>--%>
<label for="<%= TxtNumCajas.ClientID.ToString()%>" style="width: 90%;"># Cajas:</label>
</div>
<ajax:MaskedEditExtender ID="MEENoCajas" runat="server" TargetControlID="TxtNumCajas" Mask="9999" MaskType="Number" AcceptNegative="None"></ajax:MaskedEditExtender>
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:TextBox ID="TxtPeso" CssClass="form-control " runat="server" CausesValidation="true"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVTxtPuestoContactoProveedor" runat="server" ControlToValidate="TxtPuestoContactoProveedor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarContactoProveedor"></asp:RequiredFieldValidator>--%>
<label for="<%= TxtPeso.ClientID.ToString()%>" style="width: 90%;">Peso (Kg):</label>
</div>
<ajax:MaskedEditExtender ID="MEEPeso" runat="server" TargetControlID="TxtPeso" Mask="999.999" MaskType="Number" InputDirection="LeftToRight" DisplayMoney="None" AcceptNegative="None"></ajax:MaskedEditExtender>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:TextBox ID="TxtDimensiones" CssClass="form-control" runat="server" CausesValidation="true" Style="margin-top: 5px; padding: 0px;"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RFVTxtPuestoContactoProveedor" runat="server" ControlToValidate="TxtPuestoContactoProveedor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarContactoProveedor"></asp:RequiredFieldValidator>--%>
<label for="<%= TxtDimensiones.ClientID.ToString()%>" style="width: 90%;">Dimensiones:</label>
</div>
<div class="form-group col-md-6 form-md-line-input input-iconright" style="border-bottom: none;">
<asp:CheckBox runat="server" ID="ChkImplicaCosto" Checked="true" CssClass="form-control make-switchsd" data-size="small" Text="" Style="margin-top: 5px; padding: 0px;" />
<label for="<%= ChkImplicaCosto.ClientID.ToString()%>" style="width: 90%; height: 97px; padding-top: 0px; margin-bottom: 5px">Implica Costo:</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-6 form-md-line-input input-iconright">
<asp:TextBox ID="TxtObservaciones" CssClass="form-control MultiLineTextBox" runat="server" CausesValidation="true" Height="70px" Style="margin-top: 17px; padding: 0px;" TextMode="MultiLine"></asp:TextBox>
<label for="<%= TxtObservaciones.ClientID.ToString()%>" style="width: 90%; height: 97px; padding-top: 10px">Observaciones:</label>
</div>
<div id="DivDownloadGuia" runat="server" class="form-group col-md-6 form-md-line-input input-iconright" style="border-bottom: none;" visible="false">
<label style="width: 90%; padding-top: 0px; margin-bottom: 5px; color: #888888;">Archivo Guías:</label>
<asp:Button ID="BtnDownloadGuia" runat="server" OnClick="BtnDownloadGuia_Click" CssClass="btn btn-primary" Text="Descargar" />
</div>
</div>
</div>
</tr>
<tr>
<div class="col-md-12 font-green" style="padding-left: 0">
<i class="fa fa-truck font-green"></i>
<span class="bold uppercase">Vinculaciones:</span>
</div>
<div class="col-md-12" style="overflow-y: auto; overflow-x: auto;">
<asp:GridView ID="GvGuiasVinculadas" runat="server" GridLines="None" DataKeyNames="Folio, TipoAgrupador, CveAgrupador, CvePaqueteriaGuiaDetalle, CvePaqueteriaGuia, Paqueteria, Guia, Fecha, FechaEstimada, CveEstatus, Estatus"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False"
EmptyDataText="No se encontraron registros de guías vinculadas." EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GvGuiasVinculadas_RowDataBound">
<%-- heighterror="800"--%>
<Columns>
<asp:BoundField DataField="TipoAgrupador" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50%" />
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="50%">
<ItemTemplate>
<asp:HyperLink runat="server" ID="HLFolioDetalle" Text='<%# Eval("Folio")%>' ToolTip='<%# "Ir a " + Eval("TipoAgrupador")%>' Target="_blank" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="Paqueteria" HeaderText="Paqueteria" HeaderStyle-Width="20%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:BoundField DataField="Guia" HeaderText="Guia" HeaderStyle-Width="20%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:BoundField DataField="Rastreo" HeaderText="Rastreo" HeaderStyle-Width="15%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" HeaderStyle-Width="10%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:BoundField DataField="FechaEstimada" HeaderText="FechaEstimada" DataFormatString="{0:dd/MM/yyyy}" HeaderStyle-Width="10%" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />--%>
<%-- <asp:BoundField DataField="Estatus" HeaderText="Estatus" HeaderStyle-Width="20%" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="25%" />--%>
</Columns>
</asp:GridView>
</div>
</tr>
</table>
</fieldset>
<div class="modal-footer">
<asp:Button ID="BtGuardarGuia" runat="server" OnClick="BtGuardarGuia_Click" CssClass="btn btn-success" Text="Actualizar" ValidationGroup="GrpEditarGuia" />
<asp:Button ID="BtnEliminarGuia" runat="server" OnClick="BtnEliminarGuia_Click" CssClass="btn btn-danger" Text="Eliminar" data-toggle="confirmation" data-popout="true" data-original-title="Eliminar la Guía tambien eliminara sus vinculaciones, ¿Desea continuar?." data-btn-ok-label="si" />
<button id="BtnCancelarGuia" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDownloadGuia" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
<%--MODAL--%>
<div id="ModalUploadGuiaDocumento" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:UpdatePanel ID="UpModalTitleUploadDocumentoGuia" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Literal ID="LtlModalTitleUploadDocumentoGuia" runat="server">Documentacion </asp:Literal>
</ContentTemplate>
</asp:UpdatePanel>
</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpModalUploadGuiaDocumento" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:TextBox ID="TxtFileDocumentacion" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtObservacionVenta" CssClass="form-control" MaxLength="50" runat="server"></asp:TextBox>
<label runat="server" id="LblObservacionArchivo" for="<%= TxtObservacionVenta.ClientID.ToString() %>">Observación de la Venta:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnModalGuiaDocumentoUpload" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnModalGuiaDocumentoUpload_Click" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
function Descargar_archivo() {
}
</script>
</asp:Content>

View File

@@ -0,0 +1,947 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using Microsoft.Reporting.WebForms;
using System.IO;
using System.Text;
public partial class General_RepPaqueteriasGuias : ClsPaginas
{
#region PROPIEDADES
private DataTable DTDatos
{
get
{
return (DataTable)ViewState["DTDatos"];
}
set
{
ViewState["DTDatos"] = value;
}
}
private int CvePaqueteriaGuia
{
get
{
return ViewState["CvePaqueteriaGuia"].ToString().ToEntero();
}
set
{
ViewState["CvePaqueteriaGuia"] = value;
}
}
private int CveVenta
{
get
{
return ViewState["CveVenta"].ToString().ToEntero();
}
set
{
ViewState["CveVenta"] = value;
}
}
private int CveMovimiento
{
get
{
return ViewState["CveMovimiento"].ToString().ToEntero();
}
set
{
ViewState["CveMovimiento"] = value;
}
}
private String SerieFolio
{
get
{
return ViewState["SerieFolio"].ToString();
}
set
{
ViewState["SerieFolio"] = value;
}
}
private String NombreCliente
{
get
{
return ViewState["NombreCliente"].ToString();
}
set
{
ViewState["NombreCliente"] = value;
}
}
private String Destinatario
{
get
{
return ViewState["Destinatario"].ToString();
}
set
{
ViewState["Destinatario"] = value;
}
}
private String Paqueteria
{
get
{
return ViewState["Paqueteria"].ToString();
}
set
{
ViewState["Paqueteria"] = value;
}
}
private String Guia
{
get
{
return ViewState["Guia"].ToString();
}
set
{
ViewState["Guia"] = value;
}
}
private String Rastreo
{
get
{
return ViewState["Rastreo"].ToString();
}
set
{
ViewState["Rastreo"] = value;
}
}
private DataTable DTMovimientos
{
get
{
return (DataTable)ViewState["DTMovimientos"];
}
set
{
ViewState["DTMovimientos"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaEstatus();
CargaSucursales();
CargaPaqueterias();
CargaPaqueteriasGuiasTipo();
InicializaFechas();
UPFiltros.Update();
if (!UsuarioActual.TienePermisoProceso(219))
{
GVDatos.Columns[10].HeaderText = "Detalle/Liga";
}
if (!UsuarioActual.TienePermisoProceso(218))
{
LnkAgregarGuia.Visible = false;
}
CargaDatos();
}
}
#region CARGA DDL
protected void CargaSucursales()
{
DdlSucursales.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1);
DdlSucursales.DataBind();
DdlSucursales.Items.Insert(0, new ListItem("Todos ", "-1"));
DdlSucursalesEditar.DataSource = get_GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1);
DdlSucursalesEditar.DataBind();
DdlSucursalesEditar.Items.Insert(0, new ListItem("Seleccione ", "-1"));
}
protected void CargaPaqueterias()
{
DdlPaqueterias.DataSource = GlobalDTPaqueterias;
DdlPaqueterias.DataBind();
DdlPaqueterias.Items.Insert(0, new ListItem("Todos ", "-1"));
DdlPaqueteriaEditar.DataSource = GlobalDTPaqueterias;
DdlPaqueteriaEditar.DataBind();
DdlPaqueteriaEditar.Items.Insert(0, new ListItem("Seleccione ", "-1"));
}
protected void CargaPaqueteriasGuiasTipo()
{
DdlTipo.DataSource = get_GlobalDTPaqueteriaGuiaTipos(UsuarioActual.CveEmpresa);
DdlTipo.DataBind();
DdlTipo.Items.Insert(0, new ListItem("Todos ", "-1"));
DdlTipoEditar.DataSource = get_GlobalDTPaqueteriaGuiaTipos(UsuarioActual.CveEmpresa);
DdlTipoEditar.DataBind();
DdlTipoEditar.Items.Insert(0, new ListItem("Seleccione ", "-1"));
}
protected void CargaEstatus()
{
DdlEstatus.Items.Insert(0, new ListItem("Todos ", "-1"));
DdlEstatus.Items.Insert(1, new ListItem("En Proceso ", "1"));
DdlEstatus.Items.Insert(2, new ListItem("Confirmado por Proveedor ", "2"));
DdlEstatus.Items.Insert(3, new ListItem("Entregado ", "3"));
DdlEstatus.Items.Insert(4, new ListItem("Confirmado por Cliente", "4"));
DdlEstatus.SelectedValue = "1";
DdlEstatusEditar.Items.Insert(0, new ListItem("Seleccione ", "-1"));
DdlEstatusEditar.Items.Insert(1, new ListItem("En Proceso ", "1"));
DdlEstatusEditar.Items.Insert(2, new ListItem("Confirmado por Proveedor ", "2"));
DdlEstatusEditar.Items.Insert(3, new ListItem("Entregado ", "3"));
DdlEstatusEditar.Items.Insert(4, new ListItem("Confirmado por Cliente", "4"));
DdlEstatusEditar.SelectedValue = "-1";
}
protected void InicializaFechas()
{
DateTime FI = new DateTime(DateTime.Now.Year, 1, 1);
TxtFechaI.Text = FI.ToShortDateString();
TxtFechaF.Text = DateTime.Today.ToShortDateString();
TxtFechaInicialIngreso.Text = "";//FI.ToShortDateString();
TxtFechaFinalIngreso.Text = ""; //DateTime.Today.ToShortDateString();
}
#endregion
#region CARGA DATOS
protected void CargaDatos()
{
ClsGenerales ObjGeneral = new ClsGenerales();
int CvePaqueteriaGuia = -1;
int CvePaqueteria = DdlPaqueterias.SelectedValue.ToEntero();
int CvePaqueteriaGuiaTipo = DdlTipo.SelectedValue.ToEntero();
int CveEstatus = DdlEstatus.SelectedValue.ToEntero();
int CveSubProyecto = DdlSucursales.SelectedValue.ToEntero();
int CveEmpresa = UsuarioActual.CveEmpresa;
int Filtro = DdlFiltro.SelectedValue.ToEntero();
String Guia = "-1";
String FechaInicio = TxtFechaI.Text == "" ? "-1" : TxtFechaI.Text;
String FechaFin = TxtFechaF.Text == "" ? "-1" : TxtFechaF.Text;
String FechaIngInicio = TxtFechaInicialIngreso.Text == "" ? "-1" : TxtFechaInicialIngreso.Text;
String FechaIngFin = TxtFechaFinalIngreso.Text == "" ? "-1" : TxtFechaFinalIngreso.Text;
if (ObjGeneral.GetPaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CvePaqueteria, CveEstatus, CveSubProyecto, CveEmpresa, Guia, FechaInicio, FechaFin, FechaIngInicio, FechaIngFin, Filtro: Filtro))
{
DTDatos = ObjGeneral.DtResultados;
GVDatos.DataSource = DTDatos;
}
ObjGeneral.Dispose();
GVDatos.DataBind();
UPDatos.Update();
}
protected void ActualizaGuia()
{
ClsGenerales ObjGeneral = new ClsGenerales();
int CvePaqueteria = DdlPaqueteriaEditar.SelectedValue.ToEntero();
int CvePaqueteriaGuiaTipo = DdlTipoEditar.SelectedValue.ToEntero();
int CveEstatus = DdlEstatusEditar.SelectedValue.ToEntero();
int CveSubProyecto = DdlSucursalesEditar.SelectedValue.ToEntero();
String Guia = (TxtGuia.Text != "") ? TxtGuia.Text : "-1";
String Rastreo = TxtRastreo.Text;
String Fecha = TxtFecha.Text;
String FechaEstimada = TxtFechaEstimada.Text == "" ? "-1" : TxtFechaEstimada.Text;
int NumCajas = TxtNumCajas.Text.ToEntero();
Double Peso = TxtPeso.Text.ToDouble();
String Dimensiones = TxtDimensiones.Text;
String Observaciones = TxtObservaciones.Text;
Boolean ImplicaCosto = ChkImplicaCosto.Checked;
Boolean MensajeEnviado = false;
if (ObjGeneral.UpdatePaqueteriasGuias(CvePaqueteriaGuia, CvePaqueteriaGuiaTipo, CveSubProyecto, CvePaqueteria, CveEstatus, Fecha, Rastreo, Guia, NumCajas, Peso, Dimensiones, FechaEstimada, Observaciones, ImplicaCosto))
{
if (Guia == "-1")
{
Alert(String.Format("La Guía se ha actualizado correctamente."), ModExtensiones.TipoMensaje.MsgInformacion);
}
else
{
//Si es Guia de Venta y se actualizo el estatus a Confirmado por el Cliente
if (CveVenta > 0 && CveEstatus == 4)
{
//Cargamos datos para Correo del Vendedor
CargaDatosCorreo(CveVenta, false);
Paqueteria = DdlPaqueteriaEditar.SelectedItem.Text;
MensajeEnviado = EnviarCorreoNotificacionEntrega(2, SerieFolio, NombreCliente, Destinatario, Paqueteria, Guia, Rastreo, CveVenta, DTMovimientos);
if (MensajeEnviado)
{
Alert(String.Format("La Guía {0} se ha actualizado correctamente.<br><br>Correo enviado exitosamente a {1}.", Guia, Destinatario));
}
else
{
Alert(String.Format("La Guía {0} se ha actualizado correctamente.<br><br>Error al enviar correo a: {1}.", Guia, Destinatario));
}
}
else
{
Alert(String.Format("La Guía {0} se ha actualizado correctamente.", Guia), ModExtensiones.TipoMensaje.MsgInformacion);
}
}
}
this.RegistraScript("$('#DivEditarGuia').modal('hide');");
ObjGeneral.Dispose();
}
protected void EliminaGuia()
{
ClsGenerales ObjGeneral = new ClsGenerales();
ObjGeneral.IniciaTransacSQL();
Boolean TieneError = false;
TieneError = !ObjGeneral.RemovePaqueteriasGuiasDetalles(-1, CvePaqueteriaGuia);
if (!TieneError)
{
TieneError = !ObjGeneral.RemovePaqueteriasGuias(CvePaqueteriaGuia);
}
if (!TieneError)
{
ObjGeneral.Commit();
Alert(String.Format("La Guía se ha Eliminado correctamente."), ModExtensiones.TipoMensaje.MsgInformacion);
}
else
{
ObjGeneral.RollBack();
}
ObjGeneral.Dispose();
}
protected void CargaGuiasVinculadas()
{
ClsGenerales ObjGeneral = new ClsGenerales();
if (ObjGeneral.GetPaqueteriasGuiasDetalles(-1, CvePaqueteriaGuia, -1, -1, -1, -1))
{
GvGuiasVinculadas.DataSource = ObjGeneral.DtResultados;
GvGuiasVinculadas.DataBind();
}
ObjGeneral.Dispose();
}
#endregion
#region BOTONES
protected void BtnConsultar_Click(object sender, EventArgs e)
{
CargaDatos();
}
protected void imgEditar_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CvePaqueteriaGuia = GvRow.DataKey("CvePaqueteriaGuia").ToEntero();
if (GvRow.DataKey("TipoAgrupador").ToString() == "Venta")
{
CveVenta = GvRow.DataKey("CveAgrupador").ToString().ToEntero();
}
else
{
CveVenta = -1;
}
Paqueteria = GvRow.DataKey("Paqueteria");
Guia = GvRow.DataKey("Guia");
DdlSucursalesEditar.SelectedValueExist(GvRow.DataKey("CveSubProyecto"));
//DdlSucursalesEditar.Enabled = false;
DdlPaqueteriaEditar.SelectedValueExist((GvRow.DataKey("CvePaqueteria").ToEntero() > 0) ? GvRow.DataKey("CvePaqueteria") : "-1");
DdlTipoEditar.SelectedValueExist((GvRow.DataKey("CvePaqueteriaGuiaTipo").ToEntero() > 0) ? GvRow.DataKey("CvePaqueteriaGuiaTipo") : "-1");
DdlEstatusEditar.SelectedValueExist(GvRow.DataKey("CveEstatus"));
TxtGuia.Text = GvRow.DataKey("Guia");
TxtRastreo.Text = GvRow.DataKey("Rastreo");
TxtFecha.Text = GvRow.DataKey("Fecha");
TxtFechaEstimada.Text = GvRow.DataKey("FechaEstimada");
TxtNumCajas.Text = GvRow.DataKey("NumCajas");
TxtPeso.Text = String.Format("{0:N3}", GvRow.DataKey("Peso").ToDouble());
TxtDimensiones.Text = GvRow.DataKey("Dimensiones");
TxtObservaciones.Text = GvRow.DataKey("Observaciones");
ChkImplicaCosto.Checked = Boolean.Parse(GvRow.DataKey("ImplicaCosto"));
Boolean mostrarDescarga = CrearArchivo(false);
if (mostrarDescarga)
{
DivDownloadGuia.Visible = true;
} else
{
DivDownloadGuia.Visible = false;
}
CargaGuiasVinculadas();
if (!UsuarioActual.TienePermisoProceso(219))
{
DdlSucursalesEditar.Enabled = false;
DdlPaqueteriaEditar.Enabled = false;
DdlTipoEditar.Enabled = false;
DdlEstatusEditar.Enabled = false;
TxtGuia.Enabled = false;
TxtRastreo.Enabled = false;
TxtFecha.Enabled = false;
TxtFechaEstimada.Enabled = false;
imgCalendarioFecha.Enabled = false;
imgCalendarioFechaE.Enabled = false;
CETxtFecha.Enabled = false;
CETxtFechaE.Enabled = false;
TxtNumCajas.Enabled = false;
TxtPeso.Enabled = false;
TxtDimensiones.Enabled = false;
ChkImplicaCosto.Enabled = false;
TxtObservaciones.Enabled = false;
BtGuardarGuia.Visible = false;
}
if (!UsuarioActual.TienePermisoProceso(220))
{
BtnEliminarGuia.Visible = false;
}
UPEditarGuia.Update();
this.RegistraScript("$('#DivEditarGuia').modal('show');");
}
protected void BtGuardarGuia_Click(object sender, EventArgs e)
{
ActualizaGuia();
CargaDatos();
}
protected void BtnEliminarGuia_Click(object sender, EventArgs e)
{
EliminaGuia();
this.RegistraScript("$('#DivEditarGuia').modal('hide');");
CargaDatos();
}
protected void GVDatos_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DBCampo("Liga") != "")
{
e.Row.FCHyperLink("BtnLiga").NavigateUrl = string.Format(e.Row.DBCampo("Liga"), e.Row.DBCampo("Guia"));
}
else
{
//e.Row.FCHyperLink("BtnLiga").Visible = false;
e.Row.FCHyperLink("BtnLiga").ToolTip = "Sin liga";
}
if (e.Row.DBCampo("CveAgrupador").ToString().ToEntero() > 0)
{
if (e.Row.DataKey("TipoAgrupador").ToString() == "Venta")
{
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveAgrupador"));
}
if (e.Row.DataKey("TipoAgrupador").ToString() == "Mov")
{
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DataKey("CveAgrupador"));
}
if (e.Row.DataKey("TipoAgrupador").ToString() == "OC")
{
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DataKey("CveAgrupador"));
}
if (e.Row.DataKey("TipoAgrupador").ToString() == "Compra")
{
e.Row.FCHyperLink("HLFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveAgrupador"));
}
}
// Si la cve estatus es En Proceso o Confirmado por Proveedor
if (e.Row.DataKey("CveEstatus").ToEntero() > 2)
{
e.Row.FCLinkButton("SubirArchivo").Visible = false;
}
if (!UsuarioActual.TienePermisoProceso(219))
{
e.Row.FCLinkButton("SubirArchivo").Visible = false;
}
}
}
protected void GvGuiasVinculadas_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.DBCampo("CveAgrupador").ToString().ToEntero() > 0)
{
if (e.Row.DataKey("TipoAgrupador").ToString() == "Venta")
{
e.Row.FCHyperLink("HLFolioDetalle").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveAgrupador"));
}
if (e.Row.DataKey("TipoAgrupador").ToString() == "Mov")
{
e.Row.FCHyperLink("HLFolioDetalle").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DataKey("CveAgrupador"));
}
if (e.Row.DataKey("TipoAgrupador").ToString() == "OC")
{
e.Row.FCHyperLink("HLFolioDetalle").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DataKey("CveAgrupador"));
}
if (e.Row.DataKey("TipoAgrupador").ToString() == "Compra")
{
e.Row.FCHyperLink("HLFolioDetalle").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveAgrupador"));
}
}
}
}
protected void LnkAgregarGuia_Click(object sender, EventArgs e)
{
//Agregamos guia sin vincular
this.RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,480);"));
}
protected void LnkImprimirPDF_Click(object sender, EventArgs e)
{
ImprimiReporte("PDF");
}
protected void LnkImprimirExcel_Click(object sender, EventArgs e)
{
ImprimiReporte("Excel");
}
#endregion
#region SUBIR/DESCARGAR DOCUMENTO
protected void SubirArchivo_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CvePaqueteriaGuia = GvRow.DataKey("CvePaqueteriaGuia").ToEntero();
Paqueteria = GvRow.DataKey("Paqueteria");
Guia = GvRow.DataKey("Guia");
Rastreo = GvRow.DataKey("Rastreo");
// Especificar demas parametros a subir
if (GvRow.DataKey("TipoAgrupador") == "Mov")
{
LblObservacionArchivo.InnerText = String.Format("Observación del Movimiento:");
}
else
{
LblObservacionArchivo.InnerText = String.Format("Observación de la {0}:", GvRow.DataKey("TipoAgrupador"));
}
if (GvRow.DataKey("TipoAgrupador").ToString() == "Venta")
{
CveVenta = GvRow.DataKey("CveAgrupador").ToString().ToEntero();
}
else
{
CveVenta = -1;
}
UpModalUploadGuiaDocumento.Update();
this.RegistraScript("$('#ModalUploadGuiaDocumento').modal({ backdrop: 'static', keyboard: false});");
}
protected void BtnModalGuiaDocumentoUpload_Click(object sender, EventArgs e)
{
String FileExtension = "-1";
List<Archivo> Filesgral = TxtFileDocumentacion.getfiles().Archivos;
foreach (Archivo fileItem in Filesgral)
{
try
{
FileExtension = System.IO.Path.GetExtension(string.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
string rutaDestino = UsuarioActual.Empresa.Ruta + "Documentos\\Guias\\" + CvePaqueteriaGuia + "." + FileExtension;
if (!System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta + "Documentos\\Guias\\"))
{
System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta + "Documentos\\Guias\\");
}
if (System.IO.File.Exists(rutaDestino))
{
System.IO.File.Delete(rutaDestino);
}
System.IO.File.Copy(fileItem.FileUrl, rutaDestino);
//Al subir el archivo actualiza el estatus de la guia a
ClsGenerales ObjGral = new ClsGenerales();
Boolean TieneError = false;
Boolean MensajeEnviado = false;
int EstatusEntregado = 3;
//Mandamos a actualizar solo el estatus
if (!ObjGral.UpdatePaqueteriasGuias(CvePaqueteriaGuia,-1, -1, -1, EstatusEntregado, "-1", "", "", -1, -1, "-1", "-1", ""))
{
TieneError = true;
}
if (!TieneError)
{
//Si es Venta Notificamos a Cliente
if (CveVenta > 0)
{
CargaDatosCorreo(CveVenta, true);
MensajeEnviado = EnviarCorreoNotificacionEntrega(1, SerieFolio, NombreCliente, Destinatario, Paqueteria, Guia, Rastreo, CveVenta, DTMovimientos, RutaArchivoAdjunto: rutaDestino);
if (MensajeEnviado)
{
Alert(String.Format("El Archivo ha sido guardado y el estatus de la Guía ha sido actualizado correctamente. <br><br>Correo enviado exitosamente a {0}.", Destinatario));
}else
{
Alert(String.Format("El Archivo ha sido guardado y el estatus de la Guía ha sido actualizado correctamente. <br><br>Error al Notificar al Cliente a su correo: {0}.", Destinatario));
}
}
else
{
Alert("El Archivo ha sido guardado y el estatus de la Guía ha sido actualizado correctamente.");
}
}
else
{
Alert("Ocurrio un error al Guardar el Archivo o Actualizar el Estatus de la Guia.", ModExtensiones.TipoMensaje.MsgError);
}
ObjGral.Dispose();
CargaDatos();
UPDatos.Update();
TxtFileDocumentacion.Text = "";
TxtObservacionVenta.Text = "";
UpModalUploadGuiaDocumento.Update();
}
catch (Exception ex)
{
Alert("Error al cargar archivo", ModExtensiones.TipoMensaje.MsgError);
this.GuardaLog(string.Format("Error al cargar archivo: {0}", ex.Message));
}
}
this.RegistraScript("$('#ModalUploadGuiaDocumento').modal('hide')", "hidemodal3");
}
protected void BtnDownloadGuia_Click(object sender, EventArgs e)
{
CrearArchivo();
}
private Boolean CrearArchivo(Boolean descargar = true)
{
String path = Path.Combine(UsuarioActual.Empresa.Ruta, "Documentos", "Guias", CvePaqueteriaGuia.ToString() + ".pdf");
System.IO.FileInfo file = new System.IO.FileInfo(path);
string[] fileEntries = Directory.GetFiles(Path.Combine(UsuarioActual.Empresa.Ruta, "Documentos", "Guias"));
foreach (string fileName in fileEntries)
{
System.IO.FileInfo fileActual = new System.IO.FileInfo(fileName);
if (CvePaqueteriaGuia.ToString() == Path.GetFileNameWithoutExtension(fileActual.FullName))
{
file = fileActual;
}
}
//Si es descarga va por el archivo, si no regresa si existe o no
if (descargar)
{
DescargarArchivo(file);
}else
{
if (!file.Exists)
{
return false;
}
}
return true;
}
private void DescargarArchivo(System.IO.FileInfo File)
{
if (File.Exists)
{
try
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename="+ String.Format("Guia {0} - {1}{2}",Paqueteria, Guia,File.Extension));
Response.AddHeader("Content-Length", File.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(File.FullName);
Response.End();
}
catch (Exception e)
{
Alert(e.Message, ModExtensiones.TipoMensaje.MsgError);
}
}
else
{
Alert("Ocurrio un error al descargar el archivo", ModExtensiones.TipoMensaje.MsgAdvertencia, "window.close()");
}
}
#endregion
#region GENERAR REPORTE
protected void ImprimiReporte(string Formato = "PDF")
{
string Sucursal = DdlSucursales.SelectedItem.Text;
string Estatus = DdlEstatus.SelectedItem.Text;
string Paqueteria = DdlPaqueterias.SelectedItem.Text;
string FechaInicio = DateTime.Parse(TxtFechaI.Text).ToShortDateString();
string FechaFinal = DateTime.Parse(TxtFechaF.Text).ToShortDateString();
string FechaIngInicio = TxtFechaInicialIngreso.Text;
string FechIngaFinal = TxtFechaFinalIngreso.Text;
string Ruta = string.Format("{0}Empresas/{1}/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa);
string RutaPDF = string.Format("{0}/Formatos/RepPaqueteriasGuias.rdlc", Ruta);
if (!File.Exists(RutaPDF))
{
RutaPDF = "Empresas/Grales/Formatos/RepPaqueteriasGuias.rdlc";
}
var logouri = string.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
System.IO.FileInfo Imagen = new System.IO.FileInfo(string.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
List<ReportParameter> @params = new List<ReportParameter>();
@params.Add(new ReportParameter("pEmp", UsuarioActual.Empresa.Empresa));
@params.Add(new ReportParameter("pImg", new Uri(Server.MapPath(string.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri));
@params.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
@params.Add(new ReportParameter("Sucursal", Sucursal));
@params.Add(new ReportParameter("Estatus", Estatus));
@params.Add(new ReportParameter("Paqueteria", Paqueteria));
@params.Add(new ReportParameter("FechaInicio", FechaInicio));
@params.Add(new ReportParameter("FechaFin", FechaFinal));
//@params.Add(new ReportParameter("FechaIngInicio", FechaIngInicio));
//@params.Add(new ReportParameter("FechaIngFin", FechIngaFinal));
@params.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
@params.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()));
@params.Add(new ReportParameter("Filtros", String.Format(" <b>Sucursal: </b>{0}&emsp;&emsp;<b>Estatus: </b>{1}&emsp;&emsp;<b>Paquetería: </b>{2}<br/><b>Fecha Inicio: </b>{3}&emsp;&emsp;<b>Fecha Fin: </b>{4}", Sucursal, Estatus, Paqueteria, FechaInicio, FechaFinal)));
if (Imagen.Exists)
{
@params.Add(new ReportParameter("LogoPath", logouri));
}
else
{
@params.Add(new ReportParameter("LogoPath", ""));
}
ImprimirPDF(RutaPDF, DTDatos, @params, "RepPaqueteriasGuias" + DateTime.Now.ToString("yyyyMMddhhmmss"), Formato);
}
#endregion
#region CORREO DE NOTIFICACION DE GUIA
protected Boolean EnviarCorreoNotificacionEntrega(int Tipo, String SerieFolio, String NombreCliente, String Destinatario, String Paqueteria, String Guia, String Rastreo, int CveVenta, DataTable tDtMovimientos, int CountPaqueteria = 0, int CvePaqueteriaGuia = -1, String RutaArchivoAdjunto = "")
{
ClsSisMail Correo = new ClsSisMail();
String Asunto = String.Format("{0} Envio de pedido: {1}", UsuarioActual.Empresa.NombreCorto, SerieFolio);
StringBuilder Cuerpo = new StringBuilder();
Boolean MensajeEnviado = false;
switch (Tipo)
{
// Tipo 1 Paqueteria Entregada - Notifica a Cliente al subir archivo
case 1:
Cuerpo.AppendLine(String.Format("Estimado {0} le informamos que los productos de la factura {1} con Guía {3} y paquetería {2} han sido entregados.<br><br>", NombreCliente, SerieFolio, Paqueteria, Guia));
if (tDtMovimientos.Rows.Count > 0)
{
Cuerpo.AppendLine("<table><tr>");
Cuerpo.AppendLine("<th>Cantidad</th><th>Producto</th>");
foreach (DataRow Drow in tDtMovimientos.Rows)
{
Cuerpo.AppendLine(String.Format("<tr><td>{0}</td><td>{1}</td></tr>", Drow["Cantidad"].ToString().ToEntero(), Drow["PS"].ToString()));
}
Cuerpo.AppendLine("</tr></table>");
}
Cuerpo.AppendLine("<br><br>Dudas y aclaraciones con su coordinador empresarial.");
//Adjunta Archivo al Correo
ClsSisMail.ArchivoMail ArchivoAdjunto = new ClsSisMail.ArchivoMail();
List<ClsSisMail.ArchivoMail> ListaAdjuntos = new List<ClsSisMail.ArchivoMail>();
if (File.Exists(RutaArchivoAdjunto))
{
ArchivoAdjunto.ArchivoBinario = File.ReadAllBytes(RutaArchivoAdjunto);
ArchivoAdjunto.Ruta = RutaArchivoAdjunto;
ArchivoAdjunto.NombreArchivo = new FileInfo(RutaArchivoAdjunto).Name;
ListaAdjuntos.Add(ArchivoAdjunto);
}
if ((ListaAdjuntos.Count > 0))
{
MensajeEnviado = Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString(), Archivos: ListaAdjuntos);
}
else
{
MensajeEnviado = Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString());
}
break;
case 2:
// Tipo 2 Paqueteria Recibida por Cliente - Notifica a Vendedor al actualizar estatus a 4
Cuerpo.AppendLine(String.Format("Le informamos que los productos de la factura {0} con Guía {1} y paquetería {2} han sido confirmados de recibido por el Cliente {3}.<br><br>", SerieFolio, Guia, Paqueteria, NombreCliente));
if (tDtMovimientos.Rows.Count > 0)
{
Cuerpo.AppendLine("<table><tr>");
Cuerpo.AppendLine("<th>Cantidad</th><th>Producto</th>");
foreach (DataRow Drow in tDtMovimientos.Rows)
{
Cuerpo.AppendLine(String.Format("<tr><td>{0}</td><td>{1}</td></tr>", Drow["Cantidad"].ToString().ToEntero(), Drow["PS"].ToString()));
}
Cuerpo.AppendLine("</tr></table>");
}
if (Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString()))
{
MensajeEnviado = true;
}
break;
}
return MensajeEnviado;
}
protected void CargaDatosCorreo(int CveVenta, Boolean SubirArchivo = false)
{
if (CveVenta > 0)
{
ClsVentas ObjVentas = new ClsVentas();
if (ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa))
{
if (ObjVentas.DtResultados.Rows.Count > 0)
{
DataRow DbRowVenta = ObjVentas.DtResultados.Rows[0];
int CveCliente = DbRowVenta["CveCliente"].ToString().ToEntero();
SerieFolio = String.Format("{0}-{1}", DbRowVenta["Serie"].ToString(), DbRowVenta["Folio"].ToString().ToEntero());
NombreCliente = DbRowVenta["ClienteNombre"].ToString();
//Si se subio Archivo
if (!SubirArchivo)
{
//correo de Vendedor
Destinatario = DbRowVenta["CorreoVendedorVenta"].ToString();
}
else
{
//correo del cliente
Destinatario = DbRowVenta["Mail"].ToString();
}
// Destinatario = "sig.buzon02@gmail.com"; // CORREO PRUEBA
if (ObjVentas.GetVentaDetalle(CveVenta))
{
DTMovimientos = ObjVentas.DtResultados;
}
}
}
}
}
#endregion
}

View File

@@ -0,0 +1,106 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SaldosIniciales.aspx.vb" Inherits="General_SaldosIniciales" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Carga de Saldos Iniciales
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargar" />
</Triggers>
<ContentTemplate>
<div class="col-md-4">
<div class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Selección de formato</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<asp:RadioButtonList runat="server" ID="RblFormato">
<asp:ListItem Value="1" Text="Compras - Proveedor" Selected="True"></asp:ListItem>
<asp:ListItem Value="2" Text="Ventas - Cliente"></asp:ListItem>
<asp:ListItem Value="3" Text="Factura - Proveedor"></asp:ListItem>
<asp:ListItem Value="4" Text="Factura - Cliente"></asp:ListItem>
<asp:ListItem Value="5" Text="Productos y Sevicios" ></asp:ListItem>
<asp:ListItem Value="6" Text="RH - Personal"></asp:ListItem>
<asp:ListItem Value="7" Text="AF - Activos Fijos" Enabled="false"></asp:ListItem>
<asp:ListItem Value="8" Text="Contabilidad - Cuentas Contables" Enabled="True"></asp:ListItem>
<asp:ListItem Value="9" Text="ContaSIG - Cuentas Contables" Enabled="True"></asp:ListItem>
<asp:ListItem Value="10" Text="Cont - Saldos Iniciales Cuentas" Enabled="True"></asp:ListItem>
<asp:ListItem Value="11" Text="ContaSIG - Saldos Iniciales Cuentas" Enabled="True"></asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
</div>
<div class="col-md-8">
<div class="portlet light smmallpadding traspasorow bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Subir Archivo</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-12">
<h3>Arraste o haga click para subir el archivo Excel</h3>
</div>
</div>
<div class="row">
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px; margin-bottom: 50px;">
<asp:TextBox ID="TxtExcel" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
</div>
</div>
<div class="row">
<div class="col-md-2" style="text-align: left">
<asp:Button ID="BtnDescargar" runat="server" CssClass="btn btn-warning" Text="Descargar Formato" />
</div>
<div class="col-md-10" style="text-align: right">
<asp:Button ID="BtnCargaExcel" runat="server" CssClass="btn btn-success" Text="Guardar"></asp:Button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,552 @@

Imports System.Data
Imports Extensiones
Imports System.Xml
'Imports msExcel = Microsoft.Office.Interop.Excel
Imports Microsoft.Reporting.WebForms
Partial Class General_SaldosIniciales
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
End If
End Sub
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
If TxtExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError)
End If
End Sub
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable
Dim Conexion As Odbc.OdbcConnection = Nothing
Dim ErrorArchivo = False
Dim ErrorExcel = False
Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=Excel 8.0;"
Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
objDbConnection.ConnectionString = strConnString
objDbConnection.Open()
Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
Try
Select Case Tipo
Case "CSV"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
Conexion.Open()
Dim cmd = Conexion.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = $"SELECT * FROM [{FileName}]"
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
DataAdapter.Fill(dt)
Case "EXCEL"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
Conexion.Open()
Dim cmd = Conexion.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
DataAdapter.Fill(dt)
Case Else
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
Exit Sub
End Select
Catch ex As Exception
ErrorArchivo = True
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
End Try
Conexion.Close()
If Not ErrorArchivo Then
If RblFormato.SelectedValue = "1" Or RblFormato.SelectedValue = "2" Then
If Not dt.Columns(0).ColumnName = "Codigo" Then
Alert("El nombre de la primera columna debe ser 'Codigo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(1).ColumnName = "RazonSocial" Then
Alert("El nombre de la segunda columna debe ser 'Fecha'.Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(2).ColumnName = "RFC" Then
Alert("El nombre de la tercera columna debe ser 'RFC'.Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(3).ColumnName = "Calle" Then
Alert("El nombre de la cuarta columna debe ser 'Calle'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(4).ColumnName = "Número exterior" Then
Alert("El nombre de la quinta columna debe ser 'Número exterior' .Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(5).ColumnName = "Colonia" Then
Alert("El nombre de la sexta columna debe ser 'Colonia'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(6).ColumnName = "Código postal" Then
Alert("El nombre de la séptima columna debe ser 'Código postal'.Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(7).ColumnName = "Población" Then
Alert("El nombre de la octava columna debe ser 'Población'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(8).ColumnName = "Estado" Then
Alert("El nombre de la novena columna debe ser 'Estado'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(9).ColumnName = "Teléfono" Then
Alert("El nombre de la décima columna debe ser 'Teléfono'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(10).ColumnName = "Contacto" Then
Alert("El nombre de la onceava columna debe ser 'Contacto'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(11).ColumnName = "Celular Contacto" Then
Alert("El nombre de la doceava columna debe ser 'Celular Contacto'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
ElseIf RblFormato.SelectedValue = "3" Or RblFormato.SelectedValue = "4" Then
If Not dt.Columns(0).ColumnName = "Sucursal" Then
Alert("El nombre de la primera columna debe ser 'Sucursal'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(1).ColumnName = "RFC" Then
Alert("El nombre de la segunda columna debe ser 'RFC'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(2).ColumnName = "Serie" Then
Alert("El nombre de la tercera columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(3).ColumnName = "Folio" Then
Alert("El nombre de la cuarta columna debe ser 'Folio'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(4).ColumnName = "Fecha" Then
Alert("El nombre de la quinta columna debe ser 'Fecha'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(5).ColumnName = "SubTotal" Then
Alert("El nombre de la sexta columna debe ser 'SubTotal'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(6).ColumnName = "IVA" Then
Alert("El nombre de la séptima columna debe ser 'IVA'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(7).ColumnName = "Total" Then
Alert("El nombre de la octava columna debe ser 'Total'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(8).ColumnName = "Saldo" Then
Alert("El nombre de la novena columna debe ser 'Saldo'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(9).ColumnName = "Tipo Documento" Then
Alert("El nombre de la décima columna debe ser 'Tipo Documento'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
ElseIf RblFormato.SelectedValue = "5" Then
If Not dt.Columns(0).ColumnName = "Codigo" Then
Alert("El nombre de la primera columna debe ser 'Código'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(1).ColumnName = "Descripción" Then
Alert("El nombre de la segunda columna debe ser 'Descripcion'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(2).ColumnName = "Marca" Then
Alert("El nombre de la tercera columna debe ser 'Serie'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(3).ColumnName = "Código de Barras" Then
Alert("El nombre de la cuarta columna debe ser 'Código de Barras'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(4).ColumnName = "Unidad de Medida" Then
Alert("El nombre de la quinta columna debe ser 'Unidad de Medida'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(5).ColumnName = "Producto/Servicio" Then
Alert("El nombre de la sexta columna debe ser 'Producto/Servicio'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(6).ColumnName = "Clasificación" Then
Alert("El nombre de la séptima columna debe ser 'Clasificacion'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
If Not dt.Columns(7).ColumnName = "Precio" Then
Alert("El nombre de la octava columna debe ser 'Precio'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub
End If
End If
dt.TableName = "Datos"
Dim NumRows As Integer = dt.Rows.Count
If Not ErrorArchivo Then
'P R O V E E D O R E S
If RblFormato.SelectedValue = "1" Then
Dim ObjProv As New ClsCompProveedores
Dim ErrorProv As Boolean = False
Dim Contador As Integer = 0
Dim ExisteProveedor As Boolean = False
ObjProv.IniciaTransacSQL()
For Each Row As DataRow In dt.Rows
Dim Codigo As String = Row("Codigo").ToString
Dim RazonSocial As String = Row("RazonSocial").ToString
Dim RFC As String = Row("RFC").ToString.Trim
Dim Calle As String = Row("Calle").ToString
Dim NumExt As Decimal = Row("Número exterior").ToString.ToDecimal
Dim Colonia As String = Row("Colonia").ToString
Dim CodigoPostal As Decimal = Row("Código Postal").ToString.ToDecimal
Dim Poblacion As String = Row("Población").ToString
Dim Estado As String = Row("Estado").ToString
Dim Telefono As String = Row("Teléfono").ToString
Dim Contacto As String = Row("Contacto").ToString
Dim CelularContacto As String = Row("Celular Contacto").ToString
Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
If CveProveedor > 0 Then
ExisteProveedor = True
Contador = Contador + 1
Else
If Not ObjProv.AddProveedor(Codigo, RazonSocial, RazonSocial, RazonSocial, RFC, Calle, Telefono,
Contacto, "", Telefono, -1, -1, "", 0, 0, 0, -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "",
-1, "", -1, "", -1, "", -1, "", -1, "", -1, "", -1, "", 1, -1, "", "", False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorProv = True
Exit For
End If
End If
Next
If Not ErrorProv Then
ObjProv.Commit()
If ObjProv.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, -1) Then Application("GlobalDTCompProveedores") = ObjProv.DtResultados
If Contador > 0 Then
Alert(String.Format("Se agregaron: <b>{0}</b> Proveedores correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else
Alert(String.Format("Se agregaron: <b>{0}</b> Proveedores correctamente.", NumRows), TipoMensaje.MsgInformacion)
End If
TxtExcel.Text = ""
UpDatos.Update()
Else
ObjProv.RollBack()
End If
ObjProv.Dispose()
' C L I E N T E S
ElseIf RblFormato.SelectedValue = "2" Then
Dim ObjClientes As New ClsClientes
Dim ErrorClientes As Boolean = False
Dim ExisteCliente As Boolean = False
Dim Contador As Integer = 0
ObjClientes.IniciaTransacSQL()
For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows
Dim Codigo As String = Row("Codigo").ToString
Dim RazonSocial As String = Row("RazonSocial").ToString
Dim RFC As String = Row("RFC").ToString.Trim
Dim Calle As String = Row("Calle").ToString
Dim NumExt As Decimal = Row("Número exterior").ToString.ToDecimal
Dim Colonia As String = Row("Colonia").ToString
Dim CodigoPostal As Decimal = Row("Código Postal").ToString.ToDecimal
Dim Poblacion As String = Row("Población").ToString
Dim Estado As String = Row("Estado").ToString
Dim Telefono As String = Row("Teléfono").ToString
Dim Contacto As String = Row("Contacto").ToString
Dim CelularContacto As String = Row("Celular Contacto").ToString
Dim CveCliente As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
If CveCliente > 0 Then
ExisteCliente = True
Contador = Contador + 1
Else
If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, "", "", Colonia, "", "", Estado, RFC, CodigoPostal, "", "", Contacto, "", "", "", "", -1, False, 1, -1, -1, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, -1,
"-1", "-1", "", 0, "", 0, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", "", 0, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False) Then
ErrorClientes = True
RFC.GuardaLog
Exit For
End If
End If
Next
If Not ErrorClientes Then
ObjClientes.Commit()
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
If Contador > 0 Then
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente.", NumRows), TipoMensaje.MsgInformacion)
End If
TxtExcel.Text = ""
UpDatos.Update()
Else
ObjClientes.RollBack()
End If
ObjClientes.Dispose()
'P R O V E E D O R E S - F A C T U R A S
ElseIf RblFormato.SelectedValue = "3" Then
Dim ObjCompras As New ClsCompras
Dim ErrorCompras As Boolean = False
Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL())
Dim CveCompra As Integer
Dim Contador As Integer = 0
Dim ExisteCompra As Boolean = False
Dim DtProveedores = New DataTable
DtProveedores = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
For Each Row As DataRow In dt.Rows
Dim Sucursal As String = Row("Sucursal").ToString
Dim RFC As String = Row("RFC").ToString.Trim
Dim Serie As String = Row("Serie").ToString
Dim Folio As Integer = Row("Folio").ToString.ToEntero
Dim Fecha As Date = Row("Fecha").ToString.ToDate
Dim SubTotal As Double = Row("SubTotal").ToString.ToDouble
Dim IVA As Double = Row("IVA").ToString.ToDouble
Dim Total As Double = Row("Total").ToString.ToDouble
Dim Saldo As Double = Row("Saldo").ToString.ToDouble
Dim TipoDocto As String = Row("Tipo Documento").ToString
Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString.ToEntero
Dim CvePS As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS").ToString.ToEntero
Dim CveUnidadMedida As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True
If Not CveUnidadMedida > 0 Then Alert(String.Format("No se encontró la Unidad de Medida."), TipoMensaje.MsgError) : ErrorCompras = True
If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For
TipoDocto = IIf(TipoDocto = "Ingresos", "Fac", "NC")
'PrePóliza
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Compras/SaldoInicial", 1, Total, Total, 1, Fecha, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not CvePrePoliza > 0 Then ErrorCompras = True : Exit For
'Compra
If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio, CveProveedor.ToEntero, SubTotal, 0, 0, IVA, 0, 0, 0, 0, 0, Total, Fecha, 1, 1, "-1".ToDate,
True, "", 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ErrorCompras = True
Exit For
End If
CveCompra = ObjCompras.CveCompra
'Compra Detalle
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, -1, -1, 0, 1, SubTotal, 0.16, SubTotal, 0, "Carga Inicial", -1) Then
ErrorCompras = True
Exit For
End If
'PrePólizaDetalle
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio, IIf(TipoDocto = "Fac", 5, 18), String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio, 6, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Folio, 14, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
'Saldo
If Saldo < Total Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio, 17, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Folio, 95, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor) Then ErrorCompras = True : Exit For
End If
Next
If Not ErrorCompras Then
If Contador > 0 Then
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.<br>Se Omitieron: <b>{1}</b> Compras ya que ya se encuentran registradas.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.", NumRows), TipoMensaje.MsgInformacion)
End If
Alert(String.Format("Se agregaron: <b>{0}</b> Compras correctamente.", NumRows), TipoMensaje.MsgInformacion)
ObjCompras.Commit()
TxtExcel.Text = ""
UpDatos.Update()
Else
ObjCompras.RollBack()
End If
ObjCompras.Dispose()
'C L I E N T E S - F A C T U R A S
ElseIf RblFormato.SelectedValue = "4" Then
Dim ObjVentas As New ClsVentas
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ErrorVentas As Boolean = False
Dim CveVenta As Integer
Dim DtClientes = New DataTable
' Dim ExisteVenta As Boolean = False
'Dim Contador As Integer = 0
DtClientes = GlobalDTCliente(UsuarioActual.CveEmpresa)
Dim CveSucursal As Integer = GlobalDTSucursales(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSucursal").ToString.ToEntero
Dim CvePS As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS").ToString.ToEntero
Dim CveUnidadMedida As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorVentas = True
If Not CveSucursal > 0 Then Alert("No se encontró la sucursal.", TipoMensaje.MsgError) : ErrorVentas = True
If Not CveUnidadMedida > 0 Then Alert(String.Format("No se encontró la Unidad de Medida."), TipoMensaje.MsgError) : ErrorVentas = True
For Each Row As DataRow In dt.Rows
Dim Sucursal As String = Row("Sucursal").ToString
Dim TipoDocto As String = Row("Tipo Documento").ToString
Dim RFC As String = Row("RFC").ToString.Trim
Dim Serie As String = Row("Serie").ToString
Dim Folio As Integer = Row("Folio").ToString.ToEntero
Dim Fecha As Date = Row("Fecha").ToString.ToDate
Dim SubTotal As Double = Row("SubTotal").ToString.ToDouble
Dim IVA As Double = Row("IVA").ToString.ToDouble
Dim Total As Double = Row("Total").ToString.ToDouble
Dim Saldo As Double = Row("Saldo").ToString.ToDouble
Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero
If Not CveCliente > 0 Then Alert(String.Format("No se encontró el cliente con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorVentas = True : RFC.GuardaLog : Exit For
TipoDocto = IIf(TipoDocto = "Ingresos", "Ing", "Egs")
'PrePóliza
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Venta/SaldoIncial", 1, Total, Total, 1, Fecha, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not CvePrePoliza > 0 Then ErrorVentas = True : Exit For
'Venta
If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero, -1, SubTotal, 0, 0, IVA, 0, 0, Total, 1, 1,
0, 0, 0, Fecha, Fecha, "", "", Fecha, 0, CveSucursal, CveSucursal, "", "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
UsuarioActual.CveUsuario, CveSucursal, UsuarioActual.CveEmpresa, Serie:=Serie) Then
ErrorVentas = True
Exit For
End If
CveVenta = ObjVentas.CveVenta
If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, 0.16, SubTotal, "Saldo Inicial", 0, 0, -1, 0) Then
ErrorVentas = True
Exit For
End If
'PrePólizaDetalle
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=1) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio, 1, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
'Saldo
If Saldo < Total Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Folio, 2, Folio, Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio, 95, Folio, Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente) Then ErrorVentas = True : Exit For
End If
Next
If Not ErrorVentas Then
Alert(String.Format("Se agregaron: <b>{0}</b> Ventas correctamente.", NumRows), TipoMensaje.MsgInformacion)
ObjVentas.Commit()
TxtExcel.Text = ""
UpDatos.Update()
Else
ObjVentas.RollBack()
End If
ObjVentas.Dispose()
'P R O D U C T O S / S E R V I C I O S
ElseIf RblFormato.SelectedValue = "5" Then
Dim ObjPS As New ClsProductosServicios
Dim ErrorPS As Boolean = False
Dim ExistePS As Boolean = False
Dim Contador As Integer = 0
' ObjPS.IniciaTransacSQL()
For Each Row As DataRow In dt.Rows
Dim Codigo As String = Row("Codigo").ToString
Dim Descripcion As String = Row("Descripcion").ToString
Dim TipoPS As String = Row("Tipo").ToString.Trim
Dim CodigoBarras As String = Row("Código Barras").ToString
Dim UnidadMedida As String = Row("Unidad Medida").ToString
Dim Clasificacion As String = Row("Clasificacion").ToString
Dim Marca As Decimal = Row("Marca").ToString.ToDecimal
Dim AplicaSerie As String = Row("AplicaSerie").ToString
Dim Precio As String = Row("Precio").ToString
Dim IEPS As String = Row("IEPS").ToString
Dim CvePS As Integer = GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", $"Codigo = '{Codigo}'").ToString.ToEntero
If CvePS > 0 Then
ExistePS = True
Contador = Contador + 1
Else
If Not ObjPS.AddPS(1, 1, 1, Codigo, "", "", Descripcion, Precio, 0, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1) Then
ErrorPS = True
Codigo.GuardaLog
Exit For
End If
End If
Next
If Not ErrorPS Then
'ObjPS.Commit()
If ObjPS.GetPS(-1, -1, -1) Then Application("GlobalDTProductosServicios") = ObjPS.DtResultados.AsEnumerable()
If Contador > 0 Then
Alert(String.Format("Se agregaron: <b>{0}</b> Productos/Servicios correctamente. <br>Se Omitieron: <b>{1}</b> Productos/Servicios ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else
Alert(String.Format("Se agregaron: <b>{0}</b> Productos/Servicios correctamente.", NumRows), TipoMensaje.MsgInformacion)
End If
TxtExcel.Text = ""
UpDatos.Update()
Else
'ObjPS.RollBack()
End If
ObjPS.Dispose()
End If
End If
End If
End Sub
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
Dim Directorio As String = ""
If RblFormato.SelectedValue = "1" Then
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedores.xlsx"
ElseIf RblFormato.SelectedValue = "2" Then
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx"
ElseIf RblFormato.SelectedValue = "3" Then
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas.xlsx"
ElseIf RblFormato.SelectedValue = "4" Then
Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas.xlsx"
End If
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name)
Response.AddHeader("Content-Length", Archivo.Length.ToString())
Response.ContentType = "text/plain"
Response.Flush()
Response.TransmitFile(Archivo.FullName)
Response.End()
End If
End Sub
End Class

File diff suppressed because it is too large Load Diff