diff --git a/App_Code/ClsEdocumentacion.vb b/App_Code/ClsEdocumentacion.vb index d49f988a3..b850d1078 100644 --- a/App_Code/ClsEdocumentacion.vb +++ b/App_Code/ClsEdocumentacion.vb @@ -153,7 +153,7 @@ Public Class ClsEdocumentacion Public Function DocumentacionAdd(Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, - DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer) As Boolean + DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer, Optional Periodicidad As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionAdd") @@ -169,6 +169,7 @@ Public Class ClsEdocumentacion .Add("@DiasLimite", SqlDbType.Int).Value = DiasLimite .Add("@AplicaDiasLimite", SqlDbType.Bit).Value = AplicaDiasLimite .Add("@AplicaFechaVencimiento", SqlDbType.Bit).Value = AplicaFechaVencimiento + .Add("@Periodicidad", SqlDbType.Int).Value = Periodicidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -187,7 +188,7 @@ Public Class ClsEdocumentacion End Function - Public Function DocumentacionUpdate(CveDocumentacion As Integer, Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer) As Boolean + Public Function DocumentacionUpdate(CveDocumentacion As Integer, Documentacion As String, DocumentacionFormato As String, CveDocumentacionTipo As Integer, Estatus As Integer, Orden As Integer, Requerido As Integer, DiasLimite As Integer, AplicaDiasLimite As Boolean, AplicaFechaVencimiento As Boolean, CveEmpresa As Integer, Optional Periodicidad As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Edoc_DocumentacionUpdate") @@ -204,6 +205,7 @@ Public Class ClsEdocumentacion .Add("@DiasLimite", SqlDbType.Int).Value = DiasLimite .Add("@AplicaDiasLimite", SqlDbType.Bit).Value = AplicaDiasLimite .Add("@AplicaFechaVencimiento", SqlDbType.Bit).Value = AplicaFechaVencimiento + .Add("@Periodicidad", SqlDbType.Int).Value = Periodicidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With @@ -452,35 +454,61 @@ Public Class ClsEdocumentacion End Try Return Retorno - End Function + End Function + + Public Function DocumentacionElectronicaAuditoriaGet(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Optional Modulo As Integer = 3, Optional Estatus As Integer = -1) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Edoc_DocumentacionElectronicaAuditoriaGet") - 'Public Function DocumentacionGet(CveDocumentacionTipo As Integer, CveEmpresa As Integer) As Boolean + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Modulo", SqlDbType.Int).Value = Modulo + .Add("@Estatus", SqlDbType.Int).Value = Estatus + End With - ' Dim Retorno As Boolean = False + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los registros de documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try - ' DataAdapter("PA_Edoc_DocumentacionGet") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo - ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al consultar la documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - - ' Return Retorno - ' End Function + Return Retorno + End Function + + + + 'Public Function DocumentacionGet(CveDocumentacionTipo As Integer, CveEmpresa As Integer) As Boolean + + ' Dim Retorno As Boolean = False + + ' DataAdapter("PA_Edoc_DocumentacionGet") + + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveDocumentacionTipo", SqlDbType.Int).Value = CveDocumentacionTipo + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + ' End With + + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar la documentación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + + ' Return Retorno + ' End Function #End Region - - - + + + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not disposedValue Then If disposing Then diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index d64782ccb..3e035cf13 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -369,9 +369,12 @@ Public Class ClsGenerales End Function - Public Function GetGralPaqueteriasGuiasTipo() As Boolean + Public Function GetGralPaqueteriasGuiasTipo(Optional CveEmpresa As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_PaqueteriasGuiasTipoGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data) Retorno = True diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index b0d91b2b5..5ce6ad484 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3956,6 +3956,10 @@ Public Class ClsPaginas PaginaDict.Add("/Compras/RepPUESinPago.aspx".ToUpper(), 675) PaginaDict.Add("/Compras/RepReqOCCompraInv.aspx".ToUpper(), 689) PaginaDict.Add("/Compras/RepComprasPrecios.aspx".ToUpper(), 690) + PaginaDict.Add("/Compras/RepDocumentacionProveedor.aspx".ToUpper(), 1206) + PaginaDict.Add("/Compras/CatPaqueteriasGuiasTipo.aspx".ToUpper(), 753) + + #End Region 'CONTABILIDAD @@ -4663,9 +4667,13 @@ Public Class ClsPaginas 'Portal Cliente/Proveedor PaginaDict.Add("/PortalCliente/PortalCliente.aspx".ToUpper(), 1101) - PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201) - - 'Portal + PaginaDict.Add("/PortalProveedor/PortalProveedor.aspx".ToUpper(), 1201) + + PaginaDict.Add("/Edoc/CatDocumentos.aspx".ToUpper(), 1205) + PaginaDict.Add("/Edoc/CatTipoContratos.aspx".ToUpper(), -1) + PaginaDict.Add("/Edoc/CatDocumentosContratos.aspx".ToUpper(), -1) + + 'Portal PaginaDict.Add("/AIMMGM/ConsultaCliente.aspx".ToUpper(), -1) PaginaDict.Add("/Portal/ConsultaCliente.aspx".ToUpper(), -1) PaginaDict.Add("/Proveedores/PortalProveedor.aspx".ToUpper(), -1) @@ -4682,6 +4690,7 @@ Public Class ClsPaginas + 'Orden Produccion' 'RMA diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 14fe93b5f..fd2af8bf0 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -10090,19 +10090,22 @@ Partial Class Compras_Compras EmisorRFC = ValorXML(node, "RFC") 'EmisorNombre = ValorXML(node, "nombre") End If - node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + + node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) + node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces) + If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then ReceptorRFC = ValorXML(node, "RFC") End If - If UsuarioActual.CveEmpresa.Contiene(119) Then + If UsuarioActual.CveEmpresa.Contiene(119, 7) Then node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces) If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then If ValorXML(node, "TipoRelacion").ToString.Contiene("04", "07") Then Dim nodeDocumentosRelacionados As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionado", Prefijo), namespaces) For Each documento As XmlNode In nodeDocumentosRelacionados If documento.Attributes("UUID").Value <> "" Then - 'ListaDocumentos.Add(documento.Attributes("UUID").Value) + ListaDocumentos.Add(documento.Attributes("UUID").Value) End If Next End If diff --git a/Compras/RepDocumentacionProveedor.aspx b/Compras/RepDocumentacionProveedor.aspx new file mode 100644 index 000000000..ad4776c3d --- /dev/null +++ b/Compras/RepDocumentacionProveedor.aspx @@ -0,0 +1,322 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepDocumentacionProveedor.aspx.vb" Inherits="Proveedores_RepDocumentacionProveedor" %> + + + + + + + + + Reporte documentación + + + + + + + + +
  • + +
  • + +
    + + + +
    + +
    + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    + +
    Proveedor:
    +
    + + +
    + +
    Fecha Inicio
    +
    +
    + + + + +
    + + + + + + + + + +
    + +
    Fecha Fin
    +
    +
    + + + + +
    + <%-- --%> + + + + + + + + +
    + + +
    Estatus
    + +
    + + + Todos + Pendiente + Entregado + Completado + + +
    + + +
    + +
    +
    +
    > + + + +
    +
    +
    +
    + + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + + + --%> + + + +
    + + +
    +
    +
    + + + +
    +
    + + +
    + + + + + diff --git a/Compras/RepDocumentacionProveedor.aspx.vb b/Compras/RepDocumentacionProveedor.aspx.vb new file mode 100644 index 000000000..d89519107 --- /dev/null +++ b/Compras/RepDocumentacionProveedor.aspx.vb @@ -0,0 +1,380 @@ +Option Strict On + + +Imports System.Data +Imports System.IO +Imports Extensiones +Imports GemBox.Spreadsheet + + + + +Partial Class Proveedores_RepDocumentacionProveedor + Inherits ClsPaginas + + Private Property DTDatos As DataTable + Get + If ViewState("DTDatos") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDatos"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTDatos") = value + End Set + End Property + + + Private Property DTHeaders As DataTable + Get + If ViewState("DTHeaders") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTHeaders"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTHeaders") = value + End Set + End Property + + + Private Sub Proveedores_RepDocumentacionProveedor_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + + 'TxtFechaI.Text = Now.AddMonths(-3).ToString("dd/MM/yyyy") + 'TxtFechaF.Text = Now.ToString("dd/MM/yyyy") + + TxtFechaI.Text = "" + TxtFechaF.Text = "" + + LnkDescargarExcel.Visible = False + End If + 'ExportaExcel() + End Sub + + Private Sub CargaCombos() + + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Todos" + DdlProveedores.SelectedValue = "-1" + + End Sub + + + Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click + CargaDocumentacion() + End Sub + + + Private Sub CargaDocumentacion() + + Dim CveProveedor As Integer = -1 + + Dim FechaInicio As Date + Dim FechaFin As Date + + If TxtFechaI.Text = "" Then + FechaInicio = MinFecha + Else + FechaInicio = TxtFechaI.Text.ToDate + End If + + If TxtFechaF.Text = "" Then + FechaFin = MaxFecha + Else + FechaFin = TxtFechaF.Text.ToDate + End If + + If DdlProveedores.txtValue.Value.ToEntero > 0 Then + CveProveedor = DdlProveedores.txtValue.Value.ToEntero + End If + + Dim obEDoc As New ClsEdocumentacion + + If obEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, 3, DdlEstatus.SelectedValue.ToEntero) Then + GvDocumentos.DataSource = obEDoc.DtResultados + Else + GvDocumentos.DataSource = Nothing + End If + + obEDoc.Dispose() + + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + + + End Sub + + + + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired") + Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite") + Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia") + Dim Documentacion As String = e.Row.DataKey("Documentacion") + + Dim ImgRechazar As LinkButton = e.Row.FCLinkButton("ImgRechazar") + + Dim ImgAceptar As LinkButton = e.Row.FCLinkButton("ImgAceptar") + + Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido")) + 'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + 'Dim RDBAcptar As RadioButton = e.Row.FCRadioButton("RDBAcptar") + 'Dim RDBRechazar As RadioButton = e.Row.FCRadioButton("RDBRechazar") + + Dim separado As Char() = ".".ToCharArray + Dim array() As String = Adjunto.Split(separado) + Dim extencion As String = "" + + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + txtFechaLimite.Visible = If(AplicaDiasLimite, True, False) + txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False) + + + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then + txtFechaVigencia.ForeColor = Drawing.Color.Red + End If + End If + + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + 'If e.Row.DBCampo("Estatus").ToString.ToEntero = 3 Then + ' RDBAcptar.Checked = True + 'Else + ' chkEstatus.Checked = False + 'End If + + txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy") + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + End If + + Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');" + RegistraScript(scripMascara, "scriptMascara") + + If Adjunto.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & e.Row.DataKey("CveProveedor") & "/" & Adjunto + + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion & "." & extencion) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion) + End If + + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2, 3) Then + ImgRechazar.Visible = True + End If + + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(2) Then + ImgAceptar.Visible = True + End If + + 'If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then + ' chkEstatus.Checked = True + 'End If + + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + If requerido Then + ImgRequired.Text = " " + End If + + 'chkEstatus.Checked = ImgDownLoad.Visible + + End If + End Sub + + Protected Sub ImgRechazar_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim Obsebaciones As String = GvRow.FCTextBox("TxtObservaciones").Text + If Obsebaciones.Trim.Length = 0 Then + Alert("Debe de proporcionar una obserbación o motivo de rechazo.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim Correo As String = GvRow.DataKey("ContactoMail") + Dim Documentacion As String = GvRow.DataKey("Documentacion") + Dim Obserbaciones As String = GvRow.FCTextBox("TxtObservaciones").Text + + Dim Adjunto As String = GvRow.DataKey("Adjunto") + Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero + Dim Archivo As String = UsuarioActual.Empresa.Ruta & $"Edoc\Proveedor\{CveProveedor}\{Adjunto}" + + + Dim objEdoc As New ClsEdocumentacion + Dim ErrorProceso As Boolean = False + + objEdoc.IniciaTransacSQL() + + If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 1, + If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", + UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then + + Try + File.Delete(Archivo) + Catch ex As Exception + ErrorProceso = True + End Try + + If Not ErrorProceso Then + + Dim Cuerpo As String = $"

    Por medio del presente correo se le notifica que el documento {Documentacion}   ha sido rechazado por la siguiente causa: {Obserbaciones}  por favor ingrese nuevamente al portal  y agréguelo nuevamente. 

    +

    Atentamente:

    +

    Saludos.

    " + + If Not MandaCorreo(Correo, $"{ UsuarioActual.Empresa.Empresa } documento Rechazado", Cuerpo) Then + ErrorProceso = True + End If + + Alert($"El documento {GvRow.DataKey("Documentacion") } fue rechazado.") + + End If + + + Else + ErrorProceso = True + End If + + If ErrorProceso Then + objEdoc.RollBack() + Else + objEdoc.Commit() + End If + + objEdoc.Dispose() + + CargaDocumentacion() + + End Sub + + Protected Sub ImgAceptar_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim objEdoc As New ClsEdocumentacion + + If objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, 3, + "", "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, GvRow.DataKey("FechaVigencia").ToDate) Then + Alert("Dcumento Aceptado.") + End If + + + objEdoc.Dispose() + + CargaDocumentacion() + End Sub + + Private Function MandaCorreo(Para As String, Asunto As String, Body As String) As Boolean + Dim Respuesta As Boolean = False + + Dim Mail As New ClsSisMail() + + Para = If(Para IsNot Nothing, Para, "") + Asunto = If(Asunto IsNot Nothing, Asunto, "") + Body = If(Body IsNot Nothing, Body, "") + + Dim ListaArchivos As New List(Of ClsSisMail.ArchivoMail) + + If Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=ListaArchivos) Then + Respuesta = True + End If + + Return Respuesta + + + End Function + + + + 'Protected Sub BrnProcesar_Click(sender As Object, e As EventArgs) + + ' Dim objEdoc As New ClsEdocumentacion + ' objEdoc.IniciaTransacSQL() + + ' Dim ErrorProceso As Boolean = False + + ' For Each GvRow As GridViewRow In GvDocumentos.Rows + + ' Dim RDBAcptar As RadioButton = GvRow.FCRadioButton("RDBAcptar") + ' Dim RDBRechazar As RadioButton = GvRow.FCRadioButton("RDBRechazar") + ' Dim ContactoMail As String = GvRow.DataKey("ContactoMail") + + ' If RDBAcptar.Checked Or RDBRechazar.Checked Then + + ' Dim Estatus As Integer = If(RDBAcptar.Checked, 3, 1) + ' Dim Obsebaciones As String = If(RDBAcptar.Checked, "", GvRow.FCTextBox("TxtObservaciones").Text) + + + + ' If Not objEdoc.DocumentacionElectronicaUpdate(GvRow.DataKey("CveDocumentacionElectronica").ToEntero, GvRow.DataKey("CveDocumentacion").ToEntero, -1, -1, GvRow.DataKey("CveProveedor").ToEntero, Estatus, + ' If(Obsebaciones.Trim.Length > 0, Obsebaciones, GvRow.DataKey("Observacion")), "-1", UsuarioActual.CveUsuario, GvRow.DataKey("FechaLimite").ToDate, + ' GvRow.DataKey("FechaVigencia").ToDate) Then + ' ErrorProceso = True + ' Exit For + ' Else + + ' If Estatus = 1 Then + ' 'Enviar correo rechazo con obserbación + ' End If + ' End If + + ' Else + ' 'Enviar correo archivo pediente + ' End If + + ' Next + + ' If ErrorProceso Then + ' objEdoc.RollBack() + ' Else + ' objEdoc.Commit() + ' Alert("Proceso Terminado correctamente.") + ' End If + + ' objEdoc.Dispose() + + + 'End Sub + + + +End Class diff --git a/Edoc/CatDocumentos.aspx b/Edoc/CatDocumentos.aspx new file mode 100644 index 000000000..eaa6a2fed --- /dev/null +++ b/Edoc/CatDocumentos.aspx @@ -0,0 +1,353 @@ +<%@ Page Title="RH - Catálogo de Documentos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentos.aspx.vb" Inherits="RH_CatDocumentos" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + Catálogo de Documentos + + + + +
  • + +
  • + <%--
  • + Etiquetas +
  • --%> +
    +
    +
    + + + + + + + + + +
    +
    +
    + + Documentación +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + +
    + + + +
    + + +
    +
    + + + + + + + + + + + + + + + +
    + + + diff --git a/Edoc/CatDocumentos.aspx.vb b/Edoc/CatDocumentos.aspx.vb new file mode 100644 index 000000000..2858a24c0 --- /dev/null +++ b/Edoc/CatDocumentos.aspx.vb @@ -0,0 +1,414 @@ + + +Imports System.Data +Imports System.Linq +Imports Extensiones +Imports System.IO + +Partial Class RH_CatDocumentos + Inherits ClsPaginas + + Private Property DTDocumentacion As DataTable + Get + If ViewState("DTDocumentacion") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDocumentacion"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTDocumentacion") = value + End Set + End Property + + + Property Documentacion As String + Get + If ViewState("Documentacion") Is Nothing Then + Return "-1" + Else + Return ViewState("Documentacion").ToString + End If + End Get + Set(value As String) + ViewState("Documentacion") = value + End Set + End Property + Property CveDocumentacion As Integer + Get + If ViewState("CveDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CveDocumentacion") = value + End Set + End Property + + Private Property DocumentacionTipo As String + Get + If ViewState("DocumentacionTipo") Is Nothing Then + Return "" + Else + Return ViewState("DocumentacionTipo").ToString + End If + End Get + Set(value As String) + + End Set + End Property + + + Private Property CveDocumentacionTipo As Integer + Get + If ViewState("CveDocumentacionTipo") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacionTipo"), Integer) + End If + End Get + + Set(value As Integer) + ViewState("CveDocumentacionTipo") = value + End Set + End Property + + + Property ActualizarDocumentacion As Boolean + Get + If ViewState("ActualizarDocumentacion") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("ActualizarDocumentacion") = value + End Set + End Property + + Property Estatus As Boolean + Get + If ViewState("Estatus") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("Estatus"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("Estatus") = value + End Set + End Property + + + Property DocumentacionFormato As String + Get + If ViewState("DocumentacionFormato") Is Nothing Then + Return "" + Else + Return ViewState("DocumentacionFormato").ToString + End If + End Get + Set(value As String) + ViewState("DocumentacionFormato") = value + End Set + End Property + + Property Requerido As Boolean + Get + If ViewState("Requerido") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("Requerido"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("Requerido") = value + End Set + End Property + + + Property Orden As Integer + Get + If ViewState("Orden") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("Orden"), Integer) + End If + End Get + Set(value As Integer) + ViewState("Orden") = value + End Set + End Property + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaDocumentacion() + CargaComboDocumentacion() + End If + End Sub + + +#Region "D O C U M E N T A C I O N" + + Protected Sub BtnAgregarDocumento_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumento.Click + ResetFormDocumentacion() + RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});") + End Sub + + Private Sub ResetFormDocumentacion() + + Txtdocumentacion.Text = "" + TxtOrden.Text = "" + TxtPeriodicidad.Text = "" + TxtDiasLimite.Text = "" + BtnAgregarDocumentoModal.Text = "Agregar" + LtlTituloModalDocumentacion.Text = "Agregar documentación" + 'TxtDocumentacionFormato.Text = "" + DdlDocumentacionTipo.SelectedIndex = 0 + chkEstatus.Checked = True + chkRequerido.Checked = True + + ActualizarDocumentacion = False + UpModalDocumentacion.Update() + End Sub + + Private Sub CargaDocumentacion() + + Dim objRH As New ClsEdocumentacion + + If objRH.DocumentacionGet(-1, -1, -1, UsuarioActual.Empresa.CveEmpresa) Then + + DTDocumentacion = objRH.DtResultados + GvDocumentos.DataSource = objRH.DtResultados + Else + DTDocumentacion = Nothing + GvDocumentos.DataSource = Nothing + End If + + objRH.Dispose() + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + End Sub + + Private Sub CargaComboDocumentacion() + Dim objDocumentacion As New ClsEdocumentacion + + If objDocumentacion.DocumentacionTipoGet(UsuarioActual.CveEmpresa) Then + + DdlDocumentacionTipo.DataSource = objDocumentacion.DtResultados + + End If + + objDocumentacion.Dispose() + DdlDocumentacionTipo.DataBind() + DdlDocumentacionTipo.Items.Insert(0, New ListItem("Seleccione un tipo", "-1")) + End Sub + + Public Sub Edit_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + CveDocumentacion = GvRow.DataKey("CveDocumentacion") + Documentacion = GvRow.DataKey("Documentacion") + DocumentacionFormato = GvRow.DataKey("DocumentacionFormato") + CveDocumentacionTipo = GvRow.DataKey("CveDocumentacionTipo") + DocumentacionTipo = GvRow.DataKey("DocumentacionTipo") + Orden = GvRow.DataKey("Orden") + Estatus = GvRow.DataKey("Estatus") + Requerido = GvRow.DataKey("Requerido") + + + Txtdocumentacion.Text = Documentacion + TxtOrden.Text = Orden + + TxtDiasLimite.Text = GvRow.DataKey("DiasLimite") + ChkAplicaDiasLimite.Checked = GvRow.DataKey("AplicaDiasLimite") + TxtPeriodicidad.Text = GvRow.DataKey("Periodicidad") + + ChkAplicaFechaVencimiento.Checked = GvRow.DataKey("AplicaFechaVencimiento") + + DdlDocumentacionTipo.SelectedValueExist(CveDocumentacionTipo) + chkEstatus.Checked = Estatus + chkRequerido.Checked = Requerido + + + LtlTituloModalDocumentacion.Text = "Actualizar Documento: " & Documentacion + BtnAgregarDocumentoModal.Text = "Actualizar" + + UpModalDocumentacion.Update() + ActualizarDocumentacion = True + + RegistraScript("$('#divAgregarDocumentacion').modal({ backdrop: 'static', keyboard: false});") + + End Sub + + Private Function GuardarArchivo(_CveDocumentacion As Integer) As String + + Dim respuesta As String = "" + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + + For Each fileItem As Archivo In Filesgral + Try + respuesta = fileItem.filenameO + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + Dim tempArray() As String + tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) + + Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & fileItem.filenameO + Dim docAnterior As String = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & DocumentacionFormato + + If DocumentacionFormato.Trim.Length > 0 Then + If File.Exists(docAnterior) Then + File.Delete(docAnterior) + End If + End If + + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "\Formatos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "\Formatos") + + End If + + If System.IO.File.Exists(rutaDestino) Then + System.IO.File.Delete(rutaDestino) + End If + + System.IO.File.Move(fileItem.FileUrl, rutaDestino) + + Catch ex As Exception + OnError("Error al cargar archivo", ex) + End Try + TxtFileDocumentacion.Text = "" + UpModalDocumentacion.Update() + Next + + + Return respuesta + End Function + + Public Sub Remove_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion") + Dim _documetacionFormato As String = GvRow.DataKey("DocumentacionFormato") + + + + Dim objEdoc As New ClsEdocumentacion + + If objEdoc.DocumentacionRemove(_CveDocumentacion, UsuarioActual.Empresa.CveEmpresa) Then + EliminarDocumentoDisco(_documetacionFormato) + Alert("Documento eliminado correctamente", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + End Sub + + Private Sub EliminarDocumentoDisco(documento As String) + + Dim archivo As String = UsuarioActual.Empresa.Ruta & "Formatos\" & documento + + If File.Exists(archivo) Then + File.Delete(archivo) + End If + + End Sub + + + Protected Sub BtnAgregarDocumentoModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarDocumentoModal.Click + + Dim objRH As New ClsEdocumentacion + Dim intCompleto As Integer = 0 + Dim _estatus As Integer = 0 + Dim _requerido As Integer = 0 + Dim _formato As String = "" + + + If chkEstatus.Checked Then + _estatus = 1 + End If + + If chkRequerido.Checked Then + _requerido = 1 + End If + + If ActualizarDocumentacion Then + + _formato = GuardarArchivo(CveDocumentacion) + If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, + TxtPeriodicidad.Text.ToEntero) Then + + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion")) + Alert("Documento Actualizado correctamente.", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + + Else + If objRH.DocumentacionAdd(Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, TxtPeriodicidad.Text.ToEntero) Then + + CveDocumentacion = objRH.DtResultados(0)(0).ToString.ToEntero + _formato = GuardarArchivo(CveDocumentacion) + If objRH.DocumentacionUpdate(CveDocumentacion, Txtdocumentacion.Text.Trim, _formato, DdlDocumentacionTipo.SelectedValue.ToEntero, _estatus, TxtOrden.Text.ToEntero, _requerido, TxtDiasLimite.Text.ToEntero, ChkAplicaDiasLimite.Checked, ChkAplicaFechaVencimiento.Checked, UsuarioActual.Empresa.CveEmpresa, + TxtPeriodicidad.Text.ToEntero) Then + + End If + + RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarDocumentacion")) + Alert("Documento agregado correctamente.", TipoMensaje.MsgInformacion) + CargaDocumentacion() + End If + End If + + ActualizarDocumentacion = False + + End Sub + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString.ToEntero + Dim DocumetacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim separado As Char() = {"."} + Dim array() As String = DocumetacionFormato.Split(separado) + Dim extencion As String = "" + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + If DocumetacionFormato.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & _CveDocumentacion & "_" & DocumetacionFormato + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "\Formatos\" & _CveDocumentacion & "_" & DocumetacionFormato + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, DocumetacionFormato) + End If + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + End If + + End Sub + +#End Region + + +End Class + diff --git a/Edoc/CatDocumentosContratos.aspx b/Edoc/CatDocumentosContratos.aspx new file mode 100644 index 000000000..25f611602 --- /dev/null +++ b/Edoc/CatDocumentosContratos.aspx @@ -0,0 +1,468 @@ +<%@ Page Title="RH - Catálogo de Géneros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDocumentosContratos.aspx.vb" Inherits="Edoc_CatDocumentosContratos" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Documentos Contratos + + + + <%-- +
  • + +
  • + +
    --%> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Tipo de contratoDocumentoRequerido
    SubContratosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA) +
    +
    SubContratosIDENTIFICACION REPRESENTANTE LEGAL
    SubContratosPODER REPRESENTANTE LEGAL
    SubContratosREGISTRO PATRONAL IMSS
    SubContratosREGISTRO ANTE EL SAT
    SubContratosPAGOS PROVSIONALES
    SubContratosPAGO DEL IMSS
    SubContratosPAGO DEL ESTADO
    SubContratosOPINION DE CUMPLIMIENTO SAT
    SubContratosCARTA DE NO ADEUDO IMSS
    SubContratosRELACION DE PERSONAL
    SubContratosRECIBOS XML NOMINA
    SubContratosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    AcarreosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    AcarreosIDENTIFICACION REPRESENTANTE LEGAL
    AcarreosPODER REPRESENTANTE LEGAL
    AcarreosREGISTRO PATRONAL IMSS
    AcarreosREGISTRO ANTE EL SAT
    AcarreosPAGOS PROVSIONALES
    AcarreosPAGO DEL IMSS
    AcarreosPAGO DEL ESTADO
    AcarreosOPINION DE CUMPLIMIENTO SAT
    AcarreosCARTA DE NO ADEUDO IMSS
    AcarreosRELACION DE PERSONAL
    AcarreosRECIBOS XML NOMINA
    AcarreosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    LimpiezaACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    LimpiezaIDENTIFICACION REPRESENTANTE LEGAL
    LimpiezaPODER REPRESENTANTE LEGAL
    LimpiezaREGISTRO PATRONAL IMSS
    LimpiezaREGISTRO ANTE EL SAT
    LimpiezaPAGOS PROVSIONALES
    LimpiezaPAGO DEL IMSS
    LimpiezaPAGO DEL ESTADO
    LimpiezaOPINION DE CUMPLIMIENTO SAT
    LimpiezaCARTA DE NO ADEUDO IMSS
    LimpiezaRELACION DE PERSONAL
    LimpiezaRECIBOS XML NOMINA
    LimpiezaREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    MaterialesACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    MaterialesIDENTIFICACION REPRESENTANTE LEGAL
    MaterialesPODER REPRESENTANTE LEGAL
    MaterialesREGISTRO PATRONAL IMSS
    MaterialesREGISTRO ANTE EL SAT
    MaterialesPAGOS PROVSIONALES
    MaterialesPAGO DEL IMSS
    MaterialesPAGO DEL ESTADO
    MaterialesOPINION DE CUMPLIMIENTO SAT
    MaterialesCARTA DE NO ADEUDO IMSS
    MaterialesRELACION DE PERSONAL
    MaterialesRECIBOS XML NOMINA
    MaterialesREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    AcarreosACTA CONSTITUTIVA (PERSONA FISICA NO APLICA)
    AcarreosIDENTIFICACION REPRESENTANTE LEGAL
    AcarreosPODER REPRESENTANTE LEGAL
    AcarreosREGISTRO PATRONAL IMSS
    AcarreosREGISTRO ANTE EL SAT
    AcarreosPAGOS PROVSIONALES
    AcarreosPAGO DEL IMSS
    AcarreosPAGO DEL ESTADO
    AcarreosOPINION DE CUMPLIMIENTO SAT
    AcarreosCARTA DE NO ADEUDO IMSS
    AcarreosRELACION DE PERSONAL
    AcarreosRECIBOS XML NOMINA
    AcarreosREGISTRO DE OBRA ANTE EL SIROC (SOLAMENTE AL INICIO)
    + + + <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +   +
    +
    + + + +
    + + + + + +
    + + +
    --%> + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Edoc/CatDocumentosContratos.aspx.vb b/Edoc/CatDocumentosContratos.aspx.vb new file mode 100644 index 000000000..fdf7d0d87 --- /dev/null +++ b/Edoc/CatDocumentosContratos.aspx.vb @@ -0,0 +1,116 @@ +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Edoc_CatDocumentosContratos + Inherits ClsPaginas + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + End If + + End Sub + + + 'Protected Sub BtnAgregarMotivo_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click + ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposContrato")) + 'End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarTiposDModal.Click + + + + End Sub + +#Region "G V D A T O S" + + 'Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowIndex = 0 Then + ' e.Row.Cells(0).Width = Unit.Pixel(250) + ' e.Row.Cells(1).Width = Unit.Pixel(100) + ' e.Row.Cells(2).Width = Unit.Pixel(100) + ' e.Row.Cells(3).Width = Unit.Pixel(100) + ' e.Row.Cells(4).Width = Unit.Pixel(100) + ' e.Row.Cells(5).Width = Unit.Pixel(61) + ' End If + ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting + ' Dim ObjGenero As New ClsRH + ' If ObjGenero.RemoveGenero(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("El Género se eliminó correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit + ' GvDatos.EditIndex = -1 + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowUpdating(sender As Object, e As EventArgs) Handles BtnEditarTiposDModal.Click + ' Dim ObjGenero As New ClsRH + ' Dim Genero As String = GeneroTxt.Text.Trim + ' Dim Estatus As Boolean = ChkEstatus.Checked + ' Dim CveGenero As Integer = CveGeneroAEditar + + ' If ObjGenero.UpdateGenero(Genero, Estatus, CveGenero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs) + ' BtnAgregarTiposDModal.Visible = False + ' BtnEditarTiposDModal.Visible = True + ' CheckActiveSection.Visible = True + ' saltoDeLinea.Visible = True + + ' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'obtenemos el renglon que acabamos de seleccionar + ' GeneroTxt.Text = GvRow.DataKey("Genero") + ' ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False) + ' CveGeneroAEditar = Convert.ToInt32(GvRow.DataKey("CveGenero")) 'Guardamos en una propiedad el id del registro del cual haremos cambios, se guarda y se utiliza en el metodo "GvDatos_RowUpdating" + + ' UpDatos.Update() + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + 'End Sub +#End Region + + +End Class diff --git a/Edoc/CatTipoContratos.aspx b/Edoc/CatTipoContratos.aspx new file mode 100644 index 000000000..77164873c --- /dev/null +++ b/Edoc/CatTipoContratos.aspx @@ -0,0 +1,165 @@ +<%@ Page Title="RH - Catálogo de Géneros" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoContratos.aspx.vb" Inherits="Edoc_CatTipoContrato" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo Tipos de Contrato + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Tipo de ContratoEstatusUsuarioComandos
    SubContratosActivoSistema
    AcarreosActivoSistema
    LimpiezaActivoSistema
    MaterialesActivoSistema
    + <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +   +
    +
    + + + +
    + + + + + +
    + + +
    --%> + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Edoc/CatTipoContratos.aspx.vb b/Edoc/CatTipoContratos.aspx.vb new file mode 100644 index 000000000..f153a181b --- /dev/null +++ b/Edoc/CatTipoContratos.aspx.vb @@ -0,0 +1,116 @@ +Option Strict On + +Imports System.Data +Imports System.Linq +Imports Extensiones + +Partial Class Edoc_CatTipoContrato + Inherits ClsPaginas + + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + End If + + End Sub + + + Protected Sub BtnAgregarMotivo_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposContrato")) + End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarTiposDModal.Click + + + + End Sub + +#Region "G V D A T O S" + + 'Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowIndex = 0 Then + ' e.Row.Cells(0).Width = Unit.Pixel(250) + ' e.Row.Cells(1).Width = Unit.Pixel(100) + ' e.Row.Cells(2).Width = Unit.Pixel(100) + ' e.Row.Cells(3).Width = Unit.Pixel(100) + ' e.Row.Cells(4).Width = Unit.Pixel(100) + ' e.Row.Cells(5).Width = Unit.Pixel(61) + ' End If + ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting + ' Dim ObjGenero As New ClsRH + ' If ObjGenero.RemoveGenero(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("El Género se eliminó correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit + ' GvDatos.EditIndex = -1 + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Protected Sub GvDatos_RowUpdating(sender As Object, e As EventArgs) Handles BtnEditarTiposDModal.Click + ' Dim ObjGenero As New ClsRH + ' Dim Genero As String = GeneroTxt.Text.Trim + ' Dim Estatus As Boolean = ChkEstatus.Checked + ' Dim CveGenero As Integer = CveGeneroAEditar + + ' If ObjGenero.UpdateGenero(Genero, Estatus, CveGenero) Then + ' GvDatos.EditIndex = -1 + ' ViewState("DTGenero") = ObjGenero.DtResultados + ' GlobalDTGenero = ObjGenero.DtResultados + ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + ' End If + + ' ObjGenero.Dispose() + + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + 'End Sub + + 'Public Sub GvDatos_RowEditing(sender As Object, e As EventArgs) + ' BtnAgregarTiposDModal.Visible = False + ' BtnEditarTiposDModal.Visible = True + ' CheckActiveSection.Visible = True + ' saltoDeLinea.Visible = True + + ' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'obtenemos el renglon que acabamos de seleccionar + ' GeneroTxt.Text = GvRow.DataKey("Genero") + ' ChkEstatus.Checked = If(GvRow.DataKey("Estatus") = "Activo", True, False) + ' CveGeneroAEditar = Convert.ToInt32(GvRow.DataKey("CveGenero")) 'Guardamos en una propiedad el id del registro del cual haremos cambios, se guarda y se utiliza en el metodo "GvDatos_RowUpdating" + + ' UpDatos.Update() + ' If ViewState("Orden").ToString() <> String.Empty Then + ' CargaGrid(ViewState("Orden").ToString()) + ' Else + ' CargaGrid("") + ' End If + ' RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) + 'End Sub +#End Region + + +End Class diff --git a/Empresas/Grales/Formatos/RepAlmacen.rdlc b/Empresas/Grales/Formatos/RepAlmacen.rdlc index fa9f1d6cf..f8b2c15e1 100644 --- a/Empresas/Grales/Formatos/RepAlmacen.rdlc +++ b/Empresas/Grales/Formatos/RepAlmacen.rdlc @@ -46,6 +46,46 @@ + + + + true + true + + + + + Tipo Almacén + + + + + + + Textbox6 + + + + + + Gray + 2pt + 2pt + 2pt + 1pt + + + + @@ -57,9 +97,6 @@ 3.17009cm - - 6.13624cm - @@ -135,41 +172,6 @@ - - - - true - - - - - =Fields!TipoAlmacen.Value - - - - - - - TipoAlmacen - - - =IIF(Fields!Almacen.Value="Total","#67809F","White") - 2pt - 2pt - 1pt - 1pt - - - - @@ -256,46 +258,6 @@ - - - 0.3751cm - - - true - true - - - - - Tipo Almacén - - - - - - - Textbox42 - - - Gray - 2pt - 2pt - 2pt - 1pt - - - - - @@ -344,6 +306,44 @@ + + + + 6.13624cm + + + true + true + + + + + =Fields!TipoAlmacen.Value + + + + + + =IIF(Fields!Almacen.Value="Total","#67809F","White") + 2pt + 2pt + 1pt + 1pt + + + + + + @@ -371,11 +371,13 @@ - Filtros - 0.17638cm + 0.20788cm 0.6cm 18.70841cm 1 @@ -676,6 +678,7 @@ + 0cm 0cm 19.26933cm 5 diff --git a/General/CatDocumentacionTipo.aspx b/General/CatDocumentacionTipo.aspx index 3cffb0787..dba6be481 100644 --- a/General/CatDocumentacionTipo.aspx +++ b/General/CatDocumentacionTipo.aspx @@ -100,7 +100,8 @@ Catalogo Documentacion Tipo Seleccione uno Recursos Humanos - Clientes + Clientes + Proveedor diff --git a/Inventarios/RepAlmacen.aspx b/Inventarios/RepAlmacen.aspx index 5d4b16180..3edf19640 100644 --- a/Inventarios/RepAlmacen.aspx +++ b/Inventarios/RepAlmacen.aspx @@ -161,6 +161,11 @@ <%# Eval("Almacen") %> + + + + + @@ -171,11 +176,6 @@ - - - - - diff --git a/Inventarios/RepAlmacen.aspx.vb b/Inventarios/RepAlmacen.aspx.vb index 0285cdfd0..57284f8ca 100644 --- a/Inventarios/RepAlmacen.aspx.vb +++ b/Inventarios/RepAlmacen.aspx.vb @@ -85,10 +85,10 @@ Partial Class Inventarios_RepAlmacen Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim StrFiltro As New StringBuilder - If TxtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", TxtFechaI.Text.ToDate.ToShortDateString) - If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", TxtFechaF.Text.ToDate.ToShortDateString) - If DdlTipoAlmacen.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Tipo Almacen: {0}", DdlTipoAlmacen.GetSelectedText) - If DdlModalidadFiltro.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Modalidad: {0}", DdlModalidadFiltro.SelectedItem) + If TxtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio : {0}", TxtFechaI.Text.ToDate.ToShortDateString) Else StrFiltro.AppendFormat(" Fecha Inicio : Sin Considerar") + If TxtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin : {0}", TxtFechaF.Text.ToDate.ToShortDateString) Else StrFiltro.AppendFormat(" Fecha Fin : Sin Considerar") + If DdlTipoAlmacen.GetSelectedText <> "" Then StrFiltro.AppendFormat(" Tipo Almacen: {0}", DdlTipoAlmacen.GetSelectedText) Else StrFiltro.AppendFormat(" Tipo Almacen: Todos") + If DdlModalidadFiltro.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Modalidad: {0}", DdlModalidadFiltro.SelectedItem) Else StrFiltro.AppendFormat(" Modalidad: Todas") Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index 217c9a811..f2d679fd2 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -83,8 +83,8 @@ Partial Class CatSubProyectos Private Sub RecargaGlobal() Dim ObjSubProyectos As New ClsSubProyectos - If ObjSubProyectos.GetSubProyectos() Then - GlobalDTSubProyectos(-1) = ObjSubProyectos.DtResultados + If ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa) Then + GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjSubProyectos.DtResultados End If ObjSubProyectos.Dispose() End Sub @@ -400,6 +400,7 @@ Partial Class CatSubProyectos RecargaGlobal() Else ObjSubproyectos.RollBack() + RecargaGlobal() End If 'se regeneran los subproyectos diff --git a/PortalProveedor/PortalProveedor.aspx b/PortalProveedor/PortalProveedor.aspx index ad0b81226..4c0b7fd38 100644 --- a/PortalProveedor/PortalProveedor.aspx +++ b/PortalProveedor/PortalProveedor.aspx @@ -798,10 +798,184 @@ + <%---2020/02/06 - Auditoria--%> + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + + +
    + + +
    +
    +
    + + + + +
    +
    +
    +
    + - + @@ -853,6 +1027,16 @@ }); }); + + + function RestrictSpace() { + + if (event.keyCode == 32) { + event.returnValue = false; + return false; + } + } + - e + diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index fbc7a3673..fb21bc792 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -2,12 +2,13 @@ Option Strict On Imports System.Data +Imports System.IO Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Portal_PortalProveedor - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "PROPIEDADES" Private Property CveProveedor As Integer Get @@ -102,10 +103,10 @@ Partial Class Portal_PortalProveedor Set(value As DataTable) ViewState("DTGvAH") = value End Set - End Property - + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -114,8 +115,9 @@ Partial Class Portal_PortalProveedor ViewState("Orden") = "" CargaDatos() - - 'CARGAN PESTANIAS SEGUN PERMISOS + CargaDocumentacion() + + 'CARGAN PESTANIAS SEGUN PERMISOS If UsuarioActual.TienePermisoProceso(236) Then ' CARGA TAB HISTORIAL DE VENTAS TabHistorial.Visible = True CargaHistorial("-1", 20) @@ -147,11 +149,11 @@ Partial Class Portal_PortalProveedor If UsuarioActual.CvePlataforma = 7 Then TabContraseña.Visible = True End If - End Sub - - + End Sub + + #Region "C A R G A - D A T O S" - + Protected Sub CargaDatos() GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}") Dim ObjProveedor As New ClsCompProveedores() @@ -169,8 +171,8 @@ Partial Class Portal_PortalProveedor End If ObjProveedor.Dispose() - End Sub - + End Sub + #Region "CARGA GRIDS" Private Sub CargaHistorial(SerieSucursal As String, SelectTop As Integer) Dim ObjProveedores As New ClsCompProveedores() @@ -308,9 +310,9 @@ Partial Class Portal_PortalProveedor GvBancosCuentas.DataBind() UpCuentasBancos.Update() - End Sub + End Sub #End Region - + #Region "ROW DATA BOUND" Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -448,13 +450,13 @@ Partial Class Portal_PortalProveedor End If Archivo = Nothing Alert("No se encontro el documento") - End Sub + End Sub #End Region - - + + #End Region - - + + #Region " BTNS VER MÁS" Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs) @@ -506,289 +508,289 @@ Partial Class Portal_PortalProveedor GvCxPHistorial.DataBind() ' UpDatos.Update() - End Sub - + End Sub + #End Region - - + + #Region "Usuarios Portal" - - 'Private Sub CargaUsuariosPortal() - ' Dim ObjUsrs As New ClsSisUsuarios() - ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' Dim dtUsr As DataTable = ObjUsrs.DtResultados - ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) - ' 'If dr IsNot Nothing Then - - ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" - ' ' If True Then TabCxP.Visible = True - ' ' If True Then TabAnticipos.Visible = True - ' ' If True Then TabBancos.Visible = True - ' ' If True Then TabSistema.Visible = True - - ' 'End If - - ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - - ' ViewState("OrdenUsuarios") = "" - ' GvUsuariosPortal.DataSource = dtUsr - ' ViewState("DTUsuariosProveedor") = dtUsr - ' Else - ' GvUsuariosPortal.DataSource = Nothing - ' ViewState("DTUsuariosProveedor") = Nothing - ' End If - ' ObjUsrs.Dispose() - ' GvUsuariosPortal.DataBind() - 'End Sub - - - 'Private Sub CargaGridUsuarios(Orden As String) - ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then - ' If Orden <> String.Empty Then - ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) - ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' DV.Dispose() - ' Else - ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - ' End If - ' GvUsuariosPortal.DataBind() - ' UPPUsuarios.Update() - 'End Sub - - ''ajustar el tamaño de las celdas de la GvUsuarios Portal - 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - - ' 'El usuario Admin no se puede editar ni eliminar - ' If e.Row.DataKey("Nombre") = "Admin" Then - ' e.Row.FCLinkButton("imgE").Visible = False - ' e.Row.FCLinkButton("imgD").Visible = False - ' e.Row.FCLinkButton("imgC").Visible = False - ' End If - - ' If e.Row.RowIndex = 0 Then - ' '' e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(0).Width = Unit.Pixel(120) - ' 'e.Row.Cells(1).Width = Unit.Pixel(150) - ' 'e.Row.Cells(2).Width = Unit.Pixel(55) - ' 'e.Row.Cells(3).Width = Unit.Pixel(55) - ' 'e.Row.Cells(4).Width = Unit.Pixel(55) - ' 'e.Row.Cells(5).Width = Unit.Pixel(55) - ' 'e.Row.Cells(6).Width = Unit.Pixel(55) - ' 'e.Row.Cells(7).Width = Unit.Pixel(55) - - ' 'e.Row.Cells(8).Width = Unit.Pixel(75) - ' 'e.Row.Cells(9).Width = Unit.Pixel(100) - ' 'e.Row.Cells(10).Width = Unit.Pixel(150) - ' End If - ' End If - 'End Sub - - ''Editar usuarios - 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing - ' GvUsuariosPortal.EditIndex = e.NewEditIndex - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim Nombre, Correo As String - ' Dim Estatus As Boolean - ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) - - ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim - ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim - ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim - ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked - - ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero - ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero - - ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados - ' End If - ' ObjUsuario.Dispose() - - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - - 'End Sub - - ''Cancelar Edición - 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit - ' GvUsuariosPortal.EditIndex = -1 - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Restablecer contraseña - 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand - - ' If e.CommandName = "RestablecerContraseña" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) - ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") - ' End If - ' End If - ' Usuario.Dispose() - ' End If - - ' If e.CommandName = "ReenviarCorreo" Then - ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero - ' Dim Usuario As New ClsSisUsuarios - ' Usuario.IniciaTransacSQL() - ' Dim TieneError = False - - ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then - ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") - - ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS - ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then - ' TieneError = True - ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) - ' End If - - ' 'MANDA CORREO ACTIVACION - ' If Not TieneError Then - ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) - ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" - ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) - - ' Dim ObjMail As New ClsSisMail() - - ' If dr("Correo").ToString <> "" Then - ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) - ' Dim Texto = "" - ' For Each Correo As String In Correos - ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) - ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then - ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then - ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) - ' TieneError = True - ' Exit For - ' End If - ' Next - - ' Else - ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) - ' TieneError = True - ' End If - ' End If - - ' If Not TieneError Then - ' Usuario.Commit() - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) - ' Else - ' Usuario.RollBack() - ' End If - - ' End If - ' Usuario.Dispose() - ' End If - - 'End Sub - - ''Eliminar Usuarios - 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting - ' Dim Usuario As New ClsSisUsuarios - ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then - ' GvUsuariosPortal.EditIndex = -1 - ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados - ' End If - ' Usuario.Dispose() - ' Alert("Usuario Eliminado") - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - - ''Agregar Usuario - 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click - ' Dim ObjUsuario As New ClsSisUsuarios - ' Dim CvePlataforma As Integer = 7 - - ' ObjUsuario.IniciaTransacSQL() - - ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - - ' If CveUsuario > 0 Then - ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then - ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then - ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) - ' End If - - ' TxtNombrePortal.Text = "" - ' TxtCorreo.Text = "" - ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") - ' ObjUsuario.Commit() - ' Else - ' ObjUsuario.RollBack() - ' End If - ' Else - ' ObjUsuario.RollBack() - ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") - ' End If - - ' ObjUsuario.Dispose() - ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then - ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) - ' Else - ' CargaGridUsuarios("") - ' End If - 'End Sub - + + 'Private Sub CargaUsuariosPortal() + ' Dim ObjUsrs As New ClsSisUsuarios() + ' If ObjUsrs.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' Dim dtUsr As DataTable = ObjUsrs.DtResultados + ' 'Dim dr As DataRow = dtUsr.FiltroPrimero(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)) + ' 'If dr IsNot Nothing Then + + ' ' If True Then TabHistorial.Visible = True 'dr("Permiso1").ToString = "True" + ' ' If True Then TabCxP.Visible = True + ' ' If True Then TabAnticipos.Visible = True + ' ' If True Then TabBancos.Visible = True + ' ' If True Then TabSistema.Visible = True + + ' 'End If + + ' 'dtUsr = dtUsr '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + + ' ViewState("OrdenUsuarios") = "" + ' GvUsuariosPortal.DataSource = dtUsr + ' ViewState("DTUsuariosProveedor") = dtUsr + ' Else + ' GvUsuariosPortal.DataSource = Nothing + ' ViewState("DTUsuariosProveedor") = Nothing + ' End If + ' ObjUsrs.Dispose() + ' GvUsuariosPortal.DataBind() + 'End Sub + + + 'Private Sub CargaGridUsuarios(Orden As String) + ' If CType(ViewState("DTUsuariosProveedor"), DataTable).Rows.Count > 0 Then + ' If Orden <> String.Empty Then + ' Dim DV As New DataView(CType(ViewState("DTUsuariosProveedor"), DataTable), "", Orden, DataViewRowState.CurrentRows) + ' GvUsuariosPortal.DataSource = DV.ToTable() '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' DV.Dispose() + ' Else + ' GvUsuariosPortal.DataSource = CType(ViewState("DTUsuariosProveedor"), DataTable) '.FiltraParametros("Nombre <> 'Administrador' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + ' End If + ' GvUsuariosPortal.DataBind() + ' UPPUsuarios.Update() + 'End Sub + + ''ajustar el tamaño de las celdas de la GvUsuarios Portal + 'Protected Sub GvUsuariosPortal_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuariosPortal.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' 'El usuario Admin no se puede editar ni eliminar + ' If e.Row.DataKey("Nombre") = "Admin" Then + ' e.Row.FCLinkButton("imgE").Visible = False + ' e.Row.FCLinkButton("imgD").Visible = False + ' e.Row.FCLinkButton("imgC").Visible = False + ' End If + + ' If e.Row.RowIndex = 0 Then + ' '' e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(0).Width = Unit.Pixel(120) + ' 'e.Row.Cells(1).Width = Unit.Pixel(150) + ' 'e.Row.Cells(2).Width = Unit.Pixel(55) + ' 'e.Row.Cells(3).Width = Unit.Pixel(55) + ' 'e.Row.Cells(4).Width = Unit.Pixel(55) + ' 'e.Row.Cells(5).Width = Unit.Pixel(55) + ' 'e.Row.Cells(6).Width = Unit.Pixel(55) + ' 'e.Row.Cells(7).Width = Unit.Pixel(55) + + ' 'e.Row.Cells(8).Width = Unit.Pixel(75) + ' 'e.Row.Cells(9).Width = Unit.Pixel(100) + ' 'e.Row.Cells(10).Width = Unit.Pixel(150) + ' End If + ' End If + 'End Sub + + ''Editar usuarios + 'Protected Sub GvUsuariosPortal_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles GvUsuariosPortal.RowEditing + ' GvUsuariosPortal.EditIndex = e.NewEditIndex + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + 'Protected Sub GvUsuariosPortal_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) Handles GvUsuariosPortal.RowUpdating + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim Nombre, Correo As String + ' Dim Estatus As Boolean + ' Dim gvr As GridViewRow = GvUsuariosPortal.Rows(e.RowIndex) + + ' 'Usuario = gvr.FCLiteral("LtlUUsuario").Text.Trim + ' Nombre = gvr.FCTextBox("TxtUsuarioPortalEdit").Text.Trim + ' Correo = gvr.FCTextBox("TxtCorreoEdit").Text.Trim + ' Estatus = gvr.FCCheckBox("ChkEstatus").Checked + + ' Dim CveUsuarioPortal As Integer = gvr.DataKey("CveUsuario").ToEntero + ' Dim pCveProveedor As Integer = gvr.DataKey("CveProveedor").ToEntero + + ' If ObjUsuario.UpdateUsuarioPortal(Correo, Nombre, Correo, Estatus, "-1", -1, CveProveedor, CveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados + ' End If + ' ObjUsuario.Dispose() + + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + + 'End Sub + + ''Cancelar Edición + 'Protected Sub GvUsuariosPortal_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) Handles GvUsuariosPortal.RowCancelingEdit + ' GvUsuariosPortal.EditIndex = -1 + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Restablecer contraseña + 'Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand + + ' If e.CommandName = "RestablecerContraseña" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' If Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, CType(dr("Estatus"), Boolean), ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados '.FiltraParametros("Usuario <> 'Admin' AND CveUsuarioPortal <> " & UsuarioActual.CveUsuario) + ' Alert("Contraseña Restablecida.
    La nueva contraseña es: """ & ContraseñaPredeterminada & "") + ' End If + ' End If + ' Usuario.Dispose() + ' End If + + ' If e.CommandName = "ReenviarCorreo" Then + ' Dim cveUsuarioPortal As Integer = e.CommandArgument.ToString.ToEntero + ' Dim Usuario As New ClsSisUsuarios + ' Usuario.IniciaTransacSQL() + ' Dim TieneError = False + + ' If Usuario.GetUsuariosPortal(cveUsuarioPortal, -1, -1) Then + ' Dim dr As DataRow = Usuario.DtResultados.FiltroPrimero("") + + ' 'ACTUALIZA USUARIO, CONTRASEÑA Y ESTATUS + ' If Not Usuario.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString, dr("Correo").ToString, True, ContraseñaPredeterminadaEncriptada, -1, CveProveedor, cveUsuarioPortal, UsuarioActual.CveUsuario) Then + ' TieneError = True + ' Alert("Ocurrió un error al actualizar el usuario. Por favor vuelva a intentar.", TipoMensaje.MsgError) + ' End If + + ' 'MANDA CORREO ACTIVACION + ' If Not TieneError Then + ' Dim ObjParametro As SisParametro = GlobalDTParametros(SisParametros.URL) + ' Dim Liga As String = ObjParametro.Cadena1 & "LogIn.aspx" + ' Dim LigaActivar = Liga & "?p=" & Encripta("CveU=" & cveUsuarioPortal & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks & "&CveE=" & UsuarioActual.CveEmpresa) + + ' Dim ObjMail As New ClsSisMail() + + ' If dr("Correo").ToString <> "" Then + ' Dim Correos As String() = dr("Correo").ToString.Split(New Char() {";"c}) + ' Dim Texto = "" + ' For Each Correo As String In Correos + ' Texto = String.Format("Direccion de Acceso: Portal del Proveedor
    Usuario: {2}
    Haga click para activar su cuenta Activar", Liga, CveProveedor, dr("Usuario").ToString, LigaActivar) + ' 'If Not ObjMail.MandaCorreo(EmpresaNotificaciones, Correo, "Activación de cuenta", "", "", {""}, Texto) Then + ' If Not ObjMail.SendMail(EmpresaNotificaciones, Correo, "Activación de cuenta", Texto) Then + ' Alert("Error al mandar el correo. Por favor vuelva a intentar", TipoMensaje.MsgError) + ' TieneError = True + ' Exit For + ' End If + ' Next + + ' Else + ' Alert("No se ha registrado ningún correo al usuario.", TipoMensaje.MsgAdvertencia) + ' TieneError = True + ' End If + ' End If + + ' If Not TieneError Then + ' Usuario.Commit() + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' Alert(String.Format("Se envio correo al usuario y se restablecio contraseña .
    La nueva contraseña es: ""{0}""", ContraseñaPredeterminada), TipoMensaje.MsgInformacion) + ' Else + ' Usuario.RollBack() + ' End If + + ' End If + ' Usuario.Dispose() + ' End If + + 'End Sub + + ''Eliminar Usuarios + 'Protected Sub GvUsuariosPortal_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvUsuariosPortal.RowDeleting + ' Dim Usuario As New ClsSisUsuarios + ' If Usuario.RemoveUsuarioPortal(GvUsuariosPortal.DataKeys(e.RowIndex).Value.ToString().ToEntero()) Then + ' GvUsuariosPortal.EditIndex = -1 + ' ViewState("DTUsuariosProveedor") = Usuario.DtResultados + ' End If + ' Usuario.Dispose() + ' Alert("Usuario Eliminado") + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' End If + 'End Sub + + ''Agregar Usuario + 'Protected Sub LnkAgregarUsuario_Click(sender As Object, e As EventArgs) Handles LnkAgregarUsuario.Click + ' Dim ObjUsuario As New ClsSisUsuarios + ' Dim CvePlataforma As Integer = 7 + + ' ObjUsuario.IniciaTransacSQL() + + ' Dim CveUsuario As Integer = ObjUsuario.AddUsuarioPortal(TxtCorreo.Text.Trim, ContraseñaPredeterminadaEncriptada, TxtNombrePortal.Text.Trim, TxtCorreo.Text.Trim, -1, CveProveedor, CvePlataforma, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + + ' If CveUsuario > 0 Then + ' If ObjUsuario.UpdateUsuariosModulos(CveUsuario, 1201, True, UsuarioActual.CveUsuario) Then + ' If ObjUsuario.GetUsuariosPortal(-1, -1, CveProveedor) Then + ' ViewState("DTUsuariosProveedor") = ObjUsuario.DtResultados.FiltraParametros("Nombre <> 'Admin' AND CveUsuario <> " & UsuarioActual.CveUsuario) + ' End If + + ' TxtNombrePortal.Text = "" + ' TxtCorreo.Text = "" + ' Alert("Usuario Creado.
    El usuario accesará con la contraseña '" & ContraseñaPredeterminada & "'") + ' ObjUsuario.Commit() + ' Else + ' ObjUsuario.RollBack() + ' End If + ' Else + ' ObjUsuario.RollBack() + ' Alert("No se ha podido registrar al nuevo Usuario, Verifique si el Usuario ya está registrado") + ' End If + + ' ObjUsuario.Dispose() + ' If ViewState("OrdenUsuarios").ToString() <> String.Empty Then + ' CargaGridUsuarios(ViewState("OrdenUsuarios").ToString()) + ' Else + ' CargaGridUsuarios("") + ' 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("") - ' Else - ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) - ' Literal.Text = String.Format("") - ' End If - ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString - ' ViewState("Orden") = Orden - ' CargaGridUsuarios(Orden) - 'End Sub - + '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("") + ' Else + ' ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo) + ' Literal.Text = String.Format("") + ' End If + ' Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString + ' ViewState("Orden") = Orden + ' CargaGridUsuarios(Orden) + 'End Sub + #End Region - - + + #Region " BANCOS" Protected Sub BtnExcelGvBancosCuentas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteGvBancosCuentas("EXCEL") @@ -898,12 +900,12 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function + End Function #End Region - - + + #Region "Crédito por Aplicar Impresión" - + Protected Sub BtnExcelCredito_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimeReporteNTPorAplicar("EXCEL") If retorno IsNot Nothing Then @@ -1019,14 +1021,14 @@ Partial Class Portal_PortalProveedor Return retorno - End Function - - + End Function + + #End Region - - + + #Region "Historial de Ventas IMPRESION" - + Protected Sub BtnExcelVentas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteVentas("EXCEL") If retorno IsNot Nothing Then @@ -1086,11 +1088,11 @@ Partial Class Portal_PortalProveedor End If ObjProveedores.Dispose() Return retorno - End Function - + End Function + #End Region - - + + #Region "CxP Pagadas IMPRESION" Protected Sub BtnExcelPagadas_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteCxPPagadas("EXCEL") @@ -1149,13 +1151,13 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function - + End Function + #End Region - - + + #Region "CxCActivas IMPRESION" - + Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = ImprimirReporteCxCHistorial("EXCEL") If retorno IsNot Nothing Then @@ -1217,11 +1219,11 @@ Partial Class Portal_PortalProveedor End If ObjMovtos.Dispose() Return retorno - End Function + End Function #End Region - + #Region "TAB CONTRASENIA" - + Protected Sub BtnGuardarContraseña_Click(sender As Object, e As EventArgs) Handles BtnGuardarContraseña.Click If Decripta(UsuarioActual.Contraseña) = TxtContraseniaActual.Text Then @@ -1244,7 +1246,465 @@ Partial Class Portal_PortalProveedor Alert("La Contraseña Actual es incorrecta.", TipoMensaje.MsgAdvertencia) End If - End Sub + End Sub #End Region + + +#Region "AUDITORIA" + + Property DTDocumentacion As DataTable + Get + If ViewState("DTDocumentacion") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTDocumentacion"), DataTable) + End If + End Get + Set(value As DataTable) + + End Set + + End Property + + Private Sub CargaDocumentacion() + Dim ObjEDoc As New ClsEdocumentacion + + 'If objRH.DocumentacionElectronicaGet(-1, -1, CveProveedor, UsuarioActual.Empresa.CveEmpresa, -1, -1, 3) Then + + If ObjEDoc.DocumentacionElectronicaAuditoriaGet(CveProveedor, MinFecha, MaxFecha, UsuarioActual.CveEmpresa, 3, -1) Then + + + DTDocumentacion = ObjEDoc.DtResultados + GvDocumentos.DataSource = ObjEDoc.DtResultados + Else + DTDocumentacion = Nothing + GvDocumentos.DataSource = Nothing + End If + + ObjEDoc.Dispose() + GvDocumentos.DataBind() + UPGvDocumentos.Update() + + End Sub + + + Property CveDocumentacionElectronica As Integer + Get + If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CvePersonalClienteDocumentacion") = value + End Set + End Property + + Property CveDocumentacion As Integer + Get + If ViewState("CveDocumentacion") Is Nothing Then + Return -1 + Else + Return DirectCast(ViewState("CveDocumentacion"), Integer) + End If + End Get + Set(value As Integer) + ViewState("CveDocumentacion") = value + End Set + End Property + + Property Documentacion As String + Get + If ViewState("Documentacion") Is Nothing Then + Return "-1" + Else + Return ViewState("Documentacion").ToString + End If + End Get + Set(value As String) + ViewState("Documentacion") = value + End Set + End Property + + Property AdjuntoDocumentacion As String + Get + If ViewState("AdjuntoDocumentacion") Is Nothing Then + Return "" + Else + Return ViewState("AdjuntoDocumentacion").ToString + End If + End Get + Set(value As String) + ViewState("AdjuntoDocumentacion") = value + End Set + End Property + + + + Property DiasVigencia As Integer + Get + If ViewState("DiasVigencia") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("DiasVigencia"), Integer) + End If + End Get + Set(value As Integer) + ViewState("DiasVigencia") = value + End Set + End Property + + Property AplicaFechaVencimiento As Boolean + Get + If ViewState("AplicaFechaVencimiento") Is Nothing Then + Return True + Else + Return DirectCast(ViewState("AplicaFechaVencimiento"), Boolean) + End If + End Get + Set(value As Boolean) + ViewState("AplicaFechaVencimiento") = value + End Set + End Property + + Private Property FechaVigencia As Date + Get + If ViewState("FechaVigencia") Is Nothing Then + Return Nothing + Else + Return ViewState("FechaVigencia").ToString.ToDate + End If + End Get + Set(value As Date) + ViewState("FechaVigencia") = value + End Set + End Property + + Property Estatus As Integer + Get + If ViewState("Estatus") Is Nothing Then + Return 0 + Else + Return DirectCast(ViewState("Estatus"), Integer) + End If + End Get + Set(value As Integer) + ViewState("Estatus") = value + End Set + End Property + + Property ObservacionDocumentacion As String + Get + If ViewState("ObservacionDocumentacion") Is Nothing Then + Return "" + Else + Return ViewState("ObservacionDocumentacion").ToString + End If + End Get + Set(value As String) + ViewState("ObservacionDocumentacion") = value + End Set + End Property + + Private Property FechaLimite As Date + Get + If ViewState("FechaLimite") Is Nothing Then + Return Date.Now.AddDays(15) + Else + Return ViewState("FechaLimite").ToString.ToDate + End If + End Get + Set(value As Date) + ViewState("FechaLimite") = value + End Set + + End Property + + Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + ' Dim chkEstatus As CheckBox + CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero + CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString.ToEntero + Documentacion = GvRow.DataKey("Documentacion") + AdjuntoDocumentacion = GvRow.DataKey("Adjunto") + + + 'DiasVigencia = GvRow.DataKey("DiasVigencia").ToString.ToEntero + Dim x As String = GvRow.DataKey("AplicaFechaVencimiento") + If GvRow.DataKey("AplicaFechaVencimiento") = "1" Then AplicaFechaVencimiento = True Else AplicaFechaVencimiento = False + + If GvRow.DataKey("Adjunto").ToString.Length > 0 Then + FechaVigencia = GvRow.DataKey("Adjunto").ToString.ToDate + Else + FechaVigencia = Nothing + End If + + + Estatus = GvRow.DataKey("Estatus").ToEntero + + 'If chkEstatus.Checked Then + ' Estatus = 1 + 'Else + ' Estatus = 0 + 'End If + + ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper + FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate + + AdjuntoDocumentacion = GvRow.DataKey("Adjunto") + + LtlModalUploadTitulo.Text = "Subir " & Documentacion + + UpModalTitleUploadDocumento.Update() + + RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});") + + End Sub + + + + Protected Sub GvDocumentos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentos.RowDataBound + + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString + + Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad") + Dim ImgUpload As LinkButton = e.Row.FCLinkButton("ImgUpload") + Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired") + Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite") + Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia") + Dim Documentacion As String = e.Row.DataKey("Documentacion") + + Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido")) + + 'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus") + Dim separado As Char() = ".".ToCharArray + Dim array() As String = Adjunto.Split(separado) + Dim extencion As String = "" + + Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + txtFechaLimite.Visible = If(AplicaDiasLimite, True, False) + txtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False) + + + 'If AplicaFechaVencimiento And e.Row.DataKey("DiasVigencia").ToString.ToEntero > 0 Then + ' txtFechaVigencia.Enabled = False + 'End If + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + If DateTime.Today > e.Row.DBCampo("FechaVigencia").ToString.ToDateTime Then + txtFechaVigencia.ForeColor = Drawing.Color.Red + End If + End If + + + If array.Length > 0 Then + extencion = array(array.Length - 1) + End If + + If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then + ' chkEstatus.Checked = True + ImgUpload.Visible = False + Else + 'chkEstatus.Checked = False + End If + + txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString.ToDate.ToString("dd/MM/yyyy") + + If e.Row.DBCampo("FechaVigencia").ToString.Length > 0 Then + txtFechaVigencia.Text = e.Row.DBCampo("FechaVigencia").ToString.ToDate.ToString("dd/MM/yyyy") + End If + + Dim scripMascara = "$('#" & txtFechaLimite.ClientID & "').mask('00/00/0000');$('#" & txtFechaVigencia.ClientID & "').mask('00/00/0000');" + RegistraScript(scripMascara, "scriptMascara") + + If Adjunto.Trim.Length > 0 Then + + Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Edoc/Proveedor/" & CveProveedor & "/" & Adjunto + + If File.Exists(linkDescargaArchivo) Then + ImgDownLoad.Visible = True + + If extencion.Length > 0 Then + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion & "." & extencion) + Else + ImgDownLoad.Text = String.Format(" ", linkDescarga, Documentacion) + End If + Else + ImgDownLoad.Visible = False + End If + + Else + ImgDownLoad.Visible = False + End If + + If requerido Then + ImgRequired.Text = " " + End If + + 'chkEstatus.Checked = ImgDownLoad.Visible + + End If + End Sub + + + Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click + + Dim FileExtension As String = "-1" + Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos + Dim Filename As String = "" + + If AplicaFechaVencimiento And DiasVigencia > 0 Then + FechaVigencia = DateTime.Today.AddDays(DiasVigencia) + End If + + For Each fileItem As Archivo In Filesgral + + Try + + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + Dim tempArray() As String + tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) + + Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & Documentacion & "." & FileExtension + Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion + + If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") Then + System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\") + End If + + If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then + File.Delete(rutaAdjuntoAnterior) + End If + + If System.IO.File.Exists(rutaDestino) Then + System.IO.File.Delete(rutaDestino) + End If + + System.IO.File.Move(fileItem.FileUrl, rutaDestino) + + + Dim objEdoc As New ClsEdocumentacion + + If CveDocumentacionElectronica = -1 Then + If objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) > 0 Then + + End If + Else + If objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then + + End If + End If + + objEdoc.Dispose() + + 'GuardarDocumentos(CveDocumentacion) + CargaDocumentacion() + + TxtFileDocumentacion.Text = "" + UPModalUploadDoc.Update() + + + Alert("Archivo cargado correctamente.") + Catch ex As Exception + OnError("Error al cargar archivo", ex) + End Try + + Next + + RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3") + + End Sub + + Private Sub GuardarDocumentos(Optional _CveDocumentacionExcluir As Integer = -1) + + Dim hasError As Boolean = True + Dim objDocumentos As New ClsEdocumentacion + + For Each dRow As GridViewRow In GvDocumentos.Rows + + Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString.ToEntero + Dim _Adjunto As String = dRow.DataKey("Adjunto") + Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString.ToEntero + Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones") + Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite") + Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia") + + Dim _FechaVigencia As Date + Dim _FechaLimite As Date + + Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus") + Dim _estatus As Integer + + If chkEstatus.Checked Then + _estatus = 1 + Else + _estatus = 0 + End If + + Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString.ToEntero + Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString = "1", True, False) + Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString = "1", True, False) + + If _TxtFechaVigencia.Text.Length = 10 Then + _FechaVigencia = _TxtFechaVigencia.Text.ToDate + Else + _FechaVigencia = Nothing + End If + + If Not AplicaDiasLimite Then + _FechaLimite = MinFecha + Else + _FechaLimite = _TxtFechaLimite.Text.ToDate + End If + + If Not AplicaFechaVencimiento Then + _FechaVigencia = MinFecha + End If + + If Not _CveDocumentacionExcluir = _CveDocumentacion Then + Try + If _CveDocumentacionElectronica = -1 Then + + If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, -1, -1, CveProveedor, -1, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then + Else + hasError = True + Exit For + End If + + Else + If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, -1, -1, CveProveedor, -1, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then + Else + hasError = True + Exit For + End If + End If + + + hasError = False + Catch ex As Exception + hasError = True + Exit For + End Try + End If + Next + + CargaDocumentacion() + objDocumentos.Dispose() + End Sub + +#End Region + + End Class \ No newline at end of file