-
This commit is contained in:
@@ -132,16 +132,16 @@ Partial Class Sistemas_Empresa
|
||||
TrDescargaBanner.Visible = True
|
||||
LnkBanner.InnerText = "Reemplazar Banner"
|
||||
|
||||
If LnkArchivoKey.InnerText = "" Then
|
||||
LnkArchivoKey.InnerText = "Reemplazar Archivo Key"
|
||||
End If
|
||||
If LnkArchivoCer.InnerText = "" Then
|
||||
LnkArchivoCer.InnerText = "Reemplazar Archivo Cer"
|
||||
End If
|
||||
'If LnkArchivoKey.InnerText = "" Then
|
||||
' LnkArchivoKey.InnerText = "Reemplazar Archivo Key"
|
||||
'End If
|
||||
'If LnkArchivoCer.InnerText = "" Then
|
||||
' LnkArchivoCer.InnerText = "Reemplazar Archivo Cer"
|
||||
'End If
|
||||
|
||||
If LnkArchivoPfx.InnerText = "" Then
|
||||
LnkArchivoPfx.InnerText = "Reemplazar Archivo Pfx"
|
||||
End If
|
||||
'If LnkArchivoPfx.InnerText = "" Then
|
||||
' LnkArchivoPfx.InnerText = "Reemplazar Archivo Pfx"
|
||||
'End If
|
||||
BtnGuardar.Text = "Guardar Cambios"
|
||||
|
||||
'Plantilla Correo
|
||||
@@ -398,7 +398,7 @@ Partial Class Sistemas_Empresa
|
||||
LbBannerDescarga.OnClientClick = "javascript:AbrirVentana('/Banners/" & .Banner & "', 500, 500, 'N', 'Banner Empresa');"
|
||||
Session("FileUpload") = .Banner
|
||||
|
||||
LbArchivoKeyDescarga.OnClientClick = "javascript:AbrirVentana('/Key/" & .ArchivoKey & "', 500, 500, 'N', 'ArchivoKey Empresa');"
|
||||
'LbArchivoKeyDescarga.OnClientClick = "javascript:AbrirVentana('/Key/" & .ArchivoKey & "', 500, 500, 'N', 'ArchivoKey Empresa');"
|
||||
Session("FileUpload") = .ArchivoKey
|
||||
|
||||
LbBannerDescarga.OnClientClick = "javascript:AbrirVentana('/Cer/" & .ArchivoCer & "', 500, 500, 'N', 'ArchivoCer Empresa');"
|
||||
@@ -1632,4 +1632,63 @@ Partial Class Sistemas_Empresa
|
||||
Dim result = conector.RegistraEmisor(RFCEmisor, certByte, llaveByte, contrasena)
|
||||
|
||||
If result.Exitoso Then
|
||||
Alert("El emisor se registró correctamente.<br>" & result.Descripcion)
|
||||
Else
|
||||
Alert("Ocurrió un error al registrar el emisor.<br>" & result.Descripcion & ".<br> Numero Error: " & result.NumeroError, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al registrar el emisor", ex)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkArchivoKey_Click(sender As Object, e As EventArgs) Handles LnkArchivoKey.Click
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkArchivoCer_Click(sender As Object, e As EventArgs) Handles LnkArchivoCer.Click
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo"))
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkArchivoPfx_Click(sender As Object, e As EventArgs) Handles LnkArchivoPfx.Click
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo"))
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardarArchivo_Click(sender As Object, e As EventArgs)
|
||||
Dim FileExtension As String = "-1"
|
||||
Dim filesgral As List(Of Archivo) = TxtCargaImg.getfiles().Archivos
|
||||
Dim filemove As String = ""
|
||||
Dim TieneError As Boolean = False
|
||||
|
||||
For Each fileItem As Archivo In filesgral
|
||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||
filemove = fileItem.filename
|
||||
|
||||
Dim Patron As String = "(^\d{1,}-)|(\.\w{1,}$)"
|
||||
Dim NombreArchivo As String = Regex.Replace(filemove, Patron, "")
|
||||
|
||||
Dim yaExistente As String = String.Format("{0}Empresas\{1}\Certificados\{2}.{3}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, NombreArchivo, FileExtension)
|
||||
If File.Exists(yaExistente) Then
|
||||
File.Delete(yaExistente)
|
||||
End If
|
||||
Try
|
||||
If filemove <> "" Then
|
||||
Dim Ruta As String = String.Format("Empresas\{0}\Certificados\", CveEmpresa)
|
||||
filemove.FilesMove(NombreArchivo, Ruta)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
TieneError = True
|
||||
End Try
|
||||
Next
|
||||
If Not TieneError Then
|
||||
Alert("Certificado cargado con exito")
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalArchvivo"))
|
||||
End If
|
||||
TxtCargaImg.getfiles().Archivos = Nothing
|
||||
UpAddArchivo.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LbArchivoKeyDescarga_Download(sender As Object, e As EventArgs) Handles LbArchivoKeyDescarga.Click
|
||||
Dim FilePath As String = String.Format("{0}Empresas\{1}\Certificados\{2}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, TxtArchivoKey.Text)
|
||||
'Dim fi As New FileInfo(File)
|
||||
|
||||
Reference in New Issue
Block a user