--activar carga de documento en Roles
This commit is contained in:
@@ -51,6 +51,19 @@
|
||||
<%-- <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="row" id="DivManual" runat="server" visible="false">
|
||||
<div class="col-md-3">
|
||||
<label>Manual del rol:</label>
|
||||
<div>
|
||||
<asp:LinkButton ID="BtnAdjuntar" runat="server" Visible="false" Text="<i class='fa-upload fa' style=' color: white;'></i> Adjuntar" data-toggle="modal" data-target="#ModalAdjuntar" CssClass="btn myventasbutton btn-primary" />
|
||||
<br />
|
||||
<asp:LinkButton ID="BtnArchivoAdjunto" runat="server" Visible="false" Text="" Font-Size="14px" />
|
||||
|
||||
<asp:LinkButton ID="BtnReemplazarAdjunto" runat="server" Visible="false" AlternateText="Reemplazar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm blue" Text="<i class='fa-upload fa' style=' color: white;'></i>" data-toggle="modal" data-target="#ModalAdjuntar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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>
|
||||
@@ -59,6 +72,7 @@
|
||||
<label for="<%= TxtUsuarioAlta.ClientID.ToString()%>">Usuario Alta:</label>
|
||||
<asp:Label ID="TxtUsuarioAlta" runat="server"></asp:Label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,15 +83,15 @@
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabPanelPermisos" runat="server" HeaderText="Acceso a Módulos">
|
||||
<ajax:TabPanel ID="TabPanelPermisos" runat="server" HeaderText="Acceso a Módulos">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UPPAltaRep" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -122,37 +136,37 @@
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<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>
|
||||
<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>
|
||||
</ContentTemplate>
|
||||
@@ -161,7 +175,7 @@
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabPanelIndicadores" runat="server" HeaderText="Indicadores">
|
||||
@@ -187,7 +201,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<div class="tools">
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
@@ -213,7 +227,7 @@
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabPanelUsuarios" runat="server" HeaderText="Usuarios">
|
||||
<ajax:TabPanel ID="TabPanelUsuarios" runat="server" HeaderText="Usuarios">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpUsuarios" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
@@ -235,19 +249,18 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvUsurios" DataKeyNames="CveUsuario" data-sort="true" CssClass="table table-striped table-hover Widthall ScrollAD"
|
||||
<asp:GridView ID="GvUsurios" DataKeyNames="CveUsuario" data-sort="true" CssClass="table table-striped table-hover Widthall ScrollAD"
|
||||
DataKey="CveUsuario" AutoGenerateColumns="false" GridLines="None" EmptyDataText="Aun no se usuarios" runat="server">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" />
|
||||
<asp:BoundField DataField="Nombre" HeaderText="Nombre" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" />
|
||||
<asp:BoundField DataField="Nombre" HeaderText="Nombre" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
@@ -275,6 +288,29 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--MODAL ADJUNTAR--%>
|
||||
<div id="ModalAdjuntar" class="modal ADS 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">×</button>
|
||||
<h4 class="modal-title">Adjuntar</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:TextBox ID="txtAdjuntar" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="btnGuardarAdjunto" runat="server" Text="Guardar" CssClass="btn btn-primary" OnClick="btnGuardarAdjunto_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Imports System.Data
|
||||
Imports System.Drawing
|
||||
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||
Imports System.IO
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Partial Class Sistemas_RolesDetalle
|
||||
@@ -43,6 +45,11 @@ Partial Class Sistemas_RolesDetalle
|
||||
TxtFecha.Text = DTRoles.FiltroPrimeroValor("FechaIng").ToDate.ToShortDateString
|
||||
TxtUsuarioAlta.Text = DTRoles.FiltroPrimeroValor("Nombre")
|
||||
DdlModulo.SelectedValueExist(DTRoles.FiltroPrimeroValor("CveModulo").ToEntero)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(382) = "1" OrElse UsuarioActual.CveRol = 1 Then
|
||||
CargaAdjunto(DTRoles.FiltroPrimeroValor("Adjunto"))
|
||||
End If
|
||||
|
||||
Else
|
||||
Dim Liga As String = $"document.location.href=""/Sistemas/CatRoles.aspx"";"
|
||||
Alert("El Rol solicitado no existe.", TipoMensaje.MsgAdvertencia, Liga)
|
||||
@@ -59,6 +66,18 @@ Partial Class Sistemas_RolesDetalle
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaAdjunto(Adjunto As String)
|
||||
DivManual.Visible = True
|
||||
If Adjunto <> "" Then
|
||||
BtnArchivoAdjunto.Text = Adjunto
|
||||
BtnArchivoAdjunto.Visible = True
|
||||
BtnAdjuntar.Visible = False
|
||||
BtnReemplazarAdjunto.Visible = True
|
||||
Else
|
||||
BtnAdjuntar.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUsuarios()
|
||||
|
||||
If CveRol > 0 Then
|
||||
@@ -253,5 +272,57 @@ Partial Class Sistemas_RolesDetalle
|
||||
GlobalDTRoles(UsuarioActual.CveEmpresa) = Nothing
|
||||
End Sub
|
||||
|
||||
Private Sub GuardarArchivoAdjunto()
|
||||
If Not txtAdjuntar.getfiles().Archivos.Count > 0 Then
|
||||
Alert("Tiene que cargar un archivo.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim Filesgral As List(Of Archivo) = txtAdjuntar.getfiles().Archivos
|
||||
Dim Filename As String = ""
|
||||
Dim fileItem As Archivo = Filesgral(0)
|
||||
Try
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
Dim Adjunto = String.Format("{0}.{1}", Me.CveRol, FileExtension)
|
||||
|
||||
Dim Path As String
|
||||
Path = String.Format("{0}Roles", UsuarioActual.Empresa.Ruta)
|
||||
If Not Directory.Exists(Path) Then
|
||||
Directory.CreateDirectory(Path)
|
||||
End If
|
||||
Path += $"/{Adjunto}"
|
||||
If File.Exists(Path) Then
|
||||
File.Delete(Path)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path)
|
||||
|
||||
If File.Exists(Path) Then
|
||||
If Me.CveRol > 0 Then
|
||||
Using ObjRol As New ClsSisRoles
|
||||
If ObjRol.UpdateRolAdjunto(Me.CveRol, Adjunto, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Documento cargado", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End Using
|
||||
Else
|
||||
Alert("Documento cargado", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End If
|
||||
|
||||
BtnAdjuntar.Visible = False
|
||||
BtnArchivoAdjunto.Text = Adjunto
|
||||
BtnArchivoAdjunto.Visible = True
|
||||
BtnReemplazarAdjunto.Visible = True
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Error al cargar archivo", ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub btnGuardarAdjunto_Click(sender As Object, e As EventArgs)
|
||||
GuardarArchivoAdjunto()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user