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,63 @@
<%@ Page Title="SIG - Catálogo de Usuario" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatContrasenia.aspx.vb" Inherits="CatContrasenia" %>
<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">
Cambiar Contraseña
</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">
<td colspan="2"></td>
</tr>
<tr>
<th>Contraseña Actual:
</th>
<th>
<asp:TextBox ID="TxtContraseniaActual" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVActual" runat="server" ErrorMessage="Contraseña Vacía"
ControlToValidate="TxtContraseniaActual" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</th>
</tr>
<tr>
<th>Nueva contraseña:
</th>
<th>
<asp:TextBox ID="TxtContrasenia1" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVContrasenia" runat="server" ErrorMessage="Contraseña Vacía"
ControlToValidate="TxtContrasenia1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</th>
</tr>
<tr>
<th>Confirmar contraseña:
</th>
<th style="text-align: left;">
<asp:TextBox ID="TxtContrasenia2" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Contraseña Vacía"
ControlToValidate="TxtContrasenia2" ValidationGroup="GrpGuardar" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVContrasenia" runat="server" ErrorMessage="Contraseñas diferentes"
Text="La nueva contraseña es diferente" ControlToCompare="TxtContrasenia1" ControlToValidate="TxtContrasenia2"
ValidationGroup="GrpGuardar" Display="Dynamic"></asp:CompareValidator>
</th>
</tr>
<tr>
<th colspan="2" style="text-align: center;">
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" />
</th>
</tr>
</thead>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,51 @@
Imports System.Data
Imports Extensiones
Partial Class CatContrasenia
Inherits ClsPaginas
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
'oculto el menu
CType(Me.Master, BaseMasterPage).EsPopup = True
End If
End Sub
Public Sub GuardaDatos()
Dim Usuario As New ClsSisUsuarios
Usuario.IniciaTransacSQL()
If Usuario.GetUsuarios(UsuarioActual.CveUsuario) Then
Dim db As DataRow = Usuario.DtResultados.FiltroPrimero("")
If db("contraseña").ToString = Encripta(TxtContraseniaActual.Text) Then
If Usuario.UpdateUsuarioContrasenia(Encripta(TxtContrasenia1.Text), db("CveUsuario").ToString.ToEntero, db("CveEmpresa").ToString.ToEntero) Then
Alert("Contraseña Modificada.", TipoMensaje.MsgInformacion, JSBtnAceptar:=If(TxtContraseniaActual.Text = ContraseñaPredeterminada, "location.href=""/Inicio.aspx""", ""))
'redirecciona, cuando es el primer cambio de contraseña
UsuarioActual.Contraseña = TxtContrasenia1.Text
Usuario.Commit()
Else
Usuario.RollBack()
Alert("Contraseña Incorrecta.", TipoMensaje.MsgAdvertencia)
End If
Else
Usuario.RollBack()
Alert("Contraseña Incorrecta.", TipoMensaje.MsgError)
End If
End If
Usuario.Dispose()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
GuardaDatos()
End Sub
End Class

View File

@@ -0,0 +1,84 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDistribuidores.aspx.vb" Inherits="Sistemas_CatDistribuidores" %>
<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 distribuidores
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<li>
<a href="javascript:$('#divAgregar').modal()"><i class="fa fa-plus"></i> Agregar</a>
</li>
</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" GridLines="None" DataKeyNames="CveDistribuidor, Distribuidor, CvePlataforma" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
<Columns>
<asp:BoundField DataField="Distribuidor" ItemStyle-Width="45%" HeaderText="Distribuidor" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Plataforma" HeaderText="Plataforma" ItemStyle-Width="45%" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:LinkButton ID="imgE" HeaderText="Eliminar" 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 HeaderText="Eliminar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
<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>
<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">Agregar Distribuidor</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDistribuidor" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEstatusOS" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDistribuidor" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Distribuidor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtDistribuidor.ClientID.ToString()%>">Distribuidor:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPlataforma" runat="server" DataTextField="Plataforma" DataValueField="CvePlataforma" CssClass="form-control select2me js-Impuesto-programmatic" Width="100%">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlPlataforma" runat="server" ControlToValidate="DdlPlataforma" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Plataforma''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlPlataforma.ClientID.ToString()%>">Plataforma:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="BtnAgregarDistribuidor" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
<asp:linkbutton runat="server" id="btnCancelar" cssclass="btn btn-default" text="Cancelar"></asp:linkbutton>
</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,144 @@
Imports Extensiones
Imports System.Data
Partial Class Sistemas_CatDistribuidores
Inherits ClsPaginas
#Region "Propiedades"
Public Property CveDistribuidor As Integer
Get
Return ViewState("CveDistribuidor").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveDistribuidor") = value
End Set
End Property
Public Property CvePlataforma As Integer
Get
Return ViewState("CvePlataforma").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePlataforma") = 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
CveDistribuidor = -1
CvePlataforma = -1
EsEditar = 0
CargaCombos()
CargaDatos(-1)
End If
End Sub
Private Sub CargaCombos()
Dim Plataforma As New ClsSisEmpresas
If Plataforma.GetPlataforma(CvePlataforma, "-1") Then
DdlPlataforma.DataSource = Plataforma.DtResultados
Else
DdlPlataforma.DataSource = Nothing
End If
Plataforma.Dispose()
DdlPlataforma.DataBind()
DdlPlataforma.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlPlataforma.SelectedValue = "-1"
End Sub
Private Sub CargaDatos(CvePlataforma As Integer)
Dim Plataforma As New ClsSisEmpresas
If Plataforma.GetDistribuidor(-1, "-1", -1) Then
GvDatos.DataSource = Plataforma.DtResultados
Else
GvDatos.DataSource = Nothing
End If
Plataforma.Dispose()
GvDatos.DataBind()
End Sub
Protected Sub imgE_Click(sender As Object, e As EventArgs)
Dim Boton = CType(sender, LinkButton)
CveDistribuidor = Boton.CommandArgument.ToEntero
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
TxtDistribuidor.Text = GvRow.DataKey("Distribuidor").ToString
DdlPlataforma.SelectedValueExist(GvRow.DataKey("CvePlataforma").ToString)
EsEditar = 1
BtnAgregarDistribuidor.Text = "Actualizar"
UpBodyEstatus.Update()
UpFooter.Update()
RegistraScript("$('#divAgregar').modal()")
End Sub
Protected Sub BtnAgregarDistribuidor_Click(sender As Object, e As EventArgs) Handles BtnAgregarDistribuidor.Click
Dim Plataforma As New ClsSisEmpresas
If EsEditar = 0 Then
If Plataforma.AddDistribuidor(TxtDistribuidor.Text.Trim, DdlPlataforma.SelectedValue.ToEntero) Then
Alert("El distribuidor se agregó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al agregar el distribuidor", TipoMensaje.MsgError)
End If
ElseIf EsEditar = 1 Then
If Plataforma.UpdateDistribuidor(CveDistribuidor, DdlPlataforma.SelectedValue, TxtDistribuidor.Text) Then
Alert("el distribuidor se editó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al editar el distribuidor", TipoMensaje.MsgError)
End If
EsEditar = 0
BtnAgregarDistribuidor.Text = "Agregar"
End If
RegistraScript("$('#divAgregar').modal('hide')")
Plataforma.Dispose()
TxtDistribuidor.Text = ""
DdlPlataforma.SelectedValue = "-1"
CargaDatos(-1)
UpDatos.Update()
UpBodyEstatus.Update()
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim Plataforma As New ClsSisEmpresas
Dim CveDistribuidor As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveDistribuidor").ToEntero
If Plataforma.DeleteDistribuidor(CveDistribuidor) Then
Alert("La plataforma se eliminó correctamente", TipoMensaje.MsgInformacion)
End If
Plataforma.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("CveDistribuidor").ToString
End If
End Sub
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
EsEditar = 0
TxtDistribuidor.Text = ""
DdlPlataforma.SelectedValue = "-1"
RegistraScript("$('#divAgregar').modal('hide')")
BtnAgregarDistribuidor.Text = "Agregar"
UpBodyEstatus.Update()
UpFooter.Update()
End Sub
End Class

130
Sistemas/CatEmpresas.aspx Normal file
View File

@@ -0,0 +1,130 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEmpresas.aspx.vb" Inherits="Sistemas_CatEmpresas" %>
<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 runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="LBAdd" PostBackUrl="/Sistemas/Empresa.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Nueva Empresa</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
<%--<img alt="Nueva Empresa" title="Nueva Empresa" onclick="document.location.href='/Sistemas/Empresa.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />
&nbsp--%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Empresas
</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="90px">
<asp:LinkButton ID="LbCveEmpresa" runat="server" CausesValidation="false" Text="" CommandArgument="CveEmpresa" OnClick="LbOrden_Click">
Clave
<asp:Literal ID="ImgCveEmpresa" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="350px">
<asp:LinkButton ID="LbEmpresa" runat="server" CausesValidation="false" Text="" CommandArgument="Empresa" OnClick="LbOrden_Click">
Nombre de la Empresa
<asp:Literal ID="ImgEmpresa" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="180px">
<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="110px">
<asp:LinkButton ID="LbTipoFacturacion" runat="server" CausesValidation="false" Text="" CommandArgument="TipoFacturacion" OnClick="LbOrden_Click">
Tipo de Facturación
<asp:Literal ID="ImgTipoFacturacion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="110px">
<asp:LinkButton ID="LbTimbres" runat="server" CausesValidation="false" Text="" CommandArgument="Timbres" OnClick="LbOrden_Click">
Timbres
<asp:Literal ID="ImgTimbres" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="110px">
<asp:LinkButton ID="LbEstatusFacturacion" runat="server" CausesValidation="false" Text="" CommandArgument="EstatusFacturacion" OnClick="LbOrden_Click">
Estatus Facturación
<asp:Literal ID="ImgEstatusFacturacion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
</tr>
</thead>
</table>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se Encontró Empresas Registradas" Width="100%" ToolTip="Listado de Empresas" CssClass="table table-striped table-advance table-hover ScrollAD" data-sort="true" Style=" text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Clave">
<ItemTemplate>
<asp:Literal ID="LtlCveEmpresa" runat="server" Text='<%# Eval("CveEmpresa", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre de la Empresa">
<ItemTemplate>
<asp:Literal ID="LtlEmpresa" runat="server" Text='<%# Eval("Empresa", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC">
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Facturación">
<ItemTemplate>
<asp:Literal ID="LtlTipoFacturacion" runat="server" Text='<%# Eval("TipoFacturacion", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Timbres">
<ItemTemplate>
<asp:Literal ID="LtlTimbres" runat="server" Text='<%# Eval("Timbres") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus de Facturación">
<ItemTemplate>
<asp:Literal ID="LtlEstatusFacturacion" runat="server" Text='<%# Eval("EstatusFacturacion") %>' />
</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 la Empresa?');
}
function AsignaPermisos(Rol) {
$get("LblUsrEdit").innerText = Rol;
$("#DivPermisos").show();
$("#DivPermisos").center();
}
function AsignaProcesos(Rol) {
$get("LblProcesoEdit").innerText = Rol;
$("#DivProcesos").show();
$("#DivProcesos").center();
}
$(function () {
$("#DivPermisos").draggable();
});
</script>
</asp:Content>

View File

@@ -0,0 +1,132 @@
Imports System.Data
Imports System.Drawing
Imports Extensiones
Partial Class Sistemas_CatEmpresas
Inherits ClsPaginas
#Region "Permisos"
Private Property PermisoEditar As Boolean
Get
Return CType(ViewState("PermisoEditar"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoEditar") = value
End Set
End Property
Private Property PermisoModulos As Boolean
Get
Return CType(ViewState("PermisoModulos"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoModulos") = value
End Set
End Property
Private Property PermisoProcesos As Boolean
Get
Return CType(ViewState("PermisoProcesos"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoProcesos") = value
End Set
End Property
Private Property PermisoRestablecerContraseña As Boolean
Get
Return CType(ViewState("PermisoProcesos"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoProcesos") = 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
If UsuarioActual.CveRol <> 1 Then Response.Redirect("/Inicio.aspx")
ViewState("Orden") = "CveEmpresa ASC"
ViewState("CveRol") = -1
'CargaRoles()
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim Empresa As New ClsSisEmpresas
If Empresa.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
GlobalDTEmpresas = Empresa.DtResultados
Else
GvDatos.DataSource = Nothing
End If
Empresa.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal Then
If e.Row.RowIndex <= 1 Then
e.Row.Cells(0).Width = Unit.Pixel(90)
e.Row.Cells(1).Width = Unit.Pixel(350)
e.Row.Cells(2).Width = Unit.Pixel(180)
e.Row.Cells(3).Width = Unit.Pixel(110)
e.Row.Cells(4).Width = Unit.Pixel(109)
e.Row.Cells(5).Width = Unit.Pixel(109)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.FCLiteral("LtlCveEmpresa").Text = String.Format("<a class=""Texto"" href=""/Sistemas/Empresa.aspx?CveEmpresa={0}"">{1}</a>", e.Row.DBCampo("CveEmpresa"), e.Row.FCLiteral("LtlCveEmpresa").Text)
End If
End If
End Sub
#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(GlobalDTEmpresas, "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = GlobalDTEmpresas
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,239 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatFuncionalidades.aspx.vb" Inherits="Sistemas_CatFuncionalidades" %>
<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 Funcionalidades
</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="TabEmpresasFuncionalidad" runat="server" HeaderText="Empresa-Funcionalidades">
<ContentTemplate>
<asp:UpdatePanel ID="UpTitulosE" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEmpresas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEmpresas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<table class="table-striped Widthall" style="max-width: 100%">
<thead>
<tr class="Titulos">
<th width="20%">Empresa
</th>
<th width="20%">Funcionalidad
</th>
<th width="20%">Valor
</th>
<th width="20%">Comandos
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center">
<asp:DropDownList ID="DdlEmpresa" runat="server" Width="100%" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Empresa" DataValueField="CveEmpresa" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlFuncionalidad" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="FuncionalidadDdl" DataValueField="CveFuncionalidad" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<%--<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtValor" Width="50%" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVValor" runat="server" ControlToValidate="TxtValor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Funcionalidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOValor" runat="server" HighlightCssClass="vco" TargetControlID="RFVValor" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarFuncionalidadEmpresa" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton>
</td>
</tr>
</tbody>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvEmpresas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveFuncionalidad,Funcionalidad,CveEmpresa" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<%--<asp:BoundField DataField="CveFuncionalidad" ItemStyle-HorizontalAlign="Center" />--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlCveFuncionalidad" runat="server" Text='<%# Eval("CveFuncionalidad") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlFuncionalidad" runat="server" Text='<%# Eval("Funcionalidad") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlValor" runat="server" Text='<%# Eval("Valor") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtValordEdit" runat="server" Width="50%" Text='<%# Eval("Valor") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVValorEdit" runat="server" ControlToValidate="TxtValordEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Valor''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpComisionEdit"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOValorEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVValorEdit" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="20%" HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<div style="width: 80px;">
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpLimiteEdit" />
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</div>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" 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 ItemStyle-Width="10%" HeaderText="Eliminar" 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="confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabFuncionalidades" runat="server" HeaderText="Funcionalidades">
<ContentTemplate>
<asp:UpdatePanel ID="UpTitulosF" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table-striped Widthall" style="max-width: 100%">
<thead>
<tr class="Titulos">
<th width="2%" style="text-align: left">Clave
</th>
<th width="25%" style="text-align: left">Funcionalidad
</th>
<th width="25%" style="text-align: left">Descripcion
</th>
<th width="20%">Comandos
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">
<asp:TextBox ID="TxtClave" Width="100%" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVClave" runat="server" ControlToValidate="TxtClave" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEClave" runat="server" HighlightCssClass="vco" TargetControlID="RFVClave" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtFuncionalidad" Width="100%" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFuncionalidad" runat="server" ControlToValidate="TxtFuncionalidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Funcionalidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFuncionalidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVFuncionalidad" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtDescripcion" Width="100%" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCODescripcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcion" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarFuncionalidad" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton>
</td>
</tr>
</tbody>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row" align="right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvFuncionalidad.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvFuncionalidad.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UpFuncionalidad" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvFuncionalidad" runat="server" Width="100%" CssClass="table-striped table-hover Widthall ADScroller" DataKeyNames="CveFuncionalidad,Funcionalidad" GridLines="None" EmptyDataText="No se encontraron Registros con el filtro actual" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlCveFuncionalidad" runat="server" Text='<%# Eval("CveFuncionalidad") %>'></asp:Literal>
</ItemTemplate>
<%-- <EditItemTemplate>
<asp:TextBox ID="TxtCveFuncionalidadEdit" runat="server" Text='<%# Eval("CveFuncionalidad") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFuncionalidadEdit" runat="server" ControlToValidate="TxtCveFuncionalidadEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpComisionEdit"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFuncionalidadEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVFuncionalidadEdit" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>--%>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlFuncionalidad" runat="server" Text='<%# Eval("Funcionalidad") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtFuncionalidadEdit" runat="server" Width="100%" Text='<%# Eval("Funcionalidad") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFuncionalidad2Edit" runat="server" ControlToValidate="TxtFuncionalidadEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Funcionalidad''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpComisionEdit"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFuncionalidad2Edit" runat="server" HighlightCssClass="vco" TargetControlID="RFVFuncionalidad2Edit" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlDescripcion" runat="server" Text='<%# Eval("Descripción") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtDescripcionEdit" runat="server" Width="100%" Text='<%# Eval("Descripción") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcionEdit" runat="server" ControlToValidate="TxtDescripcionEdit" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpComisionEdit"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCODescripcionEdit" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcionEdit" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<div style="width: 80px;">
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpLimiteEdit" />
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</div>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" 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 ItemStyle-Width="10%" HeaderText="Eliminar" 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="confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,245 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class Sistemas_CatFuncionalidades
Inherits ClsPaginas
Private Sub Sistemas_CatFuncionalidades_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlEmpresa.SelectedValue = UsuarioActual.CveEmpresa.ToString
CargaEmpresasFuncionalidad(UsuarioActual.CveEmpresa)
CargaEmpresas()
CargaFuncionalidades()
CargaEmpresaFuncionalidad()
End If
End Sub
#Region "E M P R E S A S - F U N C I O N A L I D A D E S"
Private Sub DdlEmpresa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresa.SelectedIndexChanged
CargaEmpresasFuncionalidad(DdlEmpresa.SelectedValue.ToEntero)
End Sub
Private Sub CargaEmpresasFuncionalidad(CveEmpresa As Integer)
Dim ObjSis As New ClsSisEmpresas
If ObjSis.GetEmpresasFuncionalidades(CveEmpresa) Then
GvEmpresas.DataSource = ObjSis.DtResultados.FiltraParametros("", Orderby:="CveFuncionalidad ASC")
Else
GvEmpresas.DataSource = Nothing
End If
ObjSis.Dispose()
GvEmpresas.DataBind()
UpDatos.Update()
End Sub
Private Sub CargaEmpresas()
Dim ObjSiS As New ClsSisEmpresas
If ObjSiS.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
DdlEmpresa.DataSource = ObjSiS.DtResultados
Else
DdlEmpresa.DataSource = Nothing
End If
ObjSiS.Dispose()
DdlEmpresa.DataBind()
UpTitulosE.Update()
End Sub
Private Sub CargaEmpresaFuncionalidad()
Dim ObjSiS As New ClsSisEmpresas
If ObjSiS.GetFuncionalidades() Then
DdlFuncionalidad.DataSource = ObjSiS.DtResultados
Else
DdlFuncionalidad.DataSource = Nothing
End If
ObjSiS.Dispose()
DdlFuncionalidad.DataBind()
UpTitulosE.Update()
End Sub
Private Sub GvEmpresas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEmpresas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
End If
End Sub
Private Sub GvEmpresas_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvEmpresas.RowEditing
GvEmpresas.EditIndex = e.NewEditIndex
CargaEmpresasFuncionalidad(DdlEmpresa.SelectedValue.ToEntero)
End Sub
Private Sub GvEmpresas_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvEmpresas.RowCancelingEdit
GvEmpresas.EditIndex = -1
CargaEmpresasFuncionalidad(DdlEmpresa.SelectedValue.ToEntero)
End Sub
Private Sub GvEmpresas_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvEmpresas.RowUpdating
Dim ObjSis As New ClsSisEmpresas
Dim TieneError = False
Dim CveFuncionalidad = GvEmpresas.Rows(e.RowIndex).DataKey("CveFuncionalidad").ToEntero
Dim Valor = DirectCast(GvEmpresas.Rows(e.RowIndex).FindControl("TxtValordEdit"), TextBox).Text.Trim
If Not ObjSis.UpdateEmpresaFuncionalidad(CveFuncionalidad, Valor, DdlEmpresa.SelectedValue.ToEntero) Then
TieneError = True
End If
ObjSis.Dispose()
If Not TieneError Then
GvEmpresas.EditIndex = -1
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CargaEmpresasFuncionalidad(DdlEmpresa.SelectedValue.ToEntero)
Else
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
End If
UpDatos.Dispose()
End Sub
Private Sub GvEmpresas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvEmpresas.RowDeleting
Dim ObjSis As New ClsSisEmpresas
Dim TieneError = False
Dim CveFuncionalidad = GvEmpresas.Rows(e.RowIndex).DataKey("CveFuncionalidad").ToEntero
If Not ObjSis.RemoveEmpresasFuncionalidades(CveFuncionalidad, DdlEmpresa.SelectedValue.ToEntero) Then
TieneError = True
End If
ObjSis.Dispose()
If Not TieneError Then
GvEmpresas.EditIndex = -1
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CargaEmpresasFuncionalidad(DdlEmpresa.SelectedValue.ToEntero)
Else
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
End If
UpDatos.Dispose()
End Sub
Private Sub LbAgregarFuncionalidadEmpresa_Click(sender As Object, e As EventArgs) Handles LbAgregarFuncionalidadEmpresa.Click
Dim ObjSis As New ClsSisEmpresas
Dim TieneError = False
If Not ObjSis.AddUpdateEmpresaFuncionalidades(DdlEmpresa.SelectedValue.ToEntero, DdlFuncionalidad.SelectedValue.ToEntero, TxtValor.Text.Trim) Then
TieneError = True
End If
ObjSis.Dispose()
If Not TieneError Then
Alert("Se guardo correctamente", TipoMensaje.MsgInformacion)
TxtValor.Text = ""
CargaEmpresasFuncionalidad(DdlEmpresa.SelectedValue.ToEntero)
Else
Alert("Error al guardar Funcionalidad", TipoMensaje.MsgError)
End If
End Sub
#End Region
#Region "F U N C I O N A L I D A D E S"
Private Sub CargaFuncionalidades()
Dim ObjSis As New ClsSisEmpresas
If ObjSis.GetFuncionalidades() Then
GvFuncionalidad.DataSource = ObjSis.DtResultados
Else
GvFuncionalidad.DataSource = Nothing
End If
ObjSis.Dispose()
GvFuncionalidad.DataBind()
UpFuncionalidad.Update()
End Sub
Private Sub GvFuncionalidad_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvFuncionalidad.RowEditing
GvFuncionalidad.EditIndex = e.NewEditIndex
CargaFuncionalidades()
End Sub
Private Sub GvFuncionalidad_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvFuncionalidad.RowCancelingEdit
GvFuncionalidad.EditIndex = -1
CargaFuncionalidades()
End Sub
Private Sub GvFuncionalidad_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvFuncionalidad.RowUpdating
Dim ObjSis As New ClsSisEmpresas
Dim TieneError = False
Dim CveFuncionalidad = GvFuncionalidad.Rows(e.RowIndex).DataKey("CveFuncionalidad").ToEntero
Dim Funcionalidad = DirectCast(GvFuncionalidad.Rows(e.RowIndex).FindControl("TxtFuncionalidadEdit"), TextBox).Text.Trim
Dim Descripcion = DirectCast(GvFuncionalidad.Rows(e.RowIndex).FindControl("TxtDescripcionEdit"), TextBox).Text.Trim
If Not ObjSis.UpdateFuncionalidades(CveFuncionalidad, Funcionalidad, Descripcion) Then
TieneError = True
End If
ObjSis.Dispose()
If Not TieneError Then
GvFuncionalidad.EditIndex = -1
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CargaFuncionalidades()
CargaEmpresaFuncionalidad()
Else
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
End If
UpFuncionalidad.Dispose()
End Sub
Private Sub GvFuncionalidad_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvFuncionalidad.RowDeleting
Dim ObjSis As New ClsSisEmpresas
Dim TieneError = False
Dim CveFuncionalidad = GvFuncionalidad.Rows(e.RowIndex).DataKey("CveFuncionalidad").ToEntero
If Not ObjSis.RemoveFuncionalidades(CveFuncionalidad) Then
TieneError = True
End If
ObjSis.Dispose()
If Not TieneError Then
GvFuncionalidad.EditIndex = -1
Alert("Se eliminador datos correctamente", TipoMensaje.MsgInformacion)
CargaFuncionalidades()
CargaEmpresaFuncionalidad()
Else
Alert("Error al eliminar", TipoMensaje.MsgError)
End If
UpFuncionalidad.Dispose()
End Sub
Private Sub LbAgregarFuncionalidad_Click(sender As Object, e As EventArgs) Handles LbAgregarFuncionalidad.Click
Dim ObjSis As New ClsSisEmpresas
Dim TieneError = False
If Not ObjSis.AddFuncionalidades(TxtClave.Text.Trim.ToEntero, TxtFuncionalidad.Text.Trim, TxtDescripcion.Text.Trim) Then
TieneError = True
End If
ObjSis.Dispose()
If Not TieneError Then
Alert("Se guardo correctamente", TipoMensaje.MsgInformacion)
TxtClave.Text = ""
TxtFuncionalidad.Text = ""
TxtDescripcion.Text = ""
CargaFuncionalidades()
CargaEmpresaFuncionalidad()
Else
Alert("Error al guardar Funcionalidad", TipoMensaje.MsgError)
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,264 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatIndicadores.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 Indicadores
</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="TabIndicadores" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabEmpresaIndicadores" runat="server" HeaderText="Alta Empresa Indicadores">
<ContentTemplate>
<asp:UpdatePanel ID="UpEmpresas" 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">
Indicador
<asp:Literal ID="ImgCaracteristica1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="150px">
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario1" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario1;1">
Empresa
<asp:Literal ID="ImgUsuario1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:DropDownList ID="DdlIndicador" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Indicador" DataValueField="CveIndicador" 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="DdlIndicador" 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:DropDownList ID="DdlEmpresa" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Empresa" DataValueField="CveEmpresa" Class="select2me" Style="width: 184px !important;" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEmpresa" runat="server" ControlToValidate="DdlEmpresa" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Empresa''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVEmpresa" Width="100px"></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="UpDatosempresas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvEmpresas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEmpresa, CveIndicador" EmptyDataText="No se encontraron Indicadores para las Empresas." ToolTip="Listado de Opciones para Caracteristicas de Productos o Servicios" CssClass="table table-striped table-advance table-hover Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlIndicador" runat="server" Text='<%# Eval("Indicador", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlEmpresa" runat="server" Text='<%# Eval("Empresa", "&nbsp;{0}") %>'></asp:Literal>
</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:TabPanel ID="TabAltaIndicadores" runat="server" HeaderText="Alta Indicadores">
<ContentTemplate>
<asp:UpdatePanel ID="UpIndicadores" 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">
Indicador
<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">
Módulo
<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">
Tipo Módulo
<asp:Literal ID="ImgImporte" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th></th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtIndicador" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVLimite" runat="server" ControlToValidate="TxtIndicador" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Indicador''</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 style="text-align: center">
<asp:DropDownList ID="DdlModulo" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Modulo" DataValueField="CveModulo" Class="select2me" Style="width: 184px !important;" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVModulos" runat="server" ControlToValidate="DdlModulo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Módulo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVModulos" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td align="center">
<asp:DropDownList runat="server" ID="DdlTipoModulo" CssClass="select2me">
<asp:ListItem Text="Indicador" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Gráfica" Value="2"></asp:ListItem> </asp:DropDownList>
</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="UpGvIndicadores" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvIndicadores" runat="server" AutoGenerateColumns="False" DataKeyNames="CveIndicador" EmptyDataText="No se encontraron Indicadores." ToolTip="Listado de Caracteristicas de Productos o Servicios" CssClass="table table-striped table-advance table-hover Widthall" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlIndicador" runat="server" Text='<%# Eval("Indicador", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtIndicador" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Indicador")%>' Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVIndicador" runat="server" ControlToValidate="TxtIndicador" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Indicador''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOIndicador" runat="server" HighlightCssClass="vco" TargetControlID="RFVIndicador" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlModulo" runat="server" Text='<%# Eval("Modulo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlModulo" runat="server" DataTextField="Modulo" DataValueField="CveModulo" Width="184px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVModulo" runat="server" ControlToValidate="DdlModulo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modulo''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModulo" runat="server" HighlightCssClass="vco" TargetControlID="RFVModulo" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="LtlTipoModulo" runat="server" Text='<%# Eval("TipoModulo") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkTipoModulo" CssClass="md-checksd2" runat="server" Checked='<%# If(Eval("TipoModulo").ToString = "Sí", True, False) %>' />
<asp:HiddenField ID="hdnEsOpcion" Value='<%# Eval("TipoModulo") %>' runat="server" />
</EditItemTemplate>
</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: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,200 @@
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()
CargaDdlIndicadores()
CargaDdlModulos()
CargaDdlEmpresas()
End If
End Sub
#Region " CARGAS "
Private Sub CargaDatos()
Dim Objeto As New ClsIndicadores
If Objeto.GetIndicadores() Then
GvIndicadores.DataSource = Objeto.DtResultados
End If
GvIndicadores.DataBind()
If Objeto.GetIndicadoresEmpresas() Then
GvEmpresas.DataSource = Objeto.DtResultados
End If
GvEmpresas.DataBind()
Objeto.Dispose()
End Sub
Public Sub CargaDdlIndicadores()
DdlIndicador.Items.Clear()
Dim Objeto As New ClsIndicadores
If Objeto.GetIndicadores() Then
DdlIndicador.DataSource = Objeto.DtResultados
End If
DdlIndicador.DataBind()
Objeto.Dispose()
End Sub
Public Sub CargaDdlModulos()
DdlModulo.Items.Clear()
Dim Objeto As New ClsIndicadores
If Objeto.GetModulos(UsuarioActual.CveEmpresa) Then
DdlModulo.DataSource = Objeto.DtResultados
End If
DdlModulo.DataBind()
Objeto.Dispose()
End Sub
Public Sub CargaDdlEmpresas()
DdlEmpresa.Items.Clear()
DdlEmpresa.DataSource = GlobalDTEmpresas
DdlEmpresa.DataBind()
End Sub
#End Region
#Region " GV INDICADORES Y AGREGAR "
Private Sub LbAgregarC_Click(sender As Object, e As EventArgs) Handles LbAgregarC.Click
Dim Objeto As New ClsIndicadores
Dim Indicador = TxtIndicador.Text
Dim Modulo = DdlModulo.SelectedValue.ToEntero
Dim TipoModulo = DdlTipoModulo.SelectedValue.ToEntero
If Objeto.AddIndicador(Indicador, Modulo, TipoModulo) Then
TxtIndicador.Text = ""
CargaDatos()
UpIndicadores.Update()
End If
CargaDdlIndicadores()
UpEmpresas.Update()
Objeto.Dispose()
Alert("El Indicador se agregó correctamente.", TipoMensaje.MsgInformacion)
End Sub
Protected Sub GvIndicadores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvIndicadores.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("TipoModulo") = "1" Then
e.Row.FCLabel("LtlTipoModulo").Text = "Indicador"
Else
e.Row.FCLabel("LtlTipoModulo").Text = "Gráfica"
End If
End If
End If
End Sub
Protected Sub GVCarac_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvIndicadores.RowEditing
GvIndicadores.EditIndex = e.NewEditIndex
CargaDatos()
End Sub
Protected Sub GvDatosCaracteristicas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvIndicadores.RowUpdating
Dim Update As New ClsIndicadores
Dim Indicador = GvIndicadores.Rows(e.RowIndex).FCTextBox("TxtIndicador").Text.Trim
Dim CveModulo = GvIndicadores.Rows(e.RowIndex).FCDropDownList("DdlModulo").SelectedValue.ToEntero
Dim TipoModulo = GvIndicadores.Rows(e.RowIndex).FCCheckBox("TipoModulo").Checked
Dim Clave = GvIndicadores.Rows(e.RowIndex).DataKey("CveIndicador").ToEntero
If Update.UpdateIndicador(Indicador, CveModulo, TipoModulo, Clave) Then
Alert("Se actualizó correctamente.", TipoMensaje.MsgInformacion)
End If
GvIndicadores.EditIndex = -1
CargaDatos()
UpIndicadores.Update()
End Sub
Protected Sub GvIndicadores_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvIndicadores.RowCancelingEdit
GvIndicadores.EditIndex = -1
CargaDatos()
Alert("Se canceló la edición de los campos.")
End Sub
Protected Sub GvIndicadores_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvIndicadores.RowDeleting
Dim Objeto As New ClsIndicadores
Dim Clave = GvIndicadores.Rows(e.RowIndex).DataKey("CveIndicador").ToEntero
If Objeto.RemoveIndicadores(Clave) Then
Alert("Se borró correctamente de la base de Datos.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
GvIndicadores.EditIndex = -1
CargaDatos()
CargaDdlIndicadores()
UpIndicadores.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 GvEmpresas.RowDeleting
Dim Objeto As New ClsIndicadores
Dim Cveindicador = GvEmpresas.Rows(e.RowIndex).DataKey("CveIndicador").ToEntero
Dim CveEmpresa = GvEmpresas.Rows(e.RowIndex).DataKey("CveEmpresa").ToEntero
If Objeto.RemoveIndicadoresEmpresas(Cveindicador, CveEmpresa) Then
Alert("Se borró correctamente de la base de Datos.", TipoMensaje.MsgInformacion)
End If
GvEmpresas.EditIndex = -1
CargaDatos()
UpEmpresas.Update()
End Sub
Private Sub LbAgregarO_Click(sender As Object, e As EventArgs) Handles LbAgregarO.Click
Dim Objeto As New ClsIndicadores
Dim Indicador = DdlIndicador.SelectedValue.toEntero
Dim Empresa = DdlEmpresa.SelectedValue.toEntero
If Objeto.AddIndicadorEmpresa(Indicador, Empresa) Then
End If
CargaDatos()
UpDatosempresas.Update()
UpTitulosO.Update()
Objeto.Dispose()
Alert("El valor del Indicador se agregó correctamente.", TipoMensaje.MsgInformacion)
End Sub
#End Region
End Class

View File

@@ -0,0 +1,225 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatIndicadoresUsuarios.aspx.vb" Inherits="Sistemas_CatIndicadoresUsuarios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position:static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Indicadores y Usuarios
</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="TcIndicaresUsuarios" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabRoles" runat="server" HeaderText="Roles">
<ContentTemplate>
<asp:UpdatePanel ID="UpRoles" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover Widthall">
<thead>
<tr class="Titulos">
<th style=" width:25% !important;">Indicadores
</th>
<th style=" width:25% !important;">Roles
</th>
<th style="width: 310px">Comandos</th>
</tr>
</thead>
<tr>
<td align="left" style="text-align: center">
<asp:DropDownList ID="DdlIndicador" runat="server" CausesValidation="true" DataTextField="Indicador" DataValueField="CveIndicador" ValidationGroup="GrpGuardar" Width="160px" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVIndicador" runat="server" ControlToValidate="DdlIndicador" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Indicador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VcoIndicador" runat="server" HighlightCssClass="vco" TargetControlID="RFVIndicador" Width="300px" />
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlRol" runat="server" CausesValidation="true" DataTextField="Rol" DataValueField="CveRol" ValidationGroup="GrpGuardar" Width="160px" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVRol" runat="server" ControlToValidate="DdlRol" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Rol''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORol" runat="server" HighlightCssClass="vco" TargetControlID="RFVRol" Width="300px" />
</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
<asp:GridView ID="GvRoles" runat="server" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" DataKeyNames="CveIndicador,CveRol" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="Indicador" DataField="Indicador" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Rol" DataField="Rol" ItemStyle-HorizontalAlign="Left" />
<%-- <asp:TemplateField>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Indicador") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEIndicador" runat="server" DataTextField="Indicador" DataValueField="CveIndicador" ></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Rol") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlERol" runat="server" DataTextField="Rol" DataValueField="CveRol" ></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>--%>
<%-- <asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:LinkButton ID="LnkU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ValidationGroup="GrpEditGuardar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" />
<asp:LinkButton ID="LnkC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkE" 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-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkD" 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>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabUsuarios" runat="server" HeaderText="Usuarios">
<ContentTemplate>
<asp:UpdatePanel ID="UpUsuarios" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover Widthall">
<thead>
<tr class="Titulos">
<th style=" width:25% !important;">Indicadores
</th>
<th style=" width:25% !important;">Usuarios
</th>
<th style="width: 310px">Comandos</th>
</tr>
</thead>
<tr>
<td align="left" style="text-align: center">
<asp:DropDownList ID="DdlIndicadorUsuario" runat="server" CausesValidation="true" DataTextField="Indicador" DataValueField="CveIndicador" ValidationGroup="GrpGuardar" Width="160px" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVIndicadorUsuario" runat="server" ControlToValidate="DdlIndicadorUsuario" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Indicador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVIndicadorUsuario" Width="300px" />
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlUsuario" runat="server" CausesValidation="true" DataTextField="Usuario" DataValueField="CveUsuario" ValidationGroup="GrpGuardar" Width="160px" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVUsuario" runat="server" ControlToValidate="DdlUsuario" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Rol''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVUsuario" Width="300px" />
</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregaIU" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
<asp:GridView ID="GvUsuarios" runat="server" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" DataKeyNames="CveIndicador,CveUsuario" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="Indicador" DataField="Indicador" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" ItemStyle-HorizontalAlign="Left" />
<%-- <asp:TemplateField>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Indicador") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEIndicador" runat="server" DataTextField="Indicador" DataValueField="CveIndicador" ></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEUsuario" runat="server" DataTextField="Usuario" DataValueField="CveUsuario" ></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>--%>
<%--<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:LinkButton ID="LnkU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ValidationGroup="GrpEditGuardar" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" />
<asp:LinkButton ID="LnkC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkE" 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-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkD" 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>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
var OrdenarGV = function () {
var Tam = TamañoVentana();
var Alto = Tam.height - 330;
if (Alto < 100) {
Alto = 100;
}
$('#<%= GvRoles.ClientID%>').DataTable({ scrollY: Alto + 'px', scrollCollapse: true, paging: false, searching: false, info: false, });
$('#<%= GvRoles.ClientID%>').parent().parent().children().first().css("position", "static");
$('#<%= GvUsuarios.ClientID%>').DataTable({ scrollY: Alto + 'px', scrollCollapse: true, paging: false, searching: false, info: false, });
$('#<%= GvUsuarios.ClientID%>').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

View File

@@ -0,0 +1,221 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class Sistemas_CatIndicadoresUsuarios
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Public Property DtIndicadoresRoles() As DataTable
Get
Return CType(ViewState("DtIndicadoresRoles"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtIndicadoresRoles") = value
End Set
End Property
Public Property DtIndicadoresUsuarios() As DataTable
Get
Return CType(ViewState("DtIndicadoresUsuarios"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtIndicadoresUsuarios") = value
End Set
End Property
Public Property DtIndicadores() As DataTable
Get
Return CType(ViewState("DtIndicadores"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtIndicadores") = value
End Set
End Property
#End Region
Private Sub Sistemas_CatIndicadoresUsuarios_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaCombos()
CargaDatos()
OrdenaDatos()
End If
End Sub
Private Sub CargaCombos()
Dim ObjIndicador As New ClsIndicadores
DdlRol.DataSource = GlobalDTRoles(UsuarioActual.CveEmpresa)
DdlUsuario.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
If ObjIndicador.GetIndicadoresUsuariosEmpresa(UsuarioActual.CveEmpresa) Then
DdlIndicador.DataSource = ObjIndicador.DtResultados
DdlIndicadorUsuario.DataSource = ObjIndicador.DtResultados
DtIndicadores = ObjIndicador.DtResultados
End If
ObjIndicador.Dispose()
DdlRol.DataBind()
DdlIndicador.DataBind()
DdlIndicadorUsuario.DataBind()
DdlUsuario.DataBind()
End Sub
Private Sub CargaDatos()
Dim ObjIndicador As New ClsIndicadores
If ObjIndicador.GetIndicadoresRoles(UsuarioActual.CveEmpresa) Then
GvRoles.DataSource = ObjIndicador.DtResultados
DtIndicadoresRoles = ObjIndicador.DtResultados
End If
If ObjIndicador.GetIndicadoresUsuarios(UsuarioActual.CveEmpresa) Then
GvUsuarios.DataSource = ObjIndicador.DtResultados
DtIndicadoresUsuarios = ObjIndicador.DtResultados
End If
ObjIndicador.Dispose()
GvRoles.DataBind()
GvUsuarios.DataBind()
End Sub
#Region "I N D I C A D O R E S - R O L E S"
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LbAgregar.Click
Dim ObjIndicador As New ClsIndicadores
Dim CveIndicador = DdlIndicador.SelectedValue.ToEntero
Dim CveRol = DdlRol.SelectedValue.ToEntero
If ObjIndicador.AddIndicadoresRoles(CveIndicador, CveRol) Then
If ObjIndicador.GetIndicadoresRoles(UsuarioActual.CveEmpresa) Then
GvRoles.DataSource = ObjIndicador.DtResultados
DtIndicadoresRoles = ObjIndicador.DtResultados
End If
End If
ObjIndicador.Dispose()
GvRoles.DataBind()
OrdenaDatos()
End Sub
'Protected Sub GvRoles_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvRoles.RowEditing
' GvRoles.EditIndex = e.NewEditIndex
' GvRoles.DataSource = DtIndicadoresRoles
' GvRoles.DataBind()
'End Sub
Protected Sub GvRoles_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvRoles.RowDeleting
Dim ObjIndicadores As New ClsIndicadores
Dim CveIndicador As Integer = GvRoles.Rows(e.RowIndex).DataKey("CveIndicador").ToEntero
Dim CveRol As Integer = GvRoles.Rows(e.RowIndex).DataKey("CveRol").ToEntero
If ObjIndicadores.RemoveIndicadoresRoles(CveIndicador, CveRol) Then
If ObjIndicadores.GetIndicadoresRoles(UsuarioActual.CveEmpresa) Then
GvRoles.DataSource = ObjIndicadores.DtResultados
End If
End If
ObjIndicadores.Dispose()
GvRoles.DataBind()
OrdenaDatos()
End Sub
'Protected Sub GvRoles_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRoles.RowDataBound
' If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
' e.Row.FCDropDownList("DdlEIndicador").DataSource = DtIndicadores
' e.Row.FCDropDownList("DdlEIndicador").DataBind()
' e.Row.FCDropDownList("DdlERol").DataSource = GlobalDTRoles(UsuarioActual.CveEmpresa)
' e.Row.FCDropDownList("DdlERol").DataBind()
' End If
'End Sub
'Protected Sub GvRoles_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvRoles.RowUpdating
' Dim ObjIndicadores As New ClsIndicadores
' Dim CveIndicador As Integer = GvRoles.Rows(e.RowIndex).FCDropDownList("DdlEIndicador").SelectedValue.ToEntero
' Dim CveRol As Integer = GvRoles.Rows(e.RowIndex).FCDropDownList("DdlERol").SelectedValue.ToEntero
' Dim CveIndicadorAnterior As Integer = GvRoles.Rows(e.RowIndex).DataKey("CveIndicador").ToEntero
' Dim CveRolAnterior As Integer = GvRoles.Rows(e.RowIndex).DataKey("CveRol").ToEntero
' If ObjIndicadores.UpdateIndicadoresRoles(CveIndicador, CveIndicadorAnterior, CveRol, CveRolAnterior) Then
' If ObjIndicadores.GetIndicadoresRoles(UsuarioActual.CveEmpresa) Then
' DtIndicadoresRoles = ObjIndicadores.DtResultados
' GvRoles.DataSource = ObjIndicadores.DtResultados
' End If
' End If
' GvRoles.EditIndex = -1
' GvRoles.DataBind()
' ObjIndicadores.Dispose()
'End Sub
'Protected Sub GvRoles_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvRoles.RowCancelingEdit
' GvRoles.EditIndex = -1
' GvRoles.DataSource = DtIndicadoresRoles
' GvRoles.DataBind()
'End Sub
#End Region
#Region "I N D I C A D O R E S - U S U A R I O S"
Protected Sub LbAgregaIU_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LbAgregaIU.Click
Dim ObjIndicador As New ClsIndicadores
Dim CveIndicador = DdlIndicadorUsuario.SelectedValue.ToEntero
Dim CveUsuario = DdlUsuario.SelectedValue.ToEntero
If ObjIndicador.AddIndicadoresUsuarios(CveIndicador, CveUsuario) Then
If ObjIndicador.GetIndicadoresUsuarios(UsuarioActual.CveEmpresa) Then
GvUsuarios.DataSource = ObjIndicador.DtResultados
DtIndicadoresUsuarios = ObjIndicador.DtResultados
End If
End If
ObjIndicador.Dispose()
GvUsuarios.DataBind()
OrdenaDatos()
End Sub
'Protected Sub GvUsuarios_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuarios.RowEditing
' GvUsuarios.EditIndex = e.NewEditIndex
' GvUsuarios.DataSource = DtIndicadoresUsuarios
' GvUsuarios.DataBind()
'End Sub
Protected Sub GvUsuarios_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting
Dim ObjIndicadores As New ClsIndicadores
Dim CveIndicador As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveIndicador").ToEntero
Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero
If ObjIndicadores.RemoveIndicadoresUsuarios(CveIndicador, CveUsuario) Then
If ObjIndicadores.GetIndicadoresUsuarios(UsuarioActual.CveEmpresa) Then
GvUsuarios.DataSource = ObjIndicadores.DtResultados
DtIndicadoresUsuarios = ObjIndicadores.DtResultados
End If
End If
ObjIndicadores.Dispose()
GvUsuarios.DataBind()
OrdenaDatos()
End Sub
'Protected Sub GvUsuarios_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvUsuarios.RowDataBound
' If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
' e.Row.FCDropDownList("DdlEIndicador").DataSource = DtIndicadores
' e.Row.FCDropDownList("DdlEIndicador").DataBind()
' e.Row.FCDropDownList("DdlEUsuario").DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
' e.Row.FCDropDownList("DdlEUsuario").DataBind()
' End If
'End Sub
'Protected Sub GvUsuarios_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvUsuarios.RowUpdating
' Dim ObjIndicadores As New ClsIndicadores
' Dim CveIndicador As Integer = GvUsuarios.Rows(e.RowIndex).FCDropDownList("DdlEIndicador").SelectedValue.ToEntero
' Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).FCDropDownList("DdlEUsuario").SelectedValue.ToEntero
' Dim CveIndicadorAnterior As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveIndicador").ToEntero
' Dim CveUsuarioAnterior As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero
' If ObjIndicadores.UpdateIndicadoresUsuarios(CveIndicador, CveIndicadorAnterior, CveUsuario, CveUsuarioAnterior) Then
' If ObjIndicadores.GetIndicadoresUsuarios(UsuarioActual.CveEmpresa) Then
' DtIndicadoresRoles = ObjIndicadores.DtResultados
' GvUsuarios.DataSource = ObjIndicadores.DtResultados
' DtIndicadoresUsuarios = ObjIndicadores.DtResultados
' End If
' End If
' ObjIndicadores.Dispose()
' GvUsuarios.EditIndex = -1
' GvUsuarios.DataBind()
'End Sub
'Protected Sub GvUsuarios_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvUsuarios.RowCancelingEdit
' GvUsuarios.EditIndex = -1
' GvUsuarios.DataSource = DtIndicadoresUsuarios
' GvUsuarios.DataBind()
'End Sub
#End Region
#Region "O R D E N A M I E N T O - J A V A S C R I P T"
Private Sub OrdenaDatos()
If GvRoles.Rows.Count > 0 Then
GvRoles.UseAccessibleHeader = True
GvRoles.HeaderRow.TableSection = TableRowSection.TableHeader
End If
If GvUsuarios.Rows.Count > 0 Then
GvUsuarios.UseAccessibleHeader = True
GvUsuarios.HeaderRow.TableSection = TableRowSection.TableHeader
End If
RegistraScript("OrdenarGV();")
End Sub
#End Region
End Class

291
Sistemas/CatModulos.aspx Normal file
View File

@@ -0,0 +1,291 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatModulos.aspx.vb" Inherits="CatModulos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a {
color: white !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Módulos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="HlAgregarModulo" runat="server"><i class="fa fa-plus"></i> Agregar Módulo</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<div align="right">
<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>
<br />
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveModulo, DesPadre, Modulo, Liga, PopUp, Ancho, Alto, Orden, Estilo, Incluye, Agrupacion, CvePadre,CvePlataforma" EmptyDataText="No se encontraron módulos" ToolTip="Módulos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Clave">
<ItemTemplate>
<asp:Label ID="A" runat="server" Text='<%# Eval("CveModulo", "{0}") %>'></asp:Label>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Padre">
<ItemTemplate>
&nbsp;<asp:Label ID="B" runat="server" Text='<%# Eval("DesPadre", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Descripción">
<ItemTemplate>
&nbsp;<asp:Label ID="C" runat="server" Text='<%# Eval("Modulo", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Liga">
<ItemTemplate>
&nbsp;<asp:Label ID="D" runat="server" Text='<%# Eval("Liga", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="PopUp" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
&nbsp;<asp:Label ID="E" runat="server" Text='<%# Eval("PopUp", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Ancho">
<ItemTemplate>
<asp:Label ID="F" runat="server" Text='<%# Eval("Ancho", "{0}") %>'></asp:Label>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Alto">
<ItemTemplate>
<asp:Label ID="G" runat="server" Text='<%# Eval("Alto", "{0}") %>'></asp:Label>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Orden">
<ItemTemplate>
<asp:Label ID="H" runat="server" Text='<%# Eval("Orden", "{0}") %>'></asp:Label>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estilo">
<ItemTemplate>
<asp:Label ID="Estilo" runat="server" Text='<%# Eval("Estilo", "{0}") %>'></asp:Label>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Incluye" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
&nbsp;<asp:Label ID="I" runat="server" Text='<%# Eval("Incluye", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Agrupación" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
&nbsp;<asp:Label ID="J" runat="server" Text='<%# Eval("Agrupacion", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Label ID="K" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre">
<ItemTemplate>
&nbsp;<asp:Label ID="L" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="99px">
<ItemTemplate>
<asp:LinkButton ID="ImgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaModulo" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="83px">
<ItemTemplate>
<asp:LinkButton ID="ImgEE" 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="ModalModulos" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalModulos" 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 Modulos</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtClave" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVClave" runat="server" ControlToValidate="TxtClave" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Clave''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModulo"></asp:RequiredFieldValidator>
<label for="<%= TxtClave.ClientID.ToString()%>">Clave:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="CboPadres" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="Padres" DataValueField="CveModulo" Width="240px" ValidationGroup="GrpModulo"></asp:DropDownList>
<label for="<%= CboPadres.ClientID.ToString()%>">Padre:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtDescripcion" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModulo"></asp:RequiredFieldValidator>
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripción:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtLiga" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtLiga.ClientID.ToString()%>">Liga:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="CboPopUp" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" Width="55px">
<asp:ListItem Selected="True" Text="No" Value="N"></asp:ListItem>
<asp:ListItem Text="Si" Value="S"></asp:ListItem>
</asp:DropDownList>
<label for="<%= CboPopUp.ClientID.ToString()%>">Pop Up:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAncho" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAncho" runat="server" ControlToValidate="TxtAncho" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Ancho''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModulo"></asp:RequiredFieldValidator>
<label for="<%= TxtAncho.ClientID.ToString()%>">Ancho:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtAlto" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAlto" runat="server" ControlToValidate="TxtAlto" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'¨Alto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModulo"></asp:RequiredFieldValidator>
<label for="<%= TxtAlto.ClientID.ToString()%>">Alto:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtOrden" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrden" runat="server" ControlToValidate="TxtOrden" 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="GrpModulo"></asp:RequiredFieldValidator>
<label for="<%= TxtOrden.ClientID.ToString()%>">Orden:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEstilo" CssClass="form-control " runat="server" MaxLength="50" CausesValidation="true"></asp:TextBox>
<label for="<%= TxtEstilo.ClientID.ToString()%>">Estilo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="CboIncluye" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" Width="55px">
<asp:ListItem Selected="True" Text="No" Value="N"></asp:ListItem>
<asp:ListItem Text="Si" Value="S"></asp:ListItem>
</asp:DropDownList>
<label for="<%= CboIncluye.ClientID.ToString()%>">Incluye:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="CboAgrupacion" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" Width="55px">
<asp:ListItem Selected="True" Text="No" Value="N"></asp:ListItem>
<asp:ListItem Text="Si" Value="S"></asp:ListItem>
</asp:DropDownList>
<label for="<%= CboAgrupacion.ClientID.ToString()%>">Agrupación:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPlataforma" AppendDataBoundItems="true" DataTextField="Plataforma" DataValueField="CvePlataforma" CssClass="form-control input-sm select2me js-cuenta-programmatic" runat="server" Width="240px">
<%-- <asp:ListItem Selected="True" Text="SIG" Value="1"></asp:ListItem>
<asp:ListItem Text="PyME" Value="2"></asp:ListItem>
<asp:ListItem Text="GPS" Value="3"></asp:ListItem>
<asp:ListItem Text="App" Value="4"></asp:ListItem>--%>
</asp:DropDownList>
<label for="<%= DdlPlataforma.ClientID.ToString()%>">Plataforma:</label>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LbAgregar" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpModulo" />
<button id="BtnCancelarProyecto" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</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 Módulo?');
}
</script>
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
function OrdenarGV() {
//var Tam = TamañoVentana();
//var Alto = Tam.height - 270;
//if (Alto < 100) {
// Alto = 100;
//}
//$('#C_GvDatos').DataTable({
// scrollY: Alto + 'px',
// scrollCollapse: true,
// paging: false,
// searching: false,
// info: false
//});
//$('#C_GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

206
Sistemas/CatModulos.aspx.vb Normal file
View File

@@ -0,0 +1,206 @@
Imports Extensiones
Imports System.Data
Partial Class CatModulos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
CargaPadres()
CargaPlataformas()
End If
End Sub
Private Sub CargaDatos()
Dim Modulo As New ClsModulos
If Modulo.GetModulos(-1, -1, "-1", "-1") Then
GvDatos.DataSource = Modulo.DtResultados
GvDatos.DataBind()
End If
Modulo.Dispose()
End Sub
Private Sub CargaPadres()
Dim Modulo As New ClsModulos
If Modulo.GetModulos(-1, -1, "-1", "-1") Then
GvDatos.DataSource = Modulo.DtResultados
CboPadres.DataSource = Modulo.DtResultados.FiltraParametros("CvePadre = 0 OR Agrupacion = 'S'")
CboPadres.DataBind()
End If
'CboPadres.Items.Insert(0, New ListItem("Seleccione", "-1"))
CboPadres.Items.Insert(0, New ListItem("Raíz", "0"))
End Sub
Private Sub CargaPlataformas()
Dim ObjEmpresas As New ClsSisEmpresas
If ObjEmpresas.GetPlataforma(-1, "-1") Then
DdlPlataforma.DataSource = ObjEmpresas.DtResultados
DdlPlataforma.DataBind()
End If
' DdlPlataforma.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim Modulo As New ClsModulos
If HdnModalidad.Value = "A" Then
If Modulo.AddModulo(Me.TxtClave.Text.Trim().ToEntero(), Me.TxtDescripcion.Text.Trim(), Me.CboPadres.SelectedValue.ToEntero(), Me.TxtLiga.Text.Trim(), CboPopUp.SelectedValue,
Me.TxtAncho.Text.Trim().ToEntero(), Me.TxtAlto.Text.Trim().ToEntero(), Me.TxtOrden.Text.Trim().ToEntero(), Me.TxtEstilo.Text.Trim(), Me.CboIncluye.SelectedValue, Me.CboAgrupacion.SelectedValue,
UsuarioActual.CveUsuario, DdlPlataforma.SelectedValue.ToEntero) Then
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalModulos"))
Alert("El nuevo Módulo se guardó correctamente.", TipoMensaje.MsgInformacion)
CargaDatos()
UpDatos.Update()
End If
ElseIf HdnModalidad.Value = "U" Then
If Modulo.UpdateModulo(CboPadres.SelectedValue, TxtDescripcion.Text.Trim(), TxtLiga.Text.Trim(), CboPopUp.SelectedValue, TxtAncho.Text.Trim().ToEntero(), TxtAlto.Text.Trim().ToEntero(),
TxtOrden.Text.Trim().ToEntero(), TxtEstilo.Text.Trim(), CboIncluye.SelectedValue, CboAgrupacion.SelectedValue, UsuarioActual.CveUsuario, HdnID.Value, DdlPlataforma.SelectedValue.ToEntero) Then
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalModulos"))
Alert("El Módulo se actualizó correctamente.", TipoMensaje.MsgInformacion)
CargaDatos()
UpDatos.Update()
End If
End If
Modulo.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
'e.Row.Cells(0).Width = Unit.Pixel(63)
'e.Row.Cells(1).Width = Unit.Pixel(85)
'e.Row.Cells(2).Width = Unit.Pixel(95)
'e.Row.Cells(3).Width = Unit.Pixel(95)
'e.Row.Cells(4).Width = Unit.Pixel(74)
'e.Row.Cells(5).Width = Unit.Pixel(69)
'e.Row.Cells(6).Width = Unit.Pixel(55)
'e.Row.Cells(7).Width = Unit.Pixel(70)
'e.Row.Cells(8).Width = Unit.Pixel(90)
'e.Row.Cells(9).Width = Unit.Pixel(65)
'e.Row.Cells(10).Width = Unit.Pixel(60)
'e.Row.Cells(11).Width = Unit.Pixel(76)
'e.Row.Cells(12).Width = Unit.Pixel(79)
'e.Row.Cells(13).Width = Unit.Pixel(80)
'e.Row.Cells(14).Width = Unit.Pixel(68)
If e.Row.DBCampo("PopUp") = "N" Then e.Row.FCLabel("E").Text = "No" Else e.Row.FCLabel("E").Text = "Si"
If e.Row.DBCampo("Incluye") = "N" Then e.Row.FCLabel("I").Text = "No" Else e.Row.FCLabel("I").Text = "Si"
If e.Row.DBCampo("Agrupacion") = "N" Then e.Row.FCLabel("J").Text = "No" Else e.Row.FCLabel("J").Text = "Si"
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
If e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate Then
If CType(e.Row.FindControl("C"), Label).Text.Length > 15 Then
CType(e.Row.FindControl("C"), Label).ToolTip = CType(e.Row.FindControl("C"), Label).Text
CType(e.Row.FindControl("C"), Label).Text = CType(e.Row.FindControl("C"), Label).Text.Substring(0, 14)
End If
If CType(e.Row.FindControl("D"), Label).Text.Length > 15 Then
CType(e.Row.FindControl("D"), Label).ToolTip = CType(e.Row.FindControl("D"), Label).Text
CType(e.Row.FindControl("D"), Label).Text = CType(e.Row.FindControl("D"), Label).Text.Substring(0, 14)
End If
ElseIf e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
Dim Modulo As New ClsModulos
If Modulo.GetModulos(-1, -1, "-1", "-1") Then
e.Row.FCDropDownList("B").DataSource = Modulo.DtResultados.FiltraParametros("CvePadre = 0 OR Agrupacion = 'S'")
e.Row.FCDropDownList("B").DataBind()
e.Row.FCDropDownList("B").SelectedValue = e.Row.FCLabel("LB").Text.ToEntero
End If
End If
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim Modulo As New ClsModulos
If Modulo.RemoveModulo(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
GvDatos.EditIndex = -1
CargaDatos()
End If
Modulo.Dispose()
End Sub
#End Region
Private Sub HlAgregarModulo_Click(sender As Object, e As EventArgs) Handles HlAgregarModulo.Click
TxtClave.Text = ""
TxtDescripcion.Text = ""
TxtAlto.Text = ""
TxtAncho.Text = ""
TxtLiga.Text = ""
TxtOrden.Text = ""
CboAgrupacion.SelectedIndex = 0
CboIncluye.SelectedIndex = 0
CboPadres.SelectedIndex = 0
CboPopUp.SelectedIndex = 0
LtlTituloModal.Text = "Agregar Modulo"
LbAgregar.Text = "Agregar"
HdnModalidad.Value = "A"
UpModal.Update()
RegistraScript("$('#ModalModulos').modal();")
End Sub
Public Sub ActualizaModulo(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveModulo As String = GvRow.DataKey("CveModulo").ToString
Dim CvePadre As String = GvRow.DataKey("CvePadre").ToString
Dim ModuloPadre As String = GvRow.DataKey("DesPadre").ToString
Dim Descripcion As String = GvRow.DataKey("Modulo").ToString
Dim Liga As String = GvRow.DataKey("Liga").ToString
Dim PopUp As String = GvRow.DataKey("PopUp").ToString
Dim Ancho As String = GvRow.DataKey("Ancho").ToString
Dim Alto As String = GvRow.DataKey("Alto").ToString
Dim Orden As String = GvRow.DataKey("Orden").ToString
Dim Estilo As String = GvRow.DataKey("Estilo").ToString
Dim Incluye As String = GvRow.DataKey("Incluye").ToString
Dim Agrupacion As String = GvRow.DataKey("Agrupacion").ToString
Dim CvePlataforma As String = GvRow.DataKey("CvePlataforma").ToString
TxtClave.Text = CveModulo
'CboPadres.Items.FindByText(ModuloPadre).Selected = True
CboPadres.SelectedValueExist(CvePadre)
TxtDescripcion.Text = Descripcion
TxtLiga.Text = Liga
CboPopUp.SelectedValueExist(PopUp)
TxtAncho.Text = Ancho
TxtAlto.Text = Alto
TxtOrden.Text = Orden
TxtEstilo.Text = Estilo
CboIncluye.SelectedValueExist(Incluye)
CboAgrupacion.SelectedValueExist(Agrupacion)
DdlPlataforma.SelectedValueExist(CvePlataforma)
HdnID.Value = CveModulo
HdnModalidad.Value = "U"
LtlTituloModal.Text = "Actualizar Modulo"
LbAgregar.Text = "Actualizar"
UpModal.Update()
RegistraScript("$('#ModalModulos').modal();")
End Sub
End Class

View File

@@ -0,0 +1,344 @@
<%@ Page Title="SIG - Catálogo de Notificaciones" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatNotificaciones.aspx.vb" Inherits="CatNotificaciones" EnableEventValidation="false" %>
<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 Notificaciones
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabEmpresasNotificaciones" runat="server" HeaderText="Empresa-Notificaciones">
<ContentTemplate>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table-striped Widthall" style="max-width: 100%">
<thead>
<tr class="Titulos">
<th width="20%">Empresa
</th>
<th width="20%">Notificacion
</th>
<th width="20%"></th>
<th width="20%">Comandos
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center">
<asp:DropDownList ID="DdlEmpresa" runat="server" Width="100%" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Empresa" DataValueField="CveEmpresa" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlNotificaciones" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="Notificacion" DataValueField="CveNotificacionPlantilla" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
</asp:DropDownList>
</td>
<td style="text-align: center"></td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarFuncionalidadEmpresa" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar"></asp:LinkButton>
</td>
</tr>
</tbody>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpEmpresa" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvEmpresas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveNotificacion,CveEmpresa,CveNotificacionPlantilla,CveNotificacionEmpresa" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField ItemStyle-Width="20%" DataField="Empresa" />
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="Notificacion" runat="server" Text='<%# Eval("Notificacion") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlNotificacionesEdit" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="Notificacion" DataValueField="CveNotificacionPlantilla" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="20%" HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
<EditItemTemplate>
<div style="width: 80px;">
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpLimiteEdit" />
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</div>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" 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 ItemStyle-Width="10%" HeaderText="Eliminar" 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="confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabNotificaciones" runat="server" HeaderText="Notificaciones">
<ContentTemplate>
<asp:UpdatePanel ID="UpTitulosN" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table-striped Widthall" style="max-width: 100%">
<thead>
<tr class="Titulos">
<th width="20%"></th>
<th width="20%"></th>
<th width="20%"></th>
<th width="20%">Comandos
</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td style="text-align: center">
<%--<button id="btnAddNotificacion" type="button" class="btn btn-primary" onclick>Agregar</button>--%>
<asp:Button ClientIDMode="Static" runat="server" ID="LbAddNotificacion" class="btn btn-primary" Text="Agregar" />
<%--<asp:LinkButton ID="LbAgregarNotificacion" runat="server" OnClick="" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton>--%>
</td>
</tr>
</tbody>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveNotificacion" Value="-1" />
<asp:Button ClientIDMode="Static" runat="server" ID="BtnCargaModal" OnClick="BtnCargaModal_Click" Style="display: none;" />
<asp:GridView ID="GvNotificaciones" runat="server" AutoGenerateColumns="False" DataKeyNames="CveNotificacionPlantilla,CveModulo,CveUsuario" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Notificación" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
&nbsp;<asp:LinkButton ID="LtlNotificacion" OnClick="BtnCargaModal_Click" runat="server" Text='<%# Eval("Notificacion") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField />
<asp:BoundField ItemStyle-Width="10%" DataField="Modulo" HeaderText="Módulo" />
<asp:BoundField ItemStyle-Width="10%" DataField="Plantilla" ApplyFormatInEditMode="true" HeaderText="Plantilla" />
<asp:BoundField ItemStyle-Width="10%" DataField="Correo" HeaderText="Correo" />
<asp:BoundField ItemStyle-Width="10%" DataField="SMS" HeaderText="SMS" />
<asp:BoundField ItemStyle-Width="10%" DataField="MSN" HeaderText="Messenger" />
<asp:BoundField ItemStyle-Width="10%" DataField="Campana" HeaderText="Campana" />
<asp:BoundField ItemStyle-Width="10%" DataField="Recurrencia" HeaderText="Recurrencia" />
<asp:BoundField ItemStyle-Width="10%" DataField="Frecuencia" HeaderText="Frecuencia" />
<asp:BoundField ItemStyle-Width="10%" DataField="DiasSemana" HeaderText="Dias Semana" />
<asp:BoundField ItemStyle-Width="10%" DataField="RecurrenciaFin" HeaderText="RecurrenciaFin" />
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Eliminar" 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="confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="divAddNotificacion" class="modal fade">
<div class="modal-dialog modal-sm">
<asp:UpdatePanel ID="UpNotificacion" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header modal-header-primary">
<h4>
<asp:Label Text="" ID="LbTitulo" runat="server" />
</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpNotificionIS" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNotificacion" CssClass="form-control" ClientIDMode="Static" runat="server" TextMode="MultiLine"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNotificacion" runat="server" ControlToValidate="TxtNotificacion" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Notificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="<%= TxtNotificacion.ClientID.ToString()%>">Notificación:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModulo" runat="server" CssClass="form-control select2me" CausesValidation="true" DataTextField="Modulo" DataValueField="CveModulo"></asp:DropDownList>
<label for="<%= DdlModulo.ClientID.ToString()%>">Módulo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPlantilla" ClientIDMode="Static" runat="server" TextMode="MultiLine" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPlantilla" runat="server" ControlToValidate="TxtPlantilla" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Plantilla''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="<%= TxtPlantilla.ClientID.ToString()%>">Plantilla:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkCorreo" runat="server" Text="Correo"/>
<asp:CheckBox ID="ChkSMS" runat="server" Text="SMS" />
<asp:CheckBox ID="ChkMSN" runat="server" Text="Messenger" />
<asp:CheckBox ID="ChkCampana" runat="server" Text="Campana" />
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:CheckBox ID="ChkRecurrencia" runat="server" Text="Recurrencia" AutoPostBack="true" />
</div>
<div class="form-group form-md-line-input input-iconright" id="DivRecurrencia" runat="server" visible="false">
<asp:DropDownList ID="DdlRecurrencia" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" CausesValidation="true">
<asp:ListItem Text="Seleccione" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Hora" Value="1"></asp:ListItem>
<asp:ListItem Text="Diario" Value="2"></asp:ListItem>
<asp:ListItem Text="Semanal" Value="3"></asp:ListItem>
<asp:ListItem Text="Mensual" Value="4"></asp:ListItem>
<asp:ListItem Text="Anual" Value="5"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVRecurrenciaTipo" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlRecurrencia" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Recurrencia''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="<%= DdlRecurrencia.ClientID.ToString()%>">Recurrencia:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="divDiasSemana" runat="server" visible="false">
<asp:CheckBox ID="ChkLunes" runat="server" Text="Lunes" />
<asp:CheckBox ID="ChkMartes" runat="server" Text="Martes" />
<asp:CheckBox ID="ChkMiercoles" runat="server" Text="Miercoles" />
<asp:CheckBox ID="ChkJueves" runat="server" Text="Jueves" />
<asp:CheckBox ID="ChkViernes" runat="server" Text="Viernes" />
<asp:CheckBox ID="ChkSabado" runat="server" Text="Sabado" />
<asp:CheckBox ID="ChkDomingo" runat="server" Text="Domingo" />
</div>
<div class="form-group form-md-line-input input-iconright" id="DivFrecuencia" runat="server" visible="false">
<asp:TextBox ID="TxtFrecuencia" ClientIDMode="Static" runat="server" TextMode="Number" CssClass="form-control"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVFrecuencia" runat="server" ControlToValidate="TxtFrecuencia" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Frecuencia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label for="<%= TxtFrecuencia.ClientID.ToString()%>">Frecuencia:</label>
</div>
<div class="row">
<div class="form-group form-md-line-input input-iconright" id="DivRecurrenciaFin" runat="server" visible="false">
<div class="col-md-6">
<asp:RadioButton ID="ChkRecurrenciaVeces" runat="server" Text="Terminar despues de:" GroupName="Recurrencia" ValidationGroup="GrpGuardar" />
<asp:TextBox ID="TxtRecurrenciaFin" ClientIDMode="Static" runat="server" TextMode="Number" Width="20px"></asp:TextBox><label> veces</label>
</div>
<div class="col-md-6">
<asp:RadioButton ID="ChkRecurrenciaFecha" runat="server" Text="Terminar en:" GroupName="Recurrencia" ValidationGroup="GrpGuardar" />
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" ClientIDMode="Static"></asp:TextBox>
<span class="input-group-btn ">
<button runat="server" id="imgCalendario" class="btn default" type="button">
<i class="fa fa-calendar"></i>
</button>
</span>
<ajax:MaskedEditExtender ID="MEEFechaC" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFecha" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<%-- <asp:RequiredFieldValidator ID="RFVFechaC" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha Factura''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>--%>
<asp:CompareValidator ID="CVFechaC" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha Factura''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<%--<ajax:ValidatorCalloutExtender ID="VCERFVFC" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>--%>
<ajax:ValidatorCalloutExtender ID="VCECVFC" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaC" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<asp:CustomValidator ID="Rb" runat="server" Display="Dynamic" ValidationGroup="GrpGuardar" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Recurrencia''</b> es necesario, por favor ingréselo." ClientValidationFunction="ClientValidate" OnServerValidate="ServerValidate"></asp:CustomValidator>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnAddNotificacion" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardar" />
<button type="button" class="btn btn-danger" onclick="LimpiaModal()" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<asp:HiddenField ID="HdnModalidad" runat="server" Value="I" ClientIDMode="Static" />
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script>
var TxtNotificacion = '<%= TxtNotificacion.ClientID%>';
var TxtPlantilla = '<%=TxtPlantilla.ClientID%>';
var TxtFrecuencia = '<%= TxtFrecuencia.ClientID%>';
var DdlModulo = '<%= DdlModulo.ClientID%>';
var DdlRecurrencia = '<%= DdlRecurrencia.ClientID%>';
function LimpiaModal() {
$('#<%= TxtNotificacion.ClientID %>').val('');
$('#<%= TxtPlantilla.ClientID %>').val('');
$('#<%= TxtFrecuencia.ClientID %>').val('');
$('#<%= DdlModulo.ClientID %>').val('1');
$('#<%= DdlRecurrencia.ClientID %>').val('-1');
$('#<%= ChkCorreo.ClientID %>').prop("checked", false);
$('#<%= ChkSMS.ClientID %>').prop("checked", false);
$('#<%= ChkMSN.ClientID %>').prop("checked", false);
$('#<%= ChkCampana.ClientID %>').prop("checked", false);
$('#<%= ChkRecurrenciaVeces.ClientID %>').prop("checked", false);
$('#<%= ChkRecurrenciaFecha.ClientID %>').prop("checked", false);
$('#<%= ChkRecurrencia.ClientID %>').prop("checked", false);
$('#<%= TxtRecurrenciaFin.ClientID %>').val('');
$('#<%= TxtFecha.ClientID %>').val('');
$('#<%= ChkLunes.ClientID %>').prop("checked", false);
$('#<%= ChkMartes.ClientID %>').prop("checked", false);
$('#<%= ChkMiercoles.ClientID %>').prop("checked", false);
$('#<%= ChkJueves.ClientID %>').prop("checked", false);
$('#<%= ChkViernes.ClientID %>').prop("checked", false);
$('#<%= ChkSabado.ClientID %>').prop("checked", false);
$('#<%= ChkDomingo.ClientID %>').prop("checked", false);
$('#<%= ChkRecurrencia.ClientID %>').prop("checked", false);
}
function CargaModal(CveNotificacion) {
debugger;
$get("HdnCveNotificacion").value = CveNotificacion;
$("#BtnCargaModal").click();
}
function ClientValidate(source, args) {
if (document.getElementById("<%= ChkRecurrenciaVeces.ClientID %>").checked || document.getElementById("<%= ChkRecurrenciaFecha.ClientID %>").checked) {
args.IsValid = true;
}
else {
args.IsValid = false;
}
}
</script>
</asp:Content>

View File

@@ -0,0 +1,447 @@
Imports Extensiones
Imports System.Data
Partial Class CatNotificaciones
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveNotificacion As Integer
Get
Return ViewState("CveNotificacion").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveNotificacion") = value
End Set
End Property
#End Region
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If ViewState("CveNotificacion") = Nothing Then
ViewState("CveNotificacion") = -1
End If
DdlEmpresa.SelectedValue = UsuarioActual.CveEmpresa.ToString
CargaEmpresasNotificaciones(UsuarioActual.CveEmpresa)
CargaNotificaciones()
CargaNoficacionesEmpresa()
CargaCombos()
End If
End Sub
Private Sub LimpiaChk()
ChkCampana.Checked = False
ChkCorreo.Checked = False
ChkDomingo.Checked = False
ChkJueves.Checked = False
ChkLunes.Checked = False
ChkMartes.Checked = False
ChkMiercoles.Checked = False
ChkMSN.Checked = False
ChkRecurrencia.Checked = False
ChkRecurrenciaFecha.Checked = False
ChkRecurrenciaVeces.Checked = False
ChkSabado.Checked = False
ChkSMS.Checked = False
ChkViernes.Checked = False
End Sub
#Region "N O T I F I C A C I O N E S "
Private Sub CargaCombos()
DdlModulo.DataSource = GlobalDTModulos()
DdlModulo.DataBind()
DdlEmpresa.DataSource = GlobalDTEmpresas()
DdlEmpresa.DataBind()
End Sub
Private Sub CargaNotificaciones()
Dim ObjNotificaciones As New ClsSisNotificaciones
If ObjNotificaciones.GetNotificacionesPlantilla() Then
GvNotificaciones.DataSource = ObjNotificaciones.DtResultados
Else
GvNotificaciones.DataSource = Nothing
End If
ObjNotificaciones.Dispose()
GvNotificaciones.DataBind()
UpDatos.Update()
End Sub
Private Sub DdlRecurrencia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlRecurrencia.SelectedIndexChanged
If DdlRecurrencia.SelectedValue = 3 Then
divDiasSemana.Visible = True
Else
divDiasSemana.Visible = False
ChkLunes.Checked = False
ChkMartes.Checked = False
ChkMiercoles.Checked = False
ChkJueves.Checked = False
ChkViernes.Checked = False
ChkSabado.Checked = False
ChkDomingo.Checked = False
End If
End Sub
Private Sub BtnAddNotificacion_Click(sender As Object, e As EventArgs) Handles BtnAddNotificacion.Click
Dim ObjSis As New ClsSisNotificaciones
Dim TieneError = False
Dim DiasSemana As New StringBuilder()
If ChkLunes.Checked Then DiasSemana.AppendFormat("{0}", "L")
If ChkMartes.Checked Then DiasSemana.AppendFormat(If(DiasSemana.Length > 0, ",{0}", "{0}"), "Ma")
If ChkMiercoles.Checked Then DiasSemana.AppendFormat(If(DiasSemana.Length > 0, ",{0}", "{0}"), "Mi")
If ChkJueves.Checked Then DiasSemana.AppendFormat(If(DiasSemana.Length > 0, ",{0}", "{0}"), "J")
If ChkViernes.Checked Then DiasSemana.AppendFormat(If(DiasSemana.Length > 0, ",{0}", "{0}"), "V")
If ChkSabado.Checked Then DiasSemana.AppendFormat(If(DiasSemana.Length > 0, ",{0}", "{0}"), "S")
If ChkDomingo.Checked Then DiasSemana.AppendFormat(If(DiasSemana.Length > 0, ",{0}", "{0}"), "D")
Dim RecurrenciaFin As String
If ChkRecurrenciaVeces.Checked Then
RecurrenciaFin = TxtRecurrenciaFin.Text.Trim()
ElseIf ChkRecurrenciaFecha.Checked Then
RecurrenciaFin = TxtFecha.Text.Trim()
Else
RecurrenciaFin = "-1"
End If
If CveNotificacion < 0 Then
CveNotificacion = ObjSis.AddNotificacionesPlantilla(TxtNotificacion.Text.Trim, DdlModulo.SelectedValue.ToEntero, TxtPlantilla.Text.Trim, ChkCorreo.Checked, ChkSMS.Checked, ChkMSN.Checked,
ChkCampana.Checked, If(ChkRecurrencia.Checked, DdlRecurrencia.SelectedValue.ToEntero, -1), DiasSemana.ToString, If(ChkRecurrencia.Checked, TxtFrecuencia.Text.Trim.ToEntero, 0), RecurrenciaFin, UsuarioActual.CveUsuario)
If CveNotificacion > 0 Then
RegistraScript("LimpiaModal(); $('#divAddNotificacion').modal('hide')")
Alert("Se Agregó la Notificacón con éxito.")
CargaNotificaciones()
CargaNoficacionesEmpresa()
CargaEmpresasNotificaciones(UsuarioActual.CveEmpresa)
Else
Alert("Ocurrió un error al registar Notificación")
End If
Else
If Not ObjSis.UpdateNotificacionesPlantilla(CveNotificacion, TxtNotificacion.Text.Trim, DdlModulo.SelectedValue.ToEntero, TxtPlantilla.Text.Trim, ChkCorreo.Checked, ChkSMS.Checked, ChkMSN.Checked,
ChkCampana.Checked, If(ChkRecurrencia.Checked, DdlRecurrencia.SelectedValue.ToEntero, 0), DiasSemana.ToString, If(ChkRecurrencia.Checked, TxtFrecuencia.Text.Trim.ToEntero, 0), RecurrenciaFin, UsuarioActual.CveUsuario) Then
TieneError = True
End If
If Not TieneError Then
Alert("Se Modificó la Notificacón con éxito.")
RegistraScript("$('#divAddNotificacion').modal('hide')")
CargaNotificaciones()
CargaNoficacionesEmpresa()
CargaEmpresasNotificaciones(UsuarioActual.CveEmpresa)
Else
Alert("Ocurrió un error al registar Notificación")
End If
End If
End Sub
Private Sub ChkRecurrencia_CheckedChanged(sender As Object, e As EventArgs) Handles ChkRecurrencia.CheckedChanged
If ChkRecurrencia.Checked Then
DivRecurrencia.Visible = True
DivFrecuencia.Visible = True
DivRecurrenciaFin.Visible = True
If DdlRecurrencia.SelectedValue.ToEntero = 3 Then divDiasSemana.Visible = True
Else
DivRecurrencia.Visible = False
DivFrecuencia.Visible = False
divDiasSemana.Visible = False
DivRecurrenciaFin.Visible = False
End If
UpNotificionIS.Update()
End Sub
#Region "GV NOTIFICACIONES"
Private Sub GvNotificaciones_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvNotificaciones.RowEditing
GvNotificaciones.EditIndex = e.NewEditIndex
CargaNotificaciones()
End Sub
Private Sub GvNotificaciones_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvNotificaciones.RowCancelingEdit
GvNotificaciones.EditIndex = -1
CargaNotificaciones()
End Sub
Private Sub GvNotificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvNotificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim URL As String = String.Format("javascript:CargaModal({0})", e.Row.DataKey("CveNotificacionPlantilla").ToEntero)
Dim Liga As String = String.Format("<a class=""LinkBlanco"" href=""{0}"">", URL)
e.Row.FCLinkButton("LtlNotificacion").CommandArgument = e.Row.DataKey("CveNotificacionPlantilla")
End If
End Sub
Private Sub GvNotificaciones_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvNotificaciones.RowDeleting
Dim ObjNotificaciones As New ClsSisNotificaciones
Dim TieneError = False
Dim CveNotificacion = GvNotificaciones.Rows(e.RowIndex).DataKey("CveNotificacionPlantilla").ToEntero
If Not ObjNotificaciones.RemoveNotificacionesPlantilla(CveNotificacion) Then
TieneError = True
End If
If Not TieneError Then
GvNotificaciones.EditIndex = -1
Alert("La notificación ha sido eliminada.", TipoMensaje.MsgInformacion)
CargaNoficacionesEmpresa()
CargaNotificaciones()
CargaEmpresasNotificaciones(UsuarioActual.CveEmpresa)
Else
Alert("Error al eliminar los cambios.", TipoMensaje.MsgError)
End If
UpDatos.Dispose()
UpTitulos.Update()
End Sub
#End Region
Protected Sub BtnCargaModal_Click(sender As Object, e As EventArgs)
Dim ObjNotificaciones As New ClsSisNotificaciones
Dim DTnotificaciones As New DataTable
Dim Clave = CType(sender, LinkButton).CommandArgument.ToEntero
If ObjNotificaciones.GetNotificacionesPlantilla() Then
DTnotificaciones = ObjNotificaciones.DtResultados.FiltraParametros(String.Format("CveNotificacionPlantilla = {0}", Clave))
Else
DTnotificaciones = Nothing
End If
Dim Dias = DTnotificaciones(0)("DiasSemana").ToString.Split(","c)
For Each Dia As String In Dias
Select Case Dia
Case "L"
ChkLunes.Checked = True
Case "Ma"
ChkMartes.Checked = True
Case "Mi"
ChkMiercoles.Checked = True
Case "J"
ChkJueves.Checked = True
Case "V"
ChkViernes.Checked = True
Case "S"
ChkSabado.Checked = True
Case "D"
ChkDomingo.Checked = True
End Select
Next
TxtNotificacion.Text = DTnotificaciones(0)("Notificacion").ToString
DdlModulo.SelectedValueExist(DTnotificaciones(0)("CveModulo").ToString)
TxtPlantilla.Text = DTnotificaciones(0)("Plantilla").ToString
ChkCorreo.Checked = If(DTnotificaciones(0)("Correo").ToString = "Activo", True, False)
ChkSMS.Checked = If(DTnotificaciones(0)("SMS").ToString = "Activo", True, False)
ChkMSN.Checked = If(DTnotificaciones(0)("MSN").ToString = "Activo", True, False)
ChkCampana.Checked = If(DTnotificaciones(0)("Campana").ToString = "Activo", True, False)
DdlRecurrencia.SelectedValueExist(DTnotificaciones(0)("RecurrenciaTipo").ToString)
TxtFrecuencia.Text = DTnotificaciones(0)("Frecuencia").ToString
If DTnotificaciones(0)("RecurrenciaFin").ToString.ToEntero > 0 Then
ChkRecurrenciaVeces.Checked = True
TxtRecurrenciaFin.Text = DTnotificaciones(0)("RecurrenciaFin").ToString
Else
ChkRecurrenciaFecha.Checked = True
TxtFecha.Text = DTnotificaciones(0)("RecurrenciaFin").ToString
End If
If DdlRecurrencia.SelectedValue.ToEntero > 0 Then
ChkRecurrencia.Checked = True
ChkRecurrencia_CheckedChanged(ChkRecurrencia, EventArgs.Empty)
Else
ChkRecurrencia.Checked = False
End If
If Clave > 0 Then
BtnAddNotificacion.Text = "Actualizar"
Else
BtnAddNotificacion.Text = "Agregar"
End If
CveNotificacion = Clave
RegistraScript("$('#divAddNotificacion').modal()")
UpNotificionIS.Update()
UpNotificacion.Update()
End Sub
Private Sub LbAddNotificacion_Click(sender As Object, e As EventArgs) Handles LbAddNotificacion.Click
CveNotificacion = -1
If CveNotificacion > 0 Then
BtnAddNotificacion.Text = "Actualizar"
Else
BtnAddNotificacion.Text = "Agregar"
End If
divDiasSemana.Visible = False
DivFrecuencia.Visible = False
DivRecurrencia.Visible = False
DivRecurrenciaFin.Visible = False
UpFooter.Update()
UpNotificionIS.Update()
RegistraScript("$('#divAddNotificacion').modal();LimpiaModal()")
End Sub
#End Region
#Region "E M P R E S A S - N O T I F I C A C I O N E S"
Private Sub CargaNoficacionesEmpresa()
Dim ObjSis As New ClsSisNotificaciones
DdlNotificaciones.Items.Clear()
If ObjSis.GetNotificacionesEmpresa() Then
DdlNotificaciones.DataSource = ObjSis.DtResultados
Else
DdlNotificaciones.DataSource = Nothing
End If
DdlNotificaciones.DataBind()
ObjSis.Dispose()
UpTitulos.Update()
End Sub
Private Sub CargaEmpresasNotificaciones(CveEmpresa As Integer)
Dim ObjSis As New ClsSisNotificaciones
If ObjSis.GetNotificacionesEmpresas2(CveEmpresa) Then
GvEmpresas.DataSource = ObjSis.DtResultados
Else
GvEmpresas.DataSource = Nothing
End If
ObjSis.Dispose()
GvEmpresas.DataBind()
UpEmpresa.Update()
End Sub
Private Sub LbAgregarFuncionalidadEmpresa_Click(sender As Object, e As EventArgs) Handles LbAgregarFuncionalidadEmpresa.Click
Dim ObjSis As New ClsSisNotificaciones
Dim TieneError = False
If Not ObjSis.AddNotificacionesEmpresas(DdlEmpresa.SelectedValue.ToEntero, DdlNotificaciones.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TieneError = True
End If
ObjSis.Dispose()
If Not TieneError Then
Alert("Se ha agregado con éxito")
CargaEmpresasNotificaciones(DdlEmpresa.SelectedValue.ToEntero)
Else
Alert("Ha ocurrido un error al registrar los datos")
End If
End Sub
Private Sub DdlEmpresa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresa.SelectedIndexChanged
CargaEmpresasNotificaciones(DdlEmpresa.SelectedValue.ToEntero)
End Sub
#Region "GV EMPRESA"
Private Sub GvEmpresas_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvEmpresas.RowEditing
GvEmpresas.EditIndex = e.NewEditIndex
CargaEmpresasNotificaciones(DdlEmpresa.SelectedValue.ToEntero)
End Sub
Private Sub GvEmpresas_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvEmpresas.RowCancelingEdit
GvEmpresas.EditIndex = -1
CargaEmpresasNotificaciones(DdlEmpresa.SelectedValue.ToEntero)
End Sub
Private Sub GvEmpresas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEmpresas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.RowState And DataControlRowState.Edit) > 0 Then
Dim ObjSis As New ClsSisNotificaciones
If ObjSis.GetNotificacionesEmpresa() Then
e.Row.FCDropDownList("DdlNotificacionesEdit").DataSource = ObjSis.DtResultados
e.Row.FCDropDownList("DdlNotificacionesEdit").DataBind()
End If
e.Row.FCDropDownList("DdlNotificacionesEdit").SelectedValueExist(e.Row.DataKey("CveNotificacion"))
ObjSis.Dispose()
End If
End If
End Sub
Private Sub GvEmpresas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvEmpresas.RowDeleting
Dim ObjNotificaciones As New ClsSisNotificaciones
Dim TieneError = False
Dim CveNotificacion = GvEmpresas.Rows(e.RowIndex).DataKey("CveNotificacion").ToEntero
Dim CveEmpresa = GvEmpresas.Rows(e.RowIndex).DataKey("CveEmpresa").ToEntero
Dim CveEmpresaNotificacion = GvEmpresas.Rows(e.RowIndex).DataKey("CveNotificacionEmpresa").ToEntero
If Not ObjNotificaciones.RemoveNotificacionesEmpresa(CveNotificacion, CveEmpresa, CveEmpresaNotificacion) Then
TieneError = True
End If
If Not TieneError Then
GvEmpresas.EditIndex = -1
Alert("La notificación ha sido eliminada.", TipoMensaje.MsgInformacion)
CargaEmpresasNotificaciones(DdlEmpresa.SelectedValue.ToEntero)
Else
Alert("Error al eliminar los cambios.", TipoMensaje.MsgError)
End If
End Sub
Private Sub GvEmpresas_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvEmpresas.RowUpdating
Dim ObjNotificaciones As New ClsSisNotificaciones
Dim TieneError = False
Dim CveNotificacion = GvEmpresas.Rows(e.RowIndex).FCDropDownList("DdlNotificacionesEdit").SelectedValue.ToEntero
Dim CveEmpresa = GvEmpresas.Rows(e.RowIndex).DataKey("CveEmpresa").ToEntero
Dim CveEmpresaNotificacion = GvEmpresas.Rows(e.RowIndex).DataKey("CveNotificacionEmpresa").ToEntero
If Not ObjNotificaciones.UpdateNotificacionesEmpresa(CveNotificacion, CveEmpresa, UsuarioActual.CveUsuario, CveEmpresaNotificacion) Then
TieneError = True
End If
ObjNotificaciones.Dispose()
If Not TieneError Then
GvEmpresas.EditIndex = -1
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CargaEmpresasNotificaciones(DdlEmpresa.SelectedValue.ToEntero)
Else
Alert("Error al actualizar los cambios.", TipoMensaje.MsgError)
End If
End Sub
#End Region
#End Region
Protected Sub ServerValidate(source As Object, args As ServerValidateEventArgs)
args.IsValid = ChkRecurrenciaFecha.Checked Or ChkRecurrenciaVeces.Checked
End Sub
End Class

126
Sistemas/CatPac.aspx Normal file
View File

@@ -0,0 +1,126 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPac.aspx.vb" Inherits="Sistemas_CatPAC" %>
<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 PAC
</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" ID="UpDatos">
<ContentTemplate>
<table border="0">
<tr>
<td>
<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">
PAC
<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">
Estatus
<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="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: left">
<asp:TextBox ID="TxtPAC" runat="server" Width="165px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPAC" runat="server" ControlToValidate="TxtPAC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PAC''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardarCaracteristicas"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOLimite" runat="server" HighlightCssClass="vco" TargetControlID="RFVPAC" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td align="center">
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="md-checksd2" Checked="true" /></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>
<asp:UpdatePanel ID="UpGvPac" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVPac" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePAC" EmptyDataText="No se encontraron PACS." ToolTip="Listado de PACS" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
&nbsp; <asp:Literal ID="LtlPAC" runat="server" Text='<%# Eval("PAC", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtPAC" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("PAC")%>' Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtPAC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''PAC''</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="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" CssClass="md-checksd2" runat="server" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="193px" ItemStyle-HorizontalAlign="Left">
<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>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
</script>
</asp:Content>

127
Sistemas/CatPac.aspx.vb Normal file
View File

@@ -0,0 +1,127 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class Sistemas_CatPAC
Inherits ClsPaginas
#Region "PROPIEDADES"
#End Region
Private Sub General_CatMarcas_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 Objeto As New ClsSisEmpresas
If Objeto.GetPacs() Then
GVPac.DataSource = Objeto.DtResultados
End If
GVPac.DataBind()
Objeto.Dispose()
End Sub
#End Region
#Region " GV MARCAS Y AGREGAR "
Private Sub LbAgregarC_Click(sender As Object, e As EventArgs) Handles LbAgregarC.Click
Dim Objeto As New ClsSisEmpresas
Dim PAC = TxtPAC.Text
Dim Estatus = ChkEstatus.Checked
If Objeto.AddPacs(PAC, Estatus, UsuarioActual.CveUsuario) Then
TxtPAC.Text = ""
Alert("La Marca se agregó correctamente.", TipoMensaje.MsgInformacion)
CargaDatos()
End If
Objeto.Dispose()
End Sub
Protected Sub GVPac_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVPac.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("Estatus") = "True" Then
e.Row.FCLabel("LtlEstatus").ForeColor = Drawing.Color.Green
e.Row.FCLabel("LtlEstatus").Font.Bold = True
e.Row.FCLabel("LtlEstatus").Text = "Activo"
Else
e.Row.FCLabel("LtlEstatus").Text = "Inactivo"
e.Row.FCLabel("LtlEstatus").ForeColor = Drawing.Color.Red
e.Row.FCLabel("LtlEstatus").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("Estatus") = "True" Then
e.Row.FCCheckBox("ChkEstatus").Checked = True
Else
e.Row.FCCheckBox("ChkEstatus").Checked = False
End If
End If
End If
End Sub
Protected Sub GVPac_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GVPac.RowEditing
GVPac.EditIndex = e.NewEditIndex
CargaDatos()
End Sub
Protected Sub GVPac_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GVPac.RowUpdating
Dim Update As New ClsSisEmpresas
Dim PAC = GVPac.Rows(e.RowIndex).FCTextBox("TxtPAC").Text.Trim
Dim Estatus = GVPac.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim Clave = GVPac.Rows(e.RowIndex).DataKey("CvePAC").ToEntero
If Update.UpdatePacs(PAC, Estatus, UsuarioActual.CveUsuario, Clave) Then
Alert("Se actualizó correctamente.", TipoMensaje.MsgInformacion)
End If
GVPac.EditIndex = -1
CargaDatos()
End Sub
Protected Sub GVPac_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GVPac.RowCancelingEdit
GVPac.EditIndex = -1
CargaDatos()
Alert("Se canceló la edición de los campos.")
End Sub
Protected Sub GvMarcas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GVPac.RowDeleting
Dim Objeto As New ClsSisEmpresas
Dim Clave = GVPac.Rows(e.RowIndex).DataKey("CvePAC").ToEntero
If Objeto.RemovePacs(Clave) Then
Alert("Se eliminó correctamente el PAC.", TipoMensaje.MsgInformacion)
End If
Objeto.Dispose()
GVPac.EditIndex = -1
CargaDatos()
End Sub
#End Region
End Class

452
Sistemas/CatParametros.aspx Normal file
View File

@@ -0,0 +1,452 @@
<%@ Page Title="SIG - Catálogo de Parametros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatParametros.aspx.vb" Inherits="CatParametros" %>
<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 Parámetros
</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="39px">#</th>
<th width="109px">
<asp:LinkButton ID="LbModulo" runat="server" CausesValidation="false" Text="" CommandArgument="Modulo" OnClick="LbOrden_Click">
Módulo
<asp:Literal ID="ImgModulo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">
<asp:LinkButton ID="LbDescripcion" runat="server" CausesValidation="false" Text="" CommandArgument="Descripcion" OnClick="LbOrden_Click">
Descripción
<asp:Literal ID="ImgDescripcion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="155px">
<asp:LinkButton ID="lbCadena" runat="server" CausesValidation="false" Text="Cadena">
</asp:LinkButton>
</th>
<th width="84px">
<asp:LinkButton ID="LbNum" runat="server" CausesValidation="false" Text="Número">
</asp:LinkButton>
</th>
<th width="119px">
<asp:LinkButton ID="LbFechas" runat="server" CausesValidation="false" Text="Fechas">
</asp:LinkButton>
</th>
<th width="114px">
<asp:LinkButton ID="LbVencimiento" runat="server" CausesValidation="false" Text="Venc">
</asp:LinkButton>
</th>
<th width="88px">
<asp:LinkButton ID="LbFechaIng" 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>
<th width="88px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="132px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtCveParam" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="25px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAParam" runat="server" ControlToValidate="TxtCveParam" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOAParam" runat="server" HighlightCssClass="vco" TargetControlID="RFVAParam" Width="300px" />
</td>
<td style="text-align: center">
<asp:DropDownList ID="CboModulos" runat="server" CausesValidation="true" DataTextField="Modulo" DataValueField="CveModulo" Width="90px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVModulo" runat="server" ControlToValidate="CboModulos" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Padre''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModulo" runat="server" HighlightCssClass="vco" TargetControlID="RFVModulo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtDescripcion" runat="server" CausesValidation="true" MaxLength="50" Width="140px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCODescripcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcion" Width="300px" />
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtStrValor1" runat="server" CausesValidation="true" MaxLength="50" Width="120px"></asp:TextBox>
<asp:TextBox ID="TxtStrValor2" runat="server" CausesValidation="true" MaxLength="50" Width="120px"></asp:TextBox>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtNumValor1" runat="server" CausesValidation="true" MaxLength="50" Width="60px"></asp:TextBox>
<asp:TextBox ID="TxtNumValor2" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="60px"></asp:TextBox>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtDTValor1" runat="server" CausesValidation="true" MaxLength="50" Width="90px"></asp:TextBox>
<asp:TextBox ID="TxtDTValor2" runat="server" CausesValidation="true" MaxLength="50" Width="90px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="TxtDTVencimiento" runat="server" CausesValidation="true" MaxLength="50" Width="94px"></asp:TextBox></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<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" DataKeyNames="CveParametro,CveModulo" EmptyDataText="No se encontraron Parametros" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TxtCveParam" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("CveParametro") %>' ValidationGroup="GrpEditGuardar" Width="25px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAParam" runat="server" ControlToValidate="TxtCveParam" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clave''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOAParam" runat="server" HighlightCssClass="vco" TargetControlID="RFVAParam" Width="300px" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Parametro" runat="server" Text='<%# Eval("CveParametro") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="B" runat="server" Text='<%# Eval("Modulo") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="CboModulo" runat="server" CausesValidation="true" DataTextField="Modulo" DataValueField="CveModulo" ValidationGroup="GrpEditGuardar" Width="90px"></asp:DropDownList>
<asp:Label ID="LModulo" runat="server" Text='<%# Eval("CveModulo") %>' Visible="false"></asp:Label>
<asp:RequiredFieldValidator ID="RFModulo" runat="server" ControlToValidate="CboModulo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Módulo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModulo" runat="server" HighlightCssClass="vco" TargetControlID="RFModulo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="txtDescrip" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Descripcion") %>' ValidationGroup="GrpEditGuardar" Width="140px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVA" runat="server" ControlToValidate="txtDescrip" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOA" runat="server" HighlightCssClass="vco" TargetControlID="RFVA" Width="200px" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="A" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TxtStrValor1" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("StrValor1") %>' ValidationGroup="GrpEditGuardar" Width="120px"></asp:TextBox>
<br />
<hr />
<asp:TextBox ID="TxtStrValor2" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("StrValor2") %>' ValidationGroup="GrpEditGuardar" Width="120px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="StrValor1" runat="server" Text='<%# Eval("StrValor1") %>' Height="18px"></asp:Label><br />
<hr />
<asp:Label ID="StrValor2" runat="server" Text='<%# Eval("StrValor2") %>' Height="18px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TxtNumValor1" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("NumValor1") %>' ValidationGroup="GrpEditGuardar" Width="60px"></asp:TextBox>
<br />
<hr />
<asp:TextBox ID="TxtNumValor2" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("NumValor2")%>' ValidationGroup="GrpEditGuardar" Width="60px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="NumValor1" runat="server" Text='<%# Eval("NumValor1") %>' Height="18px"></asp:Label><br />
<hr />
<asp:Label ID="NumValor2" runat="server" Text='<%# Eval("NumValor2") %>' Height="18px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TxtDTValor1" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("DTValor1") %>' ValidationGroup="GrpEditGuardar" Width="90px"></asp:TextBox>
<br />
<hr />
<asp:TextBox ID="TxtDTValor2" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("DTValor2") %>' ValidationGroup="GrpEditGuardar" Width="90px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="DTValor1" runat="server" Text='<%# Eval("DTValor1") %>' Height="18px"></asp:Label><br />
<hr />
<asp:Label ID="DTValor2" runat="server" Text='<%# Eval("DTValor2") %>' Height="18px"></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TxtFechaVencimiento" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("FechaVencimiento") %>' ValidationGroup="GrpEditGuardar" Width="80px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="FechaVencimiento" runat="server" Text='<%# Eval("FechaVencimiento")%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="C" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="D" runat="server" Text='<%# Eval("Usuario")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" Visible="false">
<EditItemTemplate>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpEditGuardar" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" Visible="false">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivPermisos" style="display: none; z-index: 5000;">
<asp:UpdatePanel ID="UPPAltaRep" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" border="0" width="350px">
<tr>
<td style="width: 9px;">
<img src="/imagenes/TopLeft.gif" style="border-width: 0px;" alt="" /></td>
<td style="background-image: url('/Imagenes/Top.gif'); background-repeat: repeat-x;" class="Titulo">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="left" style="height: 16px">Asignación de Permisos:&nbsp;<asp:Label ID="LblRolEdit" runat="server" ClientIDMode="static"></asp:Label></td>
<td width="28px" valign="bottom" style="height: 16px">
<asp:Image ID="ImgCerrar" runat="server" ImageUrl="/Imagenes/BotonCerrar.gif" AlternateText=" " onmouseover="this.style.cursor='hand'" /></td>
</tr>
</table>
</td>
<td style="width: 29px;">
<img src="/imagenes/TopRight.gif" border="0" alt="" /></td>
</tr>
<tr>
<td style="background-image: url('/Imagenes/MidLeft.gif'); background-repeat: repeat-y;" valign="top">
<img src="/Imagenes/MidTopLeft.gif" alt="" /></td>
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" width="350px">
<tr>
<td align="left">
<table bgcolor="white" border="0">
<tr>
<td align="center">
<asp:GridView ID="GvPermisos" runat="server" AutoGenerateColumns="False" Width="350px" DataKeyNames="CveModulo">
<Columns>
<asp:BoundField DataField="Descripcion" HeaderText="Módulo">
<ControlStyle Width="175px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<HeaderTemplate><span title="Seleccionar">S</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkL"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><span title="Insertar">I</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkR"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><span title="Actualizar">A</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkM"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><span title="Eliminar">E</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkE"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="CmdGuardar" runat="server" Text="Guardar Permisos" />&nbsp;<asp:Button ID="CmdCancelar" runat="server" Text="Cancelar" OnClientClick="javascript:$('#DivPermisos').hide(); return false;" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td style="background-image: url('/Imagenes/MidRight.gif'); background-repeat: repeat-y; width: 29px;" valign="top">
<img src="/Imagenes/MidTopRight.gif" alt="" /></td>
</tr>
<tr>
<td style="width: 9px;">
<img src="/imagenes/BotLeft.gif" style="border-width: 0px;" alt="" /></td>
<td style="background-image: url('/Imagenes/Bottom.gif'); background-repeat: repeat-x;" align="center">&nbsp;</td>
<td style="width: 29px;">
<img src="/imagenes/BotRight.gif" style="border-width: 0px;" alt="" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<%--<table border="0" cellpadding="0" cellspacing="0">
<tr align="left">
<td align="left">Nombre del Rol</td>
<td align="left">
<asp:TextBox ID="TxtDescripcion" runat="server" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" ErrorMessage="*" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</td>
<td align="left"><asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" /></td>
</tr>
</table>
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" CssClass="tabla_estilo" DataKeyNames="CveRol" OnRowEditing="GvDatos_RowEditing" OnRowUpdating="GvDatos_RowUpdating">
<Columns>
<asp:TemplateField HeaderText="Descripción" SortExpression="Descripcion">
<EditItemTemplate>
<asp:TextBox ID="TxtEditDescripcion" runat="server" Text='<%# Bind("DesRol") %>' Width="230px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" Width="10px" ControlToValidate="TxtEditDescripcion" ErrorMessage="*" ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<div style="height: 100px; width: 267px; overflow: auto;">
<asp:GridView ID="GvPermisos" runat="server" AutoGenerateColumns="False" Width="250px" OnRowDataBound="GvPermisosEdit_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="L">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkL"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="R">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkR"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="M">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkM"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="E">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkE"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:BoundField DataField="Descripcion" HeaderText="Módulo" ItemStyle-HorizontalAlign="Left">
<ControlStyle Width="150px" />
</asp:BoundField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
<HeaderStyle CssClass="Titulos"></HeaderStyle>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</div>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("DesRol") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="370px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ShowHeader="False">
<EditItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="True" CommandName="Update" ImageUrl="~/Imagenes/Btn_Update.png" Text="Actualizar" ValidationGroup="GrpEditGuardar" />
&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="~/Imagenes/Btn_Cancel.png" Text="Cancelar" />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Edit" ImageUrl="~/Imagenes/Btn_Edit.png" Text="Editar" />
</ItemTemplate>
<ItemStyle Width="50px" />
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="ImgEliminar" runat="server" CausesValidation="False" CommandName="Delete" ImageUrl="~/Imagenes/Btn_Delete.png" Text="Eliminar" OnClientClick=" return confirm('Desea eliminar el rol?');" />
</ItemTemplate>
<ItemStyle Width="50px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
<td valign="top">
<div style="height: 100px; width: 267px; overflow: auto;">
<asp:GridView ID="GvPermisos" runat="server" AutoGenerateColumns="False"
Width="250px" DataKeyNames="CveModulo">
<Columns>
<asp:TemplateField HeaderText="L">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkL"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="R">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkR"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="M">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkM"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="E">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkE"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:BoundField DataField="Descripcion" HeaderText="Módulo">
<ControlStyle Width="175px" />
</asp:BoundField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</div>
</td>
</tr>
</table>
</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 Parámetro?');
}
</script>
</asp:Content>

View File

@@ -0,0 +1,200 @@
Imports Extensiones
Imports System.Data
Partial Class CatParametros
Inherits ClsPaginas
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
ViewState("CveRol") = -1
CargaModulos()
CargaDatos()
'Permisos
'Permiso Registro
If UsuarioActual.TienePermisoProceso(1) Then LbAgregar.Enabled = True Else LbAgregar.Enabled = False
'Permiso Modificar
If UsuarioActual.TienePermisoProceso(2) Then GvDatos.Columns(9).Visible = True Else GvDatos.Columns(9).Visible = False
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(3) Then GvDatos.Columns(10).Visible = True Else GvDatos.Columns(10).Visible = False
End If
End Sub
Private Sub CargaModulos()
CboModulos.DataSource = GlobalDTModulos.FiltraParametros("NOT (Agrupacion = 'S')")
CboModulos.DataBind()
CboModulos.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Public Sub CargaDatos()
Dim Parametros As New ClsSisParametros
If Parametros.GetParametros() Then
ViewState("DTParametros") = Parametros.DtResultados
Else
GvDatos.DataSource = Nothing
End If
Parametros.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
Dim Parametro As New ClsSisParametros
If Parametro.AddParametros(TxtCveParam.Text.ToEntero, TxtDescripcion.Text.Trim, CboModulos.SelectedValue.ToEntero, TxtStrValor1.Text, TxtStrValor2.Text, TxtNumValor1.Text.ToEntero, TxtNumValor2.Text.ToEntero, TxtDTValor1.Text, TxtDTValor2.Text, TxtDTVencimiento.Text, UsuarioActual.CveUsuario) Then
TxtDescripcion.Text = ""
Alert("El nuevo Parámetro se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTParametros") = Parametro.DtResultados
Application("GlobalDTParametros") = Parametro.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
Parametro.Dispose()
'"$(""#DivAltaReporte"").hide();"
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal Then
e.Row.Cells(0).Width = Unit.Pixel(39)
e.Row.Cells(1).Width = Unit.Pixel(109)
e.Row.Cells(2).Width = Unit.Pixel(165)
e.Row.Cells(3).Width = Unit.Pixel(155)
e.Row.Cells(4).Width = Unit.Pixel(84)
e.Row.Cells(5).Width = Unit.Pixel(119)
e.Row.Cells(6).Width = Unit.Pixel(114)
e.Row.Cells(7).Width = Unit.Pixel(88)
e.Row.Cells(8).Width = Unit.Pixel(88)
e.Row.Cells(9).Width = Unit.Pixel(64)
e.Row.Cells(10).Width = Unit.Pixel(68)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Center
End If
End If
End Sub
Protected Sub GvDatos_RowEditing(ByVal sender As Object, ByVal 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
Dim EditingRow As GridViewRow = GvDatos.Rows(e.NewEditIndex)
Dim CboModulosR As DropDownList = CType(EditingRow.FindControl("CboModulo"), DropDownList)
For Each LI As ListItem In CboModulos.Items
CboModulosR.Items.Add(LI)
Next
CboModulosR.SelectedValue = EditingRow.DataKey("CveModulo")
End Sub
Protected Sub GvDatos_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim gvr As GridViewRow = GvDatos.Rows(e.RowIndex)
Dim CveParametro As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
Dim Parametro As New ClsSisParametros
If Parametro.UpdateParametros(gvr.FCTextBox("TxtCveParam").Text, gvr.FCTextBox("TxtDescrip").Text, gvr.FCDropDownList("CboModulo").SelectedValue.ToEntero,
gvr.FCTextBox("TxtStrValor1").Text, gvr.FCTextBox("TxtStrValor2").Text, gvr.FCTextBox("TxtNumValor1").Text, gvr.FCTextBox("TxtNumValor2").Text,
gvr.FCTextBox("TxtDTValor1").Text, gvr.FCTextBox("TxtDTValor2").Text, gvr.FCTextBox("TxtFechaVencimiento").Text, UsuarioActual.CveUsuario, CveParametro) Then
GvDatos.EditIndex = -1
ViewState("DTParametros") = Parametro.DtResultados
Application("GlobalDTParametros") = Parametro.DtResultados
End If
Parametro.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(ByVal sender As Object, ByVal 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_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim Parametro As New ClsSisParametros
If Parametro.RemoveParametros(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
GvDatos.EditIndex = -1
ViewState("DTParametros") = Parametro.DtResultados
End If
Parametro.Dispose()
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(ByVal Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTParametros"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTParametros"), DataTable)
End If
Application("GlobalDTParametros") = CType(ViewState("DTParametros"), DataTable)
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,77 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPlataformas.aspx.vb" Inherits="Sistemas_CatPlataformas" %>
<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">
Cátalogo de plataformas
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<li>
<a href="javascript:$('#divAgregar').modal()"><i class="fa fa-plus"></i> Agregar</a>
</li>
</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" GridLines="None" DataKeyNames="CvePlataforma,Plataforma" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
<Columns>
<asp:BoundField DataField="Plataforma" ItemStyle-Width="90%" HeaderText="Plataforma" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Editar" 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">Agregar Plataforma</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPlataforma" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPlataforma" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPlataforma" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Plataforma''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= TxtPlataforma.ClientID.ToString()%>">Plataforma:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:LinkButton ID="BtnAgregarPlataforma" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
<asp:linkbutton runat="server" id="btnCancelar" text="Cancelar" cssclass="btn btn-default" ></asp:linkbutton>
</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,113 @@
Imports Extensiones
Partial Class Sistemas_CatPlataformas
Inherits ClsPaginas
#Region "Propiedades"
Public Property CvePlataforma As Integer
Get
Return ViewState("CvePlataforma").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePlataforma") = 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
CvePlataforma = -1
EsEditar = 0
CargaDatos(-1)
End If
End Sub
Private Sub CargaDatos(CvePlataforma As Integer)
Dim Plataforma As New ClsSisEmpresas
If Plataforma.GetPlataforma(CvePlataforma, "-1") Then
GvDatos.DataSource = Plataforma.DtResultados
Else
GvDatos.DataSource = Nothing
End If
Plataforma.Dispose()
GvDatos.DataBind()
End Sub
Protected Sub imgE_Click(sender As Object, e As EventArgs)
Dim Boton = CType(sender, LinkButton)
CvePlataforma = Boton.CommandArgument.ToEntero
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
TxtPlataforma.Text = GvRow.DataKey("Plataforma").ToString
EsEditar = 1
BtnAgregarPlataforma.Text = "Actualizar"
UpBodyEstatus.Update()
UpFooter.Update()
RegistraScript("$('#divAgregar').modal()")
End Sub
Protected Sub BtnAgregarPlataforma_Click(sender As Object, e As EventArgs) Handles BtnAgregarPlataforma.Click
Dim Plataforma As New ClsSisEmpresas
If EsEditar = 0 Then
If Plataforma.AddPlataforma(TxtPlataforma.Text.Trim) Then
Alert("La plataforma se agregó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al agregar la plataforma", TipoMensaje.MsgError)
End If
ElseIf EsEditar = 1 Then
If Plataforma.UpdatePlataforma(CvePlataforma, TxtPlataforma.Text) Then
Alert("La plataforma se editó correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al editar la plataforma", TipoMensaje.MsgError)
End If
EsEditar = 0
BtnAgregarPlataforma.Text = "Agregar"
End If
RegistraScript("$('#divAgregar').modal('hide')")
Plataforma.Dispose()
TxtPlataforma.Text = ""
CargaDatos(-1)
UpDatos.Update()
UpBodyEstatus.update()
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim Plataforma As New ClsSisEmpresas
Dim CvePlataforma As Integer = GvDatos.Rows(e.RowIndex).DataKey("CvePlataforma").ToEntero
If Plataforma.DeletePlataforma(CvePlataforma) Then
Alert("La plataforma se eliminó correctamente", TipoMensaje.MsgInformacion)
End If
Plataforma.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("CvePlataforma").ToString
End If
End Sub
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
EsEditar = 0
RegistraScript("$('#divAgregar').modal('hide')")
BtnAgregarPlataforma.Text = "Agregar"
UpBodyEstatus.Update()
UpFooter.Update()
End Sub
End Class

350
Sistemas/CatProcesos.aspx Normal file
View File

@@ -0,0 +1,350 @@
<%@ Page Title="SIG - Catálogo de Procesos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProcesos.aspx.vb" Inherits="CatProcesos" %>
<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 Procesos
</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="30px">#</th>
<th width="150px">
<asp:LinkButton ID="LbModulo" runat="server" CausesValidation="false" Text="" CommandArgument="Modulo" OnClick="LbOrden_Click">
Módulo
<asp:Literal ID="ImgModulo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="300px">
<asp:LinkButton ID="LbDescripcion" runat="server" CausesValidation="false" Text="" CommandArgument="Descripcion" OnClick="LbOrden_Click">
Descripción
<asp:Literal ID="ImgDescripcion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" 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>
<th width="200px">
<asp:LinkButton ID="LbNombre" runat="server" CausesValidation="false" Text="" CommandArgument="Nombre" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgNombre" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="119px">Comandos</th>
</tr>
</thead>
<tr>
<td></td>
<td style="text-align: center">
<asp:DropDownList ID="CboModulos" runat="server" CssClass="select2me" CausesValidation="true" DataTextField="Modulo" DataValueField="CveModulo" ValidationGroup="GrpGuardar" Width="140px"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVModulo" runat="server" ControlToValidate="CboModulos" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Padre''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModulo" runat="server" HighlightCssClass="vco" TargetControlID="RFVModulo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtDescripcion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="290px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCODescripcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVDescripcion" Width="300px" />
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<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" DataKeyNames="CveProceso,CveModulo" EmptyDataText="No se encontraron Procesos" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:BoundField DataField="CveProceso" ReadOnly="true" />
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="B" runat="server" Text='<%# Eval("Modulo", "&nbsp;{0}") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="CboModulo" runat="server" CausesValidation="true" DataTextField="Modulo" DataValueField="CveModulo" ValidationGroup="GrpEditGuardar" Width="140px"></asp:DropDownList>
<asp:Label ID="LModulo" runat="server" Text='<%# Eval("CveModulo") %>' Visible="false"></asp:Label>
<asp:RequiredFieldValidator ID="RFModulo" runat="server" ControlToValidate="CboModulo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Módulo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOModulo" runat="server" HighlightCssClass="vco" TargetControlID="RFModulo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="A" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Descripcion") %>' ValidationGroup="GrpEditGuardar" Width="290px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVA" runat="server" ControlToValidate="A" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOA" runat="server" HighlightCssClass="vco" TargetControlID="RFVA" Width="300px" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="A" runat="server" Text='<%# Eval("Descripcion", "&nbsp;{0}") %>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="C" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="D" runat="server" Text='<%# Eval("Nombre", "&nbsp;{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" Visible="false">
<EditItemTemplate>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpEditGuardar" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" Visible="false">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivPermisos" style="display: none; z-index: 5000;">
<asp:UpdatePanel ID="UPPAltaRep" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" border="0" width="350px">
<tr>
<td style="width: 9px;">
<img src="/imagenes/TopLeft.gif" style="border-width: 0px;" alt="" /></td>
<td style="background-image: url('/Imagenes/Top.gif'); background-repeat: repeat-x;" class="Titulo">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="left" style="height: 16px">Asignación de Permisos:&nbsp;<asp:Label ID="LblRolEdit" runat="server" ClientIDMode="static"></asp:Label></td>
<td width="28px" valign="bottom" style="height: 16px">
<asp:Image ID="ImgCerrar" runat="server" ImageUrl="/Imagenes/BotonCerrar.gif" AlternateText=" " onmouseover="this.style.cursor='hand'" /></td>
</tr>
</table>
</td>
<td style="width: 29px;">
<img src="/imagenes/TopRight.gif" border="0" alt="" /></td>
</tr>
<tr>
<td style="background-image: url('/Imagenes/MidLeft.gif'); background-repeat: repeat-y;" valign="top">
<img src="/Imagenes/MidTopLeft.gif" alt="" /></td>
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" width="350px">
<tr>
<td align="left">
<table bgcolor="white" border="0">
<tr>
<td align="center">
<asp:GridView ID="GvPermisos" runat="server" AutoGenerateColumns="False" Width="350px" DataKeyNames="CveModulo">
<Columns>
<asp:BoundField DataField="Descripcion" HeaderText="Módulo">
<ControlStyle Width="175px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<HeaderTemplate><span title="Seleccionar">S</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkL"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><span title="Insertar">I</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkR"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><span title="Actualizar">A</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkM"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate><span title="Eliminar">E</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkE"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="CmdGuardar" runat="server" Text="Guardar Permisos" />&nbsp;<asp:Button ID="CmdCancelar" runat="server" Text="Cancelar" OnClientClick="javascript:$('#DivPermisos').hide(); return false;" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td style="background-image: url('/Imagenes/MidRight.gif'); background-repeat: repeat-y; width: 29px;" valign="top">
<img src="/Imagenes/MidTopRight.gif" alt="" /></td>
</tr>
<tr>
<td style="width: 9px;">
<img src="/imagenes/BotLeft.gif" style="border-width: 0px;" alt="" /></td>
<td style="background-image: url('/Imagenes/Bottom.gif'); background-repeat: repeat-x;" align="center">&nbsp;</td>
<td style="width: 29px;">
<img src="/imagenes/BotRight.gif" style="border-width: 0px;" alt="" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<%--<table border="0" cellpadding="0" cellspacing="0">
<tr align="left">
<td align="left">Nombre del Rol</td>
<td align="left">
<asp:TextBox ID="TxtDescripcion" runat="server" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" ControlToValidate="TxtDescripcion" ErrorMessage="*" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</td>
<td align="left"><asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" /></td>
</tr>
</table>
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" CssClass="tabla_estilo" DataKeyNames="CveRol" OnRowEditing="GvDatos_RowEditing" OnRowUpdating="GvDatos_RowUpdating">
<Columns>
<asp:TemplateField HeaderText="Descripción" SortExpression="Descripcion">
<EditItemTemplate>
<asp:TextBox ID="TxtEditDescripcion" runat="server" Text='<%# Bind("DesRol") %>' Width="230px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDescripcion" runat="server" Width="10px" ControlToValidate="TxtEditDescripcion" ErrorMessage="*" ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<div style="height: 100px; width: 267px; overflow: auto;">
<asp:GridView ID="GvPermisos" runat="server" AutoGenerateColumns="False" Width="250px" OnRowDataBound="GvPermisosEdit_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="L">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkL"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="R">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkR"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="M">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkM"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="E">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkE"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:BoundField DataField="Descripcion" HeaderText="Módulo" ItemStyle-HorizontalAlign="Left">
<ControlStyle Width="150px" />
</asp:BoundField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
<HeaderStyle CssClass="Titulos"></HeaderStyle>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</div>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("DesRol") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="370px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ShowHeader="False">
<EditItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="True" CommandName="Update" ImageUrl="~/Imagenes/Btn_Update.png" Text="Actualizar" ValidationGroup="GrpEditGuardar" />
&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False" CommandName="Cancel" ImageUrl="~/Imagenes/Btn_Cancel.png" Text="Cancelar" />
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Edit" ImageUrl="~/Imagenes/Btn_Edit.png" Text="Editar" />
</ItemTemplate>
<ItemStyle Width="50px" />
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="ImgEliminar" runat="server" CausesValidation="False" CommandName="Delete" ImageUrl="~/Imagenes/Btn_Delete.png" Text="Eliminar" OnClientClick=" return confirm('Desea eliminar el rol?');" />
</ItemTemplate>
<ItemStyle Width="50px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
<td valign="top">
<div style="height: 100px; width: 267px; overflow: auto;">
<asp:GridView ID="GvPermisos" runat="server" AutoGenerateColumns="False"
Width="250px" DataKeyNames="CveModulo">
<Columns>
<asp:TemplateField HeaderText="L">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkL"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="R">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkR"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="M">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkM"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="E">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkE"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
</asp:TemplateField>
<asp:BoundField DataField="Descripcion" HeaderText="Módulo">
<ControlStyle Width="175px" />
</asp:BoundField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</div>
</td>
</tr>
</table>
</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 Proceso?');
}
</script>
</asp:Content>

View File

@@ -0,0 +1,184 @@
Imports Extensiones
Imports System.Data
Partial Class CatProcesos
Inherits ClsPaginas
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
ViewState("CveRol") = -1
CargaModulos()
CargaDatos()
'Permisos
'Permiso Registro
If UsuarioActual.TienePermisoProceso(1) Then LbAgregar.Enabled = True Else LbAgregar.Enabled = False
'Permiso Modificar
If UsuarioActual.TienePermisoProceso(2) Then GvDatos.Columns(5).Visible = True Else GvDatos.Columns(5).Visible = False
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(3) Then GvDatos.Columns(6).Visible = True Else GvDatos.Columns(6).Visible = False
End If
End Sub
Private Sub CargaModulos()
CboModulos.DataSource = GlobalDTModulos.FiltraParametros("NOT (Agrupacion = 'S')").FiltraParametros("", "Modulo")
CboModulos.DataBind()
CboModulos.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Public Sub CargaDatos()
Dim Procesos As New ClsSisProcesos
If Procesos.GetProcesos(-1) Then
Cache("DTProcesos" & UsuarioActual.CveUsuario.ToString()) = Procesos.DtResultados
Else
GvDatos.DataSource = Nothing
End If
Procesos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
Dim Proceso As New ClsSisProcesos
If Proceso.AddProcesos(TxtDescripcion.Text.Trim, CboModulos.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtDescripcion.Text = ""
Alert("El nuevo Proceso se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
Cache("DTProcesos" & UsuarioActual.CveUsuario.ToString()) = Proceso.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
Proceso.Dispose()
'"$(""#DivAltaReporte"").hide();"
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal Then
e.Row.Cells(0).Width = Unit.Pixel(30)
e.Row.Cells(1).Width = Unit.Pixel(150)
e.Row.Cells(2).Width = Unit.Pixel(300)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(200)
e.Row.Cells(5).Width = Unit.Pixel(53)
e.Row.Cells(6).Width = Unit.Pixel(68)
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
End If
End If
End Sub
Protected Sub GvDatos_RowEditing(ByVal sender As Object, ByVal 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
Dim EditingRow As GridViewRow = GvDatos.Rows(e.NewEditIndex)
Dim CboModulosR As DropDownList = CType(EditingRow.FindControl("CboModulo"), DropDownList)
For Each LI As ListItem In CboModulos.Items
CboModulosR.Items.Add(LI)
Next
CboModulosR.SelectedValue = EditingRow.DataKey("CveModulo")
End Sub
Protected Sub GvDatos_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim Proceso As New ClsSisProcesos
Dim CveProceso As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
Dim CveModulo As Integer = CType(GvDatos.Rows(e.RowIndex).FindControl("CboModulo"), DropDownList).SelectedValue.ToEntero
If Proceso.UpdateProcesos(CType(GvDatos.Rows(e.RowIndex).FindControl("A"), TextBox).Text.Trim(), CveModulo, UsuarioActual.CveUsuario, CveProceso) Then
GvDatos.EditIndex = -1
Cache("DTProcesos" & UsuarioActual.CveUsuario.ToString()) = Proceso.DtResultados
End If
Proceso.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(ByVal sender As Object, ByVal 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_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim Proceso As New ClsSisProcesos
If Proceso.RemoveProcesos(GvDatos.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then
GvDatos.EditIndex = -1
Cache("DTProcesos" & UsuarioActual.CveUsuario.ToString()) = Proceso.DtResultados
End If
Proceso.Dispose()
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(ByVal Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(Cache("DTProcesos" & UsuarioActual.CveUsuario.ToString()), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(Cache("DTProcesos" & UsuarioActual.CveUsuario.ToString()), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

216
Sistemas/CatRoles.aspx Normal file
View File

@@ -0,0 +1,216 @@
<%@ Page Title="SIG - Catálogo de Roles" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatRoles.aspx.vb" Inherits="CatRoles" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<%-- <style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
</style>--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:HyperLink ID="HLAgregarRoles" NavigateUrl="RolesDetalle.aspx?CveRol=-1" runat="server" > <i class="fa fa-plus"></i> Agregar Rol</asp:HyperLink>
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Roles
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</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" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveRol" Width="100%" EmptyDataText="No se encontraron Roles" ToolTip="Roles" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Módulo" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
&nbsp;<asp:Label ID="LblModulo" runat="server" Text='<%# Eval("Modulo", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Rol" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:HyperLink ID="HlRolDetalle" runat="server" Text='<%# Eval("Rol", "{0}") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="C" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
&nbsp;<asp:Label ID="D" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="70px" Visible="false" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkE" runat="server" OnClick="Edit_Click" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-xs green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Módulos" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="LnkM" runat="server" AlternateText="Asignación de Permisos" CausesValidation="False" CommandName="Permisos" CommandArgument='<%# Eval("CveRol").ToString() & "|" & Eval("Rol").ToString() %>' CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-list'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Procesos" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="LnkP" runat="server" AlternateText="Asignación de Procesos" CausesValidation="False" CommandName="Procesos" CommandArgument='<%# Eval("CveRol").ToString() & "|" & Eval("Rol").ToString() %>' CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-list-alt'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="70px" Visible="false" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkD" 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="confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivPermisos" class="modal fade">
<div class="modal-dialog">
<asp:UpdatePanel ID="UPAlta" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<h4>
<asp:Label Text="Asignación de Permisos:" ID="LbPermisos" runat="server" />
</h4>
</div>
<div class="modal-body">
<div class="row" align="right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvPermisos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvPermisos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UPPAltaRep" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div>
</div>
<div class="row">
<div style="height: 400px; overflow-y: auto;">
<asp:GridView ID="GvPermisos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" Width="100%" DataKeyNames="CveRol,CveModulo" GridLines="None">
<Columns>
<asp:BoundField DataField="Padres" HeaderText="Módulo Padre">
<ControlStyle Width="175px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Modulo" HeaderText="Módulo">
<ControlStyle Width="175px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<HeaderTemplate><span title="Permitir">P</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkP"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:Button ID="CmdGuardar" runat="server" Text="Guardar Permisos" class="btn btn-primary" />
<button type="button" data-dismiss="modal" class="btn btn-danger">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div id="DivProcesos" class="modal fade">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpAltaP" runat="server" class="modal-content rowpadding" tabindex="-1" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<h4>
<asp:Label Text="Asignación de Procesos:" ID="LbProcesos" runat="server" />
</h4>
</div>
<div class="modal-body">
<div class="row" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvProcesos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvProcesos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UPPAltaProcesos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div style="height: 400px; overflow-y: auto;">
<asp:GridView ID="GvProcesos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" Width="100%" DataKeyNames="CveRol,CveModulo,CveProceso" GridLines="None">
<Columns>
<asp:BoundField DataField="Modulo" HeaderText="Módulo">
<ControlStyle Width="150px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Descripcion" HeaderText="Proceso">
<ControlStyle Width="250px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<HeaderTemplate><span title="Permitir">P</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkP"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:Button ID="BtnGuardaProcesos" runat="server" Text="Guardar Procesos" class="btn btn-primary" />
<button type="button" data-dismiss="modal" class="btn btn-danger">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

195
Sistemas/CatRoles.aspx.vb Normal file
View File

@@ -0,0 +1,195 @@
Imports System.Drawing
Imports Extensiones
Imports System.Data
Partial Class CatRoles
Inherits ClsPaginas
Private Property DtRoles As DataTable
Get
Return CType(ViewState("DtRoles"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtRoles") = value
End Set
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
'LnkCerrar.Style.Add("cursor", "hand")
'LnkCerrar.Attributes.Add("OnClick", "$('#DivPermisos').hide();")
'LnkCerrarP.Attributes.Add("OnClick", "$('#DivProcesos').hide();")
ViewState("Orden") = ""
ViewState("CveRol") = -1
CargaModulos()
CargaDatos()
'Permisos
'Permiso Registro
If UsuarioActual.TienePermisoProceso(4) Then HLAgregarRoles.Visible = True Else HLAgregarRoles.Visible = False
'Permiso Modificar
If UsuarioActual.TienePermisoProceso(5) Then GvDatos.Columns(4).Visible = True Else GvDatos.Columns(4).Visible = False
'Permiso Editar Modulos
' If UsuarioActual.TienePermisoProceso(16) Then GvDatos.Columns(5).Visible = True Else GvDatos.Columns(5).Visible = False
'Permiso Editar Permisos
'If UsuarioActual.TienePermisoProceso(17) Then GvDatos.Columns(6).Visible = True Else GvDatos.Columns(6).Visible = False
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(6) Then GvDatos.Columns(7).Visible = True Else GvDatos.Columns(7).Visible = False
End If
End Sub
Private Sub CargaModulos()
'DdlModulo.DataSource = GlobalDTModulos.FiltraParametros("CvePadre = 0 OR Agrupacion = 'S'")
'DdlModulo.DataBind()
'DdlModulo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Public Sub CargaDatos()
Dim Rol As New ClsSisRoles
If Rol.GetRoles(-1, UsuarioActual.CveEmpresa) Then
DtRoles = Rol.DtResultados
If Rol.GetRoles(-1, -1) Then GlobalDTRoles(-1) = Rol.DtResultados
GvDatos.DataSource = Rol.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GvDatos.DataBind()
Else
GvDatos.DataSource = Nothing
End If
Rol.Dispose()
End Sub
'Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LbAgregar.Click
'Dim Rol As New ClsSisRoles
'If Rol.AddRol(DdlModulo.SelectedValue.ToEntero, TxtDescripcion.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' TxtDescripcion.Text = ""
' Alert("El nuevo Rol se guardó correctamente.", TipoMensaje.MsgInformacion)
' UpTitulos.Update()
' If Rol.GetRoles(-1, -1) Then GlobalDTRoles(-1) = Rol.DtResultados : DtRoles = GlobalDTRoles(UsuarioActual.CveEmpresa)
' If ViewState("Orden").ToString() <> String.Empty Then
' CargaGrid(ViewState("Orden").ToString())
' Else
' CargaGrid("")
' End If
'End If
'Rol.Dispose()
''"$(""#DivAltaReporte"").hide();"
' End Sub
Protected Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand
If e.CommandName = "Permisos" Then
Dim Array = e.CommandArgument.ToString.Split("|"c)
If Array.Length = 2 Then
Dim ObjPermisos As New ClsSisRoles()
ViewState("CveRol") = Array(0).ToEntero
If ObjPermisos.GetRolesModulos(Array(0).ToEntero, -1) Then
GvPermisos.DataSource = ObjPermisos.DtResultados.FiltraParametros("AGRUPACION ='N'")
Else
GvPermisos.DataSource = Nothing
End If
ObjPermisos.Dispose()
GvPermisos.DataBind()
LbPermisos.Text = String.Format("Asignación de Permisos: {0}", Array(1).ToString)
UPPAltaRep.Update()
UPAlta.Update()
RegistraScript("$('#DivPermisos').modal();")
End If
End If
If e.CommandName = "Procesos" Then
Dim Array = e.CommandArgument.ToString.Split("|"c)
If Array.Length = 2 Then
Dim ObjPermisos As New ClsSisRoles()
ViewState("CveProceso") = Array(0).ToEntero
If ObjPermisos.GetRolesProcesos(Array(0).ToEntero, -1) Then
GvProcesos.DataSource = ObjPermisos.DtResultados
Else
GvProcesos.DataSource = Nothing
End If
ObjPermisos.Dispose()
GvProcesos.DataBind()
LbProcesos.Text = String.Format("Asignación de Procesos: {0}", Array(1).ToString)
UPPAltaProcesos.Update()
UpAltaP.Update()
RegistraScript("$('#DivProcesos').modal();")
End If
End If
End Sub
Protected Sub GvPermisos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPermisos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then e.Row.FCCheckBox("ChkP").Checked = True
End If
End Sub
Protected Sub GvProcesos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvProcesos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then
e.Row.Cells(0).CssClass = "bg-yellow"
End If
If (e.Row.DBCampo("CveProcesoAcceso")) <> "" Then e.Row.FCCheckBox("ChkP").Checked = True
End If
End Sub
Protected Sub CmdGuardar_Click(sender As Object, e As EventArgs) Handles CmdGuardar.Click
Dim Roles As New ClsSisRoles
For Each Row As GridViewRow In GvPermisos.Rows
Roles.UpdateRolesModulos(Row.DataKey("CveRol").ToEntero, Row.DataKey("CveModulo").ToEntero, If(Row.FCCheckBox("ChkP").Checked, 1, 0), UsuarioActual.CveUsuario)
Next
Roles.Dispose()
RegistraScript("$('#DivPermisos').modal('hide');")
End Sub
Protected Sub BtnGuardaProcesos_Click(sender As Object, e As EventArgs) Handles BtnGuardaProcesos.Click
Dim Roles As New ClsSisRoles
For Each Row As GridViewRow In GvProcesos.Rows
Roles.UpdateRolesProcesos(Row.DataKey("CveRol").ToEntero, Row.DataKey("CveProceso").ToEntero, If(Row.FCCheckBox("ChkP").Checked, 1, 0), UsuarioActual.CveUsuario)
Next
Roles.Dispose()
RegistraScript("$('#DivProcesos').modal('hide');")
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Liga As String = String.Format("/Sistemas/RolesDetalle.aspx?CveRol={0}", e.Row.DataKey("CveRol"))
e.Row.FCHyperLink("HlRolDetalle").NavigateUrl = Liga
End If
End Sub
Protected Sub GvDatos_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim Rol As New ClsSisRoles
Dim Clave = GvDatos.Rows(e.RowIndex).DataKey("CveRol").ToEntero
If Rol.RemoveRol(Clave) Then
Alert("Se ha eliminado correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
End If
Rol.Dispose()
CargaDatos()
End Sub
#End Region
Public Sub Edit_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Response.Redirect($"/Sistemas/RolesDetalle.aspx?&CveRol={GvRow.DataKey("CveRol")}", True)
UpDatos.Update()
End Sub
End Class

68
Sistemas/CatSesiones.aspx Normal file
View File

@@ -0,0 +1,68 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSesiones.aspx.vb" Inherits="Sistemas_CatSesiones" %>
<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">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:DropDownList ID="DdlVariable" runat="server" AutoPostBack="True" Width="300px" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Usuarios" Value="GlobalDTUsuarios"></asp:ListItem>
<asp:ListItem Text="Empresas" Value="GlobalDTEmpresas"></asp:ListItem>
<asp:ListItem Text="Roles" Value="GlobalDTRoles"></asp:ListItem>
<asp:ListItem Text="Clientes" Value="GlobalDTCliente"></asp:ListItem>
<asp:ListItem Text="Monedas" Value="GlobalDTMonedas"></asp:ListItem>
<asp:ListItem Text="Proyectos" Value="GlobalDTProyectos"></asp:ListItem>
<asp:ListItem Text="ProyectosUsuarios" Value="GlobalDTProyectosUsuarios"></asp:ListItem>
<asp:ListItem Text="Sub Proyectos" Value="GlobalDTSubProyectos"></asp:ListItem>
<asp:ListItem Text="Sub ProyectosUsuarios" Value="GlobalDTSubProyectosUsuarios"></asp:ListItem>
<asp:ListItem Text="Folios" Value="GlobalDTFolios"></asp:ListItem>
<%-- <asp:ListItem Text="Sucursales" Value="GlobalDTSucursales"></asp:ListItem>--%>
<asp:ListItem Text="Proveedores" Value="GlobalDTCompProveedores"></asp:ListItem>
<asp:ListItem Text="Métodos de Pago" Value="GlobalDTMetodosPago"></asp:ListItem>
<asp:ListItem Text="Paises" Value="GlobalDTGralPaises"></asp:ListItem>
<asp:ListItem Text="Estados" Value="GlobalDTGralEstados"></asp:ListItem>
<asp:ListItem Text="Municipios" Value="GlobalDTGralMunicipios"></asp:ListItem>
<asp:ListItem Text="Poblaciones" Value="GlobalDTGralPoblaciones"></asp:ListItem>
<asp:ListItem Text="Escolaridades" Value="GlobalDTGralEscolaridades"></asp:ListItem>
<asp:ListItem Text="Almacen" Value="GlobalDTAlmacen"></asp:ListItem>
<asp:ListItem Text="Impuestos Locales" Value="GlobalDTImpuestosLocales"></asp:ListItem>
<asp:ListItem Text="Prospectos Cla" Value="GlobalDTProspectosClasificaciones"></asp:ListItem>
<asp:ListItem Text="Prospectos Coord" Value="GlobalDTProsCoordinadores"></asp:ListItem>
<asp:ListItem Text="Prospectos Sup" Value="GlobalDTProsSupervisores"></asp:ListItem>
<asp:ListItem Text="Bancos - Cuentas " Value="GlobalDTBancosCuentas"></asp:ListItem>
<asp:ListItem Text="OC - Estatus " Value="GlobalDTOCEstatus"></asp:ListItem>
<asp:ListItem Text="OC - Estatus Usuarios " Value="GlobalDTOCEstatusUsuarios"></asp:ListItem>
<asp:ListItem Text="Conta - Plantillas " Value="GlobalDTContaPlantillasPolizas"></asp:ListItem>
<asp:ListItem Text="Usuarios Activos" Value="UsuariosActivos"></asp:ListItem>
<asp:ListItem Text="ProductosServicios" Value="ProductosServicios"></asp:ListItem>
<asp:ListItem Text="ProductosServiciosSimplificado" Value="PSSimplificado"></asp:ListItem>
<asp:ListItem Text="CONAC" Value="CONAC"></asp:ListItem>
<asp:ListItem Text="Tipo Cambio" Value="TipoCambio"></asp:ListItem>
<asp:ListItem Text="Combustible" Value="GlobalDTCombustibles"></asp:ListItem>
<asp:ListItem Text="Inventarios - PS Equivalencias" Value="GlobalDTProductosServiciosEquivalencias"></asp:ListItem>
<asp:ListItem Text="RH" Value="RH"></asp:ListItem>
<asp:ListItem Text="Ventas" Value="Ventas"></asp:ListItem>
<asp:ListItem Text="Precios Lista " Value="GlobalDTPrecioListas"></asp:ListItem>
<asp:ListItem Text="Paqueterias" Value="GlobalDTPaqueterias"></asp:ListItem>
<asp:ListItem Text="GlobalDTTiposGastos" Value="GlobalDTTiposGastos"></asp:ListItem>
<asp:ListItem Text="GlobalDTVtaTiposRelacion" Value="GlobalDTVtaTiposRelacion"></asp:ListItem>
<asp:ListItem Text="GlobalDTContratos" Value="GlobalDTContratos"></asp:ListItem>
<asp:ListItem Text="GlobalDTSATMotivoTraslado" Value="GlobalDTSATMotivoTraslado"></asp:ListItem>
<asp:ListItem Text="GlobalDTConceptosContables" Value="GlobalDTConceptosContables"></asp:ListItem>
<asp:ListItem Text="GlobalDTClasificacionPorcentaje" Value="GlobalDTClasificacionPorcentaje"></asp:ListItem>
</asp:DropDownList>&nbsp;&nbsp;
<asp:Button ID="BtnCargar" runat="server" Text="Cargar" class="btn btn-primary"/>&nbsp;&nbsp;<asp:Button ID="BtnRefresh" runat="server" Text="Consultar" class="btn btn-primary" />
<br />
<br />
<asp:Label ID="LblTotal" runat="server" Text=""></asp:Label>
<asp:GridView ID="Gv" runat="server" Font-Size="6px" Font-Names="Verdana" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None"></asp:GridView>
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,567 @@
Imports Extensiones
Imports System.Data
Partial Class Sistemas_CatSesiones
Inherits ClsPaginas
Protected Sub BtnCargar_Click(sender As Object, e As EventArgs) Handles BtnCargar.Click
If DdlVariable.SelectedItem.Value = "GlobalDTUsuarios" Then
CargaUsuarios()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTAlmacenUsuarios" Then
CargaAlmacenUsuarios()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTCliente" Then
CargaClientes()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTAlmacen" Then
CargaAlmacen()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTEmpresas" Then
CargaEmpresas()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTMonedas" Then
CargaMonedas()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTProyectos" Then
CargaProyectos()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSubProyectos" Then
CargaSubProyectos()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSubProyectosUsuarios" Then
CargaSubProyectos()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTFolios" Then
CargaFolios()
'ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSucursales" Then
' CargaSucursales()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTCompProveedores" Then
CargaProveedores()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTMetodosPago" Then
CargaMetodosPago()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTGralPaises" Then
CargaPaises()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTGralEstados" Then
CargaEstados()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTGralMunicipios" Then
CargaMunicipios()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTGralPoblaciones" Then
CargaPoblaciones()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTGralEscolaridades" Then
CargaEscolaridades()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTProspectosClasificaciones" Then
CargaProsCla()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTProsCoordinadores" Then
CargaProsCoord()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTProsSupervisores" Then
CargaProsSup()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTBancosCuentas" Then
CargaBancosCuentas()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTOCEstatus" Then
CargaOCEstatus()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTOCEstatusUsuarios" Then
CargaOCEstatusUsuarios()
ElseIf DdlVariable.SelectedItem.Value = "UsuariosActivos" Then
CargaSesionesActivas()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTContaPlantillasPolizas" Then
CargaDTContaPlantillasPolizas()
ElseIf DdlVariable.SelectedItem.Value = "ProductosServicios" Then
CargaProductosServicios()
ElseIf DdlVariable.SelectedItem.Value = "PSSimplificado" Then
CargaProductosServiciossimplificado()
ElseIf DdlVariable.SelectedItem.Value = "CONAC" Then
CargaCONAC()
ElseIf DdlVariable.SelectedItem.Value = "TipoCambio" Then
CargaTC()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTRoles" Then
' CargaCONAC()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTProductosServiciosEquivalencias" Then
CargarEquivalencias()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTCombustibles" Then
CargarCombustible()
ElseIf DdlVariable.SelectedItem.Value = "RH" Then
CargaRH()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTImpuestosLocales" Then
CargaImpuestosLocales()
ElseIf DdlVariable.SelectedItem.Value = "Ventas" Then
CargaVenta()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTTiposGastos" Then
CargaTiposGastos()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTPaqueterias" Then
CargaPaqueterias()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTVtaTiposRelacion" Then
CargaTiposRelacion()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTContratos" Then
CargaContratos()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTSATMotivoTraslado" Then
CargaSATMotivoTraslado()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTConceptosContables" Then
CargaConceptosContables()
ElseIf DdlVariable.SelectedItem.Value = "GlobalDTClasificacionPorcentaje" Then
CargaDTClasificacionPorcentaje()
End If
End Sub
Private Sub CargaConceptosContables()
Dim ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetConta_ConceptosContables() Then Application("GlobalDTContaConceptosContables") = ObjContabilidad.DtResultados Else Application("GlobalDTContaConceptosContables") = Nothing
ObjContabilidad.Dispose()
End Sub
Private Sub CargaSATMotivoTraslado()
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATMotivoTraslado Then Application("GlobalDTSATMotivoTraslado") = ObjGrales.DtResultados Else Application("GlobalDTSATMotivoTraslado") = Nothing
ObjGrales.Dispose()
End Sub
Private Sub CargaContratos()
Dim ObjContratos As New ClsContratos
If ObjContratos.GetContratos(-1, -1) Then Application("GlobalDTContratos") = ObjContratos.DtResultados Else Application("GlobalDTContratos") = Nothing
If ObjContratos.GetSecciones() Then Application("GlobalDTContratosSecciones") = ObjContratos.DtResultados Else Application("GlobalDTContratosSecciones") = Nothing
If ObjContratos.GetContratosTipos() Then Application("GlobalDTContratosTipos") = ObjContratos.DtResultados Else Application("GlobalDTContratosTipos") = Nothing
ObjContratos.Dispose()
End Sub
Private Sub CargaTiposRelacion()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetTiposRelacion() Then Application("GlobalDTVtaTiposRelacion") = ObjVentas.DtResultados Else Application("GlobalDTVtaTiposRelacion") = Nothing
ObjVentas.Dispose()
End Sub
Private Sub CargaImpuestosLocales()
Dim ObjPSImpuestos As New ClsProductosServicios
If ObjPSImpuestos.GetPSImpuestosLocales(-1, -1) Then Application("GlobalDTImpuestosLocales") = ObjPSImpuestos.DtResultados Else Application("GlobalDTImpuestosLocales") = Nothing
ObjPSImpuestos.Dispose()
End Sub
Private Sub CargaTiposGastos()
Dim ObjCompra As New ClsCompras()
If ObjCompra.GetTipoGasto(-1, -1) Then Application("GlobalDTTiposGastos") = ObjCompra.DtResultados Else Application("GlobalDTTiposGastos") = Nothing
ObjCompra.Dispose()
End Sub
Private Sub CargaDTContaPlantillasPolizas()
Dim Conta As New ClsContabilidad
If Conta.GetConta_PlantillasPolizas(-1, -1) Then Application("GlobalDTContaPlantillasPolizas") = Conta.DtResultados Else Application("GlobalDTContaPlantillasPolizas") = Nothing
If Conta.GetConta_PlantillasPolizasDetalle(-1, -1) Then Application("GlobalDTContaPlantillasPolizasDetalle") = Conta.DtResultados Else Application("GlobalDTContaPlantillasPolizasDetalle") = Nothing
If Conta.GetConta_ConceptosContables() Then Application("GlobalDTContaConceptosContables") = Conta.DtResultados Else Application("GlobalDTContaConceptosContables") = Nothing
Conta.Dispose()
End Sub
Private Sub CargaAlmacenUsuarios()
Dim Obj As New ClsSisUsuarios
If Obj.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = Obj.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing
Obj.Dispose()
End Sub
Private Sub CargaClientes()
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados Else Application("GlobalDTCliente") = Nothing
If ObjClientes.GetClienteClasificacion(-1) Then Application("GlobalDTClienteClasificaciones") = ObjClientes.DtResultados Else Application("GlobalDTClienteClasificaciones") = Nothing
ObjClientes.Dispose()
End Sub
Private Sub CargaAlmacen()
Dim Objinventarios As New ClsInventarios
If Objinventarios.GetAlmacenes(-1, -1, -1, -1) Then Application("GlobalDTAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTAlmacen") = Nothing
If Objinventarios.GetSeccionesAlmacenes(-1) Then Application("GlobalDTSeccionAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTSeccionAlmacen") = Nothing
If Objinventarios.GetTiposAlmacenes Then Application("GlobalDTTipoAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTTipoAlmacen") = Nothing
If Objinventarios.GetConceptos Then Application("GlobalDTInvConceptos") = Objinventarios.DtResultados Else Application("GlobalDTInvConceptos") = Nothing
Objinventarios.Dispose()
End Sub
Private Sub CargaRH()
Dim ObjRH As New ClsRH
If ObjRH.GetTipoBuzon() Then Application("GlobalDTTipoBuzon") = ObjRH.DtResultados Else Application("GlobalDTTipoBuzon") = Nothing
If ObjRH.GetDepartamentos Then Application("GlobalDTDepartamentos") = ObjRH.DtResultados Else Application("GlobalDTDepartamentos") = Nothing
If ObjRH.GetDocumentos() Then Application("GlobalDTDocumentos") = ObjRH.DtResultados Else Application("GlobalDTDocumentos") = Nothing
If ObjRH.GetEscolaridades() Then Application("GlobalDTEscolaridad") = ObjRH.DtResultados Else Application("GlobalDTEscolaridad") = Nothing
If ObjRH.GetEstadoCivil() Then Application("GlobalDTEstadoCivil") = ObjRH.DtResultados Else Application("GlobalDTEstadoCivil") = Nothing
If ObjRH.GetEstatusPersonal() Then Application("GlobalDTEstatusPersonal") = ObjRH.DtResultados Else Application("GlobalDTEstatusPersonal") = Nothing
If ObjRH.GetGeneros() Then Application("GlobalDTGenero") = ObjRH.DtResultados Else Application("GlobalDTGenero") = Nothing
If ObjRH.GetMotivoBaja() Then Application("GlobalDTMotivoBaja") = ObjRH.DtResultados Else Application("GlobalDTMotivoBaja") = Nothing
If ObjRH.GetPuestos(-1) Then Application("GlobalDTRHPuestos") = ObjRH.DtResultados Else Application("GlobalDTRHPuestos") = Nothing
If ObjRH.GetRutas() Then Application("GlobalDTRutas") = ObjRH.DtResultados Else Application("GlobalDTRutas") = Nothing
If ObjRH.GetTiposContrato() Then Application("GlobalDTTiposContrato") = ObjRH.DtResultados Else Application("GlobalDTTiposContrato") = Nothing
If ObjRH.GetTurnos() Then Application("GlobalDTTurno") = ObjRH.DtResultados Else Application("GlobalDTTurno") = Nothing
If ObjRH.GetJornadas() Then Application("GlobalDTJornadas") = ObjRH.DtResultados Else Application("GlobalDTJornadas") = Nothing
If ObjRH.GetAsistenciasInasistencias() Then Application("GlobalDTAsistenciasInasistencias") = ObjRH.DtResultados Else Application("GlobalDTAsistenciasInasistencias") = Nothing
If ObjRH.GetMotivoHorasExtras() Then Application("GlobalDTMotivosHorasExtras") = ObjRH.DtResultados Else Application("GlobalDTMotivosHorasExtras") = Nothing
If ObjRH.GetAsistenciasDetalle() Then Application("GlobalDTAsistenciaDetalle") = ObjRH.DtResultados Else Application("GlobalDTAsistenciaDetalle") = Nothing
ObjRH.Dispose()
End Sub
Private Sub CargaVenta()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetMesas Then Application("GlobalDTMesas") = ObjVentas.DtResultados Else Application("GlobalDTMesas") = Nothing
If ObjVentas.GetPrecioListas Then Application("GlobalDTPrecioListas") = ObjVentas.DtResultados Else Application("GlobalDTPrecioListas") = Nothing
If ObjVentas.GetCondicionesEntrega(-1) Then Application("GlobalDTVtaCondicionesEntrega") = ObjVentas.DtResultados Else Application("GlobalDTVtaCondicionesEntrega") = Nothing
ObjVentas.Dispose()
End Sub
Private Sub CargaProductosServicios()
'Carga Usuarios
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSAlias(-1, -1) Then Application("GlobalDTProductosServiciosAlias") = ObjPS.DtResultados Else Application("GlobalDTProductosServiciosAlias") = Nothing
If ObjPS.GetPSEquivalencias(-1, -1) Then Application("GlobalDTProductosServiciosEquivalencias") = ObjPS.DtResultados Else Application("GlobalDTProductosServiciosEquivalencias") = Nothing
'If ObjPS.GetPS(-1, -1, -1) Then Application("GlobalDTProductosServicios") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTProductosServicios") = Nothing
If ObjPS.GetMetodosInv() Then Application("GlobalDTInvMetodosInventario") = ObjPS.DtResultados Else Application("GlobalDTInvMetodosInventario") = Nothing
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
ObjPS.Dispose()
'Fin Carga Usuarios
End Sub
Private Sub CargaProductosServiciosSimplificado()
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
ObjPS.Dispose()
End Sub
Private Sub CargaSesionesActivas()
Try
Dim gv As New StringBuilder
Dim sessionData As Dictionary(Of String, HttpSessionState) = DirectCast(Application("s"), Dictionary(Of String, HttpSessionState))
If sessionData IsNot Nothing Then
For Each item As KeyValuePair(Of String, HttpSessionState) In sessionData
'gv.Add(New String() With { _
' Key .SessionId = item.Key, _
' Key .SessionKey = Nothing, _
' Key .SessionValue = Nothing _
'})
If item.Value IsNot Nothing AndAlso item.Value.Count > 0 Then
For Each key As String In item.Value.Keys
'gv.Add(New String() With { _
' Key .SessionId = item.Key, _
' Key .SessionKey = key, _
' Key .SessionValue = If(item.Value(key) IsNot Nothing, item.Value(key).ToString(), String.Empty) _
'})
Next
End If
Next
'sessionValuesGrid.DataSource = gv
'sessionValuesGrid.DataBind()
End If
Catch
End Try
End Sub
'Generales
Private Sub CargaUsuarios()
'Carga Usuarios
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetUsuariosEmpresas(-1) Then
Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados
Else
Application("GlobalDTUsuarios") = Nothing
End If
If ObjUsuarios.GetAlmacen(-1) Then Application("GlobalDTAlmacenUsuarios") = ObjUsuarios.DtResultados Else Application("GlobalDTAlmacenUsuarios") = Nothing
ObjUsuarios.Dispose()
'Fin Carga Usuarios
End Sub
Private Sub CargaEmpresas()
'Carga Empresas
Dim ObjEmp As New ClsSisEmpresas()
If ObjEmp.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
Application("GlobalDTEmpresas") = ObjEmp.DtResultados
Else
Application("GlobalDTEmpresas") = Nothing
End If
ObjEmp.Dispose()
'Fin Carga Empresas
End Sub
Private Sub carga1()
Dim ObjAC As New ClsAC
If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados
ObjAC.Dispose()
End Sub
Private Sub CargaMonedas()
'Carga Monedas
Dim ObjMonedas As New ClsMonedas()
If ObjMonedas.GetMonedas() Then
Application("GlobalDTMonedas") = ObjMonedas.DtResultados
Else
Application("GlobalDTMonedas") = Nothing
End If
If ObjMonedas.GetMonedasAlias() Then
Application("GlobalDTMonedasAlias") = ObjMonedas.DtResultados
Else
Application("GlobalDTMonedasAlias") = Nothing
End If
ObjMonedas.Dispose()
'Fin Carga Monedass
End Sub
Private Sub CargaProyectos()
'Carga Proyectos
Dim ObjProyectos As New ClsProyectos
If ObjProyectos.GetProyectos Then
Application("GlobalDTProyectos") = ObjProyectos.DtResultados
Else
Application("GlobalDTProyectos") = Nothing
End If
ObjProyectos.Dispose()
'Fin Carga Proyectos
End Sub
Private Sub CargaSubProyectos()
'Carga SubProyectos
Dim ObjSubProyectos As New ClsSubProyectos
If ObjSubProyectos.GetSubProyectos Then
Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados
Else
Application("GlobalDTSubProyectos") = Nothing
End If
If ObjSubProyectos.GetSubProyectosUsuarios Then
Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"})
Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados
Else
Application("GlobalDTProyectosUsuarios") = Nothing
Application("GlobalDTSubProyectosUsuarios") = Nothing
End If
ObjSubProyectos.Dispose()
'Fin Carga Proyectos
End Sub
Private Sub CargaFolios()
'Carga Folios
Dim ObjFolios As New ClsGralFolios()
If ObjFolios.GetFolios() Then
Application("GlobalDTFolios") = ObjFolios.DtResultados
Else
Application("GlobalDTFolios") = Nothing
End If
ObjFolios.Dispose()
'Fin Carga Folios
End Sub
'Private Sub CargaSucursales()
' 'Carga Sucursales
' Dim ObjSucursales As New ClsSucursales()
' If ObjSucursales.GetSucursales() Then
' Application("GlobalDTSucursales") = ObjSucursales.DtResultados
' Else
' Application("GlobalDTSucursales") = Nothing
' End If
' ObjSucursales.Dispose()
' 'Fin Carga Sucursales
'End Sub
Private Sub CargaMetodosPago()
Dim ObjMetodoPago As New ClsMetodosPagos()
If ObjMetodoPago.GetMetodosPago() Then
Application("GlobalDTMetodosPago") = ObjMetodoPago.DtResultados
Else
Application("GlobalDTMetodosPago") = Nothing
End If
ObjMetodoPago.Dispose()
End Sub
Private Sub CargaPaises()
Dim Gral As New ClsGenerales
If Gral.GetGralPaises Then Application("GlobalDTGralPaises") = Gral.DtResultados Else Application("GlobalDTGralPaises") = Nothing
If Gral.GetClasificacionPorcentaje(-1, -1, -1, -1, 1) Then Application("GlobalDTClasificacionPorcentaje") = Gral.DtResultados Else Application("GlobalDTClasificacionPorcentaje") = Nothing
Gral.Dispose()
End Sub
Private Sub CargaEstados()
Dim Gral As New ClsGenerales
If Gral.GetGralEstados Then Application("GlobalDTGralEstados") = Gral.DtResultados Else Application("GlobalDTGralEstados") = Nothing
Gral.Dispose()
End Sub
Private Sub CargaMunicipios()
Dim Gral As New ClsGenerales
If Gral.GetGralMunicipios Then Application("GlobalDTGralMunicipios") = Gral.DtResultados Else Application("GlobalDTGralMunicipios") = Nothing
Gral.Dispose()
End Sub
Private Sub CargaPoblaciones()
Dim Gral As New ClsGenerales
If Gral.GetGralPoblaciones Then Application("GlobalDTGralPoblaciones") = Gral.DtResultados Else Application("GlobalDTGralPoblaciones") = Nothing
Gral.Dispose()
End Sub
Private Sub CargaEscolaridades()
Dim Gral As New ClsGenerales
If Gral.GetEscolaridades Then Application("GlobalDTGralEscolaridades") = Gral.DtResultados Else Application("GlobalDTGralEscolaridades") = Nothing
Gral.Dispose()
End Sub
'Prospectos
Private Sub CargaProsCla()
Dim Prosp As New ClsProspectos
If Prosp.GetClasificacion Then Application("GlobalDTProspectosClasificaciones") = Prosp.DtResultados Else Application("GlobalDTProspectosClasificaciones") = Nothing
Prosp.Dispose()
End Sub
Private Sub CargaProsCoord()
Dim Prosp As New ClsProspectos
If Prosp.GetCoordinadores(-1) Then Application("GlobalDTProsCoordinadores") = Prosp.DtResultados Else Application("GlobalDTProsCoordinadores") = Nothing
Prosp.Dispose()
End Sub
Private Sub CargaProsSup()
Dim Prosp As New ClsProspectos
If Prosp.GetSupervisores(-1) Then Application("GlobalDTProsSupervisores") = Prosp.DtResultados Else Application("GlobalDTProsSupervisores") = Nothing
Prosp.Dispose()
End Sub
Private Sub CargaBancosCuentas()
Dim Banc As New ClsBancos
If Banc.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = Banc.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing
Banc.Dispose()
End Sub
Private Sub CargaOCEstatus()
Dim ObjOC As New ClsOC
If ObjOC.GetEstatus() Then Application("GlobalDTOCEstatus") = ObjOC.DtResultados Else Application("GlobalDTOCEstatus") = Nothing
ObjOC.Dispose()
End Sub
Private Sub CargaOCEstatusUsuarios()
Dim ObjOC As New ClsOC
If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, -1) Then Application("GlobalDTOCEstatusUsuarios") = ObjOC.DtResultados Else Application("GlobalDTOCEstatusUsuarios") = Nothing
ObjOC.Dispose()
End Sub
'Compras
Private Sub CargaProveedores()
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProveedores.DtResultados Else Application("GlobalDTCompProveedores") = Nothing
If ObjProveedores.GetClasificacionProveedores Then Application("GlobalDTProveedorClasificacion") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorClasificacion") = Nothing
If ObjProveedores.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorSucursales") = Nothing
ObjProveedores.Dispose()
End Sub
Protected Sub DdlVariable_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlVariable.SelectedIndexChanged
Gv.DataSource = DirectCast(Application(DdlVariable.SelectedValue), DataTable)
Gv.DataBind()
LblTotal.Text = "Registros:" & Gv.Rows.Count
End Sub
Protected Sub BtnRefresh_Click(sender As Object, e As EventArgs) Handles BtnRefresh.Click
Gv.DataSource = DirectCast(Application(DdlVariable.SelectedValue), DataTable)
Gv.DataBind()
End Sub
'DT CONAC
Private Sub CargaCONAC()
Dim ObjAC As New ClsAC
If ObjAC.GetClasificacionFuncional() Then Application("GlobalDTAC_ClasificacionFuncional") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionFuncional") = Nothing
If ObjAC.GetClasificacionGeografica() Then Application("GlobalDTAC_ClasificacionGeografica") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionGeografica") = Nothing
If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing
If ObjAC.GetFuenteFinanciamientoCONAC() Then Application("GlobalDTAC_FuentesFinanciamientoCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamientoCONAC") = Nothing
If ObjAC.GetProgramaCONAC() Then Application("GlobalDTAC_ProgramasCONAC") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramasCONAC") = Nothing
If ObjAC.GetUnidadesAdministrativas() Then Application("GlobalDTAC_UnidadesAdministrativas") = ObjAC.DtResultados Else Application("GlobalDTAC_UnidadesAdministrativas") = Nothing
If ObjAC.GetClasificacionAdministrativa() Then Application("GlobalDTAC_ClasificacionAdministrativa") = ObjAC.DtResultados Else Application("GlobalDTAC_ClasificacionAdministrativa") = Nothing
If ObjAC.GetPD_EjeRector() Then Application("GlobalDTAC_PD_EjeRector") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_EjeRector") = Nothing
If ObjAC.GetPD_Programas() Then Application("GlobalDTAC_PD_Programas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Programas") = Nothing
If ObjAC.GetPD_Estrategias() Then Application("GlobalDTAC_PD_Estrategias") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Estrategias") = Nothing
If ObjAC.GetPD_LineasAccion() Then Application("GlobalDTAC_PD_LineasAccion") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_LineasAccion") = Nothing
If ObjAC.GetPD_Metas() Then Application("GlobalDTAC_PD_Metas") = ObjAC.DtResultados Else Application("GlobalDTAC_PD_Metas") = Nothing
If ObjAC.GetTipoGasto() Then Application("GlobalDTAC_TipoGasto") = ObjAC.DtResultados Else Application("GlobalDTAC_TipoGasto") = Nothing
If ObjAC.GetProgramaOperativo() Then Application("GlobalDTAC_ProgramaOperativo") = ObjAC.DtResultados Else Application("GlobalDTAC_ProgramaOperativo") = Nothing
If ObjAC.GetFuentesFinanciamiento() Then Application("GlobalDTAC_FuentesFinanciamiento") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesFinanciamiento") = Nothing
If ObjAC.GetRubrosIngreso() Then Application("GlobalDTAC_RubrosIngreso") = ObjAC.DtResultados Else Application("GlobalDTAC_RubrosIngreso") = Nothing
If ObjAC.GetFuentesRecaudacion() Then Application("GlobalDTAC_FuentesRecaudacion") = ObjAC.DtResultados Else Application("GlobalDTAC_FuentesRecaudacion") = Nothing
If ObjAC.GetMatrizID Then Application("GlobalDTAC_MatrizIngresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizIngresos") = Nothing
If ObjAC.GetMatrizGD Then Application("GlobalDTAC_MatrizEgresos") = ObjAC.DtResultados Else Application("GlobalDTAC_MatrizEgresos") = Nothing
ObjAC.Dispose()
End Sub
Private Sub CargaTC()
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Now) Then
If ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString
End If
End If
ObjGral.Dispose()
End Sub
Private Sub CargarEquivalencias()
Dim ObjProductos As New ClsProductosServicios
If ObjProductos.GetPSEquivalencias(-1, -1) Then Application("GlobalDTProductosServiciosEquivalencias") = ObjProductos.DtResultados Else Application("GlobalDTProductosServiciosEquivalencias") = Nothing
ObjProductos.Dispose()
End Sub
Private Sub CargarCombustible()
Dim ObjFlotillas As New ClsFlotillas
If ObjFlotillas.GetCombustibles() Then Application("GlobalDTCombustibles") = ObjFlotillas.DtResultados Else Application("GlobalDTCombustibles") = Nothing
ObjFlotillas.Dispose()
End Sub
Private Sub CargaPaqueterias()
Dim ObjGenerales As New ClsGenerales
If ObjGenerales.GetGralPaqueterias Then Application("GlobalDTPaqueterias") = ObjGenerales.DtResultados Else Application("GlobalDTPaqueterias") = Nothing
If ObjGenerales.GetGralPaqueteriasGuiasTipo Then Application("GlobalDTPaqueteriaGuiaTipos") = ObjGenerales.DtResultados Else Application("GlobalDTPaqueteriaGuiaTipos") = Nothing
ObjGenerales.Dispose()
End Sub
Private Sub Sistemas_CatSesiones_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim dominio As String = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)
'If Not dominio.Contains("gps.adsistemas") Then
' dominio = dominio.Replace("http", "https")
' Response.Redirect(dominio)
'End If
LblTotal.Text = dominio
End Sub
Private Sub CargaDTClasificacionPorcentaje()
Dim ObjGenerales As New ClsGenerales
If ObjGenerales.GetClasificacionPorcentaje(-1) Then Application("GlobalDTClasificacionPorcentaje") = ObjGenerales.DtResultados Else Application("GlobalDTClasificacionPorcentaje") = Nothing
ObjGenerales.Dispose()
End Sub
End Class

View File

@@ -0,0 +1,597 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTareasProgramadas.aspx.vb" Inherits="Sistemas_CatTareasProgramadas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/codemirror/CSS") rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/codemirror/lib/codemirror.css") rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/codemirror/theme/neat.css") rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/codemirror/theme/ambiance.css") rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/codemirror/theme/material.css") rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/codemirror/theme/neo.css") rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/global/plugins/codemirror/addon/hint/show-hint.css") rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.backWhite {
background-color: #fff;
}
.logincint {
background-color: #fff;
padding: 15px;
width: 400px;
margin: 25px auto;
}
.login-form {
padding: 35px;
}
.UpLogin .loginc .btn-login {
background-color: #e52b38;
}
.UpLogin .loginc .btn-login:hover {
background-color: #e52b38;
}
.restpass a {
line-height: 4;
color: #8c8a8c;
}
.restpass a:hover, .restpass a:active {
color: #333 !important;
}
/*input*/
input[type="email"]:focus, input[type="text"]:focus, input[type="password"]:focus,
input[type="text"]:focus, select:focus, textarea:focus {
border-color: #004680 !important;
}
input[type="checkbox"]:checked + label:before, input[type="radio"]:checked + label:before {
background: #004680;
border-color: #004680;
}
input[type="checkbox"]:focus + label:before,
input[type="radio"]:focus + label:before {
border-color: #004680;
-webkit-box-shadow: 0 0 0 2px #004680;
-ms-box-shadow: 0 0 0 2px #004680;
box-shadow: 0 0 0 2px #004680;
}
.UpLogin input[type="submit"], .UpLogin input[type="reset"], .UpLogin input[type="button"],
.UpLogin button:not(.bootbox-close-button), .UpLogin .button {
background-color: #004680;
}
/* BG */
.bg-opacity {
top: 0;
left: 0;
height: 100%;
width: 100%;
position: fixed;
z-index: -1;
background-color: #004680;
opacity: .25;
}
#bg {
-moz-transition: opacity 2s ease-in-out;
-webkit-transition: opacity 2s ease-in-out;
-ms-transition: opacity 2s ease-in-out;
transition: opacity 2s ease-in-out;
height: 100%;
left: 0;
/*opacity: 0.25;*/
position: fixed;
top: 0;
width: 100%;
z-index: -1;
}
#bg div {
-moz-transition: opacity 3s ease, visibility 3s;
-webkit-transition: opacity 3s ease, visibility 3s;
-ms-transition: opacity 3s ease, visibility 3s;
transition: opacity 3s ease, visibility 3s;
background-size: cover;
height: 100%;
left: 0;
opacity: 0;
position: absolute;
top: 0;
visibility: hidden;
width: 150%;
}
#bg div.visible {
-moz-animation: bg 45s linear infinite;
-webkit-animation: bg 45s linear infinite;
-ms-animation: bg 45s linear infinite;
animation: bg 45s linear infinite;
opacity: 1;
visibility: visible;
z-index: 1;
}
#bg div.visible.top {
z-index: 2;
}
@media screen and (max-width: 1280px) {
#bg div.visible {
-moz-animation: bg 29.25s linear infinite;
-webkit-animation: bg 29.25s linear infinite;
-ms-animation: bg 29.25s linear infinite;
animation: bg 29.25s linear infinite;
}
}
@media screen and (max-width: 736px) {
#bg div.visible {
-moz-animation: bg 18s linear infinite;
-webkit-animation: bg 18s linear infinite;
-ms-animation: bg 18s linear infinite;
animation: bg 18s linear infinite;
}
}
#bg div:only-child {
-moz-animation-direction: alternate !important;
-webkit-animation-direction: alternate !important;
-ms-animation-direction: alternate !important;
animation-direction: alternate !important;
}
body.is-loading #bg {
opacity: 0;
}
@-moz-keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
@-webkit-keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
@-ms-keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
@keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus, input:-webkit-autofill,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover, textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
border: 1px solid #333 !important;
-webkit-text-fill-color: #333 !important;
-webkit-box-shadow: 0 0 0px 1000px #FFF inset;
transition: background-color 5000s ease-in-out 0s;
}
</style>
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a {
color: white !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tareas Programadas
</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="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="BtnAgregarTareasProgramadas" data-toggle="tooltip" data-placement="left" title="Agregar Tarea Programada" Text="<i class='fa fa-plus'></i> Agregar Tarea"></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="UpGral" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="Widthall" style="text-align: right!important; margin-top: 20px!important; margin-bottom: 2px!important">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTareasProgramadas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTareasProgramadas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="row" style="margin: 5px">
<asp:UpdatePanel ID="UPGvTareasProgramadas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvTareasProgramadas" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveTareaProgramada, CveEmpresa, RecursividadEnMinutos, RecursividadEnHoras, RecursividadEnDias, Parametros, Correo, PlantillaCorreo, FechaInicio"
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
data-sort="true"
data-freezerows="1"
GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Tarea">
<ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("Tarea") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empresa">
<ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("Empresa") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Inicio">
<ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("FechaInicio", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Fin">
<ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("FechaFin", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Recursividad Min." ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("RecursividadEnMinutos") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Recursividad Hrs." ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("RecursividadEnHoras") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Recursividad Días" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
&nbsp;<asp:Literal runat="server" Text='<%# Eval("RecursividadEnDias") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
<ItemTemplate>
<asp:LinkButton ID="ImgE" OnClick="Edit_ClickTareasProgramadas" runat="server" AlternateText="Editar" CausesValidation="False"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px">
<ItemTemplate>
<asp:LinkButton ID="imgD" OnClick="Remove_ClickTareasProgramadas" runat="server" AlternateText="Eliminar" 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>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<br />
<br />
<div id="DivAgregarTareasProgramadas" class="modal ADS fade" role="dialog">
<div class="modal-dialog modal-lg" >
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTareasProgramadas" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModalTareasProgramadas" runat="server">Agregar Tarea Programada</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTareaProgra" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveTareaProgramada" DataTextField="Tarea" Width="100%"
Class="table-group-action-input form-control input-inline input-small input-sm" AutoPostBack="true" OnSelectedIndexChanged="DdlTareaProgra_SelectedIndexChanged">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlTareaProgra" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tarea Programada''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:Label AssociatedControlID="DdlTareaProgra" runat="server" Text="Tarea Programada:"></asp:Label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlEmpresas" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveEmpresa" DataTextField="Empresa" Width="100%"
Class="table-group-action-input form-control input-inline input-small input-sm"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" InitialValue="-1" runat="server" ControlToValidate="DdlEmpresas" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Empresa''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:Label AssociatedControlID="DdlEmpresas" runat="server" Text="Empresa:"></asp:Label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoR" runat="server" CssClass="form-control input-sm select2me" Class="table-group-action-input form-control input-inline input-small input-sm" Width="100%">
<asp:ListItem Text="Días" Value="D" Selected="True"></asp:ListItem>
<asp:ListItem Text="Horas" Value="H"></asp:ListItem>
<asp:ListItem Text="Minutos" Value="M"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" InitialValue="-1" runat="server" ControlToValidate="DdlTipoR" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Recursividad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:Label AssociatedControlID="DdlTipoR" runat="server" Text="Tipo de Recursividad:"></asp:Label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNumerico" CssClass="form-control " Width="150px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtBonificacion" runat="server" ControlToValidate="TxtNumerico" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Numérico''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
<asp:Label AssociatedControlID="TxtNumerico" runat="server" Text="Recursividad:"></asp:Label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtParametros" CssClass="form-control" runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtParametros" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Parámetros''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
<asp:Label AssociatedControlID="TxtParametros" runat="server" Text="Parámetros:"></asp:Label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCorreo" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TxtCorreo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
<asp:Label AssociatedControlID="TxtCorreo" runat="server" Text="Correo:"></asp:Label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPlantilla" CssClass="form-control " runat="server" MaxLength="10" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="TxtPlantilla" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Plantilla correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTamanio"></asp:RequiredFieldValidator>
<asp:Label AssociatedControlID="TxtPlantilla" runat="server" Text="Plantilla correo:"></asp:Label>
<i></i>
</div>
<div>
<div style="width: 150px; display: inline-block">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtFechaI" runat="server" CssClass="form-control ADDateTimePicker" datetimeButton=".lnkTxtFechaI" CausesValidation="true" MaxLength="10"></asp:TextBox>
<asp:Label AssociatedControlID="TxtFechaI" runat="server" Text="Fecha Inicio:"></asp:Label>
</div>
</div>
<asp:LinkButton ID="ImgCEva" class="btn default " Text="<i class='fa fa-calendar lnkTxtFechaI'></i>" runat="server"></asp:LinkButton>
<ajax:MaskedEditExtender ID="MEEFechaEva" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999 99:99" MaskType="DateTime" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<%--<ajax:CalendarExtender runat="server" ID="CalendarExtender5" TargetControlID="TxtFechaI" PopupButtonID="ImgCEva" PopupPosition="BottomRight" Enabled="True" Format="dd/MM/yyyy hh:mm"></ajax:CalendarExtender>--%>
<%-- <asp:CompareValidator ID="CVFechaEva" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicio''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpTamanio"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaEva" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaEva" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
<div class="col-sm-6">
<h6>
<asp:TextBox ID="LtlDescripcion" runat="server" CssClass="minusculas codeeditorCS" Enabled="false" TextMode="MultiLine" Height="200px" Width="800px"></asp:TextBox></td>
</h6>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAgregarTareasProgramadasModal" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTamanio" />
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/JS"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/clike/clike.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/css/css.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/javascript/javascript.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/htmlembedded/htmlembedded.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/sql/sql.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/vb/vb.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/mode/xml/xml.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/hint/sql-hint.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/hint/anyword-hint.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/hint/css-hint.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/hint/html-hint.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/hint/javascript-hint.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/edit/matchbrackets.js"></script>
<script type="text/javascript" src="/Metronic/assets/global/plugins/codemirror/addon/mode/multiplex.js"></script>
<script>
let MycurrentT = null;
function ADSBegin() {
if (localStorage.getItem("MycurrentT")) {
MycurrentT = JSON.parse(localStorage.getItem("MycurrentT"));
}
if (localStorage.getItem("MyCurrentPass")) {
$('#txtPassword').val(localStorage.getItem("MyCurrentPass"));
}
if ($('#UtileriasLogin') && $('#UtileriasLogin').length > 0) {
$('.TituloPag').hide();
$('.page-bar').hide();
$('.page-content').css('background-color', '#364150')
} else {
$('.TituloPag').show();
$('.page-bar').show();
$('.page-content').css('background-color', '')
}
$(".codeeditorSQL").each(function (index) {
var id = $(this).attr('id')
var editor = CodeMirror.fromTextArea(document.getElementById(id), {
lineNumbers: true,
mode: "text/x-sql",
theme: "material",
extraKeys: { "Ctrl-Space": "autocomplete" }, // To invoke the auto complete // To invoke the auto complete
hint: CodeMirror.hint.sql,
hintOptions: {
tables: MycurrentT
},
change: function (cm) { debugger; }
});
editor.on('change', function (cMirror) {
// get value right from instance
cMirror.save();
});
});
$(".codeeditorVB").each(function (index) {
var id = $(this).attr('id')
var editor = CodeMirror.fromTextArea(document.getElementById(id), {
lineNumbers: true,
mode: "text/x-vb",
extraKeys: { "Ctrl-Space": "autocomplete" },
//parserfile: ["/Metronic/assets/global/plugins/codemirror/Externo/parsecsharp.js", "/Metronic/assets/global/plugins/codemirror/Externo/tokenizecsharp.js"],
//stylesheet: "/Metronic/assets/global/plugins/codemirror/Externo/csharpcolors.css",
theme: "material"
});
editor.on('change', function (cMirror) {
// get value right from instance
cMirror.save();
});
});
$(".codeeditorCS").each(function (index) {
var id = $(this).attr('id')
var editor = CodeMirror.fromTextArea(document.getElementById(id), {
lineNumbers: true,
mode: "text/x-csharp",
extraKeys: { "Ctrl-Space": "autocomplete" },
matchBrackets: true,
//parserfile: ["/Metronic/assets/global/plugins/codemirror/Externo/parsecsharp.js", "/Metronic/assets/global/plugins/codemirror/Externo/tokenizecsharp.js"],
//stylesheet: "/Metronic/assets/global/plugins/codemirror/Externo/csharpcolors.css",
theme: "material"
});
editor.on('change', function (cMirror) {
// get value right from instance
cMirror.save();
});
});
$(".codeeditorHTMLNET").each(function (index) {
var id = $(this).attr('id')
var editor = CodeMirror.fromTextArea(document.getElementById(id), {
lineNumbers: true,
mode: "application/x-aspx",
extraKeys: { "Ctrl-Space": "autocomplete" },
matchBrackets: true,
theme: "material"
});
editor.on('change', function (cMirror) {
// get value right from instance
cMirror.save();
});
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,256 @@
Imports System.Data
Imports Extensiones
Partial Class Sistemas_CatTareasProgramadas
Inherits ClsPaginas
#Region "Propiedades"
Private Property CveTareaProgramada As Integer
Get
If Not ViewState("CveTareaProgramada") Is Nothing Then
Return ViewState("CveTareaProgramada").ToString.ToEntero
Else
Return -1
End If
End Get
Set(value As Integer)
ViewState("CveTareaProgramada") = value
End Set
End Property
Private Property CveEmpresa As Integer
Get
If Not ViewState("CveEmpresa") Is Nothing Then
Return ViewState("CveEmpresa").ToString.ToEntero
Else
Return -1
End If
End Get
Set(value As Integer)
ViewState("CveEmpresa") = value
End Set
End Property
Private Property Actualizar As Boolean
Get
If Not ViewState("Actualizar") Is Nothing Then
Return DirectCast(ViewState("Actualizar"), Boolean)
Else
Return False
End If
End Get
Set(value As Boolean)
ViewState("Actualizar") = value
End Set
End Property
Private Property dttareas As DataTable
Get
If Not ViewState("dttareas") Is Nothing Then
Return DirectCast(ViewState("dttareas"), DataTable)
Else
Return Nothing
End If
End Get
Set
ViewState("dttareas") = Value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
CargadatosGvTareasProgramadas()
End If
End Sub
Private Sub CargaDatos()
Using ObTareasProgra As New ClsTareasProgramadas
If ObTareasProgra.GetSisTareasProgramadas() Then
dttareas = ObTareasProgra.DtResultados
End If
End Using
DdlTareaProgra.DataSource = dttareas
DdlTareaProgra.DataBind()
DdlTareaProgra.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlEmpresas.DataSource = GlobalDTEmpresas()
DdlEmpresas.DataBind()
DdlEmpresas.Items.Insert(0, New ListItem("Seleccione", "-1"))
TxtFechaI.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm")
End Sub
Protected Sub DdlTareaProgra_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim row As DataRow = dttareas.FiltroPrimero($"CveTareaProgramada={DdlTareaProgra.SelectedValue}")
If Not IsNothing(row) Then
LtlDescripcion.Text = $"{row("Descripcion")}"
Else
LtlDescripcion.Text = ""
End If
End Sub
Private Sub CargadatosGvTareasProgramadas()
Using ObTareasProgra As New ClsTareasProgramadas
If ObTareasProgra.GetTareasProgramadas(-1, -1) Then
GvTareasProgramadas.DataSource = ObTareasProgra.DtResultados
Else
GvTareasProgramadas.DataSource = Nothing
End If
End Using
UPGvTareasProgramadas.DataBind()
UpGral.Update()
End Sub
Protected Sub BtnAgregarTareasProgramadas_Click(sender As Object, e As EventArgs) Handles BtnAgregarTareasProgramadas.Click
LtlTituloModalTareasProgramadas.Text = "Agregar Tarea Programada"
BtnAgregarTareasProgramadasModal.Text = "Agregar"
DdlTareaProgra.SelectedValue = -1
DdlTareaProgra_SelectedIndexChanged(Nothing, Nothing)
DdlEmpresas.SelectedValue = -1
TxtNumerico.Text = ""
TxtParametros.Text = ""
TxtCorreo.Text = ""
TxtPlantilla.Text = ""
TxtFechaI.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm")
Actualizar = False
UpGral.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTareasProgramadas"))
End Sub
Protected Sub BtnAgregarTareasProgramadasModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarTareasProgramadasModal.Click
Dim ObTareasProgra As New ClsTareasProgramadas
Dim recursividadEnMinutos = 0
Dim recursividadEnHoras = 0
Dim recursividadEnDias = 0
If DdlTipoR.SelectedValue.ToString = "D" Then
recursividadEnDias = TxtNumerico.Text
ElseIf DdlTipoR.SelectedValue.ToString = "H" Then
recursividadEnHoras = TxtNumerico.Text
ElseIf DdlTipoR.SelectedValue.ToString = "M" Then
recursividadEnMinutos = TxtNumerico.Text
End If
If Not Actualizar Then
If ObTareasProgra.AddTareasProgramadas(DdlEmpresas.SelectedValue, DdlTareaProgra.SelectedValue, TxtFechaI.Text, "", recursividadEnMinutos, TxtParametros.Text, TxtFechaI.Text, TxtFechaI.Text, TxtCorreo.Text, TxtPlantilla.Text, recursividadEnHoras, recursividadEnDias) Then
CargadatosGvTareasProgramadas()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTareasProgramadas"), "jsHideModalTareasProgramadas")
UpGral.Update()
Alert("Tarea Programada Agregada Correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al guardar la Tarea Programada", TipoMensaje.MsgError)
End If
Else
If ObTareasProgra.RemoveTareasProgramadas(CveTareaProgramada, CveEmpresa) Then
End If
If ObTareasProgra.AddTareasProgramadas(DdlEmpresas.SelectedValue, DdlTareaProgra.SelectedValue, TxtFechaI.Text, "", recursividadEnMinutos, TxtParametros.Text, TxtFechaI.Text, TxtFechaI.Text, TxtCorreo.Text, TxtPlantilla.Text, recursividadEnHoras, recursividadEnDias) Then
CargadatosGvTareasProgramadas()
UpModalTareasProgramadas.Update()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTareasProgramadas"), "jsHideModalTareasProgramadas")
UpGral.Update()
Alert("Tarea Programada Actualizada Correctamente", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al Actualizar la Tarea Programada", TipoMensaje.MsgError)
End If
End If
CveTareaProgramada = -1
Actualizar = False
ObTareasProgra.Dispose()
End Sub
Public Sub Remove_ClickTareasProgramadas(sender As Object, e As EventArgs)
Dim ObTareasProgra As New ClsTareasProgramadas
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim activo As Boolean = 0
CveTareaProgramada = GvRow.DataKey("CveTareaProgramada")
CveEmpresa = GvRow.DataKey("CveEmpresa")
If ObTareasProgra.RemoveTareasProgramadas(CveTareaProgramada, CveEmpresa) Then
CargadatosGvTareasProgramadas()
Alert("La Tarea Programada se Eliminó Correctamente ", TipoMensaje.MsgInformacion)
Else
Alert("Ocurrió un error al Eliminar la Tarea Programada", TipoMensaje.MsgError)
End If
ObTareasProgra.Dispose()
CargadatosGvTareasProgramadas()
CveTareaProgramada = -1
End Sub
Public Sub Edit_ClickTareasProgramadas(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim activo As Boolean = 0
LtlTituloModalTareasProgramadas.Text = "Editar Tarea Programada"
Actualizar = True
CveTareaProgramada = GvRow.DataKey("CveTareaProgramada")
CveEmpresa = GvRow.DataKey("CveEmpresa")
DdlTareaProgra.SelectedValueExist(CveTareaProgramada)
DdlTareaProgra_SelectedIndexChanged(Nothing, Nothing)
DdlEmpresas.SelectedValueExist(CveEmpresa)
If GvRow.DataKey("RecursividadEnMinutos").ToEntero > 0 Then
TxtNumerico.Text = GvRow.DataKey("RecursividadEnMinutos").ToEntero
DdlTipoR.SelectedValue = "M"
ElseIf GvRow.DataKey("RecursividadEnHoras").ToEntero > 0 Then
TxtNumerico.Text = GvRow.DataKey("RecursividadEnHoras").ToEntero
DdlTipoR.SelectedValue = "H"
ElseIf GvRow.DataKey("RecursividadEnDias").ToEntero > 0 Then
TxtNumerico.Text = GvRow.DataKey("RecursividadEnDias").ToEntero
DdlTipoR.SelectedValue = "D"
End If
TxtParametros.Text = GvRow.DataKey("Parametros")
TxtCorreo.Text = GvRow.DataKey("Correo")
TxtPlantilla.Text = GvRow.DataKey("PlantillaCorreo")
TxtFechaI.Text = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy HH:mm")
BtnAgregarTareasProgramadasModal.Text = "Actualizar"
UpModalTareasProgramadas.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTareasProgramadas"))
End Sub
End Class

80
Sistemas/Cierre.aspx Normal file
View File

@@ -0,0 +1,80 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Cierre.aspx.vb" Inherits="Sistemas_Cierre" %>
<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">
Fecha Cierre
</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="UpParametros" runat="server" UpdateMode="Conditional" class="portlet light xspadding .nolineheight bordered whitoutcol" style="width: 310px;">
<ContentTemplate>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Fecha de Cierre</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 form-horizontal form-row-sepe formnombottom" style="padding-top: 0px; margin-top: -5px;">
<table border="0" width="300px">
<tr align="left">
<td><b>Fecha Cierre SIG:</b></td>
<td>
<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" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" 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="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" 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 Cierre SIG''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Cierre SIG''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>
<%-- <tr align="left" id="DivFechaContPAQ" runat="server" visible="false">
<td><b>Fecha Cierre ContPAQ:</b></td>
<td>
<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="TxtFechaContPAQ" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaCont" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaCont" runat="server" TargetControlID="TxtFechaContPAQ" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaCont" TargetControlID="TxtFechaContPAQ" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaCont" runat="server" ControlToValidate="TxtFechaContPAQ" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Cierre ContPAQ''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaCont" runat="server" ControlToValidate="TxtFechaContPAQ" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Cierre ContPAQ''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaCont" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCont" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</td>
</tr>--%>
<tr style="text-align:center">
<td style="text-align:center"> <asp:Button ID="BtnGuardar" runat="server" Text="Guardar" class="btn btn-primary" OnClick="BtnGuardar_Click" ValidationGroup="GrpGuardar" /></td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

68
Sistemas/Cierre.aspx.vb Normal file
View File

@@ -0,0 +1,68 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Sistemas_Cierre
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjEmpresas As New ClsSisEmpresas()
If ObjEmpresas.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
If ObjEmpresas.DtResultados.Rows.Count > 0 Then
TxtFecha.Text = ObjEmpresas.DtResultados.Rows(0)("Conta_FechaCerrado").ToString().ToDateTime().ToString("dd/MM/yyyy")
End If
End If
ObjEmpresas.Dispose()
'If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
' 'DivFechaContPAQ.Visible = True
' Dim DtParametros As DataTable = Nothing
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
' If ObjConta.GetParametros() Then
' DtParametros = ObjConta.DtResultados.Copy()
' End If
' ObjConta.Dispose()
' If DtParametros IsNot Nothing Then
' If DtParametros.Rows.Count > 0 Then
' TxtFechaContPAQ.Text = DtParametros.Rows(0)("FechaCierreSIG").ToString().ToDateTime().ToString("dd/MM/yyyy")
' End If
' DtParametros.Dispose()
' End If
'End If
UpParametros.Update()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim FechaCierre As Date = TxtFecha.Text.ToDate()
'Dim FechaCierreContPAQ As Date = TxtFechaContPAQ.Text.ToDate()
Dim GuardoFechaContPAQ As Boolean = False
If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
GuardoFechaContPAQ = ObjConta.UpdateFechaCierreSIG(FechaCierre)
ObjConta.Dispose()
Else
GuardoFechaContPAQ = True
End If
Dim ObjEmpresas As New ClsSisEmpresas()
If GuardoFechaContPAQ AndAlso ObjEmpresas.UpdateEmpresaCierre(UsuarioActual.CveEmpresa, FechaCierre) Then
Alert("La fecha de cierre de período se guardó correctamente.")
Else
Alert("Ocurrió un error al guardar la fecha", TipoMensaje.MsgError)
End If
ObjEmpresas.Dispose()
CargaDatos()
End Sub
End Class

View File

@@ -0,0 +1,10 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ConfiguracionesSist.aspx.vb" Inherits="ConfiguracionesSist" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<asp:Button ID="Btn" runat="server" Text="Confg." />
</asp:Content>

View File

@@ -0,0 +1,15 @@

Partial Class ConfiguracionesSist
Inherits System.Web.UI.Page
Protected Sub Btn_Click(sender As Object, e As System.EventArgs) Handles Btn.Click
'Carga Clasificaciones
'Dim ObjSucursales As New ClsSucursales()
'If ObjSucursales.GetSucursales() Then
' Application("GlobalDTSucursales") = ObjSucursales.DtResultados
'Else
' Application("GlobalDTSucursales") = Nothing
'End If
'ObjSucursales.Dispose()
End Sub
End Class

1798
Sistemas/Empresa.aspx Normal file

File diff suppressed because it is too large Load Diff

1635
Sistemas/Empresa.aspx.vb Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EmpresasModulos.aspx.vb" Inherits="Sistemas_EmpresasModulos" %>
<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">
Empresas Módulos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" 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">
<li>Empresa:
<asp:DropDownList ID="DdlEmpresa" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa" CssClass=" select2me table-group-action-input form-control input-inline input-small input-sm" Style="width: 400px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="consultar" runat="server" Text="Consultar" OnClick="consultar_Click" class="btn btn-primary" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate>
<table>
<tr>
<td>
<asp:ListBox runat="server" ID="ListModulosDisponible" DataTextField="Modulo" DataValueField="CveModulo" Height="200px" Width="200px" SelectionMode="Multiple"></asp:ListBox>
</td>
<td width="100px" align="center">
<asp:Button Text=">>" runat="server" ID="BtnAddTodos" ToolTip="Añadir Todos" OnClick="BtnAddTodos_Click" class="btn btn-primary" /><br />
<br />
<asp:Button Text=">" runat="server" ID="BtnAdd" ToolTip="Añadir Seleccionados" OnClick="BtnAdd_Click" class="btn btn-primary" /><br />
<br />
<asp:Button Text="<" runat="server" ID="BtnRemove" ToolTip="Quitar Seleccionados" OnClick="BtnRemove_Click" class="btn btn-primary" /><br />
<br />
<asp:Button Text="<<" runat="server" ID="BtnRemoveTodos" ToolTip="Quitar Todos" OnClick="BtnRemoveTodos_Click" class="btn btn-primary" />
</td>
<td>
<asp:ListBox runat="server" ID="ListModulosEmpresa" DataTextField="Modulo" DataValueField="CveModulo" Height="200px" Width="200px" SelectionMode="Multiple"></asp:ListBox>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,199 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class Sistemas_EmpresasModulos
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Public Property CveEmpresa As Integer
Get
Return ViewState("DtUsuarios").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("DtUsuarios") = value
End Set
End Property
Public Property DtModulosEmpresa As DataTable
Get
Return CType(ViewState("DtModulosEmpresa"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtModulosEmpresa") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargarEmpresa()
End If
End Sub
#Region "CARGA DATOS - CONSULTAR"
Protected Sub consultar_Click(sender As Object, e As EventArgs)
CveEmpresa = DdlEmpresa.SelectedValue.ToString.ToEntero
CargaDatos()
End Sub
Private Sub CargaDatos()
CargaModulosEmpresa()
CargaModulosDisponible()
UpDatos.Update()
End Sub
Private Sub CargarEmpresa()
If UsuarioActual.CveRol <> 1 Then
DdlEmpresa.DataSource = GlobalDTEmpresas
DdlEmpresa.Enabled = False
Else
DdlEmpresa.DataSource = GlobalDTEmpresas
End If
DdlEmpresa.SelectedValue = UsuarioActual.CveEmpresa.ToString
DdlEmpresa.DataBind()
End Sub
Private Sub CargaModulosEmpresa()
Dim ObjEmpresas As New ClsSisEmpresas
If ObjEmpresas.GetEmpresasModulos(CveEmpresa) Then
DtModulosEmpresa = ObjEmpresas.DtResultados
Else
DtModulosEmpresa = Nothing
End If
ObjEmpresas.Dispose()
ListModulosEmpresa.DataSource = DtModulosEmpresa.FiltraParametros("", "Modulo")
ListModulosEmpresa.DataBind()
End Sub
Private Sub CargaModulosDisponible()
Dim DtModulosDisponible = GlobalDTModulos.FiltraParametros("Liga <> ''")
Dim rowsToDelete = From r1 In DtModulosDisponible.AsEnumerable()
Join r2 In DtModulosEmpresa.AsEnumerable() On r1.Field(Of Integer)("CveModulo") Equals r2.Field(Of Integer)("CveModulo")
Select r1
For i = 0 To rowsToDelete.Count - 1
DtModulosDisponible.Rows.Remove(rowsToDelete(0))
Next
ListModulosDisponible.DataSource = DtModulosDisponible.FiltraParametros("", "Modulo")
ListModulosDisponible.DataBind()
End Sub
#End Region
#Region "GUARAR - AÑADIR"
Protected Sub BtnAddTodos_Click(sender As Object, e As EventArgs)
Dim ObjEmpresas As New ClsSisEmpresas
ObjEmpresas.IniciaTransacSQL()
Dim TieneError = False
For i = 0 To ListModulosDisponible.Items.Count - 1
If Not ObjEmpresas.AddEmpresasModulos(CveEmpresa, ListModulosDisponible.Items(i).Value.ToEntero) Then
TieneError = True
Exit For
End If
Next
If Not TieneError Then
Alert("Los módulos se agregaron correctamente.", TipoMensaje.MsgInformacion)
ObjEmpresas.Commit()
Else
Alert("Ocurrió un error al agregar los módulos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
ObjEmpresas.RollBack()
End If
ObjEmpresas.Dispose()
CargaDatos()
End Sub
Protected Sub BtnAdd_Click(sender As Object, e As EventArgs)
Dim ObjEmpresas As New ClsSisEmpresas
ObjEmpresas.IniciaTransacSQL()
Dim TieneError = False
For i = 0 To ListModulosDisponible.Items.Count - 1
If ListModulosDisponible.Items(i).Selected Then
If Not ObjEmpresas.AddEmpresasModulos(CveEmpresa, ListModulosDisponible.Items(i).Value.ToEntero) Then
TieneError = True
Exit For
End If
End If
Next
If Not TieneError Then
Alert("Los módulos se agregaron correctamente.", TipoMensaje.MsgInformacion)
ObjEmpresas.Commit()
Else
Alert("Ocurrió un error al agregar los módulos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
ObjEmpresas.RollBack()
End If
ObjEmpresas.Dispose()
CargaDatos()
End Sub
#End Region
#Region "REMOVE - QUITAR"
Protected Sub BtnRemove_Click(sender As Object, e As EventArgs)
Dim ObjEmpresas As New ClsSisEmpresas
ObjEmpresas.IniciaTransacSQL()
Dim TieneError = False
For i = 0 To ListModulosEmpresa.Items.Count - 1
If ListModulosEmpresa.Items(i).Selected Then
If Not ObjEmpresas.RemoveEmpresasModulos(CveEmpresa, ListModulosEmpresa.Items(i).Value.ToEntero) Then
TieneError = True
Exit For
End If
End If
Next
If Not TieneError Then
Alert("Los módulos se eliminaron correctamente.", TipoMensaje.MsgInformacion)
ObjEmpresas.Commit()
Else
Alert("Ocurrió un error al eliminar los módulos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
ObjEmpresas.RollBack()
End If
ObjEmpresas.Dispose()
CargaDatos()
End Sub
Protected Sub BtnRemoveTodos_Click(sender As Object, e As EventArgs)
Dim ObjEmpresas As New ClsSisEmpresas
ObjEmpresas.IniciaTransacSQL()
Dim TieneError = False
For i = 0 To ListModulosEmpresa.Items.Count - 1
If Not ObjEmpresas.RemoveEmpresasModulos(CveEmpresa, ListModulosEmpresa.Items(i).Value.ToEntero) Then
TieneError = True
Exit For
End If
Next
If Not TieneError Then
Alert("Los módulos se eliminaron correctamente.", TipoMensaje.MsgInformacion)
ObjEmpresas.Commit()
Else
Alert("Ocurrió un error al eliminar los módulos. Por favor vuelva a intentar.", TipoMensaje.MsgError)
ObjEmpresas.RollBack()
End If
ObjEmpresas.Dispose()
CargaDatos()
End Sub
#End Region
End Class

241
Sistemas/Librerias.aspx Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Sistemas_Librerias : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

View File

@@ -0,0 +1,19 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="NotificacionesEnLinea.aspx.cs" Inherits="Sistemas_NotificacionesEnLinea" %>
<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">
</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:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class Sistemas_NotificacionesEnLinea : System.Web.UI.Page
{
#region "PROPIEDADES"
private int CveEmpresa
{
get
{
return Convert.ToInt32(ViewState["CveEmpresa"].ToString());
}
set
{
ViewState["CveEmpresa"] = value;
}
}
private int CveTipoNotificacion
{
get
{
return Convert.ToInt32(ViewState["CveTipoNotificacion"].ToString());
}
set
{
ViewState["CveTipoNotificacion"] = value;
}
}
private DataTable DTNotificaciones
{
get
{
return (DataTable)ViewState["DTNotificaciones"];
}
set
{
ViewState["DTNotificaciones"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
InicializaParametros();
CargaDTNotificaciones();
EnviaNotificaciones();
}
#region "INICIALIZA PARAMETROS"
protected void InicializaParametros()
{
CveTipoNotificacion = 1;
CveEmpresa = 72;
}
#endregion
#region "ENVIA NOTIFICACIONES"
protected void CargaDTNotificaciones()
{
ClsContratos ObjContrato = new ClsContratos();
if (ObjContrato.GetNotificacionesEnLinea(CveEmpresa, CveTipoNotificacion))
{
DTNotificaciones = ObjContrato.DtResultados;
}
ObjContrato.Dispose();
}
protected void EnviaNotificaciones()
{
ClsSisMail ObjMail = new ClsSisMail();
String Para = "";
String Asunto = "";
String Cuerpo = "";
foreach (DataRow notificacion in DTNotificaciones.Rows)
{
Para = notificacion["Correos"].ToString();
Asunto = notificacion["Asunto"].ToString();
Cuerpo = notificacion["Cuerpo"].ToString();
ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo);
}
}
#endregion
}

View File

@@ -0,0 +1,327 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PermisosPorUsuario.aspx.vb" Inherits="Sistemas_PermisosPorUsuario" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.ColumnaenBlanco {
background-color: #DDD;
border-color: #DDD;
}
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a {
color: white !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Permisos Por Usuario"></asp:Literal>&nbsp;<asp:Literal ID="LtlUsuarios" runat="server"></asp:Literal>
</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:Panel runat="server" ID="PnlGeneral">
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" Width="100%" ActiveTabIndex="0">
<ajax:TabPanel ID="TabModulos" runat="server" HeaderText="Acceso a modulos">
<ContentTemplate>
<asp:UpdatePanel ID="UpModulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption magindate">
<div class="row">
<div class="col-md-1 truncate">Usuario:</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlUsuario" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Usuario" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">Padre:</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlPadre" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" AppendDataBoundItems="true" DataValueField="CvePadre" DataTextField="Padres" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body magindate" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-1 truncate">Rol:</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlRol" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Rol" DataValueField="CveRol" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">Módulo:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlModulo" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataValueField="CveModulo" DataTextField="Modulo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UpGvModulosAcceso" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="text-right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvModulosAcceso.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvModulosAcceso.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvModulosAcceso" ClientIDMode="Static" runat="server" AutoGenerateColumns="False" DataKeyNames="CveModulo,Permitir,CveModuloAcceso,CveUsuario"
CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Rol" HeaderText="Rol" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Padre" HeaderText="Padre" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Modulo" HeaderText="Módulo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:TemplateField HeaderText="Rol" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LnkRol" runat="server" ForeColor="Gray" Text="<i class='fa fa-minus' aria-hidden='true'></i>"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkUsuario" runat="server" OnClick="LnkUsuario_Click" ForeColor="Gray" Text="<i class='fa fa-minus' aria-hidden='true'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabProcesos" runat="server" HeaderText="Procesos">
<ContentTemplate>
<asp:UpdatePanel ID="UpProcesos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px; position: relative;">
<div class="tools">
<asp:Button ID="BtnConsultarProcesos" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="CheckBox1" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption magindate">
<div class="row">
<div class="col-md-1 truncate">Usuario:</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlUsuarioProceso" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Usuario" DataValueField="CveUsuario" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">Rol:</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlRolProceso" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" AppendDataBoundItems="true" DataValueField="CveRol" DataTextField="Rol" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body magindate smalltitle" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-1 truncate">Padre:</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlModuloPadreProcesos" runat="server" CssClass="form-control input-sm select2me" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Padres" DataValueField="CvePadre" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">Módulo:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlModuloProceso" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataValueField="CveModulo" DataTextField="Modulo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">Proceso:</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlProceso" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataValueField="CveProceso" DataTextField="Descripcion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UPPAltaProcesos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="text-right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvModulosPermiso.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvModulosPermiso.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvModulosPermiso" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveUsuario,CveModulo,CveProceso,CveModuloAcceso,CveProcesoAcceso,CveProcesoUsuarioAcceso,Permitir"
CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None">
<Columns>
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Padre" HeaderText="Módulo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:TemplateField HeaderText="Opción" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label runat="server" ID="Lblmodulo" data-toggle="tooltip" title='<%#Eval("CveProceso") %>' Text='<%#Eval("Modulo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Proceso" HeaderText="Proceso" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:TemplateField HeaderText="Rol" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="LblRol" runat="server" ForeColor="Gray" Text="<i class='fa fa-minus' aria-hidden='true'></i>"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LnkUsuario" runat="server" ForeColor="Gray" OnClick="LnkUsuarioProceso_Click" Text="<i class='fa fa-minus' aria-hidden='true'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<asp:UpdatePanel runat="server" ID="UpDivModulosPermisos" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivModulosPermisos" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Asignar Permisos"></asp:Label>
</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover Widthall">
<tbody>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkModuloPermitir" runat="server" Text="Permitir" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkModuloDenegar" runat="server" Text="Denegar" />
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="BtnModulosPermisos" runat="server" Text="Aceptar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<asp:HiddenField ID="HdnPermitir" runat="server" Value="-1" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCveModuloAcceso" runat="server" Value="-1" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCveUsuario" runat="server" Value="-1" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCveModulo" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpDivProcesosPermisos" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivProcesosPermisos" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Asignar Permisos"></asp:Label>
</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover Widthall">
<tbody>
<tr>
<td style="text-align: left;">
<asp:CheckBox ID="ChkPermitirProceso" runat="server" Text="Permitir" />
</td>
<td style="text-align: left;">
<asp:CheckBox ID="ChkDenegarProceso" runat="server" Text="Denegar" />
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAceptarProceso" runat="server" Text="Aceptar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<asp:HiddenField ID="HdnPermitirProceso" runat="server" Value="-1" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCveModuloAccesoProceso" runat="server" Value="-1" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCveUsuarioProceso" runat="server" Value="-1" ClientIDMode="Static" />
<asp:HiddenField ID="HdnCveProceso" runat="server" Value="-1" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
<script type="text/javascript">
</script>
</asp:Content>

View File

@@ -0,0 +1,489 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Microsoft.VisualBasic
Imports Extensiones
Partial Class Sistemas_PermisosPorUsuario
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property UsuarioControlado As Boolean
Get
Return CBool(ViewState("UsuarioControlado").ToString)
End Get
Set(value As Boolean)
ViewState("UsuarioControlado") = value
End Set
End Property
Private Property DTModulosPadre As DataTable
Get
Return CType(ViewState("DTModulosPadre"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTModulosPadre") = value
End Set
End Property
Private Property DTRolesModulos As DataTable
Get
Return CType(ViewState("DTRolesModulos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTRolesModulos") = value
End Set
End Property
Private Property DTModulos As DataTable
Get
Return CType(ViewState("DTModulos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTModulos") = value
End Set
End Property
Private Property DTModulosUsuarios As DataTable
Get
Return CType(ViewState("DTModulosUsuarios"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTModulosUsuarios") = value
End Set
End Property
Private Property DTAsignarProcesos As DataTable
Get
Return CType(ViewState("DTAsignarProcesos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTAsignarProcesos") = value
End Set
End Property
Private Property DTProcesos As DataTable
Get
Return CType(ViewState("DTProcesos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProcesos") = 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
If UsuarioActual.TipoControl > 0 Then
UsuarioControlado = True
Else
UsuarioControlado = False
End If
Dim ObjRoles As New ClsSisRoles
If ObjRoles.GetRolesModulos(-1, -1) Then
DTRolesModulos = ObjRoles.DtResultados
End If
ObjRoles.Dispose()
CargaDTModulos()
CargaDdlAccesoModulos()
CargaCombosProcesos()
End If
End Sub
#Region "A C C E S O A M O D U L O S"
Private Sub CargaDTModulos()
Dim ObjModulos As New ClsModulos
If ObjModulos.GetModulosEmpresas(-1, -1, "-1", "-1", UsuarioActual.CveEmpresa) Then
DTModulos = ObjModulos.DtResultados
End If
ObjModulos.Dispose()
If DTModulos IsNot Nothing Then
DTModulosPadre = DTModulos.FiltraParametros(String.Format("CvePadre = 0 OR Agrupacion = 'S'"), "", {"CvePadre", "Padres"})
End If
End Sub
Private Sub CargaDdlAccesoModulos()
DdlUsuario.Items.Clear()
DdlUsuario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveUsuario", "Usuario"})
DdlUsuario.DataBind()
DdlUsuario.SelectedIndex = 0
DdlUsuario.Items.Insert(0, New ListItem("Todos", "-1"))
Dim CveRol As Integer = GlobalDTUsuarios(CveUsuario:=DdlUsuario.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveRol").ToEntero
DdlRol.Items.Clear()
DdlRol.DataSource = GlobalDTRoles(-1).FiltraParametros(String.Format("CveRol = {0}", CveRol))
DdlRol.DataBind()
DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
DdlPadre.Items.Clear()
DdlPadre.DataSource = DTModulosPadre
DdlPadre.DataBind()
DdlPadre.Items.Insert(0, New ListItem("Todos", "-1"))
DdlPadre.Items.Insert(1, New ListItem("Raíz", "0"))
DdlModulo.Items.Clear()
DdlModulo.DataSource = DTModulos.FiltraParametros("CveModulo > 0 AND Agrupacion = 'N'", "", {"CveModulo", "Modulo"})
DdlModulo.DataBind()
DdlModulo.Items.Insert(0, New ListItem("Todos", "-1"))
DdlUsuario.SelectedIndex = 0
DdlPadre.SelectedIndex = 0
DdlRol.SelectedIndex = 0
DdlModulo.SelectedIndex = 0
UpModulos.Update()
UpDatos.Update()
End Sub
Protected Sub DdlUsuario_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlUsuario.SelectedIndexChanged
If DdlUsuario.SelectedValue.ToEntero > -1 Then
Dim CveRol As Integer = GlobalDTUsuarios(CveUsuario:=DdlUsuario.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveRol").ToEntero
DdlRol.Items.Clear()
DdlRol.DataSource = GlobalDTRoles(-1).FiltraParametros(String.Format("CveRol = {0}", CveRol))
DdlRol.DataBind()
DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
DdlPadre.Items.Clear()
DdlPadre.DataSource = DTModulosPadre
DdlPadre.DataBind()
DdlPadre.Items.Insert(0, New ListItem("Todos", "-1"))
DdlPadre.SelectedIndex = 0
Dim CvePadre = DdlPadre.SelectedValue.ToEntero
DdlModulo.Items.Clear()
DdlModulo.DataSource = DTModulos '.FiltraParametros($"CveRol ={CveRol}")
DdlModulo.DataBind()
DdlModulo.Items.Insert(0, New ListItem("Todos", "-1"))
Else
CargaDdlAccesoModulos()
End If
UpModulos.Update()
UpDatos.Update()
End Sub
Protected Sub DdlPadre_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPadre.SelectedIndexChanged
If DTModulos IsNot Nothing Then
Dim CvePadre As Integer = DdlPadre.SelectedValue.ToEntero
DdlModulo.Items.Clear()
If CvePadre > 0 Then
DdlModulo.Items.Clear()
DdlModulo.DataSource = DTModulos.FiltraParametros($"CvePadre = {CvePadre}", "", {"CveModulo", "Modulo"})
DdlModulo.Items.Insert(0, New ListItem("Todos", "-1"))
Else
DdlModulo.Items.Clear()
DdlModulo.DataSource = DTModulos.FiltraParametros("CveModulo > 0", "", {"CveModulo", "Modulo"})
DdlModulo.Items.Insert(0, New ListItem("Todos", "-1"))
End If
DdlModulo.DataBind()
End If
UpModulos.Update()
UpDatos.Update()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
Dim CveUsuario As Integer = DdlUsuario.SelectedValue.ToEntero
Dim CvePadre As Integer = DdlPadre.SelectedValue.ToEntero
Dim CveRol As Integer = DdlRol.SelectedValue.ToEntero
Dim CveModulo As Integer = DdlModulo.SelectedValue.ToEntero
'Dim ObjPermisos As New ClsSisUsuarios
'If ObjPermisos.GetUsuariosModulos(CveUsuario, UsuarioActual.CveEmpresa, If(UsuarioControlado, UsuarioActual.CveUsuario, -1)) Then
' DTModulos = ObjPermisos.DtResultados.FiltraParametros("Liga <> '' ")
'Else
' DTModulos = Nothing
'End If
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetPermisosPorUsuario(CveUsuario, CveRol, CvePadre, CveModulo, UsuarioActual.CveEmpresa, If(UsuarioControlado, UsuarioActual.CveUsuario, -1)) Then
DTModulosUsuarios = ObjUsuarios.DtResultados.FiltraParametros("Liga <> '' ")
End If
ObjUsuarios.Dispose()
GvModulosAcceso.DataSource = DTModulosUsuarios
GvModulosAcceso.DataBind()
UpModulos.Update()
UpGvModulosAcceso.Update()
UpDatos.Update()
End Sub
Protected Sub GvModulosAcceso_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvModulosAcceso.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DBCampo("Permitir")) = "0" Then
e.Row.FCLinkButton("LnkUsuario").Text = "<i class='fa fa-ban' aria-hidden='true'></i>"
e.Row.FCLinkButton("LnkUsuario").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Permitir") = "1" Then
e.Row.FCLinkButton("LnkUsuario").Text = "<i class='fa fa-check' aria-hidden='true'></i>"
e.Row.FCLinkButton("LnkUsuario").ForeColor = Drawing.Color.Green
End If
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then
e.Row.FCLabel("LnkRol").Text = "<i class='fa fa-check' aria-hidden='true'></i>"
e.Row.FCLabel("LnkRol").ForeColor = Drawing.Color.Green
End If
End If
End Sub
Protected Sub LnkUsuario_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveModuloAcceso As Integer = If(GvRow.DataKey("CveModuloAcceso") IsNot Nothing, GvRow.DataKey("CveModuloAcceso").ToEntero, -1)
HdnPermitir.Value = GvRow.DataKey("Permitir")
HdnCveModuloAcceso.Value = GvRow.DataKey("CveModuloAcceso")
HdnCveUsuario.Value = GvRow.DataKey("CveUsuario")
HdnCveModulo.Value = GvRow.DataKey("CveModulo")
'SI EL MODULO YA LO TRAE EL ROL
If (GvRow.DataKey("Permitir") Is Nothing Or GvRow.DataKey("Permitir") = String.Empty) Then
ChkModuloDenegar.Enabled = True
ChkModuloPermitir.Enabled = False
End If
'SI SE HA ASIGNADO UN VALOR AL MODULO
If (GvRow.DataKey("Permitir") IsNot Nothing AndAlso GvRow.DataKey("Permitir") <> String.Empty) Then
Dim Permitir As Boolean = CBool(GvRow.DataKey("Permitir"))
ChkModuloDenegar.Enabled = Permitir
ChkModuloPermitir.Enabled = Not Permitir
End If
'QUITA LOS VALORES ASIGNADOS AL CHECBOX
ChkModuloDenegar.Checked = False
ChkModuloPermitir.Checked = False
UpDivModulosPermisos.Update()
RegistraScript("$('#DivModulosPermisos').modal('show');")
End Sub
Protected Sub BtnModulosPermisos_Click(sender As Object, e As EventArgs) Handles BtnModulosPermisos.Click
Dim ObjUsuarios As New ClsSisUsuarios
''Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol
If HdnCveModuloAcceso.Value <> "" Then
If HdnPermitir.Value = "" OrElse HdnPermitir.Value = "0" Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, Not ChkModuloDenegar.Checked) Then
Alert("Se ha actualizado el acceso al modulo correctamente")
End If
End If
'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas)
If HdnPermitir.Value = "1" Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, Not ChkModuloDenegar.Checked) Then
Alert("Se ha actualizado el acceso al modulo correctamente")
End If
End If
Else
If HdnPermitir.Value = "" OrElse HdnPermitir.Value = "1" Then
If ObjUsuarios.UpdateUsuariosModulos(HdnCveUsuario.Value.ToEntero, HdnCveModulo.Value.ToEntero, ChkModuloPermitir.Checked) Then
Alert("Se ha actualizado el acceso al modulo correctamente")
End If
End If
End If
ObjUsuarios.Dispose()
BtnConsultar_Click(BtnConsultar, EventArgs.Empty)
End Sub
#End Region
#Region "P R O C E S O S"
Private Sub CargaCombosProcesos()
DdlUsuarioProceso.Items.Clear()
DdlUsuarioProceso.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
DdlUsuarioProceso.DataBind()
DdlUsuarioProceso.SelectedIndex = 0
DdlUsuarioProceso.Items.Insert(0, New ListItem("Todos", "-1"))
Dim CveRol As Integer = GlobalDTUsuarios(CveUsuario:=DdlUsuario.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveRol").ToEntero
DdlRolProceso.Items.Clear()
DdlRolProceso.DataSource = GlobalDTRoles(-1).FiltraParametros(String.Format("CveRol = {0}", CveRol))
DdlRolProceso.DataBind()
DdlRolProceso.Items.Insert(0, New ListItem("Todos", "-1"))
DdlModuloPadreProcesos.Items.Clear()
DdlModuloPadreProcesos.DataSource = DTModulosPadre
DdlModuloPadreProcesos.DataBind()
DdlModuloPadreProcesos.Items.Insert(0, New ListItem("Todos", "-1"))
DdlModuloPadreProcesos.Items.Insert(1, New ListItem("Raíz", "0"))
DdlModuloProceso.Items.Clear()
DdlModuloProceso.DataSource = DTModulos.FiltraParametros("CveModulo > 0 AND Agrupacion = 'N'", "", {"CveModulo", "Modulo"})
DdlModuloProceso.DataBind()
DdlModuloProceso.Items.Insert(0, New ListItem("Todos", "-1"))
DdlUsuarioProceso.SelectedIndex = 0
DdlRolProceso.SelectedIndex = 0
DdlModuloPadreProcesos.SelectedIndex = 0
DdlModuloProceso.SelectedIndex = 0
Dim ObjProcesos As New ClsSisProcesos
If ObjProcesos.GetProcesos(-1) Then
DTProcesos = ObjProcesos.DtResultados
End If
ObjProcesos.Dispose()
DdlProceso.DataSource = DTProcesos
DdlProceso.DataBind()
DdlProceso.Items.Insert(0, New ListItem("Todos", "-1"))
DdlProceso.SelectedIndex = 0
UpProcesos.Update()
UpDatos.Update()
End Sub
Protected Sub DdlUsuarioProceso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlUsuarioProceso.SelectedIndexChanged
Dim CveRol As Integer = GlobalDTUsuarios(CveUsuario:=DdlUsuarioProceso.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveRol").ToEntero
DdlRolProceso.Items.Clear()
DdlRolProceso.DataSource = GlobalDTRoles(-1).FiltraParametros(String.Format("CveRol = {0}", CveRol))
DdlRolProceso.DataBind()
DdlRolProceso.Items.Insert(0, New ListItem("Todos", "-1"))
UpProcesos.Update()
UpDatos.Update()
End Sub
Protected Sub DdlModuloPadreProcesos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlModuloPadreProcesos.SelectedIndexChanged
If DTModulos IsNot Nothing Then
Dim CvePadre As Integer = DdlModuloPadreProcesos.SelectedValue.ToEntero
If CvePadre > 0 Then
DdlModuloProceso.Items.Clear()
DdlModuloProceso.DataSource = DTModulos.FiltraParametros($"CvePadre = {CvePadre}", "", {"CveModulo", "Modulo"})
DdlModuloProceso.Items.Insert(0, New ListItem("Todos", "-1"))
Else
DdlModuloProceso.Items.Clear()
DdlModuloProceso.DataSource = DTModulos.FiltraParametros("CveModulo > 0", "", {"CveModulo", "Modulo"})
DdlModuloProceso.Items.Insert(0, New ListItem("Todos", "-1"))
End If
DdlModuloProceso.DataBind()
End If
UpProcesos.Update()
UpDatos.Update()
End Sub
Protected Sub DdlOpcionProceso_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlModuloProceso.SelectedIndexChanged
If DTProcesos IsNot Nothing Then
DdlProceso.Items.Clear()
Dim CveModulo As Integer = DdlModuloProceso.SelectedValue.ToEntero
DdlProceso.DataSource = DTProcesos.FiltraParametros($"CveModulo = {CveModulo}")
DdlProceso.DataBind()
DdlProceso.Items.Insert(0, New ListItem("Todos", "-1"))
End If
UpProcesos.Update()
UpDatos.Update()
End Sub
Protected Sub BtnConsultarProcesos_Click(sender As Object, e As EventArgs) Handles BtnConsultarProcesos.Click
Dim CveUsuario As Integer = DdlUsuarioProceso.SelectedValue.ToEntero
Dim CvePadre As Integer = DdlModuloProceso.SelectedValue.ToEntero
Dim CveRol As Integer = DdlRolProceso.SelectedValue.ToEntero
Dim CveModulo As Integer = DdlModuloProceso.SelectedValue.ToEntero
Dim CveProceso As Integer = DdlProceso.SelectedValue.ToEntero
Dim dt As DataTable = Nothing
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetPermisosPorUsuarioProcesos(CveUsuario, CvePadre, CveRol, CveModulo, CveProceso, UsuarioActual.CveUsuario) Then
dt = ObjUsuarios.DtResultados
End If
ObjUsuarios.Dispose()
GvModulosPermiso.DataSource = dt
GvModulosPermiso.DataBind()
UPPAltaProcesos.Update()
UpDatos.Update()
End Sub
Protected Sub GvModulosPermiso_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvModulosPermiso.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'cuando el Módulo es heredado del rol
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then
e.Row.Cells(1).CssClass = "bg-yellow"
' = "bg-font-yellow" '.BackColor = Color.Gold
End If
'cuando el Módulo es heredado del Rol
If (e.Row.DBCampo("CveModuloUsuarioAcceso")) <> "" Then
e.Row.Cells(1).CssClass = "bg-purple-plum"
End If
'cuando el Proceso es heredado del Rol
If (e.Row.DBCampo("CveProcesoAcceso")) <> "" Then
e.Row.FCLabel("LblRol").Text = "<i class='fa fa-check' aria-hidden='true'></i>"
e.Row.FCLabel("LblRol").ForeColor = Drawing.Color.Green
Else
If e.Row.DBCampo("Permitir") = "1" Then
e.Row.FCLinkButton("LnkUsuario").ForeColor = Drawing.Color.Green
e.Row.FCLinkButton("LnkUsuario").Text = "<i class='fa fa-check' aria-hidden='true'></i>"
End If
End If
If (e.Row.DBCampo("Permitir")) = "0" Then
e.Row.FCLinkButton("LnkUsuario").Text = "<i class='fa fa-ban' aria-hidden='true'></i>"
e.Row.FCLinkButton("LnkUsuario").ForeColor = Drawing.Color.Red
End If
End If
End Sub
'Protected Sub GvModulosPermisos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvModulosPermiso.RowCreated
' If e.Row.RowType = DataControlRowType.Header Txhen
' Dim FC As New SortedList
' FC.Add(0, " ,4,1,ColumnaenBlanco")
' FC.Add(3, "Acceso,4,2,Titulos")
' GetMultiRowHeader(DirectCast(sender, GridView), e, FC, "Titulos")
' End If
'End Sub
Protected Sub LnkUsuarioProceso_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveModuloAcceso As Integer = If(GvRow.DataKey("CveModuloAcceso") IsNot Nothing, GvRow.DataKey("CveModuloAcceso").ToEntero, -1)
HdnPermitirProceso.Value = GvRow.DataKey("Permitir")
HdnCveModuloAccesoProceso.Value = GvRow.DataKey("CveModuloAcceso")
HdnCveUsuarioProceso.Value = GvRow.DataKey("CveUsuario")
HdnCveProceso.Value = GvRow.DataKey("CveProceso")
'SI EL MODULO YA LO TRAE EL ROL
If (GvRow.DataKey("Permitir") Is Nothing Or GvRow.DataKey("Permitir") = String.Empty) Then
ChkDenegarProceso.Enabled = True
ChkPermitirProceso.Enabled = False
End If
'SI SE HA ASIGNADO UN VALOR AL MODULO
If (GvRow.DataKey("Permitir") IsNot Nothing AndAlso GvRow.DataKey("Permitir") <> String.Empty) Then
Dim Permitir As Boolean = CBool(GvRow.DataKey("Permitir"))
ChkDenegarProceso.Enabled = Permitir
ChkPermitirProceso.Enabled = Not Permitir
End If
'QUITA LOS VALORES ASIGNADOS AL CHECBOX
ChkDenegarProceso.Checked = False
ChkPermitirProceso.Checked = False
UpDivProcesosPermisos.Update()
RegistraScript("$('#DivProcesosPermisos').modal('show');")
End Sub
Protected Sub BtnAceptarProceso_Click(sender As Object, e As EventArgs) Handles BtnAceptarProceso.Click
Dim ObjUsuarios As New ClsSisUsuarios
''Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol
If HdnCveModuloAccesoProceso.Value <> "" Then
If HdnPermitirProceso.Value = "" OrElse HdnPermitirProceso.Value = "0" Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, Not ChkDenegarProceso.Checked) Then
Alert("Se ha actualizado el proceso correctamente")
End If
End If
'SI EL MODULO TRARE EL PERMISO Y ESTA ASIGNADO TAMBIEN (2 palomitas)
If HdnPermitirProceso.Value = "1" Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, Not ChkDenegarProceso.Checked) Then
Alert("Se ha actualizado el proceso correctamente")
End If
End If
Else
If HdnPermitirProceso.Value = "" OrElse HdnPermitirProceso.Value = "1" Then
If ObjUsuarios.UpdateUsuariosProcesos(HdnCveUsuarioProceso.Value.ToEntero, HdnCveProceso.Value.ToEntero, ChkPermitirProceso.Checked) Then
Alert("Se ha actualizado el proceso correctamente")
End If
End If
End If
ObjUsuarios.Dispose()
BtnConsultarProcesos_Click(BtnConsultarProcesos, EventArgs.Empty)
End Sub
#End Region
End Class

View File

@@ -0,0 +1,533 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpAddUsuario.aspx.vb" Inherits="Sistemas_PopUpAddUsuario" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.ajax__tab_xp .ajax__tab_body {
padding: 0px !important;
}
#GvModulosAcceso tr td:last-child, #GvModulosAcceso tr th:last-child,
#GvModulosPermiso tr td:last-child, #GvModulosPermiso tr th:last-child,
#GvDispositivos tr td:last-child, #GvDispositivos tr th:last-child {
width: 60px;
}
#GVNotificaciones tr td:nth-child(n+2), #GVNotificaciones tr th:nth-child(n+1) {
width: 50px;
}
#GvPermisosComandos tr td:nth-child(n+3), #GVNotificaciones tr th:nth-child(n+2) {
width: 50px;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
<asp:Literal runat="server" ID="LtlUsuario"></asp:Literal>
</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" class="Widthall" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabGeneral" runat="server" HeaderText="Información General">
<ContentTemplate>
<asp:UpdatePanel ID="UpGeneral" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Datos del Usuario</span>
</div>
<div class="actions">
<div class="btn-group"></div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:UpdatePanel runat="server" ID="UpUsuario" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEmail" ClientIDMode="Static" runat="server" CssClass="form-control" MaxLength="50" onkeyup="fncTxt(this)" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEmail" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEmail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''E-Mail''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="REVEmail" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtEmail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpObligatorio"></asp:RegularExpressionValidator>
<label style="margin-top: -6px" for="TxtEmail">Correo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDevId" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label style="margin-top: -6px" for="<%= TxtNombre.ClientID.ToString()%>">Nombre:</label>
</div>
<div runat="server" id="DivEstatus" class="form-group form-md-line-input input-iconright" style="padding-top: 0px;">
<label style="margin-top: -6px;" for="<%= ChkEstatus.ClientID.ToString()%>">Estatus Activo: </label>
<div style="margin-top: 3px;">
<asp:CheckBox runat="server" ID="ChkEstatus" CssClass="make-switchsd" data-size="small" Checked="true"></asp:CheckBox>
</div>
</div>
<div class="row" style="margin-left: 1px; margin-top: 10px;">
<asp:Button runat="server" ID="BtnDefaultPWD" Text="Reestablecer Contraseña" CssClass="btn btn-primary" Visible="false" />
</div>
<asp:Literal ID="LtlEmpresas" runat="server"></asp:Literal>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabAccesoModulos" runat="server" HeaderText="Acceso a Módulos">
<ContentTemplate>
<ajax:TabContainer runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel HeaderText="Plataforma" runat="server">
<ContentTemplate>
<asp:UpdatePanel ID="UpAccesosModulos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Asignación de Permisos</span>
</div>
<div class="actions">
<div class="text-right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvModulosAcceso.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvModulosAcceso.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:UpdatePanel ID="UPPAltaRep" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvModulosAcceso" ClientIDMode="Static" runat="server" AutoGenerateColumns="False" data-fncafter="addclickall('GvModulosAcceso', 3, 1, 0);"
DataKeyNames="CveModulo,CveUsuario,CveModuloAcceso,CveProcesoAcceso,Permitir" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="250" GridLines="None">
<Columns>
<asp:BoundField DataField="Padre" HeaderText="Padre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Modulo" HeaderText="Módulo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Permitir" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkPermitir" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Denegar" Visible="false" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkDenegar" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabApp" HeaderText="Aplicación Movil" Visible="false" runat="server">
<ContentTemplate>
<asp:UpdatePanel ID="UpAccesosModulosApp" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Asignación de Permisos</span>
</div>
<div class="actions">
<div class="text-right">
<input type="text" id="TxtBusquedaApp" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvModulosApp.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaApp','{0}')", GvModulosApp.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:UpdatePanel ID="UpGvModulosApp" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvModulosApp" ClientIDMode="Static" runat="server" AutoGenerateColumns="False" data-fncafter="addclickall('GvModulosApp', 3, 1, 0);"
DataKeyNames="CveModulo,CveUsuario,CveModuloAcceso,CveProcesoAcceso,Permitir" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="250" GridLines="None">
<Columns>
<asp:BoundField DataField="Padre" HeaderText="Padre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Modulo" HeaderText="Módulo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Permitir" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkPermitir" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Denegar" Visible="false" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkDenegar" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPermisoVehiculos" runat="server" HeaderText="Permiso a Vehículos" Visible="false">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Asignación de Permisos</span>
</div>
<div class="actions">
<div class="text-right">
<input type="text" id="TxtBusquedaV" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaV ','{0}')", GvModulosAcceso.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvModulosAcceso.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GridView1" ClientIDMode="Static" runat="server" AutoGenerateColumns="False" DataKeyNames="CveModulo,CveUsuario,CveModuloAcceso,CveProcesoAcceso,Permitir" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="250" GridLines="None">
<Columns>
<asp:BoundField DataField="Padre" HeaderText="Padre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Modulo" HeaderText="Módulo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Permitir" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkPermitir" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Denegar" Visible="false" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkDenegar" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<%--<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>--%>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPermisoModulos" runat="server" HeaderText="Permiso a Módulos">
<ContentTemplate>
<asp:UpdatePanel ID="UPPAltaProcesos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Asignación de Permisos</span>
</div>
<div class="actions">
<div class="text-right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvModulosPermiso.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvModulosPermiso.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:GridView ID="GvModulosPermiso" runat="server" AutoGenerateColumns="False" data-fncafter="addclickall('GvModulosPermiso', 3, 2, 0);"
DataKeyNames="CveUsuario,CveModulo,CveProceso,CveModuloAcceso,CveProcesoAcceso,CveProcesoUsuarioAcceso,Permitir" CssClass="ScrollAD table table-striped table-hover Widthall" GridLines="None" ClientIDMode="Static">
<Columns>
<asp:TemplateField HeaderText="Módulo" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label runat="server" ID="Lblmodulo" data-toggle="tooltip" title='<%#Eval("CveProceso") %>' Text='<%#Eval("Modulo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Proceso" HeaderText="Proceso" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Descripcion" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Permitir" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkP" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Denegar" Visible="false" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkD" Enabled="false"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabVehiculos" runat="server" HeaderText="Vehículos">
<ContentTemplate>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
</div>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Asignación de Permisos</span>
</div>
<div class="actions">
<div class="text-right">
<input type="text" id="TxtBusquedaD" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaD','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaD','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" data-fncafter="addclickall('GvDispositivos', 4, 1, 0);"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%"
AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ClientIDMode="Static">
<Columns>
<asp:BoundField DataField="NoEconomico" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="ModeloVehiculo" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="AñoVehiculo" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="center" />
<asp:BoundField DataField="PlacasVehiculo" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="center" />
<asp:TemplateField ItemStyle-HorizontalAlign="center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkDis" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabNotificaciones" runat="server" HeaderText="Notificaciones">
<ContentTemplate>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Asignación de Permisos</span>
</div>
<div class="actions">
<div class="text-right">
<input type="text" id="TxtBusquedaN" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaN','{0}')", GVNotificaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaN','{0}')", GVNotificaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:GridView ID="GVNotificaciones" runat="server" GridLines="None" DataKeyNames="CveNotificacion" data-fncafter="addclickall('GVNotificaciones', 1, 5, 0);"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ClientIDMode="Static">
<Columns>
<asp:BoundField DataField="Nombre" HeaderText="Notificación" />
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Campana">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkCampana" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Correo">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkCorreo" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Ventana">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkVentana" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="SMS">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkSMS" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Aplicación">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkApp" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPermisoComandos" runat="server" HeaderText="Permiso a Comandos">
<ContentTemplate>
<asp:UpdatePanel ID="UppComandos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Asignación de Permisos</span>
</div>
<div class="actions">
<div class="text-right">
<input type="text" id="TxtBusquedaComandos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaComandos','{0}')", GvPermisosComandos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaComandos','{0}')", GvPermisosComandos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:GridView ID="GvPermisosComandos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveComando" data-fncafter="addclickall('GvPermisosComandos', 2, 2, 0);"
CssClass="ScrollAD table table-striped table-hover Widthall" GridLines="None" ClientIDMode="Static">
<Columns>
<asp:TemplateField HeaderText="Comando" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label runat="server" ID="Lblmodulo" data-toggle="tooltip" title='<%#Eval("CveComando") %>' Text='<%#Eval("Comando") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Permitir" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkP"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Favorito" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" CssClass="ChecaFavoritos" onclick="verficaFavoritos();" ID="ChkFavorito"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<div class="text-center">
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" OnClick="BtnGuardar_Click" Text="Guardar" ValidationGroup="GrpGuardar" class="btn btn-primary" />
<asp:Button ID="BtnCambiarUsuario" CssClass="hidden" OnClick="BtnCambiarUsuario_Click" UseSubmitBehavior="false" ClientIDMode="Static" runat="server" Text="Button" />
<button id="BtnCancelar" onclick="CerrarVentana();" class="btn btn-default">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
let TusuarioOld;
function fncTxt(t) {
$('#C_Tab_TabGeneral_TxtUsuario').val(t.value);
}
let myTick = 0
$('body').on('keyup', '#TxtEmail ', function (e) {
let Tick = myTick + 1;
myTick = Tick;
setTimeout(
function () {
if (myTick == Tick) {
myTick = 0;
let Tusuario = $('#TxtEmail').val();
if (TusuarioOld != Tusuario) {
TusuarioOld = Tusuario
//console.log(Tusuario)
$.ajax({
url: "/Ashx/SIGWeb.ashx",
data: { usuario: Tusuario, metodo: 'GetUser' }
}).done(function (data) {
//console.log(data)
if (data == "1") {
$('#BtnCambiarUsuario').click()
}
});
}
}
}, 2000);
});
function ADSBegin() {
TusuarioOld = $('#TxtEmail').val()
}
function Ir(c) {
gotourl('/Ventas/Clientes.aspx?CveCliente=' + c + '&Opt=12');
}
function IrProveedores(p) {
gotourl('/Compras/Proveedores.aspx?CveProveedor=' + p + '&Opt=9');
}
function Ir2(c) {
var reload = window.opener;
if (!reload) {
reload = parent;
} else { url = reload.location; }
if (!url) {
url = reload.location.href.replace("#", "");
}
reload.location = url;
window.close();
//gotourl('/GPS/UsuariosRastreo.aspx');
}
var verficaFavoritos = function () {
var total = 0;
$(".ChecaFavoritos > input").each(function () {
if (this.checked) {
total = total + 1;
}
if (total == 5) {
alert("Ya tiene el maximo numero de comandos favoritos para asignar.");
this.checked = false;
return false;
}
});
};
function addclickall(gv, thantes, thclick, thdespues) {
if ($('#ADSH-' + gv + ' tr.Selectall').length == 0) {
thantes += 1;
thclick += thantes;
thdespues += thclick;
let tr = $('<tr class="Selectall"></tr>');
for (let i = 1; i < thantes; i++) {
tr.append($('<th></th>'));
}
for (let i = thantes; i < thclick; i++) {
let th = $('<th></th>');
let input = $('<input type="checkbox" class="chkAll">')
th.append(input);
input.click(function () {
$('#' + gv + ' tr td:nth-child(' + i + ') input[type="checkbox"]:not([disabled="disabled"])').prop("checked", input.is(":checked"))
});
tr.append(th);
}
for (let i = thclick; i < thdespues; i++) {
tr.append($('<th></th>'));
}
$('#ADSH-' + gv + ' tbody').append(tr);
}
}
</script>
</asp:Content>

View File

@@ -0,0 +1,858 @@
Imports Extensiones
Imports System.Data
Partial Class Sistemas_PopUpAddUsuario
Inherits ClsPaginas
#Region "PROPIEDADES"
Public Property CveCliente As Integer
Get
Return ViewState("CveCliente").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveCliente") = value
End Set
End Property
Public Property CveProveedor As Integer
Get
Return ViewState("CveProveedor").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveProveedor") = value
End Set
End Property
Public Property CveUsuario As Integer
Get
Return ViewState("CveUsuario").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveUsuario") = value
End Set
End Property
Private Property DTModulos As DataTable
Get
Return CType(ViewState("DTModulos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTModulos") = value
End Set
End Property
Private Property DtNotificacionesUsuarios As DataTable
Get
Return CType(ViewState("DtNotificacionesUsuarios"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtNotificacionesUsuarios") = value
End Set
End Property
Public Property CvePlataforma As Integer
Get
Return ViewState("CvePlataforma").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CvePlataforma") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
If Request("CveUsuario") IsNot Nothing AndAlso IsNumeric(Request("CveUsuario")) AndAlso Request("CveUsuario").ToEntero > 0 Then
ViewState("CveUsuario") = Request("CveUsuario").ToEntero
If CveUsuario > 0 Then
TxtEmail.Enabled = False
CargaUsuario()
End If
Else
CveUsuario = -1
LtlUsuario.Text = "Nuevo Usuario"
End If
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
ViewState("CveCliente") = Request("CveCliente").ToEntero
'CargaDispositivos()
'CargarNotificaciones()
Else
CveCliente = -1
End If
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
ViewState("CveProveedor") = Request("CveProveedor").ToEntero
'CargaDispositivos()
'CargarNotificaciones()
Else
CveProveedor = -1
End If
If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso (ViewState("CveProveedor") > 0 Or ViewState("CveCliente") > 0) Then
CargaDispositivos()
CargarNotificaciones()
TabApp.Visible = True
CargaGridModulosAccesoApp()
End If
If UsuarioActual.Empresa.CvePlataforma = 1 AndAlso (ViewState("CveProveedor") > 0 OrElse ViewState("CveCliente") > 0) Then
TabVehiculos.Visible = False
TabPermisoVehiculos.Visible = False
TabNotificaciones.Visible = False
TabPermisoComandos.Visible = False
If CveUsuario > 0 Then
DivEstatus.Visible = True
Else
DivEstatus.Visible = False
End If
Else
DivEstatus.Visible = False
CargaComandos()
End If
'INICIALIZA CVEPLATAFORMA
If UsuarioActual.Empresa.CvePlataforma = 1 And ViewState("CveCliente") > 0 Then
ViewState("CvePlataforma") = 6
ElseIf UsuarioActual.Empresa.CvePlataforma = 1 And ViewState("CveProveedor") > 0 Then
ViewState("CvePlataforma") = 7
Else
ViewState("CvePlataforma") = 3
End If
CargaModulosAcceso()
CargaModulosPermisos()
End If
End Sub
Public Sub CargaUsuario()
If CveUsuario > 0 Then
Dim ObjUsuario As New ClsSisUsuarios()
If ObjUsuario.GetUsuarios(CveUsuario) Then
LtlUsuario.Text = ObjUsuario.DtResultados.Rows(0)("Usuario").ToString()
TxtEmail.Text = ObjUsuario.DtResultados.Rows(0)("Correo").ToString()
TxtNombre.Text = ObjUsuario.DtResultados.Rows(0)("Nombre").ToString()
ChkEstatus.Checked = ObjUsuario.DtResultados.Rows(0)("Estatus")
If ObjUsuario.DtResultados.Rows(0)("CveRol").ToString.ToEntero = 1200 OrElse ObjUsuario.DtResultados.Rows(0)("CveRol").ToString.ToEntero = 1198 Then
BtnDefaultPWD.Visible = True
End If
Dim Dt As Data.DataTable = GlobalDTUsuarios(CveUsuario)
Dim empresas As New StringBuilder()
If Dt.FiltraParametros("CvePlataforma = 3").Rows.Count > 0 Then
empresas.Append($"<div class='text-center'><h3>Empresas</h3></div>")
End If
For Each row As DataRow In Dt.FiltraParametros("CvePlataforma = 3 ", "", {"CveEmpresa", "Empresa"}).Rows
empresas.Append($"<div><strong>{row("Empresa").ToString()}</strong></div>")
For Each wor As DataRow In Dt.Select($"CvePlataforma = 3 AND CveCliente>0 AND CveEmpresa={row("CveEmpresa").ToString().ToEntero()}")
empresas.Append($"<div style='padding-left:15px;'>{wor("Cliente").ToString()}</div>")
Next
Next
LtlEmpresas.Text = empresas.ToString()
Else
LtlUsuario.Text = ""
TxtEmail.Text = ""
TxtNombre.Text = ""
LtlEmpresas.Text = ""
BtnDefaultPWD.Visible = False
End If
ObjUsuario.Dispose()
UpUsuario.Update()
End If
End Sub
Private Sub BtnDefaultPWD_Click(sender As Object, e As EventArgs) Handles BtnDefaultPWD.Click
Dim ObjUsuario As New ClsSisUsuarios
If ObjUsuario.UpdateUsuarioContrasenia(ContraseñaPredeterminadaEncriptada, CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjUsuario.UpdateUsuario(LtlUsuario.Text, TxtNombre.Text, -1, TxtEmail.Text, -1, -1, True, True, -1, CveUsuario, -1, -1) Then
Alert("La contraseña se reestableció correctamente a la contraseña por default '-acceso-'.")
Dim Liga As String = $"{Context.Request.Url.OriginalString.Substring(0, Context.Request.Url.OriginalString.Length - Context.Request.Url.PathAndQuery.Length)}/LogIn.aspx"
Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
EnviaCorreo(Liga, LigaActivar)
End If
End If
ObjUsuario.Dispose()
End Sub
Private Sub CargaComandos()
Dim ObjGPS As New ClsGPS
If ObjGPS.GetUsuariosComandos(CveUsuario, UsuarioActual.CveUsuario, -1) Then
GvPermisosComandos.DataSource = ObjGPS.DtResultados
End If
ObjGPS.Dispose()
GvPermisosComandos.DataBind()
UppComandos.Update()
End Sub
Private Function ValidaDatos() As Boolean
Dim Valido As Boolean = False
If Not String.IsNullOrEmpty(TxtEmail.Text.Trim) Then
Valido = True
Else
Alert("Debe asginar un correo al usuario", TipoMensaje.MsgAdvertencia)
Valido = False
Return Valido
End If
If Not String.IsNullOrEmpty(TxtNombre.Text.Trim) Then
Valido = True
Else
Alert("Debe asignar un nombre al usuario", TipoMensaje.MsgAdvertencia)
Valido = False
Return Valido
End If
Dim NumModulos As Integer = 0
For Each Row As GridViewRow In GvModulosAcceso.Rows
If Row.RowType = DataControlRowType.DataRow Then
If Row.FCCheckBox("ChkPermitir").Checked Then
NumModulos = NumModulos + 1
End If
End If
Next
If NumModulos > 0 Then
Valido = True
Else
Alert("Debe seleccionar al menos 1 modulo", TipoMensaje.MsgAdvertencia)
Valido = False
Return Valido
End If
Return Valido
End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
If Not ValidaDatos() Then
Exit Sub
End If
Dim HuboError As Boolean
Dim Editar As Boolean = False
Dim Mensaje As String = ""
Dim ObjUsuarios As New ClsSisUsuarios()
ObjUsuarios.IniciaTransacSQL()
Try
If CveUsuario = -1 Then
'VALIDA NO ALTERAR DATOS DE OTRO USUARIO
'Dim UsuariosExistentes As Integer = GlobalDTUsuarios().COUNT("CveUsuario", $"Usuario IN ('{TxtNombre.Text.Trim}','{TxtEmail.Text.Trim}') OR Correo = '{TxtEmail.Text.Trim}'")
'If UsuariosExistentes > 0 Then
' ObjUsuarios.RollBack()
' ObjUsuarios.Dispose()
' Alert("Los datos ingresados ya existen en el sistema.Favor de verificar si existe el usuario", TipoMensaje.MsgAdvertencia)
' Return
'End If
Editar = False
'AGREGA USUARIO
If UsuarioActual.Empresa.CvePlataforma = 3 Then
CveUsuario = ObjUsuarios.AddUsuarioPopUp(TxtEmail.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombre.Text, TxtEmail.Text, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente, CveProveedor)
ElseIf UsuarioActual.Empresa.CvePlataforma = 1 Then
CveUsuario = ObjUsuarios.AddUsuarioPortal(TxtEmail.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombre.Text, TxtEmail.Text, CveCliente, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
End If
'ENVIA CORREO
If CveUsuario > 0 Then
Dim Liga As String = $"{Context.Request.Url.OriginalString.Substring(0, Context.Request.Url.OriginalString.Length - Context.Request.Url.PathAndQuery.Length)}/LogIn.aspx"
Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
Mensaje = EnviaCorreo(Liga, LigaActivar)
Else
HuboError = True
End If
'AGREGA ACCESO A MODULOS
If Not HuboError Then
For Each Row As GridViewRow In GvModulosAcceso.Rows
'Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol
If Row.DataKey("CveModuloAcceso") <> "" Then
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then
HuboError = True
Exit For
End If
End If
Else
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then
HuboError = True
Exit For
End If
End If
End If
Next
End If
'EXCLUSIVO GPS -- DISPOSITIVOS, COMANDOS
If UsuarioActual.Empresa.CvePlataforma = 3 Then
If Not HuboError AndAlso CveCliente > 0 AndAlso UsuarioActual.Empresa.CvePlataforma = 3 Then
For Each row As GridViewRow In GvDispositivos.Rows
If Not ObjUsuarios.UpdateUsuariosDispositivos(CveUsuario, row.DataKey("CveDispositivo").ToEntero, row.FCCheckBox("chkDis").Checked) Then
HuboError = True
Exit For
End If
Next
End If
If Not HuboError AndAlso CveCliente > 0 AndAlso UsuarioActual.Empresa.CvePlataforma = 3 Then
For Each row As GridViewRow In GvPermisosComandos.Rows
Dim Permitir As Boolean = row.FCCheckBox("ChkP").Checked
Dim EsFavorito As Boolean = row.FCCheckBox("ChkFavorito").Checked
If Not ObjUsuarios.UpdateUsuariosComandos(CveUsuario, UsuarioActual.CveUsuario, row.DataKey("CveComando").ToEntero, Permitir, EsFavorito) Then
HuboError = True
Exit For
End If
Next
End If
'If Not HuboError AndAlso CveCliente > 0 Then
' Using ObjNotificaciones As New ClsSisNotificaciones()
' For Each row As GridViewRow In GVNotificaciones.Rows
' If row.FCCheckBox("chkCorreo").Checked OrElse row.FCCheckBox("chkVentana").Checked OrElse row.FCCheckBox("chkSMS").Checked OrElse
' row.FCCheckBox("chkApp").Checked OrElse row.FCCheckBox("chkCampana").Checked Then
' If Not ObjNotificaciones.AddUsuariosNotificacion(CveUsuario, row.DataKey("CveNotificacion"), row.FCCheckBox("chkCorreo").Checked, row.FCCheckBox("chkVentana").Checked, row.FCCheckBox("chkSMS").Checked,
' row.FCCheckBox("chkApp").Checked, row.FCCheckBox("chkCampana").Checked) Then
' HuboError = True
' End If
' End If
' Next
' End Using
'End If
End If
'AGREGA PERMISOS
If Not HuboError Then
For Each Row As GridViewRow In GvModulosPermiso.Rows
If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkD").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkD").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked) Then
HuboError = True
Exit For
End If
End If
Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkP").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkP").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked) Then
HuboError = True
Exit For
End If
End If
End If
Next
For Each Row As GridViewRow In GvModulosApp.Rows
If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then
HuboError = True
Exit For
End If
End If
Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then
HuboError = True
Exit For
End If
End If
End If
Next
End If
ElseIf CveUsuario > 0 Then
'VALIDA NO ALTERAR DATOS DE OTRO USUARIO
'Dim DtUsuarios As DataTable = GlobalDTUsuarios.FiltraParametros($"CveUsuario <> {CveUsuario}")
Editar = True
'Dim UsuariosExistentes As Integer = DtUsuarios.COUNT("CveUsuario", $"Usuario IN ('{TxtEmail.Text.Trim}') OR Correo = '{TxtEmail.Text.Trim}'")
'If UsuariosExistentes > 0 Then
' ObjUsuarios.RollBack()
' ObjUsuarios.Dispose()
' Alert("Los datos ingresados ya existen en el sistema.Favor de verificar si existe el usuario", TipoMensaje.MsgAdvertencia)
' Return
'End If
If UsuarioActual.Empresa.CvePlataforma = 3 Then
If Not ObjUsuarios.UpdateUsuario(LtlUsuario.Text.Trim, TxtNombre.Text, -1, TxtEmail.Text, -1, -1, False, True, -1, CveUsuario, -1, -1) Then
HuboError = True
End If
If Not HuboError AndAlso Not ObjUsuarios.AddUsuarioCliente(CveUsuario, CveCliente) Then
HuboError = True
End If
ElseIf CvePlataforma = 6 OrElse CvePlataforma = 7 Then
If Not ObjUsuarios.UpdateUsuarioPortal(LtlUsuario.Text.Trim, TxtNombre.Text, TxtEmail.Text, ChkEstatus.Checked, "-1", CveCliente, CveProveedor, CveUsuario, UsuarioActual.CveUsuario) Then
HuboError = True
End If
End If
If Not HuboError Then
For Each Row As GridViewRow In GvModulosAcceso.Rows
'Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol
If Row.DataKey("CveModuloAcceso") <> "" Then
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then
HuboError = True
Exit For
End If
End If
Else
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then
HuboError = True
Exit For
End If
End If
End If
Next
For Each Row As GridViewRow In GvModulosApp.Rows
'Nota, permitir, tiene 3 valores, ''(Vacio), no se ha estipulado, '0' que se denego, '1' permitido(aplicado solo cuando no viene del rol
If Row.DataKey("CveModuloAcceso") <> "" Then
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then
HuboError = True
Exit For
End If
End If
Else
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosModulos(CveUsuario, Row.DataKey("CveModulo").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then
HuboError = True
Exit For
End If
End If
End If
Next
End If
'EXCLUSIVO GPS
If Not HuboError AndAlso CveCliente > 0 AndAlso UsuarioActual.Empresa.CvePlataforma = 3 Then
For Each row As GridViewRow In GvDispositivos.Rows
If Not ObjUsuarios.UpdateUsuariosDispositivos(CveUsuario, row.DataKey("CveDispositivo").ToEntero, row.FCCheckBox("chkDis").Checked) Then
HuboError = True
Exit For
End If
Next
End If
If Not HuboError AndAlso CveCliente > 0 AndAlso UsuarioActual.Empresa.CvePlataforma = 3 Then
For Each row As GridViewRow In GvPermisosComandos.Rows
Dim Permitir As Boolean = row.FCCheckBox("ChkP").Checked
Dim EsFavorito As Boolean = row.FCCheckBox("ChkFavorito").Checked
If Not ObjUsuarios.UpdateUsuariosComandos(CveUsuario, UsuarioActual.CveUsuario, row.DataKey("CveComando").ToEntero, Permitir, EsFavorito) Then
HuboError = True
Exit For
End If
Next
End If
'If Not HuboError AndAlso CveCliente > 0 Then
' Using ObjNotificaciones As New ClsSisNotificaciones()
' ObjNotificaciones.DeleteNotificacion(-1, CveUsuario)
' For Each row As GridViewRow In GVNotificaciones.Rows
' If row.FCCheckBox("chkCorreo").Checked OrElse row.FCCheckBox("chkVentana").Checked OrElse row.FCCheckBox("chkSMS").Checked OrElse
' row.FCCheckBox("chkApp").Checked OrElse row.FCCheckBox("chkCampana").Checked Then
' If Not ObjNotificaciones.AddUsuariosNotificacion(CveUsuario, row.DataKey("CveNotificacion"), row.FCCheckBox("chkCorreo").Checked, row.FCCheckBox("chkVentana").Checked, row.FCCheckBox("chkSMS").Checked,
' row.FCCheckBox("chkApp").Checked, row.FCCheckBox("chkCampana").Checked) Then
' HuboError = True
' End If
' End If
' Next
' End Using
'End If
If Not HuboError Then
For Each Row As GridViewRow In GvModulosPermiso.Rows
If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkD").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkD").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked) Then
HuboError = True
Exit For
End If
End If
Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkP").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkP").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked) Then
HuboError = True
Exit For
End If
End If
End If
Next
End If
Else
Alert("Ocurrió un error al agregar el usuario.", TipoMensaje.MsgInformacion)
End If
Catch ex As Exception
OnError("Ocurrió un error al agregar el usuario.", ex)
End Try
If Not HuboError Then
ObjUsuarios.Commit()
If UsuarioActual.Empresa.CvePlataforma = 3 Then
Using ObjNotificaciones As New ClsSisNotificaciones()
ObjNotificaciones.DeleteNotificacion(-1, CveUsuario)
For Each row As GridViewRow In GVNotificaciones.Rows
If row.FCCheckBox("chkCorreo").Checked OrElse row.FCCheckBox("chkVentana").Checked OrElse row.FCCheckBox("chkSMS").Checked OrElse
row.FCCheckBox("chkApp").Checked OrElse row.FCCheckBox("chkCampana").Checked Then
If Not ObjNotificaciones.AddUsuariosNotificacion(CveUsuario, row.DataKey("CveNotificacion"), row.FCCheckBox("chkCorreo").Checked, row.FCCheckBox("chkVentana").Checked, row.FCCheckBox("chkSMS").Checked,
row.FCCheckBox("chkApp").Checked, row.FCCheckBox("chkCampana").Checked) Then
HuboError = True
End If
End If
Next
End Using
End If
Dim JSBTN As String = ""
If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso UsuarioActual.CveCliente > 0 Then
JSBTN = $"document.location.href=""javascript:Ir2({CveCliente})"";"
ElseIf CveCliente > 0 Then
JSBTN = $"document.location.href=""javascript:Ir({CveCliente})"";"
ElseIf CveProveedor > 0 Then
JSBTN = $"document.location.href=""javascript:IrProveedores({CveProveedor})"";"
End If
If Editar Then
Alert($"El usuario se actualizó correctamente. <br><br>{Mensaje} ", TipoMensaje.MsgInformacion, JSBTN)
Else
Alert($"El usuario se guardó correctamente. <br><br>{Mensaje}", TipoMensaje.MsgInformacion, JSBTN)
End If
Else
ObjUsuarios.RollBack()
Alert("Ocurrió un error al agregar el usuario.", TipoMensaje.MsgInformacion)
End If
ObjUsuarios.Dispose()
RecargarGlobalUsuarios()
RecargarGlobal()
End Sub
Private Sub RecargarGlobal()
Dim GPS As New ClsGPS
If GPS.DispositivosUsuariosGet(-1, -1, -1, -1, -1) Then
GlobalDTDispositivosUsuarios(-1, -1) = GPS.DtResultados
End If
GPS.Dispose()
End Sub
Private Sub RecargarGlobalUsuarios()
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetUsuariosEmpresas(-1) Then
Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
Application("GlobalDTUsuarioResponsable") = ObjUsuarios.DtResultados.FiltraParametros("ProveedoresResponsables > 0")
End If
ObjUsuarios.Dispose()
End Sub
#Region "MANDAR CORREOS"
Private Function EnviaCorreo(Liga As String, LigaActivar As String) As String
Dim Retorno As String = ""
Try
Dim Para = TxtEmail.Text.Trim
Dim Asunto = ""
If CveCliente > 0 Then
Asunto = "ACTIVACIÓN DEL PORTAL DE CLIENTE"
ElseIf CveProveedor > 0 Then
Asunto = "ACTIVACIÓN DEL PORTAL DE PROVEEDOR"
End If
Dim SBBody As New StringBuilder
'Linia de estilos
SBBody.Append("<style> .mailbody{ background-color:#EEF1F5; padding:15px; font-family :'Open Sans', sans-serif; } .mailcontent{ background-color:#fff; font-size: 14px; color: #333; padding:0px 15px ; } .mailtitle{padding:8px;color:#32C5D2; font-size: 18px;font-weight: 700!important;border-bottom:2px solid #EEF1F5;text-transform: uppercase;}.marco{border: 1px solid #869ab3;border-top: 0;background-color: #67809F; margin: 10px 15px 25px 15px;color: #fff;}.marco-title{padding: 10px 10px;text-transform: uppercase;font-weight: 700!important;}.marco-body{color:#333;background-color:#fff;}.nota{background: #E5E5E5;padding:15px;color:#333;} .logo { font-size:12px; font-style:italic; text-align:right; } .col1{width:180px;font-weight: 700!important;display:inline-block;} .col2{min-width:260px;display:inline-block;} </style>")
'incio Cuerpo del correo
SBBody.Append("<div Class='mailbody'>")
SBBody.Append("<div Class='mailcontent'>")
SBBody.Append("<div Class='mailtitle'>")
SBBody.Append("ALTA DE CUENTA")
SBBody.Append("</div>")
SBBody.Append("<br/>")
SBBody.AppendFormat("<b> Estimado {0}:</b><br/>", TxtNombre.Text.ToUpper)
SBBody.AppendFormat("El presente correo es para informarle que se le han asignado los siguientes datos para el acceso a la Plataforma de: <b>{0}</b><br/><br/>", UsuarioActual.Empresa.Empresa)
SBBody.Append("<div Class='marco'>")
SBBody.Append("<div Class='marco-title'>Datos de usuario</div>")
SBBody.Append("<div Class='marco-body'>")
SBBody.Append("<div>")
SBBody.Append("<div>")
SBBody.Append("<div class='col1'> Usuario</div>")
SBBody.AppendFormat("<div class='col2'>{0}</div>", TxtEmail.Text)
SBBody.Append("</div>")
SBBody.Append("<div>")
SBBody.Append("<div class='col1'> Accesé al sistema dando click a la liga y estableciendo su contraseña</div>")
SBBody.AppendFormat("<div class='col2'><a href='{0}'target='_blank'>Activar</a></div>", LigaActivar)
SBBody.Append("</div>")
SBBody.Append("</div>")
SBBody.Append("</div>")
SBBody.Append("<br/>")
SBBody.Append("Para Activar su cuenta debera cambiar su contraseña.<br/><br/>")
SBBody.Append("<div Class='nota'>")
SBBody.Append("Nota Favor de NO responder este correo. ")
SBBody.Append("</div><br/><br/>")
SBBody.AppendFormat("<div class='logo'><img src='{0}Imagenes/LogoSinFondo.png' style='width:30px;'/>ADSistemas </div>", UrlSitio)
SBBody.Append("</div>")
SBBody.Append("</div>")
'Termino Cuerpo del correo
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo(Asunto, Para, SBBody.ToString))
Hilo.Start()
'Dim JSBTN As String = ""
'If UsuarioActual.CveCliente > 0 Then
' JSBTN = $"document.location.href=""javascript:Ir2({CveCliente})"";"
'ElseIf CveCliente > 0 Then
' JSBTN = $"document.location.href=""javascript:Ir({CveCliente})"";"
'End If
'If UsuarioActual.Empresa.CvePlataforma = 3 Then
' Alert("El correo se ha enviado correctamente a: " + TxtEmail.Text + ".", TipoMensaje.MsgInformacion, JSBTN)
'End If
Retorno = $"El correo se ha enviado correctamente a: <b>{TxtEmail.Text}</b>."
Catch ex As Exception
OnError("Ocurrió error al mandar MAIL", ex)
End Try
Return Retorno
End Function
Private Sub MandaCorreo(Asunto As String, Para As String, Body As String)
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
a.GuardaLog()
Dim Mail As New ClsSisMail()
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
End Sub
#End Region
#Region "M O D U L O S"
Public Sub CargaModulosAcceso()
Dim ObjPermisos As New ClsSisUsuarios
If ObjPermisos.GetUsuariosModulos(CveUsuario, UsuarioActual.CveEmpresa, If(False, UsuarioActual.CveUsuario, -1)) Then
If UsuarioActual.Empresa.CvePlataforma = 1 AndAlso CveCliente > 0 Then
DTModulos = ObjPermisos.DtResultados.FiltraParametros("Liga <> '' AND CvePlataforma = 6")
ElseIf UsuarioActual.Empresa.CvePlataforma = 1 AndAlso CveProveedor > 0 Then
DTModulos = ObjPermisos.DtResultados.FiltraParametros("Liga <> '' AND CvePlataforma = 7")
Else
DTModulos = ObjPermisos.DtResultados.FiltraParametros($"Liga <> '' AND CvePlataforma = {UsuarioActual.Empresa.CvePlataforma}")
End If
Else
DTModulos = Nothing
End If
ObjPermisos.Dispose()
CargaGridModulosAcceso()
End Sub
Private Sub CargaGridModulosAcceso()
GvModulosAcceso.DataSource = DTModulos
GvModulosAcceso.DataBind()
If (GvModulosAcceso.Rows.Count > 0) Then
GvModulosAcceso.UseAccessibleHeader = True
GvModulosAcceso.HeaderRow.TableSection = TableRowSection.TableHeader
End If
UpDatos.Update()
End Sub
Private Sub CargaGridModulosAccesoApp()
Dim ObjPermisos As New ClsSisUsuarios
If ObjPermisos.GetUsuariosModulos(CveUsuario, UsuarioActual.CveEmpresa, If(False, UsuarioActual.CveUsuario, -1)) Then
If UsuarioActual.CveRol = 1 Then
GvModulosApp.DataSource = ObjPermisos.DtResultados.FiltraParametros($"CvePlataforma = 5")
Else
GvModulosApp.DataSource = ObjPermisos.DtResultados.FiltraParametros($"CvePlataforma = 5 AND CveModulo <> 5010")
End If
End If
ObjPermisos.Dispose()
GvModulosApp.DataBind()
If (GvModulosApp.Rows.Count > 0) Then
GvModulosApp.UseAccessibleHeader = True
GvModulosApp.HeaderRow.TableSection = TableRowSection.TableHeader
End If
UpDatos.Update()
End Sub
Protected Sub GvModulosAcceso_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvModulosAcceso.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DBCampo("Permitir")) = "0" Then
e.Row.FCCheckBox("ChkDenegar").Checked = True
End If
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then
e.Row.FCCheckBox("ChkDenegar").Enabled = True
e.Row.Cells(3).CssClass = "bg-yellow"
Else
e.Row.FCCheckBox("ChkPermitir").Enabled = True
If e.Row.DBCampo("Permitir") = "1" Then e.Row.FCCheckBox("ChkPermitir").Checked = True
End If
End If
End Sub
Protected Sub GvModulosApp_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvModulosApp.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DBCampo("Permitir")) = "0" Then
e.Row.FCCheckBox("ChkDenegar").Checked = True
End If
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then
e.Row.FCCheckBox("ChkDenegar").Enabled = True
e.Row.Cells(3).CssClass = "bg-yellow"
Else
e.Row.FCCheckBox("ChkPermitir").Enabled = True
If e.Row.DBCampo("Permitir") = "1" Then e.Row.FCCheckBox("ChkPermitir").Checked = True
End If
End If
End Sub
Public Sub CargaModulosPermisos()
Dim ObjProcesos As New ClsSisUsuarios
If ObjProcesos.GetUsuariosProcesos(CveUsuario, If(False, UsuarioActual.CveUsuario, -1)) Then
If UsuarioActual.Empresa.CvePlataforma = 1 And CveCliente > 0 Then
GvModulosPermiso.DataSource = ObjProcesos.DtResultados.FiltraParametros($"CvePlataforma = 6")
ElseIf UsuarioActual.Empresa.CvePlataforma = 1 And CveProveedor > 0 Then
GvModulosPermiso.DataSource = ObjProcesos.DtResultados.FiltraParametros($"CvePlataforma = 7")
ElseIf UsuarioActual.Empresa.CvePlataforma = 3 Then
GvModulosPermiso.DataSource = ObjProcesos.DtResultados.FiltraParametros("CveModulo = 433")
End If
Else
GvModulosPermiso.DataSource = Nothing
End If
ObjProcesos.Dispose()
GvModulosPermiso.DataBind()
UpDatos.Update()
End Sub
Protected Sub GvModulosPermiso_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvModulosPermiso.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'cuando el Módulo es heredado del rol
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then
e.Row.Cells(0).CssClass = "bg-yellow"
' = "bg-font-yellow" '.BackColor = Color.Gold
End If
'cuando el Módulo es heredado del Rol
If (e.Row.DBCampo("CveModuloUsuarioAcceso")) <> "" Then
e.Row.Cells(0).CssClass = "bg-purple-plum"
End If
'cuando el Proceso es heredado del Rol
If (e.Row.DBCampo("CveProcesoAcceso")) <> "" Then
e.Row.FCCheckBox("ChkD").Enabled = True
e.Row.Cells(3).CssClass = "bg-yellow"
Else
e.Row.FCCheckBox("ChkP").Enabled = True
If e.Row.DBCampo("Permitir") = "1" Then e.Row.FCCheckBox("ChkP").Checked = True
End If
If (e.Row.DBCampo("Permitir")) = "0" Then
e.Row.FCCheckBox("ChkD").Checked = True
End If
End If
End Sub
Protected Sub GvPermisosComandos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPermisosComandos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Permitir As Integer = e.Row.DBCampo("Permitir").ToEntero
Dim EsFavorito As Boolean = CBool(e.Row.DBCampo("EsFavorito"))
e.Row.FCCheckBox("ChkFavorito").Checked = EsFavorito
If Permitir = 0 Then
e.Row.FCCheckBox("ChkP").Checked = False
End If
If Permitir = 1 Then
e.Row.FCCheckBox("ChkP").Checked = True
End If
End If
End Sub
#End Region
#Region "V E H I C U L O S"
Private Sub CargaDispositivos()
GvDispositivos.DataSource = GlobalDTDispositivos(CveCliente).FiltraParametros("Estatus = 1 ")
GvDispositivos.DataBind()
End Sub
Protected Sub GvDispositivos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDispositivos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If CveUsuario > 0 Then
If GlobalDTDispositivosUsuarios(CveCliente).FiltroPrimeroValor("Permitir", $"CveUsuario = {CveUsuario} AND CveDispositivo = {e.Row.DBCampo("CveDispositivo")} ").ToString = "True" Then
e.Row.FCCheckBox("chkDis").Checked = True
End If
End If
End If
End Sub
#End Region
#Region "N O T I F I C A C I O N E S"
Private Sub CargarNotificaciones()
Dim ObjNotificaciones As New ClsSisNotificaciones
If ObjNotificaciones.GetNotificaciones(-1) Then
DtNotificacionesUsuarios = ObjNotificaciones.DtResultados.FiltraParametros($"CveUsuario = {CveUsuario} ")
GVNotificaciones.DataSource = ObjNotificaciones.DtResultados.FiltraParametros("1 = 1", "CveNotificacion", {"CveNotificacion", "Nombre"})
End If
ObjNotificaciones.Dispose()
GVNotificaciones.DataBind()
End Sub
Protected Sub GvNotificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVNotificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If DtNotificacionesUsuarios.Rows.Count > 0 Then
e.Row.FCCheckBox("chkCampana").Checked = If(DtNotificacionesUsuarios.FiltroPrimeroValor("Alerta_Campana", $"CveNotificacion = {e.Row.DBCampo("CveNotificacion").ToString}").ToString = "True", True, False)
e.Row.FCCheckBox("chkCorreo").Checked = If(DtNotificacionesUsuarios.FiltroPrimeroValor("Alerta_Correo", $"CveNotificacion = {e.Row.DBCampo("CveNotificacion")}").ToString = "True", True, False)
e.Row.FCCheckBox("chkVentana").Checked = If(DtNotificacionesUsuarios.FiltroPrimeroValor("Alerta_Ventana", $"CveNotificacion = {e.Row.DBCampo("CveNotificacion")}").ToString = "True", True, False)
e.Row.FCCheckBox("chkSMS").Checked = If(DtNotificacionesUsuarios.FiltroPrimeroValor("Alerta_SMS", $"CveNotificacion = {e.Row.DBCampo("CveNotificacion")}").ToString = "True", True, False)
e.Row.FCCheckBox("chkApp").Checked = If(DtNotificacionesUsuarios.FiltroPrimeroValor("Alerta_App", $"CveNotificacion = {e.Row.DBCampo("CveNotificacion")}").ToString = "True", True, False)
End If
End If
End Sub
#End Region
Protected Sub BtnCambiarUsuario_Click(sender As Object, e As EventArgs)
CveUsuario = -1
Dim usuario As String = TxtEmail.Text
Dim objs As New ClsSisUsuarios
objs.GetWSusuarios(usuario)
If objs.DtResultados.Rows.Count > 0 Then
CveUsuario = objs.DtResultados.Rows(0)("CveUsuario").ToString().ToEntero()
End If
objs.Dispose()
If CveUsuario > -1 Then
CargaUsuario()
Else
LtlUsuario.Text = ""
TxtEmail.Text = ""
TxtNombre.Text = ""
LtlEmpresas.Text = ""
BtnDefaultPWD.Visible = False
UpUsuario.Update()
End If
If CveCliente > 0 Then
CargaDispositivos()
CargarNotificaciones()
End If
CargaModulosAcceso()
CargaModulosPermisos()
CargaComandos()
UpDatos.Update()
End Sub
End Class

View File

@@ -0,0 +1,83 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpCambiaUsuario.aspx.vb" Inherits="Sistemas_PopUpCambiaUsuario" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</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">
Cambio de Usuario
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:Panel ID="PnlGral" runat="server">
<asp:UpdatePanel ID="UPPGral" runat="server">
<ContentTemplate>
<h4>&nbsp;Usuario Actual:&nbsp;&nbsp;<asp:Label ID="LblUsuario" runat="server" Text="" Font-Bold="True"></asp:Label><br /></h4>
<div class="row">
<div class="col-sm-6"><asp:Label AssociatedControlID="DdlEmpresa" runat="server" Text="Empresa:"></asp:Label></div>
<div class="col-sm-6">Nombre de Usuario:</div>
</div>
<div class="row">
<div class="col-sm-6">
<asp:DropDownList ID="DdlEmpresa" runat="server" AutoPostBack="true" DataTextField="Empresa" DataValueField="CveEmpresa" style="width:100%;" Class="form-control select2me"></asp:DropDownList>
</div>
<div class="has-info col-sm-6">
<asp:TextBox id="TxtBusqueda" CssClass="form-control input-sm" placeholder="" style="width:100%" runat="server" ClientIDMode="Static"/></label>
<asp:Button ID="BtnFiltrar" runat="server" Text="Filtrar" class="btn btn-primary" style="display: none;"/>
</div>
</div>
<div >
<asp:GridView ID="gvUsuarios" runat="server" data-sort="true" CssClass="table table-striped table-advance table-hover Widthall ScrollAD " AutoGenerateColumns="False" ClientIDMode="Static" DataKeyNames="Usuario,Contraseña,CveEmpresa" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Nombre" >
<ItemTemplate>
&nbsp;
<asp:LinkButton ID="LnkNombre" runat="server" CssClass="Texto"
Text='<%#String.Format("{0}({1})", Eval("Nombre"), Eval("Usuario")) %>' ToolTip='<%# Eval("CveUsuario") %>' CommandName="Usuarios" CommandArgument='<%# eval("CveUsuario") %>'></asp:LinkButton>
</ItemTemplate>
<%-- <ItemStyle Width="250px" />
<HeaderStyle CssClass="Titulo" HorizontalAlign="Center" />--%>
</asp:TemplateField>
<asp:BoundField DataField="Rol" HeaderText="Rol" DataFormatString="&nbsp;{0}">
<ItemStyle HorizontalAlign="Left" Width="150px" />
</asp:BoundField>
</Columns>
<%-- <RowStyle CssClass="Texto" Height="19px" />
<HeaderStyle CssClass="Titulo" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
jQuery(document).ready(function () {
buscarDT();
Sys.Application.add_load(function (s, e) {
buscarDT();
});
});
function buscarDT() {
$('#TxtBusqueda').on('keyup', function () {
if (this.value == '') {
$('table#' + $(this).attr('data-table') + ' tr').css('display', 'table-row');
} else {
$('table#' + $(this).attr('data-table') + ' tr').css('display', 'none');
$('table#' + $(this).attr('data-table') + ' tr:contains("' + this.value + '")').css('display', 'table-row');
}
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,213 @@
Imports ADSSession
Imports Extensiones
Imports System.Data
Partial Class Sistemas_PopUpCambiaUsuario
Inherits ClsPaginas
Property DTUsuarios() As Data.DataTable
Get
Return CType(ViewState("DTUsuarios"), DataTable)
End Get
Set(value As Data.DataTable)
ViewState("DTUsuarios") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
If Not (UsuarioActual.CveRol = 1 OrElse UsuarioActual.ModoSimulacion) Then
PnlGral.Visible = False
RegistraScript("window.close();")
End If
Dim DtEmp As DataTable = GlobalDTEmpresas.Copy
Dim NombreEmp As String = UsuarioActual.Empresa.Empresa
'''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
''If UsuarioActual.CveUsuario = 100 Then
'' Dim customerRow() As Data.DataRow
'' customerRow = DtEmp.Select("")
'' For Each drt As DataRow In customerRow
'' drt("Empresa") = "Mi Empresa de ventas (" & drt("CveEmpresa") & ")"
'' Next
''End If
CType(Me.Master, BaseMasterPage).EsPopup = True
LblUsuario.Text = String.Format("{0} - {1}", UsuarioActual.Nombre, UsuarioActual.Empresa.Empresa)
DdlEmpresa.DataSource = DtEmp '.FiltraParametros(If(UsuarioActual.CveRol = 1, "CvePlataforma IN (1,2)", $"CvePlataforma={UsuarioActual.Empresa.CvePlataforma}"))
Dim CveEmpresa As String = UsuarioActual.CveEmpresa.ToString()
Dim splitedtext As String() = Request.Url.AbsoluteUri.Replace("http://", "").Replace("https://", "").Split("."c)
If splitedtext.Length > 0 Then
Select Case splitedtext(0).ToUpper()
Case "VSH" : CveEmpresa = "7"
Case "JAM" : CveEmpresa = "119"
Case "COMPUPROVEEDORES" : CveEmpresa = "72"
Case "DNDIFUSA" : CveEmpresa = "80"
End Select
End If
DdlEmpresa.DataBind()
DdlEmpresa.SelectedValue = CveEmpresa
'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero)
'DdlRol.DataBind()
'DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID)
CargaUsuarios()
'LblUsuario.Text = usuarioactual.
End If
End Sub
Protected Sub gvUsuarios_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles gvUsuarios.RowCommand
If e.CommandName = "Usuarios" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
'Dim Dt As DataTable = GlobalDTUsuarios(e.CommandArgument.ToString.ToEntero)
If gvr IsNot Nothing Then
Dim tUsuario, tContraseña As String
Dim tCveEmpresa As Integer
tUsuario = gvr.DataKey("Usuario").ToString
tContraseña = gvr.DataKey("Contraseña").ToString
tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario
'Dim UsuarioAsignaciones As Usuario
Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa)
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
ADSSessionConfig.sessionUser = Usuario
ADSSessionConfig.sessionUser.CvePlataforma = 1
If Usuario.CveRol = 1200 Then
ADSSessionConfig.sessionUser.CvePlataforma = 3
End If
ADSSessionConfig.sessionDpage = False
ADSSessionConfig.sessionUser.ModoSimulacion = True
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then ADSSessionConfig.sessionUser.MultipleEmpresa = True
End If
End If
dt.Dispose()
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
Else
End If
ObjEmpresa.Dispose()
If UsuarioActual.CveCliente > 0 Then
CargaZonasHorarias(UsuarioActual)
End If
End If
RegistraScript("gotourl();")
End If
End If
End Sub
Private Sub CargaZonasHorarias(ByRef UsuarioActual As Usuario)
Dim ObjClientes As New ClsClientes
Try
If ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=1) Then
If ObjClientes.DtResultados.Rows.Count = 1 Then
UsuarioActual.UTCOffset = ObjClientes.DtResultados(0)("UTCOffset").ToString().ToEntero()
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al obtener la zona horaria.", ex)
Finally
ObjClientes.Dispose()
End Try
End Sub
Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) Handles BtnFiltrar.Click
CargaUsuarios()
End Sub
#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
CargaUsuarios(Orden)
End Sub
Private Sub CargaUsuarios(Optional Orden As String = "Nombre")
Dim dtt As DataTable = GlobalDTUsuarios(-1, DdlEmpresa.SelectedValue.ToEntero)
'If DdlRol.SelectedValue <> "-1" Then
' dtt = dtt.FiltraParametros("CveRol=" & DdlRol.SelectedValue)
'End If
dtt = dtt.FiltraParametros("Estatus = 1", Orden, {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"})
gvUsuarios.DataSource = dtt
gvUsuarios.DataBind()
If (gvUsuarios.Rows.Count > 0) Then
gvUsuarios.UseAccessibleHeader = True
gvUsuarios.HeaderRow.TableSection = TableRowSection.TableHeader
End If
TxtBusqueda.Focus()
End Sub
Private Sub DdlEmpresa_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresa.SelectedIndexChanged
CargaUsuarios()
End Sub
'Private Sub DdlRol_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlRol.SelectedIndexChanged
' CargaUsuarios()
'End Sub
#End Region
End Class

179
Sistemas/PopUpPerfil.aspx Normal file
View File

@@ -0,0 +1,179 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpPerfil.aspx.vb" Inherits="Sistemas_PopUpPerfil" %>
<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">
<asp:Literal runat="server" ID="LtlUsuario"></asp:Literal>
</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="TabGeneral" runat="server" HeaderText="Información General">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<asp:UpdatePanel ID="UpGeneral" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row" style="margin-top: 15px">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-user font-green"></i>
<span class="caption-subject bold uppercase">Datos del Usuario</span>
</div>
<div class="actions">
<div class="btn-group"></div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:UpdatePanel runat="server" ID="UpUsuario" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtEmail" runat="server" CssClass="form-control" MaxLength="50" onkeyup="fncTxt(this)" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEmail" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEmail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''E-Mail''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="REVEmail" runat="server" CssClass="help-block errorimput" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtEmail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardar"></asp:RegularExpressionValidator>
<label style="margin-top: -6px" for="<%= TxtEmail.ClientID.ToString()%>">Correo:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVDevId" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Device ID''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<label style="margin-top: -6px" for="<%= TxtNombre.ClientID.ToString()%>">Nombre:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCambiarContrasenia" runat="server" HeaderText="Cambiar Contraseña">
<ContentTemplate>
<div class="row" style="margin-top: 15px">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="fa fa-lock font-green"></i>
<span class="caption-subject bold uppercase">Contraseña</span>
</div>
<div class="actions">
<div class="btn-group"></div>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtContraActual" runat="server" CssClass="form-control" TextMode="Password" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtContraActual" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Contraseña Actual''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label style="margin-top: -6px" for="<%= TxtContraActual.ClientID.ToString()%>">Contraseña Actual:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtContraNueva" runat="server" CssClass="form-control" TextMode="Password" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtContraNueva" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nueva Contraseña''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label style="margin-top: -6px" for="<%= TxtContraNueva.ClientID.ToString()%>">Nueva Contraseña:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConfirmContra" runat="server" CssClass="form-control" TextMode="Password" MaxLength="50" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConfirmContra" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Confirmar Contraseña''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label style="margin-top: -6px" for="<%= TxtConfirmContra.ClientID.ToString()%>">Confirmar Contraseña:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabZonaHoraria" runat="server" Visible="false" HeaderText="Zona Horaria">
<ContentTemplate>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPermisoComandos" runat="server" HeaderText="Permiso a Comandos">
<ContentTemplate>
<asp:UpdatePanel ID="UpPermisoComandos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel ID="UppComandos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="text-right">
<input type="text" id="TxtBusquedaComandos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaComandos','{0}')", GvPermisosComandos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaComandos','{0}')", GvPermisosComandos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GvPermisosComandos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveComando" CssClass="ScrollAD table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Comando" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label runat="server" ID="Lblmodulo" data-toggle="tooltip" title='<%#Eval("CveComando") %>' Text='<%#Eval("Comando") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:TemplateField HeaderText="Permitir" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkP"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Favorito" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
<ItemTemplate>
<asp:CheckBox runat="server" CssClass="ChecaFavoritos" onclick="verficaFavoritos();" ID="ChkFavorito"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<br />
<div class="row">
<div align="center">
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" OnClick="BtnGuardar_Click" ValidationGroup="GrpGuardar" class="btn btn-primary" />
<button id="BtnCancelar" onclick="CerrarVentana();" class="btn btn-default">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
var verficaFavoritos = function () {
var total = 0;
$(".ChecaFavoritos > input").each(function () {
if (this.checked) {
total = total + 1;
}
if (total == 5) {
alert("Ya tiene el maximo numero de comandos favoritos para asignar.");
this.checked = false;
return false;
}
});
};
</script>
</asp:Content>

View File

@@ -0,0 +1,135 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Sistemas_PopUpPerfil
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
CargaUsuario()
CargaComandos()
End If
End Sub
Private Sub CargaComandos()
Dim ObjGPS As New ClsGPS
If ObjGPS.GetUsuariosComandos(UsuarioActual.CveUsuario, UsuarioActual.CveUsuario, 1) Then
GvPermisosComandos.DataSource = ObjGPS.DtResultados
End If
ObjGPS.Dispose()
GvPermisosComandos.DataBind()
UpPermisoComandos.Update()
End Sub
Public Sub CargaUsuario()
Dim ObjUsuario As New ClsSisUsuarios
If ObjUsuario.GetUsuarios(UsuarioActual.CveUsuario) Then
LtlUsuario.Text = ObjUsuario.DtResultados.Rows(0)("Usuario").ToString
TxtEmail.Text = ObjUsuario.DtResultados.Rows(0)("Correo").ToString
TxtNombre.Text = ObjUsuario.DtResultados.Rows(0)("Nombre").ToString
End If
ObjUsuario.Dispose()
UpUsuario.Update()
End Sub
Protected Sub GvPermisosComandos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPermisosComandos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Permitir As Integer = e.Row.DBCampo("Permitir").ToEntero
Dim EsFavorito As Boolean = CBool(e.Row.DBCampo("EsFavorito"))
e.Row.FCCheckBox("ChkFavorito").Checked = EsFavorito
If Permitir = 0 Then
e.Row.FCCheckBox("ChkP").Checked = False
End If
If Permitir = 1 Then
e.Row.FCCheckBox("ChkP").Checked = True
End If
End If
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Dim Nombre As String = TxtNombre.Text.Trim
Dim Correo As String = TxtEmail.Text.Trim
'VALIDA NO ALTERAR DATOS DE OTRO USUARIO
Dim DtUsuarios As DataTable = GlobalDTUsuarios.FiltraParametros($"CveUsuario <> {UsuarioActual.CveUsuario}")
Dim UsuariosExistentes As Integer = DtUsuarios.COUNT("CveUsuario", $"Usuario IN ('{TxtNombre.Text.Trim}','{TxtEmail.Text.Trim}') OR Correo = '{TxtEmail.Text.Trim}'")
If UsuariosExistentes > 0 Then
Alert("Los datos ingresados ya existen en el sistema.Favor de verificar si existe el usuario", TipoMensaje.MsgAdvertencia)
Return
End If
Dim HuboError As Boolean = False
Dim CambioContra As Boolean = False
Dim ObjUsuarios As New ClsSisUsuarios
'MODIFICA DATOS DE USUARIO
If Not ObjUsuarios.UpdateUsuario(UsuarioActual.Usuario, Nombre, -1, Correo, -1, -1, False, True, -1, UsuarioActual.CveUsuario, -1, -1) Then
HuboError = True
End If
'ASIGNA COMANDOS
If Not HuboError Then
For Each row As GridViewRow In GvPermisosComandos.Rows
Dim Permitir As Boolean = True
Dim EsFavorito As Boolean = row.FCCheckBox("ChkFavorito").Checked
If Not ObjUsuarios.UpdateUsuariosComandos(UsuarioActual.CveUsuario, UsuarioActual.CveUsuario, row.DataKey("CveComando").ToEntero, Permitir, EsFavorito) Then
HuboError = True
Exit For
End If
Next
End If
If Not HuboError Then
Dim ContraActual As String = TxtContraActual.Text
'CHECHA SI VA A CAMBIAR A LA CONTRASEÑA
If Not String.IsNullOrEmpty(TxtContraActual.Text) Then
If Decripta(UsuarioActual.Contraseña) = ContraActual Then
Dim ContraNueva As String = TxtContraNueva.Text
Dim ContraConfirm As String = TxtConfirmContra.Text
If ContraNueva = ContraConfirm Then
If Not ObjUsuarios.UpdateUsuarioContrasenia(Encripta(ContraNueva), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
HuboError = True
Else
CambioContra = True
End If
Else
Alert("La contraseña nueva no coincide.", TipoMensaje.MsgAdvertencia)
End If
Else
Alert("La contraseña actual es incorrecta.", TipoMensaje.MsgAdvertencia)
End If
End If
End If
If Not HuboError Then
ObjUsuarios.Commit()
Alert("Los datos fueron guardados correctamente.")
If CambioContra Then
Alert("La contraseña fue modificada correctamente.")
End If
Else
ObjUsuarios.RollBack()
Alert("Ocurrió un error al guardar los cambios.")
End If
ObjUsuarios.Dispose()
CargaGlobal()
End Sub
Private Sub CargaGlobal()
Dim ObjUsuarios As New ClsSisUsuarios
If ObjUsuarios.GetUsuariosEmpresas(-1) Then
Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
End If
ObjUsuarios.Dispose()
End Sub
End Class

View File

@@ -0,0 +1,130 @@
<%@ Page Title="Lista de Empresas con acceso disponible" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpSeleccionarEmpresa.aspx.vb" Inherits="PopUpSeleccionarEmpresa" %>
<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">
Lista de Empresas con acceso disponible
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<div style="align-content: center;">
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnSeleccionar" runat="server" ClientIDMode="Static" Text="Seleccionar" Style="display: none;" class="btn btn-primary" />
<asp:HiddenField ID="HdnEmpresa" runat="server" ClientIDMode="Static" Value="-1" />
<asp:Button ID="BtnSetWindows" runat="server" ClientIDMode="Static" Text="Set Window" Style="display: none;" class="btn btn-primary" />
<asp:HiddenField ID="HdnAncho" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnAlto" runat="server" ClientIDMode="Static" Value="-1" />
<div id="TblBusqueda" runat="server" border="0" visible="false" >
<div>
Número de registros encontrados: <b>
<asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b>
</div>
<div>
<input name="ctl00$C$TxtBusqueda" type="text" id="TxtBusqueda" class="form-control input-sm TxtBusqueda" placeholder="" data-table=".GVSearch" style="width: 100%">
</div>
<asp:GridView ID="GV" runat="server" DataKeyNames="CveUsuario, Contraseña, Usuario,CveEmpresa" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros"
Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch" Style="margin-top: -10px; text-align: center;"
GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Empresa</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkEmp" runat="server" CssClass="Texto" Text='<%# Eval("Empresa")%>' CommandArgument='<%# Eval("CveEmpresa") %>' CommandName="Cambia"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle HorizontalAlign="Left" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
<asp:GridView ID="GVCliente" runat="server" DataKeyNames="CveUsuario, CveCliente, Contraseña, Usuario" AutoGenerateColumns="false" ShowHeaderWhenEmpty="false"
Width="100%" ToolTip="Listado de Empresas a las que tiene acceso." CssClass="table table-striped table-advance table-hover GVSearch"
Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Portal Rastreo</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkEmp" runat="server" CssClass="Texto" Text='<%# Eval("Cliente")%>' CommandArgument='<%# Eval("CveCliente") %>' CommandName="Cambia"></asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
jQuery(document).ready(function () {
buscarDT();
Sys.Application.add_load(function (s, e) {
buscarDT();
});
});
document.body.onload = function () {
alertSize();
}
function Ir(c) {
$get("HdnEmpresa").value = c;
$('#BtnSeleccionar').click();
}
function Ir2() {
gotourl('/PortalGPS/InicioGPS.aspx');
}
function Ir3() {
gotourl('/Inicio.aspx');
}
function buscarDT() {
$('.TxtBusqueda').on('keyup', function () {
if (this.value == '') {
$('table' + $(this).attr('data-table') + ' tr').css('display', '');
} else {
$('table' + $(this).attr('data-table') + ' tr').css('display', 'none');
$('table' + $(this).attr('data-table') + ' tr:contains("' + this.value + '")').css('display', '');
}
});
$('.TxtBusqueda').removeClass('TxtBusqueda');
}
function alertSize() {
var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number') {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
$get("HdnAncho").value = myWidth;
//$get("TablaGeneral").style.width = myWidth;
$get("HdnAlto").value = myHeight;
//$('#BtnSetWindows').click();
}
</script>
</asp:Content>

View File

@@ -0,0 +1,198 @@
Option Explicit On
Option Strict On
Imports System
Imports System.Linq
Imports System.Web.UI.WebControls
Imports Extensiones
Partial Class PopUpSeleccionarEmpresa
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
'CType(Me.Master, BaseMasterPage).PopupWidth = HdnAncho.Value.ToEntero
'RegistraScript("alertSize();")
GetEmpresas()
End If
End Sub
Private Sub GetEmpresas()
Dim Dt As Data.DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
If Dt IsNot Nothing Then
If Dt.Rows.Count > 0 Then
LtlTotalRegistros.Text = Dt.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = Dt.FiltraParametros("CvePlataforma = 1 OR (CvePlataforma = 3 AND CveCliente IS NULL)", "Empresa")
GVCliente.DataSource = Dt.FiltraParametros("CvePlataforma = 3 AND CveCliente IS NOT NULL", "Empresa")
Else
LtlTotalRegistros.Text = "0"
GV.DataSource = Nothing
Alert("No se encontraron registros con los parametros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If
End If
GV.DataBind()
GVCliente.DataBind()
UPDatos.Update()
TblBusqueda.Visible = True
End Sub
Protected Sub GV_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GV.RowCommand
If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
Usuario = ObjUsuario.ValidaUsuario(gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"), IMEI, gvr.DataKey("CveEmpresa").ToEntero)
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
Usuario.ModoSimulacion = ModoSimulacion
ADSSession.ADSSessionConfig.sessionUser = Usuario
ADSSession.ADSSessionConfig.sessionDpage = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
Dim CveEmpresa = e.CommandArgument.ToString().ToEntero()
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
Usuario.CvePlataforma = 1
Usuario.CveEmpresa = CveEmpresa
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, CveEmpresa)
CreaObjetoEmpresa(Usuario)
RegistraScript("Ir3();")
End If
End If
dt.Dispose()
End If
End If
End If
End Sub
Private Sub GuardaLogR(Mensaje As String)
Dim ArchivoW As IO.StreamWriter
Dim MensajeLog As String = ""
Dim continuar As Boolean = True
Try
If Not IsNothing(System.Web.HttpContext.Current) Then
If Not IsNothing(System.Web.HttpContext.Current.Request) Then
MensajeLog = $"{HttpContext.Current.Request.Url.ToString()}{Environment.NewLine}"
End If
End If
Catch
End Try
MensajeLog = $"{System.Environment.NewLine}'{DateTime.Now:dd/MM/yyyy hh:mm}' -- {MensajeLog}{Mensaje.Trim()}{Environment.NewLine}"
Try
ArchivoW = New IO.StreamWriter(String.Format("{0}\LogSession.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch
Exit Sub
End Try
Try
ArchivoW.Write(MensajeLog)
Catch
End Try
ArchivoW.Close()
ArchivoW.Dispose()
End Sub
Protected Sub gvUsuarios_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GVCliente.RowCommand
If e.CommandName = "Cambia" Then
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
Usuario = ObjUsuario.ValidaUsuarioGPS2(gvr.DataKey("CveCliente"), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
ObjUsuario.Dispose()
If Usuario IsNot Nothing Then
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
Dim ModoSimulacion As Boolean = ADSSession.ADSSessionConfig.sessionUser.ModoSimulacion
Usuario.ModoSimulacion = ModoSimulacion
ADSSession.ADSSessionConfig.sessionUser = Usuario
ADSSession.ADSSessionConfig.sessionDpage = False
If dt IsNot Nothing Then
If dt.Rows.Count >= 1 Then
If dt.Rows.Count > 1 Then Usuario.MultipleEmpresa = True
Usuario.CvePlataforma = 3
CreaObjetoEmpresa(Usuario)
'si la contraseña es la prederminada, pide la nueva contraseña
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario.ToString), False)
RegistraScript("Ir2();")
End If
End If
dt.Dispose()
End If
End If
End If
End Sub
Protected Sub BtnSetWindows_Click(sender As Object, e As System.EventArgs) Handles BtnSetWindows.Click
RegistraScript(String.Format("$get('tdContenido').style.height='{0}px'; $get('tdContenido').style.width='{1}px'", HdnAlto.Value.ToEntero - 30, HdnAncho.Value.ToEntero - 30))
End Sub
Private Sub CreaObjetoEmpresa()
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
'Session("Empresa") = ObjEmpresa
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
Else
Session("Empresa") = Nothing
End If
ObjEmpresa.Dispose()
End Sub
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
'Session("Empresa") = ObjEmpresa
If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
UsuarioActual.Empresa = ObjEmpresa.Empresa
Else
Session("Empresa") = Nothing
End If
ObjEmpresa.Dispose()
End Sub
End Class

150
Sistemas/Registro.aspx Normal file
View File

@@ -0,0 +1,150 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Registro.aspx.vb" Inherits="Sistemas_Registro" %>
<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">
Registro de Empresa
</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">
<div id="DivRegistro" runat="server">
<asp:UpdatePanel runat="server" ID="UpRegistro" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-12">
<!-- BEGIN VALIDATION STATES-->
<div class="portlet light portlet-fit portlet-form bordered" style="min-height: 600px" id="form_wizard_1">
<div class="portlet-title">
<div class="caption">
<i class=" icon-layers font-green"></i>
<span class="caption-subject font-green sbold uppercase">Formulario Inicial</span>
</div>
<div class="actions">
</div>
</div>
<div class="portlet-body">
<div class="form-body">
<div style="border-bottom: 1px solid #eee; margin-bottom: 40px">
<h3 class="form-section">Información General</h3>
</div>
<div class="row">
<div class="col-md-4" style="margin-left: 70px">
<div class="form-group">
<label>Nombre
<label style="color: red">*</label>
</label>
<div class="input-icon">
<i class="fa fa-user" aria-hidden="true"></i>
<asp:TextBox CssClass="form-control" CausesValidation="true" placeholder="Nombre" ID="txtNombre" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombre" runat="server" ControlToValidate="txtNombre" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombre" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<span class="help-block" style="color: #45b6af;">Nombre o Razón Social de la empresa</span>
</div>
</div>
<div class="col-md-4" style="margin-left: 70px">
<div class="form-group">
<label>RFC
<label style="color: red">*</label>
</label>
<asp:TextBox CssClass="form-control" vplaceholder="RFC" ID="TxtRFC" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVRFC" runat="server" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardar" ControlToValidate="TxtRFC" ValidationExpression="^[a-zA-Z.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
<ajax:ValidatorCalloutExtender ID="VCEREVRFC" runat="server" HighlightCssClass="vco" TargetControlID="REVRFC" Width="300px"></ajax:ValidatorCalloutExtender>
<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="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVRFC" Width="300px"></ajax:ValidatorCalloutExtender>
<span class="help-block" style="color: #45b6af;">RFC de la empresa</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4" style="margin-left: 70px">
<div class="form-group" id="FirstEmail">
<label>Correo Electrónico
<label style="color: red">*</label>
</label>
<div class="input-icon">
<i class="fa fa-envelope" aria-hidden="true"></i>
<asp:TextBox CssClass="form-control" CausesValidation="true" ID="TxtEmail" placeholder="E-Mail" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVContactoEmail" OnDataBinding="REVContactoEmail_Load" runat="server" Display="None" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtEmail" 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>
<asp:RequiredFieldValidator ID="RFVMail" runat="server" ControlToValidate="TxtEmail" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOIVA1" runat="server" HighlightCssClass="vco" TargetControlID="RFVMail" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOMail" runat="server" HighlightCssClass="vco" TargetControlID="REVContactoEmail" Width="300px"></ajax:ValidatorCalloutExtender>
<span id="helpMail" class="help-block" style="color: white;">El correo que ingresó es inválido</span>
</div>
</div>
</div>
<div class="col-md-4" style="margin-left: 70px">
<div class="form-group">
<label>Confirmar Correo
<label style="color: red">*</label>
</label>
<div class="input-icon">
<i class="fa fa-info-circle" aria-hidden="true"></i>
<asp:TextBox CssClass="form-control" CausesValidation="true" ID="TxtEmail2" placeholder="Confirmar E-Mail" runat="server"></asp:TextBox>
<asp:CompareValidator ID="cvEmail" runat="server"
ControlToValidate="TxtEmail2" ControlToCompare="TxtEmail"
Operator="Equal" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Los correos ingresados son diferentes" Style="display: none">
</asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOConfirma" runat="server" HighlightCssClass="vco" TargetControlID="cvEmail" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4" style="margin-left: 70px">
<div class="form-group">
<label>Método de pago
<label style="color: red">*</label></label>
<asp:DropDownList CausesValidation="true" CssClass="form-control input-large" ID="DdlMetodoPago" placeholder="Metodo de pago" runat="server">
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
<asp:ListItem Value="1" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="2" Text="Tarjeta"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:RequiredFieldValidator ID="rfv1" runat="server" InitialValue="-1" ControlToValidate="DdlMetodoPago" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Metodo de Pago''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar" />
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="rfv1" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<div class="col-sm-10" style="margin-top: 40px">
<asp:Button OnClick="btnGuardar_Click" ID="btnGuardar" ValidationGroup="GrpGuardar" Text="Registrar" runat="server" Style="float: right; margin-right: 35px;" CssClass="btn btn-primary" />
</div>
</div>
</div>
</div>
</div>
<!-- END FORM-->
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div runat="server" runat="server" style="display:none" id="DvFinalizado">
<h4>
¡Gracias! Se han enviado a su coreo una liga en donde se completara el registro de su empresa
</h4>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

148
Sistemas/Registro.aspx.vb Normal file
View File

@@ -0,0 +1,148 @@
Imports Extensiones
Imports System.Data
Imports System.IO
Partial Class Sistemas_Registro
Inherits Page
#Region "PROPIEDADES"
Private Property Nombre As String
Get
Nombre = ViewState("Nombre").ToString
End Get
Set(value As String)
ViewState("Nombre") = value
End Set
End Property
Private Property RFC As String
Get
RFC = ViewState("RFC").ToString
End Get
Set(value As String)
ViewState("RFC") = value
End Set
End Property
Private Property Email As String
Get
Email = ViewState("Email").ToString
End Get
Set(value As String)
ViewState("Email") = value
End Set
End Property
Private Property MetodoPago As String
Get
MetodoPago = ViewState("MetodoPago").ToString
End Get
Set(value As String)
ViewState("MetodoPago") = value
End Set
End Property
Private Property Liga As String
Get
Liga = ViewState("Liga").ToString
End Get
Set(value As String)
ViewState("Liga") = value
End Set
End Property
Private Property CveEmpresaTemp As Integer
Get
CveEmpresaTemp = ViewState("CveEmpresaTemp").ToString
End Get
Set(value As Integer)
ViewState("CveEmpresaTemp") = value
End Set
End Property
#End Region
Protected Sub btnGuardar_Click(sender As Object, e As EventArgs)
Dim objEmpresa As New ClsSisEmpresas()
Nombre = txtNombre.Text()
RFC = TxtRFC.Text()
Email = TxtEmail.Text()
MetodoPago = DdlMetodoPago.SelectedValue
Try
CveEmpresaTemp = objEmpresa.AddEmpresaTemp(Nombre, RFC, Email, MetodoPago.ToEntero)
If CveEmpresaTemp > 0 Then
Alert("Su solicitud ha sido enviada", TipoMensaje.MsgInformacion)
Liga = String.Format("sig.adsistemas.mx/Sistemas/WizardRegistro.aspx?CveEmpresaTemp={0}", Encripta(String.Format("{0}", CveEmpresaTemp)))
EnviaCorreo()
RegistraScript("$('#C_DivRegistro').css('display', 'none')")
RegistraScript("$('#C_DvFinalizado').css('display', '')")
UpRegistro.Update()
End If
Catch ex As Exception
Alert("La Empresa se guardó correctamente", TipoMensaje.MsgError)
End Try
End Sub
Protected Sub REVContactoEmail_Load(sender As Object, e As EventArgs)
RegistraScript("$('#FirstEmail').addClass('has-error');$('#helpMail').css('color', 'red')")
End Sub
Protected Sub EnviaCorreo()
Dim objMail As New ClsSisMail()
Dim body = GeneraCorreo(Nombre)
objMail.SendMail(ClsPaginas.EmpresaNotificaciones, Email, "Activación de empresa", body)
End Sub
Private Function GeneraCorreo(Nombre As String) As String
Dim strBody As New StringBuilder
strBody.Append("<!DOCTYPE html>")
strBody.Append("<html lang=""en""> ")
strBody.Append("<body class=""page-header-fixed page-quick-sidebar-over-content "">")
strBody.Append("<style>")
strBody.Append(".portlet {margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;}")
strBody.Append(".portlet > .portlet-title {border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;}")
strBody.Append(".portlet > .portlet-title {background-color: #cb5a5e;}")
strBody.Append(".portlet > .portlet-title > div {padding: 11px 0 9px 0;}")
strBody.Append(".portlet > .portlet-title > div {float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;}")
strBody.Append(".portlet > .portlet-body {background-color: #fff;padding: 10px;} ")
strBody.Append(".portlet > .portlet-body {clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;}")
strBody.Append(".mitablita td:nth-child(1){width: 100px; font-weight:700;}")
strBody.Append("a{ color: #666;padding: 3px 9px; line-height: 1.5;background-color: #fff;border: 1px solid #ccc; text-decoration: none;}a:hover{background-color: #ededed;}")
strBody.Append(".mitablita tr:nth-child(5) td{ text-align: right;}td{min-width:100px; }")
strBody.Append("</style>")
strBody.Append(" <div style=""Width:400px;"">")
strBody.Append(" <div class=""portlet box red"">")
strBody.Append(" <div class=""portlet-title"">")
strBody.Append(" <div class=""caption"">")
strBody.Append(" <i class=""fa fa-cart-plus""></i>Completar Registro")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append(" <div class=""portlet-body "">")
strBody.Append(" <table class=""mitablita"">")
strBody.Append(" <tr>")
strBody.Append(" <td>Fecha</td>")
strBody.Append(" <td>")
strBody.Append(DateTime.Now.ToString("dd/MM/yy"))
strBody.Append("</td> </tr>")
strBody.Append(" <tr>")
strBody.AppendFormat(" <td>Buen día, {0} </td>", Nombre)
strBody.Append(" <td>")
strBody.Append("</td> </tr>")
strBody.Append(" <tr>")
strBody.Append(" <td>Para continuar con el proceso de registro y activación, por favor haga click en la siguiente liga: </td>")
strBody.Append("<tr><td colspan=""4"" >")
'strBody.Append(Liga)
strBody.AppendFormat("{0}</td></tr>", Liga)
strBody.Append(" </table>")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append("</body>")
strBody.Append("</html>")
Return strBody.ToString
End Function
End Class

View File

@@ -0,0 +1,234 @@
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RegistroEmpresa.aspx.vb" Inherits="Sistemas_RegistroEmpresa" %>
<%@ Import Namespace="System.Web.Optimization" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<title>SIG | Sistema de Información Gerencial</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta content="" name="description" />
<meta content="" name="author" />
<!-- BEGIN STYLES -->
<%: Scripts.Render("~/bundles/modernizr") %>
<%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
<%: Styles.Render("~/Metronic/assets/global/css/css") %>
<!-- BEGIN THEME STYLES -->
<link href="/Metronic/assets/admin/layout/css/themes/darkblue.css" rel="stylesheet" type="text/css" id="style_color" />
<link href="/Metronic/assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css" />
<link href="/Metronic/assets/admin/layout4/css/profile.css" rel="stylesheet" type="text/css" />
<!-- END THEME STYLES -->
<link rel="shortcut icon" href="/Imagenes/favicon.ico" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="TSM" runat="server" EnableHistory="true" EnableSecureHistoryState="true" ScriptMode="Release" EnableScriptGlobalization="true" AsyncPostBackTimeout="600">
<Scripts>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="respond" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%>
<asp:ScriptReference Path="~/Scripts/AjaxControlToolkit/Bundle" />
</Scripts>
</asp:ScriptManager>
<%: Scripts.Render("~/bundles/scripts") %>
<%: Scripts.Render("~/Metronic/assets/global/scripts/JS") %>
<div class="page-container" runat="server" id="divpagecontainer">
<div class="page-content">
<div class="row">
<div class="col-md-12">
<h1 runat="server" id="h1" style="text-align: center">Registra tu empresa</h1>
</div>
</div>
<br />
<div class="profile-content">
<div id="DivRegistro" runat="server">
<div class="col-md-7">
<div class="portlet light portlet-fit portlet-form">
<div class="portlet-body">
<div class="form-body">
<h3 style="text-align: center">Tenga el control de su empresa con una sola herramienta</h3>
<div class="row">
<div class="col-md-12">
<center>
<img id="imagen" style="max-width: 600px !important; max-height:400px !important; margin-left:40px;margin-bottom:40px; margin-right:40px;margin-top:40px;" />
</center>
</div>
</div>
</div>
</div>
</div>
</div>
<asp:UpdatePanel runat="server" ID="UpRegistro" UpdateMode="Conditional">
<ContentTemplate>
<div class="col-md-5">
<div class="portlet light portlet-fit portlet-form bordered" style="min-height: 300px" id="form_wizard_1">
<div class="portlet-body">
<div class="form-body">
<div class="row">
<div class="col-md-10" style="margin-left: 45px; margin-right: 40px;">
<div class="form-group">
<label>
Nombre
<label style="color: red">*</label>
</label>
<div class="input-icon">
<i class="fa fa-user" aria-hidden="true"></i>
<asp:TextBox CssClass="form-control" CausesValidation="true" placeholder="EMPRESA" Style="text-transform: uppercase" ID="txtNombre" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVNombre" runat="server" ControlToValidate="txtNombre" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombre" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<span class="help-block" style="color: #45b6af;">Nombre o Razón Social de la empresa</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10" style="margin-left: 45px; margin-right: 40px;">
<div class="form-group">
<label>
RFC
<label style="color: red">*</label>
</label>
<asp:TextBox CssClass="form-control" vplaceholder="RFC" MaxLength="13" ID="TxtRFC" runat="server" Style="text-transform: uppercase"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVRFC" runat="server" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardar" ControlToValidate="TxtRFC" ValidationExpression="^[a-zA-Z.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
<ajax:ValidatorCalloutExtender ID="VCEREVRFC" runat="server" HighlightCssClass="vco" TargetControlID="REVRFC" Width="300px"></ajax:ValidatorCalloutExtender>
<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="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVRFC" Width="300px"></ajax:ValidatorCalloutExtender>
<span class="help-block" style="color: #45b6af;">RFC de la empresa</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10" style="margin-left: 45px; margin-right: 40px;">
<div class="form-group" id="FirstEmail">
<label>
Correo Electrónico
<label style="color: red">*</label>
</label>
<div class="input-icon">
<i class="fa fa-envelope" aria-hidden="true"></i>
<asp:TextBox CssClass="form-control" CausesValidation="true" Style="text-transform: lowercase" ID="TxtEmail" placeholder="E-Mail" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVContactoEmail" OnDataBinding="REVContactoEmail_Load" runat="server" Display="None" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtEmail" 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>
<asp:RequiredFieldValidator ID="RFVMail" runat="server" ControlToValidate="TxtEmail" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOIVA1" runat="server" HighlightCssClass="vco" TargetControlID="RFVMail" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOMail" runat="server" HighlightCssClass="vco" TargetControlID="REVContactoEmail" Width="300px"></ajax:ValidatorCalloutExtender>
<span id="helpMail" class="help-block" style="color: white;">El correo que ingresó es inválido</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10" style="margin-left: 45px; margin-right: 40px;">
<div class="form-group">
<label>
Confirmar Correo
<label style="color: red">*</label>
</label>
<div class="input-icon">
<i class="fa fa-info-circle" aria-hidden="true"></i>
<asp:TextBox CssClass="form-control" CausesValidation="true" ID="TxtEmail2" Style="text-transform: lowercase" placeholder="Confirmar E-Mail" runat="server"></asp:TextBox>
<asp:CompareValidator ID="cvEmail" runat="server"
ControlToValidate="TxtEmail2" ControlToCompare="TxtEmail"
Operator="Equal" ValidationGroup="GrpGuardar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />Los correos ingresados son diferentes" Style="display: none">
</asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOConfirma" runat="server" HighlightCssClass="vco" TargetControlID="cvEmail" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10" style="margin-left: 45px; margin-right: 40px;">
<div class="form-group">
<label>Método de pago
<label style="color: red">*</label>
</label>
<asp:DropDownList CausesValidation="true" CssClass="form-control input-sm select2me" ID="DdlMetodoPago" placeholder="Metodo de pago" runat="server">
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
<asp:ListItem Value="1" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="2" Text="Tarjeta"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:RequiredFieldValidator ID="rfv1" runat="server" InitialValue="-1" ControlToValidate="DdlMetodoPago" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Metodo de Pago''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar" />
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="rfv1" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row">
<div class="col-md-10" style="margin-left: 45px; margin-right: 40px;">
<div class="form-group" style="align-self: flex-end; text-align:center;" >
<asp:Button ID="BtnGuardar" OnClick="BtnGuardar_Click" ValidationGroup="GrpGuardar" Text="Registrar Empresa" runat="server" CssClass="btn btn-primary" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div runat="server" style="display: none" id="DvFinalizado">
<h4>¡Gracias! Se han enviado a su correo una liga en donde se completara el registro de su empresa</h4>
</div>
</div>
</div>
<script type="text/javascript">
//ARREGLO CON IMAGENES
var imagenes = new Array(
'http://sig.adsistemas.mx/Imagenes/PresentacionSIG1.png',
'http://sig.adsistemas.mx/Imagenes/PresentacionSIG2.png',
'http://sig.adsistemas.mx/Imagenes/PresentacionSIG3.png',
'http://sig.adsistemas.mx/Imagenes/PresentacionSIG4.png',
'http://sig.adsistemas.mx/Imagenes/PresentacionSIG5.png',
'http://sig.adsistemas.mx/Imagenes/PresentacionSIG6.png',
'http://sig.adsistemas.mx/Imagenes/PresentacionSIG7.png'
);
// FUNCION PARA MOSTRAR IMAGENES
function rotarImagenes() {
//AGARRAMOS IMAGEN ALEATORIAMENTE
var index = Math.floor((Math.random() * imagenes.length));
//CAMBIAMOS IMAGEN
document.getElementById("imagen").src = imagenes[index];
}
onload = function () {
rotarImagenes();
setInterval(rotarImagenes, 2000);
}
</script>
</form>
</body>
</html>

View File

@@ -0,0 +1,174 @@
Option Strict On
Option Explicit On
Imports Extensiones
Partial Class Sistemas_RegistroEmpresa
Inherits Page
#Region "PROPIEDADES"
Private Property Nombre As String
Get
Nombre = ViewState("Nombre").ToString
End Get
Set(value As String)
ViewState("Nombre") = value
End Set
End Property
Private Property RFC As String
Get
RFC = ViewState("RFC").ToString
End Get
Set(value As String)
ViewState("RFC") = value
End Set
End Property
Private Property Email As String
Get
Email = ViewState("Email").ToString
End Get
Set(value As String)
ViewState("Email") = value
End Set
End Property
Private Property MetodoPago As String
Get
MetodoPago = ViewState("MetodoPago").ToString
End Get
Set(value As String)
ViewState("MetodoPago") = value
End Set
End Property
Private Property Liga As String
Get
Liga = ViewState("Liga").ToString
End Get
Set(value As String)
ViewState("Liga") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim thisURL As String = Request.Url.Segments(Request.Url.Segments.Count - 1)
RegistraScript("$('#mBody').addClass('page-sidebar-closed')")
RegistraScript("$('#divMenu').css('display','none')")
End If
End Sub
#Region " GUARDAR "
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
Nombre = txtNombre.Text.ToUpper()
RFC = TxtRFC.Text.ToUpper()
Email = TxtEmail.Text
MetodoPago = DdlMetodoPago.SelectedValue
Dim objEmpresa As New ClsSisEmpresas()
Try
If objEmpresa.AddEmpresa(-1, Nombre, "", "", "", "", "", "", RFC, 0, "", "", Email, "CFDi", "", "", "", "", "", "", "", 100, False, False, False, "", False, "", "", "", 0, False,
False, False, False, False, False, False, False, False, False, "", "", "", "", "", "", 0, False, "", "", "", "", "", 0, False, "", "", "", 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, "", "", -1,
0.0D, "", 0, False, 0.0D, "", "", 0, False, 0, 0, False, 0, 0, False, 0, CveMetodoPago:=MetodoPago.ToEntero) Then
Alert("Su solicitud ha sido procesada correctamente, en breve recibira un correo para completar el registro.", TipoMensaje.MsgInformacion)
Liga = String.Format("sig.adsistemas.mx/Sistemas/WizardRegistro.aspx?P={0}", Encripta(String.Format("CveEmpresa={0}", objEmpresa.CveEmpresa)))
EnviaCorreo()
RegistraScript("$('#C_DivRegistro').css('display', 'none')")
RegistraScript("$('#C_DvFinalizado').css('display', '')")
UpRegistro.Update()
Else
Alert("OCurrió un error al guardar la empresa", TipoMensaje.MsgError)
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar la emrpresa desde registro basico.", ex)
Finally
objEmpresa.Dispose()
End Try
End Sub
#End Region
#Region " ENVIAR CORREO "
Protected Sub REVContactoEmail_Load(sender As Object, e As EventArgs)
RegistraScript("$('#FirstEmail').addClass('has-error');$('#helpMail').css('color', 'red')")
End Sub
Protected Sub EnviaCorreo()
Dim objMail As New ClsSisMail()
Dim body = GeneraCorreo(Nombre)
objMail.SendMail(ClsPaginas.EmpresaNotificaciones, Email, "Activación de empresa", body, "")
End Sub
Private Function GeneraCorreo(Nombre As String) As String
Dim strBody As New StringBuilder
strBody.Append("<!DOCTYPE html>")
strBody.Append("<html lang=""en""> ")
strBody.Append("<body class=""page-header-fixed page-quick-sidebar-over-content "">")
strBody.Append("<style>")
strBody.Append(".portlet {margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;}")
strBody.Append(".portlet > div {font-family: Helvetica, sans-serif;}")
strBody.Append(".portlet > .portlet-title {border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;}")
strBody.Append(".portlet > .portlet-title {background-color: #cb5a5e;}")
strBody.Append(".portlet > .portlet-title > div {padding: 11px 0 9px 0;}")
strBody.Append(".portlet > .portlet-title > div {float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;}")
strBody.Append(".portlet > .portlet-body {background-color: #fff;padding: 10px;} ")
strBody.Append(".portlet > .portlet-body {clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;}")
strBody.Append(".mitablita td:nth-child(1){width: 100px; font-weight:700;}")
strBody.Append("a{ color: #666;padding: 3px 9px; line-height: 1.5;background-color: #fff;border: 1px solid #ccc; text-decoration: none;}a:hover{background-color: #ededed;}")
strBody.Append(".mitablita tr:nth-child(5) td{ text-align: right;}td{min-width:100px; }")
strBody.Append("</style>")
strBody.Append(" <div style=""Width:100%;"">")
strBody.Append("<div style='text-align:center; font-family: Helvetica, sans-serif;'><table><tr><td style='text-align:center'> <h1> <img src='http://sig.adsistemas.mx/Imagenes/LogoSinFondo.png' width='46' height='61'/> AD Sistemas Soluciones en TI</h1> </td></tr></table> </div> ")
strBody.Append(" <div class=""portlet box red "" style=""margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;"">")
strBody.Append(" <div class=""portlet-title"" style="" font-family: Helvetica, sans-serif; background-color: #cb5a5e;border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;"">")
strBody.Append(" <div class=""caption"" style=""padding: 11px 0 9px 0;float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;"">")
strBody.Append(" <i class=""fa fa-cart-plus""></i>Completar Registro")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append(" <div class=""portlet-body "" style=""font-family: Helvetica, sans-serif; clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;background-color: #fff;padding: 10px;"" >")
strBody.Append(" <table class=""mitablita"" style=""font-family: Helvetica, sans-serif;"">")
strBody.Append(" <tr>")
strBody.Append(" <td>Fecha: ")
strBody.Append(DateTime.Now.ToString("dd/MM/yy"))
strBody.Append(" </td> <td>")
strBody.Append("</td> </tr>")
strBody.Append(" <tr>")
strBody.AppendFormat(" <td><b>{0}<br/></b> <br/> </td>", Nombre)
strBody.Append(" <td>")
strBody.Append("</td> </tr>")
strBody.Append(" <tr></tr> ")
strBody.Append(" <tr>")
strBody.Append(" <td>Para continuar con el proceso de registro y activación, por favor haga click en la siguiente liga: </td>")
strBody.Append("<tr><td colspan=""4"" >")
strBody.AppendFormat("<a href='{0}'>Continuar </a> <br/> <br/> </td></tr>", Liga)
strBody.Append("<tr> <td> Le recomendamos tener la siguiente información a la mano: </td> </tr>")
strBody.Append("<tr> <td> ")
strBody.Append("<ul>")
strBody.Append("<li>Datos Fiscales (Direccion, Contacto, Regimen, Certificados digitales, etc. ) </li> ")
strBody.Append("<li> Roles/Puestos, Permisos y Usuarios que usaran el SIG )</li> ")
strBody.Append("<li>Correos para envío de notificaciones y Para recepción de facturas (si no cuenta con un correo, se le proporcionará uno)</li> ")
strBody.Append("<li>Formatos de factura, plantillas de correo y logo </li> ")
strBody.Append("<li>Clasificaciones contables, Productos / Servicios y las unidades de medida de éstos</li> ")
strBody.Append("<li>Almacenes que se utilizand, y el método de salida de inventario</li> ")
strBody.Append("<li>Proveedores, clientes y proyectos de la empresa</li> ")
strBody.Append("</ul>")
strBody.Append(" </td> </tr>")
strBody.Append(" </table>")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append(" </div>")
strBody.Append("</body>")
strBody.Append("</html>")
Return strBody.ToString
End Function
#End Region
End Class

255
Sistemas/RolesDetalle.aspx Normal file
View File

@@ -0,0 +1,255 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RolesDetalle.aspx.vb" Inherits="Sistemas_RolesDetalle" %>
<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">
Rol:
<asp:Label runat="server" Text="Rol" ID="LblRol"></asp:Label>
</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 UpdateMode="Conditional" runat="server" ID="UpDatos">
<ContentTemplate>
<ajax:TabContainer runat="server" ID="TabsRoles">
<ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Rol">
<ContentTemplate>
<asp:UpdatePanel ID="UpTabGeneral" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">General</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModulo" runat="server" Width="50%" CssClass="select2me form-control" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Modulo" DataValueField="CveModulo" ValidationGroup="GrpObligatorio"></asp:DropDownList>
<label for="<%= DdlModulo.ClientID.ToString()%>">Modulo Rol:</label>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRol" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRol" runat="server" ControlToValidate="TxtRol" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>'Nombre del Rol''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<%-- <ajax:ValidatorCalloutExtender ID="VCEEmpresa" runat="server" HighlightCssClass="vco" TargetControlID="RFVRol" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<label for="<%= TxtRol.ClientID.ToString()%>">Nombre Rol:</label>
</div>
<div class="form-group form-md-line-input input-iconright" id="LblFechaAlta" runat="server">
<label for="<%= TxtFecha.ClientID.ToString()%>">Fecha Alta:</label>
<asp:Label ID="TxtFecha" runat="server"></asp:Label>
</div>
<div class="form-group form-md-line-input input-iconright" id="LblUsuarioAlta" runat="server">
<label for="<%= TxtUsuarioAlta.ClientID.ToString()%>">Usuario Alta:</label>
<asp:Label ID="TxtUsuarioAlta" runat="server"></asp:Label>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPanelProcesos" runat="server" HeaderText="Procesos">
<ContentTemplate>
<asp:UpdatePanel ID="UPPAltaProcesos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Procesos</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body">
<div class="row" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvProcesos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvProcesos.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<br />
<div class="row">
<div>
<asp:GridView ID="GvProcesos" runat="server" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" AutoGenerateColumns="False" Width="100%" DataKeyNames="CveRol,CveModulo,CveProceso" GridLines="None">
<Columns>
<asp:BoundField DataField="Modulo" HeaderText="Módulo">
<ControlStyle Width="150px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Descripcion" HeaderText="Proceso">
<ControlStyle Width="250px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<HeaderTemplate><span title="Permitir">P</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkP"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPanelPermisos" runat="server" HeaderText="Módulos">
<ContentTemplate>
<asp:UpdatePanel ID="UPPAltaRep" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Módulos</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body">
<div class="row" align="right">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvPermisos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvPermisos.ClientID) %>" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<br />
<div class="row">
<div>
<asp:GridView ID="GvPermisos" runat="server" CssClass="table table-striped table-hover Widthall ScrollAD" data-sort="true" AutoGenerateColumns="False" Width="100%" DataKeyNames="CveRol,CveModulo" GridLines="None">
<Columns>
<asp:BoundField DataField="Padres" HeaderText="Módulo Padre">
<ControlStyle Width="175px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Modulo" HeaderText="Módulo">
<ControlStyle Width="175px" />
<ItemStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField>
<HeaderTemplate><span title="Permitir">P</span></HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="ChkP"></asp:CheckBox>
</ItemTemplate>
<ControlStyle Width="25px" />
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" Height="15px"></HeaderStyle>
</asp:GridView>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabPanelIndicadores" runat="server" HeaderText="Indicadores">
<ContentTemplate>
<asp:UpdatePanel ID="UpIndicadores" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered ">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Indicadores</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body">
<asp:GridView ID="GvIndicadores" DataKeyNames="CveIndicador, CveRol" data-sort="true" CssClass="table table-striped table-hover Widthall ScrollAD" DataKey="CveIndicador" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no se Indicadores" runat="server">
<Columns>
<asp:BoundField DataField="Indicador" HeaderText="Indicador" />
<asp:TemplateField HeaderText="Aplica" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkIndicador" Checked="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<br />
<table width="100%">
<tr>
<td align="center">
<asp:Button runat="server" ID="BtnGuardar" Text="Guardar" CssClass="btn btn-primary" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,238 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Drawing
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Sistemas_RolesDetalle
Inherits ClsPaginas
#Region "Propiedades"
Private Property CveRol As Integer
Get
CveRol = ViewState("CveRol").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveRol") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CveRol = If(Request("CveRol") <> "", Request("CveRol").ToString.ToEntero, "-1".ToEntero)
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
CargaGridIndicadores()
CargaGridPermisos()
CargaGridProcesos()
DdlModulo.DataSource = GlobalDTModulos()
DdlModulo.DataBind()
If CveRol <> -1 Then
Dim DTRoles As New DataTable
Dim Objeto As New ClsSisRoles
If Objeto.GetRoles(CveRol, UsuarioActual.CveEmpresa) Then
DTRoles = Objeto.DtResultados
If DTRoles.Rows.Count > 0 Then
LblRol.Text = DTRoles.FiltroPrimeroValor("Rol")
TxtRol.Text = DTRoles.FiltroPrimeroValor("Rol")
TxtFecha.Text = DTRoles.FiltroPrimeroValor("FechaIng").ToDate.ToShortDateString
TxtUsuarioAlta.Text = DTRoles.FiltroPrimeroValor("Nombre")
DdlModulo.SelectedValueExist(DTRoles.FiltroPrimeroValor("CveModulo").ToEntero)
Else
Dim Liga = $"document.location.href=""/Sistemas/CatRoles.aspx"";"
Alert("El Rol solicitado no existe.", TipoMensaje.MsgAdvertencia, Liga)
End If
Objeto.Dispose()
End If
Else
LblFechaAlta.Visible = False
LblUsuarioAlta.Visible = False
End If
End Sub
#Region "I N D I C A D O R E S"
Private Sub CargaGridIndicadores()
Dim Objeto As New ClsIndicadores
If Objeto.GetRolesIndicadores(CveRol) Then
GvIndicadores.DataSource = Objeto.DtResultados
End If
GvIndicadores.DataBind()
UpDatos.Update()
Objeto.Dispose()
End Sub
Private Sub GvIndicadores_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvIndicadores.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveRol").ToString.ToEntero = CveRol Then
e.Row.FCCheckBox("chkIndicador").Checked = True
End If
End If
End Sub
#End Region
#Region "P E R M I S O S"
Protected Sub GvPermisos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPermisos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then e.Row.FCCheckBox("ChkP").Checked = True
End If
End Sub
Private Sub CargaGridPermisos()
Dim ObjPermisos As New ClsSisRoles()
If ObjPermisos.GetRolesModulos(CveRol, -1) Then
GvPermisos.DataSource = ObjPermisos.DtResultados.FiltraParametros("AGRUPACION ='N'")
Else
GvPermisos.DataSource = Nothing
End If
ObjPermisos.Dispose()
GvPermisos.DataBind()
End Sub
#End Region
#Region "P R O C E S O S"
Private Sub CargaGridProcesos()
Dim ObjPermisos As New ClsSisRoles()
If ObjPermisos.GetRolesProcesos(CveRol, -1) Then
GvProcesos.DataSource = ObjPermisos.DtResultados
Else
GvProcesos.DataSource = Nothing
End If
ObjPermisos.Dispose()
GvProcesos.DataBind()
End Sub
Protected Sub GvProcesos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvProcesos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DBCampo("CveModuloAcceso")) <> "" Then
e.Row.Cells(0).CssClass = "bg-yellow"
End If
If (e.Row.DBCampo("CveProcesoAcceso")) <> "" Then e.Row.FCCheckBox("ChkP").Checked = True
End If
End Sub
#End Region
Private Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim ObjEmpresa As New ClsSisEmpresas
Dim ObjIndicador As New ClsIndicadores(ObjEmpresa.IniciaTransacSQL())
Dim Roles As New ClsSisRoles(ObjEmpresa.IniciaTransacSQL())
Dim TieneError As Boolean = False
If CveRol <> -1 Then
If TxtRol.Text <> LblRol.Text And CveRol <> -1 Then
If Not Roles.UpdateRol(DdlModulo.SelectedValue.ToEntero, TxtRol.Text, UsuarioActual.CveUsuario, CveRol) Then
TieneError = True
Exit Sub
End If
End If
'Agregar Indicadores
For Each Row As GridViewRow In GvIndicadores.Rows
If Row.DataKey("CveIndicador") <> "" AndAlso Row.DataKey("CveRol") <> "" And Row.FCCheckBox("chkIndicador").Checked = False Then
If Not ObjIndicador.RemoveIndicadoresRoles(Row.DataKey("CveIndicador").ToEntero, CveRol) Then
TieneError = True
Exit For
End If
End If
If Row.DataKey("CveIndicador") <> "" AndAlso Row.DataKey("CveRol") = "" Then
If Row.FCCheckBox("chkIndicador").Checked Then
If Not ObjIndicador.AddIndicadoresRoles(Row.DataKey("CveIndicador").ToEntero, CveRol) Then
TieneError = True
Exit For
End If
End If
End If
Next
For Each Row As GridViewRow In GvPermisos.Rows
If Not Roles.UpdateRolesModulos(Row.DataKey("CveRol").ToEntero, Row.DataKey("CveModulo").ToEntero, If(Row.FCCheckBox("ChkP").Checked, 1, 0), UsuarioActual.CveUsuario) Then
TieneError = True
Exit For
End If
Next
For Each Row As GridViewRow In GvProcesos.Rows
If Not Roles.UpdateRolesProcesos(Row.DataKey("CveRol").ToEntero, Row.DataKey("CveProceso").ToEntero, If(Row.FCCheckBox("ChkP").Checked, 1, 0), UsuarioActual.CveUsuario) Then
TieneError = True
Exit For
End If
Next
ElseIf CveRol = -1 Then
If Not Roles.AddRol(DdlModulo.SelectedValue.ToEntero, TxtRol.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TieneError = True
End If
CveRol = Roles.CveRol
For Each Row As GridViewRow In GvIndicadores.Rows
If Row.DataKey("CveIndicador") <> "" AndAlso Row.DataKey("CveRol") = "" Then
If Row.FCCheckBox("chkIndicador").Checked Then
If Not ObjIndicador.AddIndicadoresRoles(Row.DataKey("CveIndicador").ToEntero, CveRol) Then
TieneError = True
Exit For
End If
End If
End If
Next
For Each Row As GridViewRow In GvPermisos.Rows
If Not Roles.UpdateRolesModulos(CveRol, Row.DataKey("CveModulo").ToEntero, If(Row.FCCheckBox("ChkP").Checked, 1, 0), UsuarioActual.CveUsuario) Then
TieneError = True
Exit For
End If
Next
For Each Row As GridViewRow In GvProcesos.Rows
If Not Roles.UpdateRolesProcesos(CveRol, Row.DataKey("CveProceso").ToEntero, If(Row.FCCheckBox("ChkP").Checked, 1, 0), UsuarioActual.CveUsuario) Then
TieneError = True
Exit For
End If
Next
End If
If TieneError = False Then
Dim Liga = $"document.location.href=""/Sistemas/CatRoles.aspx"";"
Alert("Se han guardado los cambios correctamente.", TipoMensaje.MsgInformacion, Liga)
ObjEmpresa.Commit()
Else
Alert("Ha ocurrido un problema, no se han guardado los cambios.", TipoMensaje.MsgError)
ObjEmpresa.RollBack()
End If
ObjEmpresa.Dispose()
End Sub
End Class

View File

@@ -0,0 +1,123 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SessionesActivas.aspx.vb" Inherits="SessionesActivas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.trnopadding td {
background-color: #ddd;
}
.trnopadding {
visibility: visible !important;
}
.GVDatos tr th {
text-align: left;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
</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:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server" ID="Updatos" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet light smmallpadding bordered" id="portlet19">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Filtros</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
<div class="actions">
<asp:LinkButton ID="LnkFiltrar" OnClick="LnkFiltrar_Click" CssClass="btn btn-default btn-sm" runat="server">Filtrar</asp:LinkButton>
</div>
</div>
<div class="portlet-body ">
<asp:ListBox ID="DdlEmpresa" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;"
DataTextField="Empresa" DataValueField="CveEmpresa" runat="server"></asp:ListBox>
</div>
</div>
<asp:GridView ID="GVDatos" OnRowDataBound="GVDatos_RowDataBound" runat="server" DataKeyNames="CveUsuario,CveEmpresa" AutoGenerateColumns="false" GridLines="none"
CssClass="table table-striped ScrollAD SearchAD GVDatos table-hover Widthall" CellSpacing="0" ShowHeaderWhenEmpty="true">
<Columns>
<asp:TemplateField HeaderText="Usuario">
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Rol">
<ItemTemplate>
<asp:Literal ID="LtlRol" runat="server" Text='<%# Eval("Rol")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empresa">
<ItemTemplate>
<asp:Literal ID="LtlEmpresa" runat="server" Text='<%# Eval("Empresa")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Login">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaSLogin")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IP">
<ItemTemplate>
<asp:Literal ID="LtlRemoteIpAddres" runat="server" Text='<%# Eval("RemoteIpAddres")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LnkEnviarMensaje" OnClick="LnkEnviarMensaje_Click" CssClass="btn btn-circle btn-sm blue" runat="server" Text="<i class='fa fa-comments-o'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Eliminar sección" ID="LnkQuitar" OnClick="LnkQuitar_Click" CssClass="btn btn-circle btn-sm red" runat="server" Text="<i class='fa fa-close'></i>"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivMensaje" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpEnEspera" class="modal-dialog" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<asp:UpdatePanel runat="server" class="modal-btn">
<ContentTemplate>
<asp:LinkButton ID="LnkEnviar" OnClick="LnkEnviar_Click" Text="Enviar" runat="server" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
<h4 class="modal-title">EnviarMensaje</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-4">
Mensaje
</div>
<div class="col-md-8">
<asp:TextBox ID="TxtMensaje" TextMode="MultiLine" CssClass="form-control input-sm" runat="server" Rows="4"></asp:TextBox>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,109 @@

Imports System.Data
Imports Extensiones
Partial Class SessionesActivas
Inherits System.Web.UI.Page
Private Property RCveUsuario As String
Get
Return ViewState("RCveUsuario").ToString
End Get
Set(value As String)
ViewState("RCveUsuario") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim listacve As New List(Of String)
listacve.Add("1815")
Notificaciones.AlertaVentana("notificacion", listacve, timeoutseconds:=0)
RCveUsuario = "0"
ClsSisNotificaciones.SendNotificacionERP(100, "Titulo", "Hola Mundo", 1)
CargaDatos("")
End If
End Sub
Private Sub CargaDatos(filtros As String)
Dim objUsuarios As New ClsSisUsuarios
objUsuarios.GetUsuarios(-1, -1, -1)
Dim dtU As DataTable = objUsuarios.DtResultados
dtU.Columns.Add("FechaSLogin", System.Type.GetType("System.DateTime"))
dtU.Columns.Add("RemoteIpAddres", System.Type.GetType("System.String"))
Dim dtF As DataTable = dtU.Clone
Dim objlist As List(Of ADSSession.ADSSessionObj) = ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.getListasession)
For Each user As ADSSession.ADSSessionObj In objlist
Dim row As DataRow = dtU.FiltroPrimero($"CveUsuario={user.CveUsuario} AND CveEmpresa={user.CveEmpresa}")
If Not IsNothing(row) Then
row("FechaSLogin") = user.FechaLogin
row("RemoteIpAddres") = user.IpAddres
dtF.Rows.Add(row.ItemArray())
End If
Next
dtU.Dispose()
Dim GroupBy1 As String() = {"CveEmpresa", "Empresa"}
DdlEmpresa.DataSource = dtF.FiltraParametros("", "", {"CveEmpresa", "Empresa"})
DdlEmpresa.DataBind()
dtF = dtF.GroupByDT(filtros, "", {GroupBy1}, Nothing, Nothing,)
GVDatos.DataSource = dtF
GVDatos.DataBind()
objUsuarios.Dispose()
End Sub
Protected Sub GVDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim CveUsuario As Integer = e.Row.DataKey("CveUsuario").ToEntero()
If CveUsuario > 0 Then
Else
e.Row.Cells(0).Visible = False
e.Row.Cells(1).Visible = False
e.Row.Cells(3).Visible = False
e.Row.Cells(2).Attributes.Add("colspan", "4")
e.Row.CssClass = "Titulos"
e.Row.FCLinkButton("LnkEnviarMensaje").Visible = False
End If
' Dim info As ADSSession.GlobalSessionInfo = ADSSession.MySessionInfo.GlobalSessions.FirstOrDefault(Function(M) M.CveUsuario = e.Row.DataKey("CveUsuario").ToEntero() AndAlso M.CveEmpresa = e.Row.DataKey("CveEmpresa").ToEntero())
' If IsNothing(info) Then
' e.Row.Visible = False
' End If
End If
End Sub
Protected Sub LnkFiltrar_Click(sender As Object, e As EventArgs)
Dim filtrosbuilder As New StringBuilder
Dim Prefix As String = ""
Dim idEmpresas As String = DdlEmpresa.GetSelectedValues("'", "'")
If idEmpresas.Length > 0 Then
filtrosbuilder.Append(String.Format("{1} CveEmpresa IN({0})", idEmpresas, Prefix))
Prefix = " AND "
End If
CargaDatos(filtrosbuilder.ToString())
End Sub
Protected Sub LnkQuitar_Click(sender As Object, e As EventArgs)
'Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
'ADSSession.MySessionInfo.GlobalSessions.RemoveAll(Function(M) M.CveUsuario = gvRow.DataKey("CveUsuario").ToEntero())
'CargaDatos()
End Sub
Protected Sub LnkEnviarMensaje_Click(sender As Object, e As EventArgs)
Dim gvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
RCveUsuario = gvRow.DataKey("CveUsuario")
RegistraScript("$(""#DivMensaje"").modal();")
End Sub
Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs)
Dim lista As New List(Of String)
lista.Add(RCveUsuario)
'Notificaciones.AlertaVentana(TxtMensaje.Text, lista)
Notificaciones.AlertaVentana(TxtMensaje.Text, lista, timeoutseconds:=0)
RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')")
End Sub
End Class

2922
Sistemas/UsuarioDetalle.aspx Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

183
Sistemas/Usuarios.aspx Normal file
View File

@@ -0,0 +1,183 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Usuarios.aspx.vb" Inherits="Sistemas_Usuarios" %>
<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 Usuarios
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="LBAdd" OnClick="LBAdd_Click" PostBackUrl="UsuarioDetalle.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Agregar</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" 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">
<li>Empresa:
<asp:DropDownList ID="DdlEmpresa" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 400px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="consultar" runat="server" Text="Consultar" OnClick="consultar_Click" class="btn btn-primary" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="SubTotales">
<td>Empresa:
<asp:DropDownList ID="DdlEmpresa" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa" Class="form-control input-sm select2me " Style="width: 400px !important;" ValidationGroup="GrpGuardar">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:Button ID="consultar" runat="server" Text="Consultar" OnClick="consultar_Click" class="btn btn-primary" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="text-right">
<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" AutoGenerateColumns="False" EmptyDataText="No se Encontró Usuarios Registrado" ToolTip="Listado de Usuarios" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LBUsuario" runat="server" CssClass="Texto" Text='<%# Eval("Usuario") %>' PostBackUrl="UsuarioDetalle.aspx" CommandArgument='<%# Eval("CveUsuario") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="LbNombre" runat="server" CausesValidation="false" Text="" CommandArgument="Nombre" OnClick="LbOrden_Click">
Nombre
<asp:Literal ID="ImgNombre" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="LbRol" runat="server" CausesValidation="false" Text="" CommandArgument="Rol" OnClick="LbOrden_Click">
Rol
<asp:Literal ID="ImgRol" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlRol" runat="server" Text='<%# Eval("Rol", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<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>
</HeaderTemplate>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:TemplateField ItemStyle-Width="250px">
<ItemTemplate>
<asp:Literal ID="LtlEmoresa" runat="server" Text='<%# Eval("Empresa") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estado" OnClick="LbOrden_Click">
Estado
<asp:Literal ID="ImgEstado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estado") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<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>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:dd/MM/yy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<asp:LinkButton ID="LbUsuarioCreo" runat="server" CausesValidation="false" Text="" CommandArgument="UsuarioCreo" OnClick="LbOrden_Click">
Registró
<asp:Literal ID="ImgUsuarioCreo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LtllUsuarioCreo" runat="server" Text='<%# Eval("UsuarioCreo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<%-- <RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
</asp:GridView>
<asp:HiddenField ID="HdnCveUsuario" ClientIDMode="Static" runat="server" Value="-1" />
</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 Usuario?');
}
function AsignaPermisos(Rol) {
$get("LblUsrEdit").innerText = Rol;
$("#DivPermisos").show();
$("#DivPermisos").center();
}
function AsignaProcesos(Rol) {
$get("LblProcesoEdit").innerText = Rol;
$("#DivProcesos").show();
$("#DivProcesos").center();
}
$(function () {
$("#DivPermisos").draggable();
});
</script>
</asp:Content>

177
Sistemas/Usuarios.aspx.vb Normal file
View File

@@ -0,0 +1,177 @@
Imports System.Data
Imports System.Drawing
Imports Extensiones
Partial Class Sistemas_Usuarios
Inherits ClsPaginas
Public ReadOnly Property CurrentUsuario() As Integer
Get
Return HdnCveUsuario.Value.ToEntero
End Get
End Property
Public Property DtUsuarios As DataTable
Get
Return CType(ViewState("DtUsuarios"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtUsuarios") = value
End Set
End Property
#Region "Permisos"
Private Property PermisoEditar As Boolean
Get
Return CType(ViewState("PermisoEditar"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoEditar") = value
End Set
End Property
Private Property PermisoModulos As Boolean
Get
Return CType(ViewState("PermisoModulos"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoModulos") = value
End Set
End Property
Private Property PermisoProcesos As Boolean
Get
Return CType(ViewState("PermisoProcesos"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoProcesos") = value
End Set
End Property
Private Property PermisoRestablecerContraseña As Boolean
Get
Return CType(ViewState("PermisoProcesos"), Boolean)
End Get
Set(value As Boolean)
ViewState("PermisoProcesos") = 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
ViewState("Orden") = ""
ViewState("CveRol") = -1
CargarEmpresa()
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim Usuario As New ClsSisUsuarios
If Usuario.GetUsuarios(-1, -1) Then
If UsuarioActual.CveRol <> 1 Then
DtUsuarios = Usuario.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0} AND CveRol <> 1", DdlEmpresa.SelectedValue))
'DtUsuarios = Usuario.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Else
DtUsuarios = Usuario.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", DdlEmpresa.SelectedValue))
End If
Else
GvDatos.DataSource = Nothing
End If
Usuario.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub consultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Protected Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand
HdnCveUsuario.Value = e.CommandArgument.ToString
End Sub
Private Sub CargarEmpresa()
Dim ClsUsuarios As New ClsSisUsuarios
Dim DtEmpresas As DataTable
'Se cargan las empresas que tenga acceso el Usuario Actual, que son las que el puede dar acceso o no.
' Si el usuario es rol = 1 se cargan todas las empresas
Dim Tipo = If(UsuarioActual.CveRol = 1, -1, UsuarioActual.CveUsuario)
If ClsUsuarios.GetEmpresasAcceso(Tipo, -1) Then
DtEmpresas = ClsUsuarios.DtResultados
Else
DtEmpresas = Nothing
End If
ClsUsuarios.Dispose()
DdlEmpresa.DataSource = DtEmpresas
DdlEmpresa.SelectedValue = UsuarioActual.CveEmpresa.ToString
DdlEmpresa.DataBind()
End Sub
'Public Sub CargarEmpresa()
' If UsuarioActual.CveRol <> 1 Then
' DdlEmpresa.DataSource = GlobalDTEmpresas
' DdlEmpresa.Enabled = False
' Else
' DdlEmpresa.DataSource = GlobalDTEmpresas
' End If
' DdlEmpresa.SelectedValue = UsuarioActual.CveEmpresa.ToString
' DdlEmpresa.DataBind()
'End Sub
Protected Sub LBAdd_Click(sender As Object, e As EventArgs)
HdnCveUsuario.Value = "-1"
End Sub
#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(ByVal Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(DtUsuarios, "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = DtUsuarios
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1 @@
<%@ WebService Language="VB" CodeBehind="~/App_Code/WsRespaldos.vb" Class="WsRespaldos" %>