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()
-
+ 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 = $"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
+ 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
-
-
+ End Function
+
+
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- ' Dim chkEstatus As CheckBox
+ 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")
@@ -516,95 +516,95 @@ Partial Class Proveedores_RepDocumentacionProveedor
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
- End Sub
-
- Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
-
+ 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 = ""
- Dim ErrorProceso As Boolean = False
-
+ Dim ErrorProceso As Boolean = False
+
If AplicaFechaVencimiento And DiasVigencia > 0 Then
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
End If
- For Each fileItem As Archivo In Filesgral
-
+ 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 TempCveDocumentacionElectronica As Integer = 0
- Dim objEdoc As New ClsEdocumentacion
- objEdoc.IniciaTransacSQL()
-
- If CveDocumentacionElectronica = -1 Then
-
- CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
-
- If CveDocumentacionElectronica > 0 Then
- If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
- ErrorProceso = True
- End If
- End If
-
-
- Else
- If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
- ErrorProceso = True
- End If
- End If
-
-
-
- If Not ErrorProceso = True Then
-
- Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
- Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
-
-
-
- Try
- 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)
- Catch ex As Exception
- GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
- ErrorProceso = True
- End Try
- End If
-
-
- If Not ErrorProceso Then
- objEdoc.Commit()
- Alert("Documento cargado correctamente")
- Else
- objEdoc.RollBack()
- Alert("Error al cargar archivo", TipoMensaje.MsgError)
- End If
- objEdoc.Dispose()
-
-
- CargaDocumentacion()
-
+
+
+ Dim TempCveDocumentacionElectronica As Integer = 0
+ Dim objEdoc As New ClsEdocumentacion
+ objEdoc.IniciaTransacSQL()
+
+ If CveDocumentacionElectronica = -1 Then
+
+ CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
+
+ If CveDocumentacionElectronica > 0 Then
+ If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
+ ErrorProceso = True
+ End If
+ End If
+
+
+ Else
+ If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
+ ErrorProceso = True
+ End If
+ End If
+
+
+
+ If Not ErrorProceso = True Then
+
+ Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
+ Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
+
+
+
+ Try
+ 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)
+ Catch ex As Exception
+ GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
+ ErrorProceso = True
+ End Try
+ End If
+
+
+ If Not ErrorProceso Then
+ objEdoc.Commit()
+ Alert("Documento cargado correctamente")
+ Else
+ objEdoc.RollBack()
+ Alert("Error al cargar archivo", TipoMensaje.MsgError)
+ End If
+ objEdoc.Dispose()
+
+
+ CargaDocumentacion()
+
TxtFileDocumentacion.Text = ""
- UPModalUploadDoc.Update()
-
+ UPModalUploadDoc.Update()
+
Catch ex As Exception
OnError("Error al cargar archivo", ex)
End Try
@@ -613,12 +613,12 @@ Partial Class Proveedores_RepDocumentacionProveedor
RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
- End Sub
-
-
-
-
-
-
-
+ End Sub
+
+
+
+
+
+
+
End Class
diff --git a/Compras/RepGastosFijos.aspx.cs b/Compras/RepGastosFijos.aspx.cs
index 4fdbd1bd7..92265c1dc 100644
--- a/Compras/RepGastosFijos.aspx.cs
+++ b/Compras/RepGastosFijos.aspx.cs
@@ -217,7 +217,7 @@ public partial class Compras_RepGastosFijos : ClsPaginas
string FechaInicio = DateTime.Parse(TxtFechaI.Text).ToShortDateString();
string FechaFinal = DateTime.Parse(TxtFechaF.Text).ToShortDateString();
- string Ruta = string.Format("{0}Empresas/{1}/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa);
+ string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa);
string RutaPDF = string.Format("{0}/Formatos/RepGastosFijos.rdlc", Ruta);
if (!File.Exists(RutaPDF))
diff --git a/Compras/RepPagado.aspx.cs b/Compras/RepPagado.aspx.cs
index 8518db5fd..8a9f73844 100644
--- a/Compras/RepPagado.aspx.cs
+++ b/Compras/RepPagado.aspx.cs
@@ -1,4 +1,11 @@
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
using static Extensiones.ModExtensiones;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI.WebControls;
+using Extensiones;
+using System.Data;
+using static Extensiones.ModExtensiones;
using Microsoft.Reporting.WebForms;
using System.Web.UI.HtmlControls;
using System.Text;
@@ -236,7 +243,7 @@ public partial class Compras_RepPagado : ClsPaginas
StrFiltro.AppendFormat(" ")
strBody.Append("")
diff --git a/GPS/CatEventos.aspx.vb b/GPS/CatEventos.aspx.vb
index dc46e72c6..0c19d4965 100644
--- a/GPS/CatEventos.aspx.vb
+++ b/GPS/CatEventos.aspx.vb
@@ -109,7 +109,7 @@ Partial Class GPS_CatEventos
Try
If TxtUpImagen.getfiles().Archivos.Count > 0 Then
Dim ArchivoImagen As Archivo = TxtUpImagen.getfiles().Archivos(0)
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Imagenes"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Imagenes"
If Not Directory.Exists(Path) Then
Directory.CreateDirectory(Path)
End If
@@ -122,7 +122,7 @@ Partial Class GPS_CatEventos
If TxtUpSonido.getfiles().Archivos.Count > 0 Then
Dim ArchivoSonido As Archivo = TxtUpSonido.getfiles().Archivos(0)
- Dim PathSonido As String = $"{AppDomain.CurrentDomain.BaseDirectory}Sonidos"
+ Dim PathSonido As String = $"{ModExtensiones.DirectorioBaseEmpresas}Sonidos"
Dim dirSonido As String = String.Format("{0}\{1}.{2}", PathSonido, Sonido, ArchivoSonido.Extencion)
If File.Exists(dirSonido) Then
My.Computer.FileSystem.DeleteFile(dirSonido)
@@ -146,7 +146,7 @@ Partial Class GPS_CatEventos
Try
If TxtUpImagen.getfiles().Archivos.Count > 0 Then
Dim ArchivoImagen As Archivo = TxtUpImagen.getfiles().Archivos(0)
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Imagenes"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Imagenes"
If Not Directory.Exists(Path) Then
Directory.CreateDirectory(Path)
End If
@@ -159,7 +159,7 @@ Partial Class GPS_CatEventos
If TxtUpSonido.getfiles().Archivos.Count > 0 Then
Dim ArchivoSonido As Archivo = TxtUpSonido.getfiles().Archivos(0)
- Dim PathSonido As String = $"{AppDomain.CurrentDomain.BaseDirectory}Sonidos"
+ Dim PathSonido As String = $"{ModExtensiones.DirectorioBaseEmpresas}Sonidos"
Dim dirSonido As String = String.Format("{0}\{1}", PathSonido)
If File.Exists(dirSonido) Then
My.Computer.FileSystem.DeleteFile(dirSonido)
@@ -214,7 +214,7 @@ Partial Class GPS_CatEventos
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.VerticalAlign = VerticalAlign.Middle
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveEvento").ToString
- If File.Exists($"{AppDomain.CurrentDomain.BaseDirectory}Sonidos/{e.Row.DataKey("Sonido").ToString}") Then
+ If File.Exists($"{ModExtensiones.DirectorioBaseEmpresas}Sonidos/{e.Row.DataKey("Sonido").ToString}") Then
e.Row.FCLinkButton("PlaySonido").OnClientClick = $"javascript:PlaySonidito('{e.Row.DataKey("Sonido").ToString}');return false;"
Else
e.Row.FCLinkButton("PlaySonido").Visible = False
diff --git a/GPS/DispositivosControles.aspx.vb b/GPS/DispositivosControles.aspx.vb
index 9829b41fe..3f7d901bf 100644
--- a/GPS/DispositivosControles.aspx.vb
+++ b/GPS/DispositivosControles.aspx.vb
@@ -155,7 +155,7 @@ Partial Class GPS_DispositivosControles
If TxtCalibración.getfiles().Archivos.Count > 0 AndAlso CveControl > 0 AndAlso Not huboerror Then
Try
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}TablasCalibracion"
Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion)
If File.Exists(dirSonido) Then
My.Computer.FileSystem.DeleteFile(dirSonido)
@@ -226,7 +226,7 @@ Partial Class GPS_DispositivosControles
huboerror = Not GPS.CalibracionDelete(CveControl)
If Not huboerror Then
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}TablasCalibracion"
Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion)
If File.Exists(dirSonido) Then
My.Computer.FileSystem.DeleteFile(dirSonido)
@@ -448,7 +448,7 @@ Partial Class GPS_DispositivosControles
End Sub
Protected Sub LbDescargaFormato_Click(sender As Object, e As EventArgs)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\FormatoCalibracion.xlsx"
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\FormatoCalibracion.xlsx"
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
Response.Clear()
diff --git a/GPS/WizardDispositivos.aspx.cs b/GPS/WizardDispositivos.aspx.cs
index 5715ecf01..d82f32cbb 100644
--- a/GPS/WizardDispositivos.aspx.cs
+++ b/GPS/WizardDispositivos.aspx.cs
@@ -766,7 +766,7 @@ public partial class GPS_WizardDispositivos : ClsPaginas
try
{
Archivo Archivo = TxtCalibracion.getfiles().Archivos[0];
- string Path = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion";
+ string Path = $"{ModExtensiones.DirectorioBaseEmpresas}TablasCalibracion";
string dirSonido = string.Format(@"{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion);
if (File.Exists(dirSonido)) { File.Delete(dirSonido); }
File.Move(Archivo.FileUrl, dirSonido);
diff --git a/GPS/WizardModelo.aspx.vb b/GPS/WizardModelo.aspx.vb
index 6be879b52..853e433c9 100644
--- a/GPS/WizardModelo.aspx.vb
+++ b/GPS/WizardModelo.aspx.vb
@@ -521,7 +521,7 @@ Partial Class GPS_WizardModelo
If TxtUpImagen.getfiles().Archivos.Count > 0 Then
Dim ArchivoImagen As Archivo = TxtUpImagen.getfiles().Archivos(0)
Imagen = FormatearNombreArchivo(ArchivoImagen.filenameO)
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Imagenes"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Imagenes"
If Not Directory.Exists(Path) Then
Directory.CreateDirectory(Path)
End If
@@ -534,7 +534,7 @@ Partial Class GPS_WizardModelo
If TxtUpSonido.getfiles().Archivos.Count > 0 Then
Dim ArchivoSonido As Archivo = TxtUpSonido.getfiles().Archivos(0)
- Dim PathSonido As String = $"{AppDomain.CurrentDomain.BaseDirectory}Sonidos"
+ Dim PathSonido As String = $"{ModExtensiones.DirectorioBaseEmpresas}Sonidos"
Sonido = FormatearNombreArchivo(ArchivoSonido.filenameO)
Dim dirSonido As String = String.Format("{0}\{1}", PathSonido, Sonido)
If File.Exists(dirSonido) Then
@@ -559,7 +559,7 @@ Partial Class GPS_WizardModelo
If TxtUpImagen.getfiles().Archivos.Count > 0 Then
Dim ArchivoImagen As Archivo = TxtUpImagen.getfiles().Archivos(0)
Imagen = FormatearNombreArchivo(ArchivoImagen.filenameO)
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Imagenes"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Imagenes"
If Not Directory.Exists(Path) Then
Directory.CreateDirectory(Path)
End If
@@ -573,7 +573,7 @@ Partial Class GPS_WizardModelo
If TxtUpSonido.getfiles().Archivos.Count > 0 Then
Dim ArchivoSonido As Archivo = TxtUpSonido.getfiles().Archivos(0)
Sonido = FormatearNombreArchivo(ArchivoSonido.filenameO)
- Dim PathSonido As String = $"{AppDomain.CurrentDomain.BaseDirectory}Sonidos"
+ Dim PathSonido As String = $"{ModExtensiones.DirectorioBaseEmpresas}Sonidos"
Dim dirSonido As String = String.Format("{0}\{1}", PathSonido, Sonido)
If File.Exists(dirSonido) Then
My.Computer.FileSystem.DeleteFile(dirSonido)
@@ -661,7 +661,7 @@ Partial Class GPS_WizardModelo
End If
e.Row.VerticalAlign = VerticalAlign.Middle
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveEvento").ToString
- If e.Row.DBCampo("Sonido").ToString <> "" AndAlso File.Exists($"{AppDomain.CurrentDomain.BaseDirectory}/Sonidos/{e.Row.DataKey("Sonido").ToString}") Then
+ If e.Row.DBCampo("Sonido").ToString <> "" AndAlso File.Exists($"{ModExtensiones.DirectorioBaseEmpresas}/Sonidos/{e.Row.DataKey("Sonido").ToString}") Then
e.Row.FCLinkButton("PlaySonido").Visible = True
e.Row.FCLinkButton("PlaySonido").OnClientClick = $"javascript:PlaySonidito('{e.Row.DataKey("Sonido").ToString}');return false;"
End If
diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs
index 1f3bef5fa..de9a07d40 100644
--- a/General/RepPaqueteriasGuias.aspx.cs
+++ b/General/RepPaqueteriasGuias.aspx.cs
@@ -618,7 +618,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
{
try
{
- FileExtension = System.IO.Path.GetExtension(string.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
+ FileExtension = System.IO.Path.GetExtension(string.Format("{0}Temp\\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "");
string rutaDestino = UsuarioActual.Empresa.Ruta + "Documentos\\Guias\\" + CvePaqueteriaGuia + "." + FileExtension;
if (!System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta + "Documentos\\Guias\\"))
{
@@ -773,7 +773,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas
string FechIngaFinal = TxtFechaFinalIngreso.Text;
- string Ruta = string.Format("{0}Empresas/{1}/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa);
+ string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa);
string RutaPDF = string.Format("{0}/Formatos/RepPaqueteriasGuias.rdlc", Ruta);
if (!File.Exists(RutaPDF))
diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb
index d2f4a0026..9eaa492e7 100644
--- a/General/SaldosIniciales.aspx.vb
+++ b/General/SaldosIniciales.aspx.vb
@@ -18,7 +18,7 @@ Partial Class General_SaldosIniciales
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
If TxtExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
@@ -2023,25 +2023,25 @@ Partial Class General_SaldosIniciales
Dim Directorio As String = ""
If RblFormato.SelectedValue = "1" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedor.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoProveedor.xlsx"
ElseIf RblFormato.SelectedValue = "2" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx"
ElseIf RblFormato.SelectedValue = "3" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas.xlsx"
ElseIf RblFormato.SelectedValue = "4" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas.xlsx"
ElseIf RblFormato.SelectedValue = "5" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoPS.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoPS.xlsx"
ElseIf RblFormato.SelectedValue = "6" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoRH-Personal.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoRH-Personal.xlsx"
ElseIf RblFormato.SelectedValue = "7" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoAF-ActivosFijos.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoAF-ActivosFijos.xlsx"
ElseIf RblFormato.SelectedValue = "8" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoContabilidad.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoContabilidad.xlsx"
ElseIf RblFormato.SelectedValue = "9" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoContabilidad.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoContabilidad.xlsx"
ElseIf RblFormato.SelectedValue = "12" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoAlmacen.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoAlmacen.xlsx"
End If
Dim Archivo As New IO.FileInfo(Directorio)
diff --git a/Global.asax b/Global.asax
index 973a330a8..51e12d39c 100644
--- a/Global.asax
+++ b/Global.asax
@@ -536,8 +536,8 @@
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
Application("GlobalDTEmpresas") = ObjEmpresas.DtResultados
'verifico si existe la carpeta de la empresa, sino la crea
- For Each dr As Data.DataRow In ObjEmpresas.DtResultados.Rows
- Dim Ruta As String = String.Format("{0}Empresas\{1}", AppDomain.CurrentDomain.BaseDirectory, dr("CveEmpresa"))
+ For Each dr As Data.DataRow In ObjEmpresas.DtResultados.Rows
+ Dim Ruta As String = String.Format("{0}Empresas\{1}", ModExtensiones.DirectorioBaseEmpresas, dr("CveEmpresa"))
If Not IO.Directory.Exists(Ruta) Then IO.Directory.CreateDirectory(Ruta)
If Not System.IO.Directory.Exists(String.Format("{0}\XML\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\XML\", Ruta))
If Not System.IO.Directory.Exists(String.Format("{0}\PDF\", Ruta)) Then System.IO.Directory.CreateDirectory(String.Format("{0}\PDF\", Ruta))
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index 595bb902b..7fb911cdb 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -3814,7 +3814,7 @@ Partial Class Inventarios_EntradasSalidas
#Region "DESCARGAR E IMPRIMIR LISTADO"
Public Sub DescargarFormato()
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\Formatos\FormatoEntradasSalidas.xlsx"
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\FormatoEntradasSalidas.xlsx"
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
@@ -3970,7 +3970,7 @@ Partial Class Inventarios_EntradasSalidas
If DdlAlmacen.SelectedValue.ToEntero > 0 Then
If TxtExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
diff --git a/Inventarios/PopUpBuscarMovto.aspx.vb b/Inventarios/PopUpBuscarMovto.aspx.vb
index 40292c98f..92994df68 100644
--- a/Inventarios/PopUpBuscarMovto.aspx.vb
+++ b/Inventarios/PopUpBuscarMovto.aspx.vb
@@ -9,7 +9,7 @@ Partial Class PopUpBuscarFolio
#Region "PROPIEDADES"
Private ReadOnly Property Ruta As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
End Get
End Property
#End Region
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 4d96a52f1..e0af15a20 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -3763,7 +3763,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim Compra As String = DdlFolio.SelectedItem.Text
Dim RutaPDF As String
- Dim Ruta As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{UsuarioActual.CveEmpresa}\"
+ Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\"
RutaPDF = $"{Ruta}\Formatos\EntradaAlmacen.rdlc"
If Not File.Exists(RutaPDF) Then
RutaPDF = "Empresas/Grales/Formatos/EntradaAlmacen.rdlc"
diff --git a/Inventarios/RecepcionEntrega.aspx.vb b/Inventarios/RecepcionEntrega.aspx.vb
index b838c9e68..47a850b40 100644
--- a/Inventarios/RecepcionEntrega.aspx.vb
+++ b/Inventarios/RecepcionEntrega.aspx.vb
@@ -698,7 +698,7 @@ Partial Class Inventarios_RecepcionEntrega
End If
End If
- CargaDocumentos(CveVenta)
+ 'CargaDocumentos(CveVenta)
Else
Alert("No se encontraron productos pendientes por surtir. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
End If
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index 1569c47fd..73cc74ab7 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -1552,7 +1552,7 @@ Partial Class Inventarios_RecepcionUsados
Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
For Each fileItem As Archivo In Filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "")
Filename = fileItem.filename
Next
@@ -1636,7 +1636,7 @@ Partial Class Inventarios_RecepcionUsados
Dim Filename As String = ""
For Each fileItem As Archivo In Filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) '.Replace(".", "")
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)) '.Replace(".", "")
Filename = fileItem.filename
Next
@@ -1983,7 +1983,7 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjFactura = Nothing
End If
- Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=Server.MapPath("/"))
+ Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas)
If Me.ObjFactura IsNot Nothing Then
'CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
@@ -2035,7 +2035,7 @@ Partial Class Inventarios_RecepcionUsados
' 'Dim CveVenta As Integer = DdlFactura.SelectedValue.ToEntero()
- ' 'ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, DirectorioServidor:=Server.MapPath("/"))
+ ' 'ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas)
' If Me.ObjFactura IsNot Nothing Then
' CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
diff --git a/Inventarios/RepConsumoInterno.aspx.cs b/Inventarios/RepConsumoInterno.aspx.cs
index 85f2a98eb..5dd00883e 100644
--- a/Inventarios/RepConsumoInterno.aspx.cs
+++ b/Inventarios/RepConsumoInterno.aspx.cs
@@ -177,7 +177,7 @@ public partial class Inventarios_RepConsumoInterno : ClsPaginas
string FechaFin = DateTime.Parse(TxtFechaF.Text).ToShortDateString();
- string Ruta = string.Format("{0}Empresas/{1}/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa);
+ string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa);
string RutaPDF = string.Format("{0}/Formatos/RepConsumoInterno.rdlc", Ruta);
if (!File.Exists(RutaPDF))
diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb
index 767d1e66f..6d03bc17b 100644
--- a/Inventarios/RepEntradasSalidas.aspx.vb
+++ b/Inventarios/RepEntradasSalidas.aspx.vb
@@ -119,7 +119,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
Dim CveAlmacen = Request("CveAlmacen").ToString
Dim Almacen As String = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {Request("CveAlmacen").ToString}")
DdlAlmacen.Items.Insert(0, New ListItem(Almacen, CveAlmacen))
- End If
+ End If
Else
DdlAlmacen.SelectedValuesIfExistM("-1")
End If
@@ -368,7 +368,7 @@ Partial Class Inventarios_ReporteEntradasSalidas
FechaF = Now
End If
Dim RutaPDF As String
- Dim Ruta As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{UsuarioActual.CveEmpresa}\"
+ Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\"
Dim NombreArchivoDescarga = "ReporteEntradas-Salidas"
If UsuarioActual.CveEmpresa.Contiene(119) Then
diff --git a/Inventarios/RepEntregasForaneas.aspx.vb b/Inventarios/RepEntregasForaneas.aspx.vb
index 281be5fa5..19e7d2694 100644
--- a/Inventarios/RepEntregasForaneas.aspx.vb
+++ b/Inventarios/RepEntregasForaneas.aspx.vb
@@ -721,7 +721,7 @@ Partial Class Inventarios_RepEntregasForaneas
Dim Tipo As String = DdlTipo.SelectedItem.Text
Dim RutaPDF As String
- Dim Ruta As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{UsuarioActual.CveEmpresa}\"
+ Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\"
RutaPDF = $"{Ruta}\Formatos\RepEntregasForaneas.rdlc"
If Not File.Exists(RutaPDF) Then
RutaPDF = "Empresas/Grales/Formatos/RepEntregasForaneas.rdlc"
diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb
index 50115c258..9d8f8a66b 100644
--- a/Inventarios/TrasladoSolicitud.aspx.vb
+++ b/Inventarios/TrasladoSolicitud.aspx.vb
@@ -711,7 +711,7 @@ Partial Class Inventarios_TrasladoSolicitud
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
If TxtExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
@@ -839,7 +839,7 @@ Partial Class Inventarios_TrasladoSolicitud
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
Dim Directorio As String = ""
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SolicitudTraslado.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SolicitudTraslado.xlsx"
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
Response.Clear()
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 0a6073f34..99ab5f5f1 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -2788,7 +2788,7 @@ Partial Class Inventarios_TraspasoAlmacen
Protected Sub BtnCargaExcelConceptos_Click(sender As Object, e As EventArgs)
If TxtExcelConceptos.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcelConceptos.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
CargarArchivoConceptos(Directorio, file.filename)
RegistraScript("$('#DivCargaExcelConceptos').modal('hide');")
Else
diff --git a/Masters/Site42.master.vb b/Masters/Site42.master.vb
index 0d647590a..143ba65de 100644
--- a/Masters/Site42.master.vb
+++ b/Masters/Site42.master.vb
@@ -42,7 +42,7 @@ Partial Class Masters_Site42
If Not UsuarioActual.Portal Then 'si no es un cliente o proveedor
Dim dt As New DataTable
- dt.ReadXml(String.Format("{0}\Menu\{1}.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveUsuario))
+ dt.ReadXml(String.Format("{0}\Menu\{1}.xml", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveUsuario))
Dim Inicio = From i In dt.AsEnumerable Where i!CvePadre.Equals(0) Order By i!Orden
Dim CveModulo As Integer
For Each dr As DataRow In Inicio
diff --git a/Nomina/EventoDetalle.aspx.vb b/Nomina/EventoDetalle.aspx.vb
index 2fd65fb23..1f30157eb 100644
--- a/Nomina/EventoDetalle.aspx.vb
+++ b/Nomina/EventoDetalle.aspx.vb
@@ -1140,14 +1140,14 @@ Partial Class OI_EventoDetalle
'CUANDO ES REENVIO
If CveEventoPadre > 0 Then
- If A2.HRef <> "" Then RutaArchivo = String.Format("{0}{1}", Request.PhysicalApplicationPath, A2.HRef.Substring(1))
+ If A2.HRef <> "" Then RutaArchivo = String.Format("{0}{1}", ModExtensiones.DirectorioBaseEmpresas, A2.HRef.Substring(1))
If File.Exists(RutaArchivo) Then
Archivo = Path.GetExtension(ArchivoReenvio)
End If
If UsuarioActual.CveRol = 1037 Then
- RutaGuardar = String.Format("{0}Empresas\70\OI\", Request.PhysicalApplicationPath)
+ RutaGuardar = String.Format("{0}Empresas\70\OI\", ModExtensiones.DirectorioBaseEmpresas)
RutaGuardar.DirectoryExistsCreate
End If
Else
@@ -1353,18 +1353,18 @@ Partial Class OI_EventoDetalle
CargaDatos()
End Sub
'Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
- ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
- ' Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
- ' If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos")
- ' File.Move(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension)
+ ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
+ ' Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
+ ' If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos")
+ ' File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension)
' Session("FileUpload") = ""
- ' If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then
+ ' If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then
' Dim ObjActivosFijos As New ClsActivosFijos
' If ObjActivosFijos.AddActivosFijosImagenes(CveEvento, CveEvento & "_" & ArchConsecutivo & Extension, UsuarioActual.CveUsuario) Then
' 'CargarArchivo()
' Else
- ' File.Delete(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension)
+ ' File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension)
' End If
' ObjActivosFijos.Dispose()
@@ -1373,7 +1373,7 @@ Partial Class OI_EventoDetalle
' End If
'End Sub
Private Sub CargaRevision()
- DdlRevision.DataSource = GlobalDTOIRevision(usuarioactual.cveempresa).FiltraParametros(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario))
+ DdlRevision.DataSource = GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario))
DdlRevision.DataBind()
DdlRevision.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
@@ -1471,7 +1471,7 @@ Partial Class OI_EventoDetalle
'End Sub
Protected Sub BtnAddObs_Click(sender As Object, e As EventArgs) Handles BtnAddObs.Click
- 'Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", Request.PhysicalApplicationPath, UsuarioActual.CveEmpresa)
+ 'Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
'Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", GlobalDTParametros(SisParametros.DirectorioSitio).Cadena1, UsuarioActual.CveEmpresa)
'Dim RutaArchivo As String = String.Format("{0}Empresas\{1}\OI\Temp\{2}", GlobalDTParametros(SisParametros.DirectorioSitio).Cadena1, UsuarioActual.CveEmpresa, Session("Eventos2"))
diff --git a/Nomina/Nomina.aspx.vb b/Nomina/Nomina.aspx.vb
index c9576dbe7..86a6aea16 100644
--- a/Nomina/Nomina.aspx.vb
+++ b/Nomina/Nomina.aspx.vb
@@ -92,12 +92,12 @@ Partial Class Nomina_Nomina
End Property
Private ReadOnly Property Ruta As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
End Get
End Property
Private ReadOnly Property RutaPruebas As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\1\"
+ Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\1\"
End Get
End Property
diff --git a/Nomina/Nomina2.aspx.cs b/Nomina/Nomina2.aspx.cs
index 0fe967499..d7e539f73 100644
--- a/Nomina/Nomina2.aspx.cs
+++ b/Nomina/Nomina2.aspx.cs
@@ -1285,7 +1285,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
//parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", ""));
//parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", ""));
;
- ImprimirPDF(System.IO.Path.Combine(Server.MapPath("/"), "Empresas/Grales/Formatos/SobreRecibo.rdlc"), lrds, parametros, "SobreRecibo", "PDF", null);
+ ImprimirPDF(System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreRecibo.rdlc"), lrds, parametros, "SobreRecibo", "PDF", null);
}
protected void BtnGuardarInfornavit_Click(object sender, EventArgs e)
{
@@ -1534,7 +1534,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
private void ImprimirReporte()
{
- string RutaDocumento = System.IO.Path.Combine(Server.MapPath("/"), "Empresas/Grales/Lista de Raya.docx");
+ string RutaDocumento = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Lista de Raya.docx");
if (dtempleados != null && dtempleados.Rows.Count > 0)
{
if (System.IO.File.Exists(RutaDocumento))
diff --git a/Nomina/RegistroNomina.aspx.vb b/Nomina/RegistroNomina.aspx.vb
index a0430d29e..4f7df7d0a 100644
--- a/Nomina/RegistroNomina.aspx.vb
+++ b/Nomina/RegistroNomina.aspx.vb
@@ -304,7 +304,7 @@ Partial Class Nomina_RegistroNomina
' Excel.DisplayAlerts = True
' If Not IO.File.Exists(UsuarioActual.Empresa.Ruta & "Formatos\Nomina.xlsm") Then
- ' IO.File.Copy(String.Format("{0}Empresas\Grales\Nomina.xlsm", AppDomain.CurrentDomain.BaseDirectory), UsuarioActual.Empresa.Ruta & "Formatos\Nomina.xlsm", False)
+ ' IO.File.Copy(String.Format("{0}Empresas\Grales\Nomina.xlsm", ModExtensiones.DirectorioBaseEmpresas), UsuarioActual.Empresa.Ruta & "Formatos\Nomina.xlsm", False)
' End If
' Dim ArchivoBase As New System.IO.FileInfo(UsuarioActual.Empresa.Ruta & "Formatos\Nomina.xlsm")
diff --git a/OC/CotizacionEnLinea.aspx.vb b/OC/CotizacionEnLinea.aspx.vb
index 24b9e12cf..3390f9e6d 100644
--- a/OC/CotizacionEnLinea.aspx.vb
+++ b/OC/CotizacionEnLinea.aspx.vb
@@ -299,10 +299,10 @@ Partial Class OC_CotizacionEnLinea
If FUArchivo.HasFile Then
'verificar que exista el directorio
- If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, CveEmpresa)) Then
- System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, CveEmpresa))
+ If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa)) Then
+ System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa))
End If
- FUArchivo.SaveAs(String.Format("{0}/Empresas/{1}/Cotizaciones/{2}{3}", AppDomain.CurrentDomain.BaseDirectory, CveEmpresa, CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName)))
+ FUArchivo.SaveAs(String.Format("{0}/Empresas/{1}/Cotizaciones/{2}{3}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName)))
End If
For Each dr As GridViewRow In GvD.Rows
@@ -351,7 +351,7 @@ Partial Class OC_CotizacionEnLinea
Dim Mail As New ClsSisMail()
Empresa = ClsPaginas.EmpresaNotificaciones
- Empresa.Ruta = String.Format("{0}Empresas\{1}\", AppDomain.CurrentDomain.BaseDirectory, CveEmpresa)
+ 'Empresa.Ruta = String.Format("{0}Empresas\{1}\", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa)
Mail.SendMail(Empresa, ViewState("Para").ToString, ViewState("Asunto").ToString, ViewState("Body").ToString, ViewState("ArrayCC").ToString)
diff --git a/OC/ListaRequisicion.aspx.cs b/OC/ListaRequisicion.aspx.cs
index 4c80e3f94..36b8d6b66 100644
--- a/OC/ListaRequisicion.aspx.cs
+++ b/OC/ListaRequisicion.aspx.cs
@@ -102,7 +102,7 @@ public partial class OC_ListaRequisicion : ClsPaginas
protected void ImprimiReporte(string Formato = "PDF")
{
- string Ruta = string.Format("{0}Empresas/{1}/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa);
+ string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa);
string RutaPDF = string.Format("{0}/Formatos/ListaRequisicion.rdlc", Ruta);
if (!File.Exists(RutaPDF))
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index b57dc6633..b3456153b 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -4811,7 +4811,7 @@ Partial Class OC
Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
For Each fileItem As Archivo In Filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "")
Filename = fileItem.filename
Next
@@ -6102,7 +6102,7 @@ Partial Class OC
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
If TxtExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
@@ -6357,7 +6357,7 @@ Partial Class OC
End Function
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click, LbDescargarExcel.Click
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\FormatoOC.xlsx"
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\FormatoOC.xlsx"
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
Response.Clear()
@@ -7509,7 +7509,7 @@ Partial Class OC
Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs)
If TxtExcelCot.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
CargarArchivoCot(Directorio, file.filename)
CargaCotizaciones(CveOrdenCompra)
diff --git a/OC/OC2.aspx.vb b/OC/OC2.aspx.vb
index e21677ddb..835646196 100644
--- a/OC/OC2.aspx.vb
+++ b/OC/OC2.aspx.vb
@@ -3430,10 +3430,10 @@ Partial Class OC
'Renombrar archivo
If Session("FileExtension").ToString.Length > 0 AndAlso Session("FileUpload").ToString.Length > 0 AndAlso Session("FileFolder").ToString.Length > 0 Then
- If Not Directory.Exists(String.Format("{0}Empresas\{1}\OI", Request.PhysicalApplicationPath, UsuarioActual.CveEmpresa)) Then
- Directory.CreateDirectory(String.Format("{0}Empresas\{1}\OI", Request.PhysicalApplicationPath, UsuarioActual.CveEmpresa))
+ If Not Directory.Exists(String.Format("{0}Empresas\{1}\OI", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) Then
+ Directory.CreateDirectory(String.Format("{0}Empresas\{1}\OI", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa))
End If
- Ruta = String.Format("{0}Empresas\{1}\OI\", Request.PhysicalApplicationPath, UsuarioActual.CveEmpresa)
+ Ruta = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
System.IO.File.Move(Archivo, String.Format("{0}OI{1}{2}", Ruta, ObjEventoBitacora.CveEvento.ToString, Extension))
End If
diff --git a/OC/PopUpBuscarReq.aspx.vb b/OC/PopUpBuscarReq.aspx.vb
index c5f5f5e40..814797b58 100644
--- a/OC/PopUpBuscarReq.aspx.vb
+++ b/OC/PopUpBuscarReq.aspx.vb
@@ -19,7 +19,7 @@ Partial Class OC_PopUpBuscarReq
End Property
Private ReadOnly Property Ruta As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
End Get
End Property
#End Region
diff --git a/OC/RepCotizacionesDetalle.aspx.vb b/OC/RepCotizacionesDetalle.aspx.vb
index e2829799f..e519b2935 100644
--- a/OC/RepCotizacionesDetalle.aspx.vb
+++ b/OC/RepCotizacionesDetalle.aspx.vb
@@ -2,14 +2,14 @@
Option Explicit On
Imports System.Data
-Imports System.Net
+Imports System.Net
Imports Extensiones
Partial Class PopOCCotizacionesDetalle
- Inherits ClsPaginas
-
+ Inherits ClsPaginas
+
#Region "Propiedades"
-
+
Friend Property EsNuevo As Boolean
Get
EsNuevo = DirectCast(ViewState("EsNuevo"), Boolean)
@@ -44,7 +44,7 @@ Partial Class PopOCCotizacionesDetalle
Set(ByVal value As DataTable)
ViewState("DtDetalle") = value
End Set
- End Property
+ End Property
Private Property Adjunto As String
Get
Adjunto = ViewState("Adjunto").ToString
@@ -52,12 +52,12 @@ Partial Class PopOCCotizacionesDetalle
Set(value As String)
ViewState("Adjunto") = value
End Set
- End Property
-
-
+ End Property
+
+
#End Region
-
-
+
+
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
@@ -86,9 +86,9 @@ Partial Class PopOCCotizacionesDetalle
BtnEliminar.Visible = True
End If
End If
- End Sub
-
-
+ End Sub
+
+
#Region " INICIALIZA VALORES - CARGA COMBOS "
Protected Sub CargaProveedoresClasificaciones()
CboClasificacionProveedor.DataSource = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa)
@@ -107,11 +107,11 @@ Partial Class PopOCCotizacionesDetalle
Protected Sub CargaMonedas()
ddlMoneda.DataSource = GlobalDTMonedas()
ddlMoneda.DataBind()
- End Sub
-
+ End Sub
+
#End Region
-
-
+
+
#Region "C A R G A D A T O S "
Private Sub CargaOCDetalle(pCveOrden As Integer)
Dim objOC As New ClsOC
@@ -141,7 +141,7 @@ Partial Class PopOCCotizacionesDetalle
TxtDiasCredito.Text = objCotizacion.DiasCredito.ToString
Adjunto = objCotizacion.Adjunto
If objCotizacion.Adjunto <> "" Then
- 'HplArchivo.NavigateUrl = String.Format("/Empresas/{0}/Cotizaciones/{1}", UsuarioActual.CveEmpresa, objCotizacion.Adjunto)
+ 'HplArchivo.NavigateUrl = String.Format("/Empresas/{0}/Cotizaciones/{1}", UsuarioActual.CveEmpresa, objCotizacion.Adjunto)
LnkArchivo.Visible = True
End If
@@ -173,59 +173,59 @@ Partial Class PopOCCotizacionesDetalle
End If
BtnGuardar.Enabled = False
- End Sub
+ End Sub
#End Region
-
-
+
+
#Region " GUARDAR "
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
Dim objCotizacion As New ClsOC
objCotizacion.IniciaTransacSQL()
- Dim TieneError = False
-
- Dim FileExtension As String = ""
- Dim Filesgral As List(Of Archivo) = TxtArchivo.getfiles().Archivos
- Dim Filename As String = ""
- For Each fileItem As Archivo In Filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) '.Replace(".", "")
- Filename = fileItem.filename
- Next
-
+ Dim TieneError = False
+
+ Dim FileExtension As String = ""
+ Dim Filesgral As List(Of Archivo) = TxtArchivo.getfiles().Archivos
+ Dim Filename As String = ""
+ For Each fileItem As Archivo In Filesgral
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) '.Replace(".", "")
+ Filename = fileItem.filename
+ Next
+
Try
If EsNuevo Then
- If objCotizacion.AddCotizacion(CveOrdenCompra, CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero,
- TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario) Then
-
- 'verificar que exista el directorio
- If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then
- System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa))
- End If
-
- If Filename <> "" Then
- Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa))
+ If objCotizacion.AddCotizacion(CveOrdenCompra, CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero,
+ TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario) Then
+
+ 'verificar que exista el directorio
+ If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) Then
+ System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa))
+ End If
+
+ If Filename <> "" Then
+ Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa))
End If
For Each dr As GridViewRow In GvDC.Rows
- TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble,
- dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble,
- If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1",
+ TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble,
+ dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble,
+ If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1",
dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero)
If TieneError = True Then Exit For
Next
End If
Else
- If objCotizacion.UpdateCotizacion(CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario, CveCotizacion) Then
-
- 'verificar que exista el directorio
- If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then
- System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa))
- End If
-
- If Filename <> "" Then
- Filename.FilesMove(CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa))
+ If objCotizacion.UpdateCotizacion(CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario, CveCotizacion) Then
+
+ 'verificar que exista el directorio
+ If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) Then
+ System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa))
+ End If
+
+ If Filename <> "" Then
+ Filename.FilesMove(CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa))
End If
For Each dr As GridViewRow In GvDC.Rows
@@ -254,19 +254,19 @@ Partial Class PopOCCotizacionesDetalle
If Not TieneError Then
objCotizacion.Commit()
Alert(If(EsNuevo, "Cotización Guardada.", "Cotización Actualizada."), TipoMensaje.MsgInformacion)
- Else
+ Else
objCotizacion.RollBack()
End If
objCotizacion.Dispose()
RegistraScript("Ir();")
- End Sub
+ End Sub
#End Region
-
-
-
-
+
+
+
+
#Region " ELIMINAR "
Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click
Dim objCotizacion As New ClsOC
@@ -280,10 +280,10 @@ Partial Class PopOCCotizacionesDetalle
objCotizacion.Dispose()
RegistraScript("Ir();")
- End Sub
+ End Sub
#End Region
-
-
+
+
#Region " G V D "
Protected Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -371,30 +371,30 @@ Partial Class PopOCCotizacionesDetalle
'e.Row.Attributes.Add("data-validadores", ValidadoresId)
- Dim asdasdasd As String = ""
+ Dim asdasdasd As String = ""
End If
- End Sub
+ End Sub
#End Region
-
-
- Protected Sub LnkArchivo_Click(sender As Object, e As EventArgs)
- If Not String.IsNullOrEmpty(Adjunto) Then
- Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, "Cotizaciones\" & Adjunto)
- Dim Archivo As New System.IO.FileInfo(filePath)
-
- If Archivo.Exists Then
- HttpContext.Current.Response.Clear()
- HttpContext.Current.Response.ClearContent()
- HttpContext.Current.Response.ContentType = "application/octet-stream"
- HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + System.IO.Path.GetFileName(filePath))
- HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
- HttpContext.Current.Response.TransmitFile(filePath)
- HttpContext.Current.Response.Flush()
- HttpContext.Current.Response.End()
-
- Archivo = Nothing
- End If
- End If
-
- End Sub
+
+
+ Protected Sub LnkArchivo_Click(sender As Object, e As EventArgs)
+ If Not String.IsNullOrEmpty(Adjunto) Then
+ Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, "Cotizaciones\" & Adjunto)
+ Dim Archivo As New System.IO.FileInfo(filePath)
+
+ If Archivo.Exists Then
+ HttpContext.Current.Response.Clear()
+ HttpContext.Current.Response.ClearContent()
+ HttpContext.Current.Response.ContentType = "application/octet-stream"
+ HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + System.IO.Path.GetFileName(filePath))
+ HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
+ HttpContext.Current.Response.TransmitFile(filePath)
+ HttpContext.Current.Response.Flush()
+ HttpContext.Current.Response.End()
+
+ Archivo = Nothing
+ End If
+ End If
+
+ End Sub
End Class
diff --git a/OI/CircularDetalle.aspx.vb b/OI/CircularDetalle.aspx.vb
index f443ccf6b..0931f4078 100644
--- a/OI/CircularDetalle.aspx.vb
+++ b/OI/CircularDetalle.aspx.vb
@@ -162,7 +162,7 @@ Partial Class OI_CircularDetalle
End Function
Private Function TituloAnterior() As String
- Dim Directorio As New IO.DirectoryInfo(String.Format("{0}Empresas/{1}/Formatos/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa))
+ Dim Directorio As New IO.DirectoryInfo(String.Format("{0}Empresas/{1}/Formatos/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa))
Dim ArchivosArreglo As IO.FileInfo() = Directorio.GetFiles()
Dim patronRegEx As String = String.Format("^{0}_.*", CveCircular)
Dim archivoEncontrado As String = ""
diff --git a/OI/CircularDetalleB.aspx.cs b/OI/CircularDetalleB.aspx.cs
index 5cb80dc8e..b779a7fe3 100644
--- a/OI/CircularDetalleB.aspx.cs
+++ b/OI/CircularDetalleB.aspx.cs
@@ -195,7 +195,7 @@ public partial class OI_CircularDetalleB : ClsPaginas
private string TituloAnterior()
{
- System.IO.DirectoryInfo Directorio = new System.IO.DirectoryInfo(string.Format("{0}Empresas/{1}/Formatos/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa));
+ System.IO.DirectoryInfo Directorio = new System.IO.DirectoryInfo(string.Format("{0}Empresas/{1}/Formatos/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa));
System.IO.FileInfo[] ArchivosArreglo = Directorio.GetFiles();
string patronRegEx = string.Format("^{0}_.*", CveCircular);
string archivoEncontrado = "";
diff --git a/OI/EventoComentario.aspx.vb b/OI/EventoComentario.aspx.vb
index bb8031698..5d71becb9 100644
--- a/OI/EventoComentario.aspx.vb
+++ b/OI/EventoComentario.aspx.vb
@@ -59,7 +59,7 @@ Partial Class OI_EventoComentario
' TxtUsuario.Text = ObjEventosComentarios.UsuarioDe
- ' If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & ObjEventosComentarios.Archivo & ".png") Then
+ ' If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & ObjEventosComentarios.Archivo & ".png") Then
' TxtArchivo.Text = "/Empresas/" & UsuarioActual.CveEmpresa & "/OI/Eventos/" & ObjEventosComentarios.Archivo & ".png"
' End If
@@ -92,17 +92,17 @@ Partial Class OI_EventoComentario
' ObjEventosComentarios.Dispose()
End Sub
- Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
- 'Preguntar si existe en temporales
- If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
- Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
- If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos") Then Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos")
- If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension) Then
- File.Delete(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension)
- File.Move(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension)
- Else
- File.Move(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension)
- End If
+ Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
+ 'Preguntar si existe en temporales
+ If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
+ Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
+ If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos")
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension) Then
+ File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension)
+ File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension)
+ Else
+ File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension)
+ End If
Else
'Imagen Default
diff --git a/OI/EventoDetalle.aspx.vb b/OI/EventoDetalle.aspx.vb
index 26ecd8f66..dd5c8cade 100644
--- a/OI/EventoDetalle.aspx.vb
+++ b/OI/EventoDetalle.aspx.vb
@@ -1147,7 +1147,7 @@ Partial Class OI_EventoDetalle
End If
If UsuarioActual.CveRol = 1037 Then
- RutaGuardar = String.Format("{0}Empresas\70\OI\", Request.PhysicalApplicationPath)
+ RutaGuardar = String.Format("{0}Empresas\70\OI\", ModExtensiones.DirectorioBaseEmpresas)
RutaGuardar.DirectoryExistsCreate
End If
Else
@@ -1353,18 +1353,18 @@ Partial Class OI_EventoDetalle
CargaDatos()
End Sub
'Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
- ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
- ' Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
- ' If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos")
- ' File.Move(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension)
+ ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
+ ' Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
+ ' If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos")
+ ' File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension)
' Session("FileUpload") = ""
- ' If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then
+ ' If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then
' Dim ObjActivosFijos As New ClsActivosFijos
' If ObjActivosFijos.AddActivosFijosImagenes(CveEvento, CveEvento & "_" & ArchConsecutivo & Extension, UsuarioActual.CveUsuario) Then
' 'CargarArchivo()
' Else
- ' File.Delete(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension)
+ ' File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension)
' End If
' ObjActivosFijos.Dispose()
@@ -1373,7 +1373,7 @@ Partial Class OI_EventoDetalle
' End If
'End Sub
Private Sub CargaRevision()
- DdlRevision.DataSource = GlobalDTOIRevision(usuarioactual.cveempresa).FiltraParametros(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario))
+ DdlRevision.DataSource = GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveUsuario = {0}", UsuarioActual.CveUsuario))
DdlRevision.DataBind()
DdlRevision.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
@@ -1471,7 +1471,7 @@ Partial Class OI_EventoDetalle
'End Sub
Protected Sub BtnAddObs_Click(sender As Object, e As EventArgs) Handles BtnAddObs.Click
- 'Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", Request.PhysicalApplicationPath, UsuarioActual.CveEmpresa)
+ 'Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
'Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", GlobalDTParametros(SisParametros.DirectorioSitio).Cadena1, UsuarioActual.CveEmpresa)
'Dim RutaArchivo As String = String.Format("{0}Empresas\{1}\OI\Temp\{2}", GlobalDTParametros(SisParametros.DirectorioSitio).Cadena1, UsuarioActual.CveEmpresa, Session("Eventos2"))
diff --git a/OI/PopUpAgenda.aspx.vb b/OI/PopUpAgenda.aspx.vb
index f2f515513..7292474e9 100644
--- a/OI/PopUpAgenda.aspx.vb
+++ b/OI/PopUpAgenda.aspx.vb
@@ -785,18 +785,18 @@ Partial Class OI_PopUpAgenda
ObjEventos.Dispose()
End Sub
Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
- If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
- Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
- If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos")
- File.Move(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension)
+ If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
+ Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
+ If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos")
+ File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension)
Session("FileUpload") = ""
- If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then
Dim ObjActivosFijos As New ClsAF
If ObjActivosFijos.AddActivosFijosImagenes(CveEvento, CveEvento & "_" & ArchConsecutivo & Extension, UsuarioActual.CveUsuario) Then
'CargarArchivo()
Else
- File.Delete(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension)
+ File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension)
End If
ObjActivosFijos.Dispose()
@@ -840,8 +840,8 @@ Partial Class OI_PopUpAgenda
'End Sub
Protected Sub BtnAddObs_Click(sender As Object, e As EventArgs) Handles BtnAddObs.Click
- Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", Request.PhysicalApplicationPath, UsuarioActual.CveEmpresa)
- Dim RutaArchivo As String = String.Format("{0}Empresas\{1}\OI\Temp\{2}", Request.PhysicalApplicationPath, UsuarioActual.CveEmpresa, Session("Eventos"))
+ Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
+ Dim RutaArchivo As String = String.Format("{0}Empresas\{1}\OI\Temp\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Session("Eventos"))
Dim tCveSeguimiento As Integer
Dim Archivo As String = ""
diff --git a/OI/Proyecto.aspx.cs b/OI/Proyecto.aspx.cs
index 035c07a72..8e861bd05 100644
--- a/OI/Proyecto.aspx.cs
+++ b/OI/Proyecto.aspx.cs
@@ -127,7 +127,7 @@ public partial class OI_Proyecto : ClsPaginas
//{
// archivoname = item.filenameO;
// ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
- // rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
+ // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename);
//}
diff --git a/OI/RepProyectos.aspx.cs b/OI/RepProyectos.aspx.cs
index 4cb9cc150..a4680cdd7 100644
--- a/OI/RepProyectos.aspx.cs
+++ b/OI/RepProyectos.aspx.cs
@@ -99,7 +99,7 @@ public partial class OI_RepProyectos : ClsPaginas
//{
// archivoname = item.filenameO;
// ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
- // rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
+ // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename);
//}
diff --git a/OI/SoporteADS.aspx.vb b/OI/SoporteADS.aspx.vb
index 23c002de6..e91072dd1 100644
--- a/OI/SoporteADS.aspx.vb
+++ b/OI/SoporteADS.aspx.vb
@@ -1345,14 +1345,14 @@ Partial Class OI_SoporteADS
'CUANDO ES REENVIO
If CveEventoPadre > 0 Then
- If A2.HRef <> "" Then RutaArchivo = String.Format("{0}{1}", Request.PhysicalApplicationPath, A2.HRef.Substring(1))
+ If A2.HRef <> "" Then RutaArchivo = String.Format("{0}{1}", ModExtensiones.DirectorioBaseEmpresas, A2.HRef.Substring(1))
If File.Exists(RutaArchivo) Then
Archivo = Path.GetExtension(ArchivoReenvio)
End If
If UsuarioActual.CveRol = 1037 Then
- RutaGuardar = String.Format("{0}Empresas\70\OI\", Request.PhysicalApplicationPath)
+ RutaGuardar = String.Format("{0}Empresas\70\OI\", ModExtensiones.DirectorioBaseEmpresas)
RutaGuardar.DirectoryExistsCreate
End If
Else
@@ -2011,7 +2011,7 @@ Partial Class OI_SoporteADS
For Each fileItem As Archivo In Filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "")
'Filename = fileItem.filename
Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
@@ -2061,7 +2061,7 @@ Partial Class OI_SoporteADS
For Each fileItem As Archivo In Filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "")
'Filename = fileItem.filename
Dim tempArray() As String
tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
@@ -2261,7 +2261,7 @@ Partial Class OI_SoporteADS
End Sub
Private Sub ImprimirReporte()
- Dim RutaDocumento As String = System.IO.Path.Combine(Server.MapPath("/"), "Empresas/Grales/FS.docx")
+ Dim RutaDocumento As String = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/FS.docx")
If File.Exists(RutaDocumento) Then
Dim GemDocumen As New clsGemBoxDocument(RutaDocumento)
diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs
index 5391e91b3..6a9f111bc 100644
--- a/OI/TareaDetalle.aspx.cs
+++ b/OI/TareaDetalle.aspx.cs
@@ -659,7 +659,7 @@ public partial class OI_TareaDetalle : ClsPaginas
{
archivoname = item.filenameO;
ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
- rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
+ rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename);
}
@@ -1029,7 +1029,7 @@ public partial class OI_TareaDetalle : ClsPaginas
{
archivoname = item.filenameO;
ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
- rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
+ rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename);
}
using (ClsOIEventos objoi = new ClsOIEventos())
{
@@ -1101,7 +1101,7 @@ public partial class OI_TareaDetalle : ClsPaginas
{
archivoname = item.filenameO;
ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion);
- rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename);
+ rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename);
}
string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta);
if (!System.IO.Directory.Exists(ruta))
diff --git a/Planeacion/CargarArchivo.aspx.vb b/Planeacion/CargarArchivo.aspx.vb
index a3dcb58b6..9cc1ebded 100644
--- a/Planeacion/CargarArchivo.aspx.vb
+++ b/Planeacion/CargarArchivo.aspx.vb
@@ -16,10 +16,10 @@ Partial Class CargarArchivo
Protected Sub AFU_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete
If AFU.HasFile Then
- If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") Then
- Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp")
+ If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") Then
+ Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp")
End If
- Dim UploadFolder As String = Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\"
+ Dim UploadFolder As String = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\"
Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName)
If System.IO.File.Exists(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension) Then
diff --git a/Planeacion/CargarImagen.aspx.vb b/Planeacion/CargarImagen.aspx.vb
index 1489cc2ba..96af0e798 100644
--- a/Planeacion/CargarImagen.aspx.vb
+++ b/Planeacion/CargarImagen.aspx.vb
@@ -13,10 +13,10 @@ Partial Class CargarImagen
Protected Sub AFU_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete
If AFU.HasFile Then
- If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") Then
- Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp")
+ If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") Then
+ Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp")
End If
- Dim UploadFolder As String = Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\"
+ Dim UploadFolder As String = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\"
Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName)
If System.IO.File.Exists(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension) Then
diff --git a/Planeacion/CatSucursales.aspx.vb b/Planeacion/CatSucursales.aspx.vb
index 70453234c..46146339d 100644
--- a/Planeacion/CatSucursales.aspx.vb
+++ b/Planeacion/CatSucursales.aspx.vb
@@ -105,7 +105,7 @@ Partial Class CatSucursales
e.Row.FCLiteral("LtlFecha").Text = Liga & e.Row.FCLiteral("LtlFecha").Text & ""
e.Row.FCLiteral("LtlUsuario").Text = Liga & e.Row.FCLiteral("LtlUsuario").Text & ""
- If System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\" & e.Row.DBCampo("FormatoFactura")) Then
+ If System.IO.File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\" & e.Row.DBCampo("FormatoFactura")) Then
e.Row.FCLiteral("LtlFormato").Text = "Ver"
Else
e.Row.FCLiteral("LtlFormato").Text = "Cargar Factura"
diff --git a/Planeacion/Sucursal.aspx.vb b/Planeacion/Sucursal.aspx.vb
index 11256efc1..a5844ccba 100644
--- a/Planeacion/Sucursal.aspx.vb
+++ b/Planeacion/Sucursal.aspx.vb
@@ -62,7 +62,7 @@ Partial Class Sucursal
Else
Matriz.Checked = False
End If
- If System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\" & DT.Rows(0)("FormatoFactura").ToString) Then
+ If System.IO.File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\" & DT.Rows(0)("FormatoFactura").ToString) Then
'DirectCast("HLVer", HtmlLink). = "Ver"
End If
diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb
index dbe6c9e10..8712a2117 100644
--- a/PortalCliente/PortalCliente.aspx.vb
+++ b/PortalCliente/PortalCliente.aspx.vb
@@ -359,7 +359,7 @@ Partial Class Ventas_PortalCliente
'Dim ObjEmprea As New ClsEmpresas()
'If ObjEmprea.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
Dim ObjMail As New ClsSisMail()
- Dim Ruta As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Dim Ruta As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
If File.Exists(Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf") AndAlso File.Exists(Ruta & "XML\" & HdnFolioVenta.Value & ".xml") Then
Dim PDF As String = Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf"
@@ -1328,11 +1328,11 @@ Partial Class Ventas_PortalCliente
If e.Row.RowIndex >= 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
'CARGAR IMAGENES DE PERSONAL
- If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("URL") & ".png") Then
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("URL") & ".png") Then
e.Row.FCImage("ImgPersonal").ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & e.Row.DBCampo("URL") & ".png"
End If
- 'If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("URL")) Then
+ 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("URL")) Then
'e.Row.FCLiteral("LtlImgPersonal").Text = " "
'Else
'e.Row.FCLiteral("LtlImgPersonal").Text = " "
diff --git a/PortalGPS/Penske.aspx.vb b/PortalGPS/Penske.aspx.vb
index 2d4586d4b..5df25f0cd 100644
--- a/PortalGPS/Penske.aspx.vb
+++ b/PortalGPS/Penske.aspx.vb
@@ -95,7 +95,7 @@ Partial Class PortalGPS_Penske
' strLineaTMP = Chr(13) & Chr(10) & Day(Now) & "/" & Month(Now) & "/" & Year(Now) & " " & Hour(Now) & ":" & Minuto & ". " & Str & Chr(13) & Chr(10)
strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
Try
- ArchivoW = New StreamWriter(String.Format("{0}\LogPenske.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
+ ArchivoW = New StreamWriter(String.Format("{0}\log\LogPenske.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As UnauthorizedAccessException
'Alert("No hay permisos para guardar en el Log.", Extensiones.TipoMensaje.MsgError)
Exit Sub
diff --git a/PortalGPS/ServiciosGPS.aspx.vb b/PortalGPS/ServiciosGPS.aspx.vb
index b59d82da9..d0d8d1aa0 100644
--- a/PortalGPS/ServiciosGPS.aspx.vb
+++ b/PortalGPS/ServiciosGPS.aspx.vb
@@ -66,7 +66,7 @@ Partial Class PortalGPS_ServiciosGPS
strLineaTMP = String.Format("{0}{1}Log: {2}{3}:{4}", Chr(13), Chr(10), Str, DateTime.Now.ToShortDateString, DateTime.Now.ToShortTimeString)
Try
- ArchivoW = New StreamWriter(String.Format("{0}\LogCanBus.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
+ ArchivoW = New StreamWriter(String.Format("{0}\log\LogCanBus.txt", AppDomain.CurrentDomain.BaseDirectory), True, System.Text.Encoding.UTF8)
Catch ex As Exception
Exit Sub
End Try
diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb
index 9b5100c61..74ae350dd 100644
--- a/PortalProveedor/PortalProveedor.aspx.vb
+++ b/PortalProveedor/PortalProveedor.aspx.vb
@@ -2,13 +2,13 @@
Option Strict On
Imports System.Data
-Imports System.IO
+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
@@ -103,14 +103,14 @@ Partial Class Portal_PortalProveedor
Set(value As DataTable)
ViewState("DTGvAH") = value
End Set
- End Property
-
+ End Property
+
#End Region
-
-#Region " D O C U M E N T A C I O N"
-
-
-
+
+#Region " D O C U M E N T A C I O N"
+
+
+
Property CveDocumentacionElectronica As Integer
Get
If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
@@ -122,8 +122,8 @@ Partial Class Portal_PortalProveedor
Set(value As Integer)
ViewState("CvePersonalClienteDocumentacion") = value
End Set
- End Property
-
+ End Property
+
Property CveDocumentacion As Integer
Get
If ViewState("CveDocumentacion") Is Nothing Then
@@ -135,8 +135,8 @@ Partial Class Portal_PortalProveedor
Set(value As Integer)
ViewState("CveDocumentacion") = value
End Set
- End Property
-
+ End Property
+
Property Documentacion As String
Get
If ViewState("Documentacion") Is Nothing Then
@@ -148,8 +148,8 @@ Partial Class Portal_PortalProveedor
Set(value As String)
ViewState("Documentacion") = value
End Set
- End Property
-
+ End Property
+
Property AdjuntoDocumentacion As String
Get
If ViewState("AdjuntoDocumentacion") Is Nothing Then
@@ -161,10 +161,10 @@ Partial Class Portal_PortalProveedor
Set(value As String)
ViewState("AdjuntoDocumentacion") = value
End Set
- End Property
-
-
-
+ End Property
+
+
+
Property DiasVigencia As Integer
Get
If ViewState("DiasVigencia") Is Nothing Then
@@ -176,8 +176,8 @@ Partial Class Portal_PortalProveedor
Set(value As Integer)
ViewState("DiasVigencia") = value
End Set
- End Property
-
+ End Property
+
Property AplicaFechaVencimiento As Boolean
Get
If ViewState("AplicaFechaVencimiento") Is Nothing Then
@@ -189,8 +189,8 @@ Partial Class Portal_PortalProveedor
Set(value As Boolean)
ViewState("AplicaFechaVencimiento") = value
End Set
- End Property
-
+ End Property
+
Private Property FechaVigencia As Date
Get
If ViewState("FechaVigencia") Is Nothing Then
@@ -202,8 +202,8 @@ Partial Class Portal_PortalProveedor
Set(value As Date)
ViewState("FechaVigencia") = value
End Set
- End Property
-
+ End Property
+
Property Estatus As Integer
Get
If ViewState("Estatus") Is Nothing Then
@@ -215,8 +215,8 @@ Partial Class Portal_PortalProveedor
Set(value As Integer)
ViewState("Estatus") = value
End Set
- End Property
-
+ End Property
+
Property ObservacionDocumentacion As String
Get
If ViewState("ObservacionDocumentacion") Is Nothing Then
@@ -228,8 +228,8 @@ Partial Class Portal_PortalProveedor
Set(value As String)
ViewState("ObservacionDocumentacion") = value
End Set
- End Property
-
+ End Property
+
Private Property FechaLimite As Date
Get
If ViewState("FechaLimite") Is Nothing Then
@@ -241,11 +241,11 @@ Partial Class Portal_PortalProveedor
Set(value As Date)
ViewState("FechaLimite") = value
End Set
- End Property
-
-
-#End Region
-
+ End Property
+
+
+#End Region
+
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -254,9 +254,9 @@ Partial Class Portal_PortalProveedor
ViewState("Orden") = ""
CargaDatos()
- CargaDocumentacion()
-
- '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)
@@ -288,11 +288,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()
@@ -310,8 +310,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()
@@ -449,9 +449,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
@@ -574,7 +574,7 @@ Partial Class Portal_PortalProveedor
Protected Sub GvBancos_comprobante(sender As Object, e As EventArgs)
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim Path As String = String.Format("{0}{1}{2}{3}{4}{5}", AppDomain.CurrentDomain.BaseDirectory, "Empresas\", UsuarioActual.CveEmpresa, "\IE\", Gvr.FCHiddenField("CveIe").Value, ".png")
+ Dim Path As String = String.Format("{0}{1}{2}{3}{4}{5}", ModExtensiones.DirectorioBaseEmpresas, "Empresas\", UsuarioActual.CveEmpresa, "\IE\", Gvr.FCHiddenField("CveIe").Value, ".png")
Dim Archivo As New System.IO.FileInfo(Path)
If Archivo.Exists Then
@@ -589,13 +589,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)
@@ -647,289 +647,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")
@@ -1039,12 +1039,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
@@ -1160,14 +1160,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
@@ -1227,11 +1227,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")
@@ -1290,13 +1290,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
@@ -1358,11 +1358,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
@@ -1385,35 +1385,35 @@ 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
-
+
+
+#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
-
-
+ 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
@@ -1425,15 +1425,15 @@ Partial Class Portal_PortalProveedor
GvDocumentos.DataBind()
UPGvDocumentos.Update()
- End Sub
-
-
-
+ End Sub
+
+
+
Public Sub UploadModal_ClickDocumentacion(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- ' Dim chkEstatus As CheckBox
+ 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")
@@ -1470,24 +1470,24 @@ Partial Class Portal_PortalProveedor
RegistraScript("$('#ModalUploadDoc').modal({ backdrop: 'static', keyboard: false});")
- End Sub
-
-
-
+ 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 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 CveDocumentacionElectronica As String = e.Row.DataKey("CveDocumentacionElectronica")
-
+ Dim txtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
+ Dim CveDocumentacionElectronica As String = e.Row.DataKey("CveDocumentacionElectronica")
+
Dim requerido As Boolean = Boolean.Parse(e.Row.DBCampo("Requerido"))
'Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
@@ -1519,9 +1519,9 @@ Partial Class Portal_PortalProveedor
extencion = array(array.Length - 1)
End If
- If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then
- ' chkEstatus.Checked = True
- ImgUpload.Visible = False
+ If e.Row.DBCampo("Estatus").ToString.ToEntero.Contiene(3) Then
+ ' chkEstatus.Checked = True
+ ImgUpload.Visible = False
Else
'chkEstatus.Checked = False
End If
@@ -1563,107 +1563,107 @@ Partial Class Portal_PortalProveedor
'chkEstatus.Checked = ImgDownLoad.Visible
End If
- End Sub
-
-
- Protected Sub BtnUploadFileDoc_Click(sender As Object, e As EventArgs) Handles btnUploadFileDoc.Click
-
+ 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 = ""
- Dim ErrorProceso As Boolean = False
-
+ Dim ErrorProceso As Boolean = False
+
If AplicaFechaVencimiento And DiasVigencia > 0 Then
FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
End If
- For Each fileItem As Archivo In Filesgral
-
+ 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 objEdoc As New ClsEdocumentacion
- objEdoc.IniciaTransacSQL()
-
- If CveDocumentacionElectronica = -1 Then
-
- CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
-
- If CveDocumentacionElectronica > 0 Then
-
-
- If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
- ErrorProceso = True
- End If
- End If
-
-
- Else
- If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
- ErrorProceso = True
- End If
- End If
-
-
-
- If Not ErrorProceso = True Then
-
- Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
- Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
-
-
-
- Try
- 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)
- Catch ex As Exception
- GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
- ErrorProceso = True
- End Try
- End If
-
-
- If Not ErrorProceso Then
- objEdoc.Commit()
- Alert("Documento cargado correctamente")
- Else
- objEdoc.RollBack()
- Alert("Error al cargar archivo", TipoMensaje.MsgError)
- End If
- objEdoc.Dispose()
-
-
- CargaDocumentacion()
-
+ tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
+
+
+
+
+ Dim objEdoc As New ClsEdocumentacion
+ objEdoc.IniciaTransacSQL()
+
+ If CveDocumentacionElectronica = -1 Then
+
+ CveDocumentacionElectronica = objEdoc.DocumentacionElectronicaAdd(CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, "-1", UsuarioActual.CveUsuario, FechaLimite, FechaVigencia)
+
+ If CveDocumentacionElectronica > 0 Then
+
+
+ If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
+ ErrorProceso = True
+ End If
+ End If
+
+
+ Else
+ If Not objEdoc.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, -1, -1, CveProveedor, 2, ObservacionDocumentacion, CveDocumentacionElectronica & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite, FechaVigencia) Then
+ ErrorProceso = True
+ End If
+ End If
+
+
+
+ If Not ErrorProceso = True Then
+
+ Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & CveDocumentacionElectronica & "." & FileExtension
+ Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Edoc\Proveedor\" & CveProveedor & "\" & AdjuntoDocumentacion
+
+
+
+ Try
+ 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)
+ Catch ex As Exception
+ GuardaLog($"Error al gaurdar documento (moviendo archivo digital) --> Error{ ex.StackTrace}")
+ ErrorProceso = True
+ End Try
+ End If
+
+
+ If Not ErrorProceso Then
+ objEdoc.Commit()
+ Alert("Documento cargado correctamente")
+ Else
+ objEdoc.RollBack()
+ Alert("Error al cargar archivo", TipoMensaje.MsgError)
+ End If
+ objEdoc.Dispose()
+
+
+ CargaDocumentacion()
+
TxtFileDocumentacion.Text = ""
- UPModalUploadDoc.Update()
-
+ UPModalUploadDoc.Update()
+
Catch ex As Exception
OnError("Error al cargar archivo", ex)
End Try
Next
- RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
-
-
+ RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
+
+
'Dim FileExtension As String = "-1"
'Dim Filesgral As List(Of Archivo) = TxtFileDocumentacion.getfiles().Archivos
'Dim Filename As String = ""
@@ -1672,11 +1672,11 @@ Partial Class Portal_PortalProveedor
' FechaVigencia = DateTime.Today.AddDays(DiasVigencia)
'End If
- 'For Each fileItem As Archivo In Filesgral
-
+ 'For Each fileItem As Archivo In Filesgral
+
' Try
- ' FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ ' FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", ModExtensiones.DirectorioBaseEmpresas, fileItem.filename)).Replace(".", "")
' Dim tempArray() As String
' tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
@@ -1695,26 +1695,26 @@ Partial Class Portal_PortalProveedor
' 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()
-
+ ' 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()
@@ -1728,8 +1728,8 @@ Partial Class Portal_PortalProveedor
'RegistraScript("$('#ModalUploadDoc').modal('hide')", "hidemodal3")
- End Sub
-
+ End Sub
+
Private Sub GuardarDocumentos(Optional _CveDocumentacionExcluir As Integer = -1)
Dim hasError As Boolean = True
@@ -1805,9 +1805,9 @@ Partial Class Portal_PortalProveedor
CargaDocumentacion()
objDocumentos.Dispose()
- End Sub
-
-#End Region
-
-
+ End Sub
+
+#End Region
+
+
End Class
\ No newline at end of file
diff --git a/Prospeccion/Prospectos.aspx.vb b/Prospeccion/Prospectos.aspx.vb
index 80eb78ad7..963c1c36b 100644
--- a/Prospeccion/Prospectos.aspx.vb
+++ b/Prospeccion/Prospectos.aspx.vb
@@ -435,7 +435,7 @@ Partial Class Prospectos_Prospectos
' 'GuardaLog("Inicia Petición de Aplicación")
' oWordApp = New Microsoft.Office.Interop.Word.Application
' oWordApp.Visible = True
- ' oWordDoc = oWordApp.Documents.Open(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Prospectos\" & "ApartarLote.doc")
+ ' oWordDoc = oWordApp.Documents.Open(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Prospectos\" & "ApartarLote.doc")
' 'GuardaLog("Inicia Petición de Documento")
' If oWordDoc IsNot Nothing Then
' 'GuardaLog("Creación de Documento")
@@ -458,10 +458,10 @@ Partial Class Prospectos_Prospectos
' 'GuardaLog("Termina de reemplazo de variables")
' objSelection.TypeBackspace()
' objSelection.TypeBackspace()
- ' If Not System.IO.Directory.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\") Then
- ' System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\")
+ ' If Not System.IO.Directory.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\") Then
+ ' System.IO.Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\")
' End If
- ' ArchivoPath = AppDomain.CurrentDomain.BaseDirectory & "Temp\" & UsuarioActual.CveUsuario & ".doc"
+ ' ArchivoPath = ModExtensiones.DirectorioBaseEmpresas & "Temp\" & UsuarioActual.CveUsuario & ".doc"
' oWordDoc.SaveAs(ArchivoPath.ToString)
' oWordDoc.Close()
@@ -574,7 +574,7 @@ Partial Class Prospectos_Prospectos
'Dim FillColor, LineColor As Color
Mapa.RemoveAllLayers()
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Accesos.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Accesos.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -585,7 +585,7 @@ Partial Class Prospectos_Prospectos
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios_Polyline.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios_Polyline.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -597,7 +597,7 @@ Partial Class Prospectos_Prospectos
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios2.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios2.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -609,7 +609,7 @@ Partial Class Prospectos_Prospectos
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Cajones_Polyline.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Cajones_Polyline.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -619,7 +619,7 @@ Partial Class Prospectos_Prospectos
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lineas.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lineas.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -629,7 +629,7 @@ Partial Class Prospectos_Prospectos
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Texto.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Texto.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' feature.LabelFont.Size = 8
@@ -655,7 +655,7 @@ Partial Class Prospectos_Prospectos
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\TextoEspecial.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\TextoEspecial.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' feature.LabelFont.Size = 12
@@ -683,7 +683,7 @@ Partial Class Prospectos_Prospectos
'End If
- dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lotes.shp", AppDomain.CurrentDomain.BaseDirectory, 1))
+ dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lotes.shp", ModExtensiones.DirectorioBaseEmpresas, 1))
dbLayer.Name = "Stand"
diff --git a/Prospeccion/RepProspectosGIS.aspx.vb b/Prospeccion/RepProspectosGIS.aspx.vb
index 2af47dc4b..9c8e84744 100644
--- a/Prospeccion/RepProspectosGIS.aspx.vb
+++ b/Prospeccion/RepProspectosGIS.aspx.vb
@@ -161,7 +161,7 @@ Partial Class Prospeccion_RepProspectosGIS
'Dim FillColor, LineColor As Color
Mapa.RemoveAllLayers()
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Accesos.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Accesos.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -172,7 +172,7 @@ Partial Class Prospeccion_RepProspectosGIS
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios_Polyline.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios_Polyline.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -184,7 +184,7 @@ Partial Class Prospeccion_RepProspectosGIS
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios2.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Edificios2.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -196,7 +196,7 @@ Partial Class Prospeccion_RepProspectosGIS
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Cajones_Polyline.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Cajones_Polyline.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -206,7 +206,7 @@ Partial Class Prospeccion_RepProspectosGIS
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lineas.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lineas.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' 'el campo de la bd es: CveSubTipoQueja, pero cuando se genera el SHP, corta las columnas a 10 caracteres
@@ -216,7 +216,7 @@ Partial Class Prospeccion_RepProspectosGIS
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Texto.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Texto.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' feature.LabelFont.Size = 8
@@ -242,7 +242,7 @@ Partial Class Prospeccion_RepProspectosGIS
'End If
- 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\TextoEspecial.shp", AppDomain.CurrentDomain.BaseDirectory, 43))
+ 'dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\TextoEspecial.shp", ModExtensiones.DirectorioBaseEmpresas, 43))
'If dbLayer IsNot Nothing Then
' feature = New AspMap.Feature()
' feature.LabelFont.Size = 12
@@ -270,7 +270,7 @@ Partial Class Prospeccion_RepProspectosGIS
'End If
- dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lotes.shp", AppDomain.CurrentDomain.BaseDirectory, 1))
+ dbLayer = Mapa.AddLayer(String.Format("{0}Empresas\{1}\GIS\Lotes.shp", ModExtensiones.DirectorioBaseEmpresas, 1))
dbLayer.Name = "Stand"
diff --git a/Proveedores/PortalProveedor.aspx.vb b/Proveedores/PortalProveedor.aspx.vb
index 59cc47128..2a3a50e6d 100644
--- a/Proveedores/PortalProveedor.aspx.vb
+++ b/Proveedores/PortalProveedor.aspx.vb
@@ -412,7 +412,7 @@ Partial Class Portal_PortalProveedor
Protected Sub GvBancos_comprobante(sender As Object, e As EventArgs)
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim Path As String = String.Format("{0}{1}{2}{3}{4}{5}", AppDomain.CurrentDomain.BaseDirectory, "Empresas\", UsuarioActual.CveEmpresa, "\IE\", Gvr.FCHiddenField("CveIe").Value, ".png")
+ Dim Path As String = String.Format("{0}{1}{2}{3}{4}{5}", ModExtensiones.DirectorioBaseEmpresas, "Empresas\", UsuarioActual.CveEmpresa, "\IE\", Gvr.FCHiddenField("CveIe").Value, ".png")
Dim Archivo As New System.IO.FileInfo(Path)
If Archivo.Exists Then
diff --git a/PyME/Sistemas/WizardRegistro.aspx.vb b/PyME/Sistemas/WizardRegistro.aspx.vb
index 15c8a9d38..a78e1faf7 100644
--- a/PyME/Sistemas/WizardRegistro.aspx.vb
+++ b/PyME/Sistemas/WizardRegistro.aspx.vb
@@ -368,7 +368,7 @@ Partial Class Sistemas_WizardRegistro
objPS.Dispose()
objInv.Dispose()
- Dim DirFactura = AppDomain.CurrentDomain.BaseDirectory + String.Format("Empresas\{0}\Formatos\Factura.mrt", CveEmpresa)
+ Dim DirFactura = ModExtensiones.DirectorioBaseEmpresas + String.Format("Empresas\{0}\Formatos\Factura.mrt", CveEmpresa)
Dim Factura As New FileInfo(DirFactura)
RblFormatoFactura.Items.Item(1).Enabled = Factura.Exists
RblFormatoFactura.Items.Item(1).Selected = Factura.Exists
@@ -493,7 +493,7 @@ Partial Class Sistemas_WizardRegistro
Case 4
If TxtFormatoFactura.getfiles().Archivos().Count > 0 Then
Dim FormatoFactura As Archivo = TxtFormatoFactura.getfiles().Archivos(0)
- Dim PathFormato = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}\Formatos\"
+ Dim PathFormato = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Formatos\"
Dim dirFormato As String = String.Format("{0}\Factura.{1}", PathFormato, FormatoFactura.Extencion)
If File.Exists(dirFormato) Then
My.Computer.FileSystem.DeleteFile(dirFormato)
@@ -549,7 +549,7 @@ Partial Class Sistemas_WizardRegistro
Dim ObjEmpresas As New ClsSisEmpresas
ObjEmpresas.IniciaTransacSQL()
Try
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}\Certificados"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Certificados"
DirectoryExistsCreate(Path)
Dim ArchivoDestino As String = String.Format("{0}\{1}", Path, ArchivoFiel.filename)
If File.Exists(ArchivoDestino) Then
@@ -589,7 +589,7 @@ Partial Class Sistemas_WizardRegistro
Dim ObjEmpresas As New ClsSisEmpresas
ObjEmpresas.IniciaTransacSQL()
Try
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}\Certificados"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Certificados"
DirectoryExistsCreate(Path)
Dim ArchivoDestino As String = String.Format("{0}\{1}", Path, ArchivoCSD.filenameO)
If File.Exists(ArchivoDestino) Then
@@ -889,7 +889,7 @@ Partial Class Sistemas_WizardRegistro
Dim ArchivoLogo As Archivo = TextLogo.getfiles().Archivos(0)
If ArchivoLogo.filenameO.Length <= 114 Then
Try
- Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}"
+ Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}"
DirectoryExistsCreate(Path)
Dim ArchivoDestino As String = String.Format("{0}\Logo.{1}", Path, ArchivoLogo.Extencion)
If File.Exists(ArchivoDestino) Then
@@ -923,7 +923,7 @@ Partial Class Sistemas_WizardRegistro
End Sub
Protected Sub RblFormatoFactura_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblFormatoFactura.SelectedIndexChanged
Dim StrParams As New StringBuilder
- Dim Directorio = AppDomain.CurrentDomain.BaseDirectory + String.Format("Empresas\{0}\Formatos\Factura.mrt", CveEmpresa)
+ Dim Directorio = ModExtensiones.DirectorioBaseEmpresas + String.Format("Empresas\{0}\Formatos\Factura.mrt", CveEmpresa)
Dim Archivo As New FileInfo(Directorio)
RblFormatoFactura.Items.Item(1).Enabled = Archivo.Exists
DivSubirFactura.Visible = (RblFormatoFactura.SelectedValue = "2")
@@ -943,7 +943,7 @@ Partial Class Sistemas_WizardRegistro
UpFormatoFactura.Update()
End Sub
Private Sub VerEditarFactura()
- Dim Directorio = AppDomain.CurrentDomain.BaseDirectory + String.Format("Empresas\{0}\Formatos\Factura.mrt", CveEmpresa)
+ Dim Directorio = ModExtensiones.DirectorioBaseEmpresas + String.Format("Empresas\{0}\Formatos\Factura.mrt", CveEmpresa)
Dim Archivo As New FileInfo(Directorio)
RblFormatoFactura.Items.Item(1).Enabled = Archivo.Exists
If Archivo.Exists Then
@@ -1620,7 +1620,7 @@ Partial Class Sistemas_WizardRegistro
Protected Sub BtnClasificacion_Click(sender As Object, e As EventArgs) Handles btnClasificacion.Click
If TxtAddClasificacion.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtAddClasificacion.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarExcelClasificaciones(Directorio, file.filename, Tipo)
Else
@@ -1629,10 +1629,10 @@ Partial Class Sistemas_WizardRegistro
'If TxtAddClasificacion.getfiles().Archivos.Count > 0 Then
'Dim file As Archivo = TxtAddClasificacion.getfiles().Archivos(0)
- 'Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch & file.filename
+ 'Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch & file.filename
'CargarExcelClasificaciones(Directorio)
' Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
- ' ' CargarArchivoClasificaciones(AppDomain.CurrentDomain.BaseDirectory & file.patch, file.filename, Tipo)
+ ' ' CargarArchivoClasificaciones(ModExtensiones.DirectorioBaseEmpresas & file.patch, file.filename, Tipo)
'Else
' Alert("No existe el archivo.Favor de subir un archivo de excel a la plataforma", TipoMensaje.MsgError)
'End If
@@ -1939,7 +1939,7 @@ Partial Class Sistemas_WizardRegistro
Protected Sub BtnDivAddUnidadesMedida_Click(sender As Object, e As EventArgs) Handles BtnDivAddUnidadesMedida.Click
If TxtAddUnidadesMedida.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtAddUnidadesMedida.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarExcelUnidadesMedida(Directorio, file.filename, Tipo)
Else
@@ -2240,7 +2240,7 @@ Partial Class Sistemas_WizardRegistro
Protected Sub BtnDivAddPS_Click(sender As Object, e As EventArgs) Handles BtnDivAddPS.Click
If TxtAddPS.getfiles().Archivos.Count > 0 Then
Dim ArchivoExcel As Archivo = TxtAddPS.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & ArchivoExcel.patch & ArchivoExcel.filename
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & ArchivoExcel.patch & ArchivoExcel.filename
Dim Tipo As String = If(ArchivoExcel.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "OTRO")
CargarExcelPS(Directorio, Tipo)
Else
@@ -2432,7 +2432,7 @@ Partial Class Sistemas_WizardRegistro
Protected Sub BtnCargaExcelProveedor_Click(sender As Object, e As EventArgs) Handles BtnCargaExcelProveedor.Click
If TxtAddProveedor.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtAddProveedor.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivoProveedor(Directorio, file.filename, Tipo)
Else
@@ -2614,7 +2614,7 @@ Partial Class Sistemas_WizardRegistro
Protected Sub BtnCargaExcelCliente_Click(sender As Object, e As EventArgs) Handles BtnCargaExcelCliente.Click
If TxtAddClientes.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtAddClientes.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivoCliente(Directorio, file.filename, Tipo)
Else
@@ -2806,7 +2806,7 @@ Partial Class Sistemas_WizardRegistro
Private Sub BtnCargaExcelFacturas_Click(sender As Object, e As EventArgs) Handles BtnCargaExcelFacturas.Click
If TxtAddFactura.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtAddFactura.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivoFactura(Directorio, file.filename, Tipo)
Else
@@ -3182,21 +3182,21 @@ Partial Class Sistemas_WizardRegistro
Dim Directorio As String = ""
Select Case Tipo
Case "Clasi"
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\FormatoClasificaciones.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\FormatoClasificaciones.xlsx"
Case "UM"
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\FormatoUnidadesMedida.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\FormatoUnidadesMedida.xlsx"
Case "PS"
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoPS.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoPS.xlsx"
Case "Prove"
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedores.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoProveedores.xlsx"
Case "Cli"
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClientes.xlsx"
Case "Fact"
If RblFormato.SelectedValue = "1" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoProveedores-Facturas.xlsx"
End If
If RblFormato.SelectedValue = "2" Then
- Directorio = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas.xlsx"
+ Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClientes-Facturas.xlsx"
End If
@@ -3368,7 +3368,7 @@ Partial Class Sistemas_WizardRegistro
' Try
' If TxtModalFielArchivo.getfiles().Archivos.Count > 0 Then
' Dim ArchivoFiel As Archivo = TxtModalFielArchivo.getfiles().Archivos(0)
- ' Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}\Certificados"
+ ' Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Certificados"
' If Not Directory.Exists(Path) Then
' Directory.CreateDirectory(Path)
' End If
@@ -3381,7 +3381,7 @@ Partial Class Sistemas_WizardRegistro
' If TxtCSD.getfiles().Archivos.Count > 0 Then
' Dim ArchivoCSD As Archivo = TxtCSD.getfiles().Archivos(0)
- ' Dim PathCSD As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}\Certificados"
+ ' Dim PathCSD As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Certificados"
' Dim dirCSD As String = String.Format("{0}\{1}.{2}", PathCSD, CSD, ArchivoCSD.Extencion)
' If File.Exists(dirCSD) Then
' My.Computer.FileSystem.DeleteFile(dirCSD)
@@ -3391,7 +3391,7 @@ Partial Class Sistemas_WizardRegistro
' If TextLogo.getfiles().Archivos().Count > 0 Then
' Dim Logo As Archivo = TextLogo.getfiles().Archivos(0)
- ' Dim PathLogo As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}\"
+ ' Dim PathLogo As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\"
' Dim dirLogo As String = String.Format("{0}\logo.{1}", PathLogo, Logo.Extencion)
' If File.Exists(dirLogo) Then
' My.Computer.FileSystem.DeleteFile(dirLogo)
@@ -3401,7 +3401,7 @@ Partial Class Sistemas_WizardRegistro
' If TxtFormatoFactura.getfiles().Archivos().Count > 0 Then
' Dim FormatoFactura As Archivo = TxtFormatoFactura.getfiles().Archivos(0)
- ' Dim PathFormato = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{CveEmpresa}\Formatos\"
+ ' Dim PathFormato = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Formatos\"
' Dim dirFormato As String = String.Format("{0}\Factura.{1}", PathFormato, FormatoFactura.Extencion)
' If File.Exists(dirFormato) Then
' My.Computer.FileSystem.DeleteFile(dirFormato)
diff --git a/RH/MiPerfil.aspx.vb b/RH/MiPerfil.aspx.vb
index 93b917727..71fbb09af 100644
--- a/RH/MiPerfil.aspx.vb
+++ b/RH/MiPerfil.aspx.vb
@@ -467,7 +467,7 @@ Partial Class RH_MiPerfil
puestoProp = ""
End If
- If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
ImgPersonal.ImageUrl = $"/Empresas/{UsuarioActual.CveEmpresa}/RH/Personal/{ObjPersonal.URL}"
End If
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb
index 01f2facb9..832bb36c8 100644
--- a/RH/Personal.aspx.vb
+++ b/RH/Personal.aspx.vb
@@ -10,8 +10,8 @@ Imports Microsoft.Reporting.WebForms
Imports System.Globalization
Partial Class RH_Personal
- Inherits ClsPaginas
-
+ Inherits ClsPaginas
+
#Region "P R O P I E D A D E S"
Private Property DTCuentasBancos As DataTable
Get
@@ -298,7 +298,7 @@ Partial Class RH_Personal
End Set
End Property
- Private Property PU As Decimal
+ Private Property PU As Decimal
Get
Return CInt(ViewState("PU"))
End Get
@@ -321,14 +321,14 @@ Partial Class RH_Personal
Set(value As Integer)
ViewState("CveMovimientoDetalleUniforme") = value
End Set
- End Property
-
-
-
+ End Property
+
+
+
#End Region
-
+
#Region "V A C A C I O N E S - P E R M I S O S"
-
+
Private Property VacInicioPeriodo As Date
Get
If ViewState("VacInicioPeriodo") Is Nothing Then
@@ -528,13 +528,13 @@ Partial Class RH_Personal
Set(value As Integer)
ViewState("CvePermiso") = value
End Set
- End Property
-
+ End Property
+
#End Region
-
-
-#Region "PROPIEDADES FAMILIARES"
-
+
+
+#Region "PROPIEDADES FAMILIARES"
+
Private Property ActualizarFamiliar As Boolean
Get
If ViewState("ActualizarFamiliar") Is Nothing Then
@@ -560,8 +560,8 @@ Partial Class RH_Personal
Set(value As Integer)
ViewState("CveFamiliar") = value
End Set
- End Property
-
+ End Property
+
Private Property IndexActual As Integer
Get
If ViewState("IndexActual") Is Nothing Then
@@ -573,8 +573,8 @@ Partial Class RH_Personal
Set(value As Integer)
ViewState("IndexActual") = value
End Set
- End Property
-
+ End Property
+
Property DTFamiliares As DataTable
Get
Return DirectCast(ViewState("DTFamiliares"), DataTable)
@@ -582,9 +582,9 @@ Partial Class RH_Personal
Set(value As DataTable)
ViewState("DTFamiliares") = value
End Set
- End Property
-
-
+ End Property
+
+
Private Property ValPadre As Boolean
Get
If ViewState("ValPadre") Is Nothing Then
@@ -609,154 +609,154 @@ Partial Class RH_Personal
Set(value As Boolean)
ViewState("ValMadre") = value
End Set
- End Property
-
-
-#End Region
-
-
-
+ End Property
+
+
+#End Region
+
+
+
Const wdPageBreak As Integer = 7
Const wdCharacter As Integer = 1
'Configuración
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
- If Not IsPostBack Then
- If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then
- pnlSalarioIMSS.Visible = False
- End If
-
- ViewState("Orden") = ""
- ViewState("Orden1") = ""
- Session("FileUpload") = ""
- ViewState("Archivo") = ""
- DTConsumos = Nothing
-
- If UsuarioActual.CveRol = 1 Or UsuarioActual.CveEmpresa = 74 Then
- TabGES.Visible = True
- End If
-
- SetValues()
- 'SetPermisos()
-
- CargaEscolaridad()
- CargaEstadoCivil()
- CargaDepartamento()
- CargaPuestos()
- CargaEstatusPersonal()
- CargaGenero()
- CargaMotivoBaja()
- CargaRuta()
- CargaTiposContrato()
- CargaTipoPeriodo()
- CargaTurno()
- CargaJornadas()
- CargaProyecto()
- CargaTiposAsistencia()
- 'CargaMotivoHoraExtra()
- CargaMotivosHorasExtras()
- CargaSupervisores()
- CargaMetodosPago()
- CargaTipoRegimen()
- CargaRiesgoPuesto()
- CargaBancos()
- CargaSubProyectosZona()
- CargaEstados(1)
- CargaMonedas()
- CargaSuperioresOrganigrama()
- CargaUsuariosNomina()
- CargaComboUniformes()
- CargaPermisos()
- CargaCombosBuzon()
- CargaPermisosReemplazos()
-
-
- If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
- ViewState("CvePersonal") = Request("CvePersonal")
- 'CvePersonal = ViewState("CvePersonal").ToString.ToEntero
- CargaDatos()
- CargaDocumentacionFirmaDecontratos()
- 'LnkAddLicencias.Visible = True
- 'TabLicencias.Visible = True
- 'Configuración de Modalidad Update
- BtnGuardar.Text = "Guardar Cambios"
- LtlTitulo.Text = "Consulta de Personal:"
- If UsuarioActual.CveRol = 1 Then
- 'ImgImprimir.Visible = True
- ImgImprimirExpediente.Visible = True
- End If
-
- 'ImgAddObs.Attributes.Add("onclick", "javascript: PosicionaObjeto(this.id,'DivEventoBitacora',null,-250,-250); $('#DivEventoBitacora').show(1000); ")
- If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero - 1
-
- 'Inicia Permisos
- If UsuarioActual.TienePermisoProceso(228) Then
- GVAsistencia.Columns(10).Visible = True
- End If
- 'Fin Permisos
- HlEvento.Visible = True
- HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CvePersonal=" & CvePersonal & "&TB_iframe=true&height=370&width=600;"
-
- CargaViaticosPersonal()
-
- divBitacora.Visible = True
- CargaGvBitacora()
- Else
-
- 'Configuración de Modalidad Insert
-
- ImgAddObs.Visible = False
- LblFechaCaptura.Text = Now.ToShortDateString()
- LblUsuarioCapturo.Text = UsuarioActual.Usuario
- ViewState("CvePersonal") = -1
- BtnEliminar.Visible = False
- CarcaConceptosNomina()
- For Each Gvr As GridViewRow In GVConceptos.Rows
- If CBool(Gvr.DataKey("Obligatorio")) Then
- Gvr.FCCheckBox("ChkAplica").Checked = True
- Else
- Gvr.Visible = False
- End If
- Next
- 'Inicia Permisos
- 'Fin Permisos
- End If
- CargaCuentasBancarias()
-
- If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
-
- CrearEstructuraFamiliares()
- CargaFamiliares()
-
- LIFamiliaresAcciones.Visible = True
- DivFamiliares.Visible = True
- DivPadres.Visible = False
-
-
- End If
-
-
-
-
- 'If UsuarioActual.TienePermisoProceso(84) Then 'abonar pago
- ' HplAbonarMasivo.Visible = True
- ' GvGxC.Columns(7).Visible = True
- 'End If
-
-
- If Not CvePersonal > 0 Then
- DivSuperiorInmediato.Visible = False
- End If
-
- '09/05/2018 - Si el Personal tiene consumos, muestra boton para generar reporte
- If DTConsumos IsNot Nothing Then
- If DTConsumos.Rows.Count > 0 Then
- UpDescargaConsumos.Visible = True
- End If
- End If
- CargaLicencias()
+ If Not IsPostBack Then
+ If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then
+ pnlSalarioIMSS.Visible = False
+ End If
+
+ ViewState("Orden") = ""
+ ViewState("Orden1") = ""
+ Session("FileUpload") = ""
+ ViewState("Archivo") = ""
+ DTConsumos = Nothing
+
+ If UsuarioActual.CveRol = 1 Or UsuarioActual.CveEmpresa = 74 Then
+ TabGES.Visible = True
+ End If
+
+ SetValues()
+ 'SetPermisos()
+
+ CargaEscolaridad()
+ CargaEstadoCivil()
+ CargaDepartamento()
+ CargaPuestos()
+ CargaEstatusPersonal()
+ CargaGenero()
+ CargaMotivoBaja()
+ CargaRuta()
+ CargaTiposContrato()
+ CargaTipoPeriodo()
+ CargaTurno()
+ CargaJornadas()
+ CargaProyecto()
+ CargaTiposAsistencia()
+ 'CargaMotivoHoraExtra()
+ CargaMotivosHorasExtras()
+ CargaSupervisores()
+ CargaMetodosPago()
+ CargaTipoRegimen()
+ CargaRiesgoPuesto()
+ CargaBancos()
+ CargaSubProyectosZona()
+ CargaEstados(1)
+ CargaMonedas()
+ CargaSuperioresOrganigrama()
+ CargaUsuariosNomina()
+ CargaComboUniformes()
+ CargaPermisos()
+ CargaCombosBuzon()
+ CargaPermisosReemplazos()
+
+
+ If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
+ ViewState("CvePersonal") = Request("CvePersonal")
+ 'CvePersonal = ViewState("CvePersonal").ToString.ToEntero
+ CargaDatos()
+ CargaDocumentacionFirmaDecontratos()
+ 'LnkAddLicencias.Visible = True
+ 'TabLicencias.Visible = True
+ 'Configuración de Modalidad Update
+ BtnGuardar.Text = "Guardar Cambios"
+ LtlTitulo.Text = "Consulta de Personal:"
+ If UsuarioActual.CveRol = 1 Then
+ 'ImgImprimir.Visible = True
+ ImgImprimirExpediente.Visible = True
+ End If
+
+ 'ImgAddObs.Attributes.Add("onclick", "javascript: PosicionaObjeto(this.id,'DivEventoBitacora',null,-250,-250); $('#DivEventoBitacora').show(1000); ")
+ If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero - 1
+
+ 'Inicia Permisos
+ If UsuarioActual.TienePermisoProceso(228) Then
+ GVAsistencia.Columns(10).Visible = True
+ End If
+ 'Fin Permisos
+ HlEvento.Visible = True
+ HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CvePersonal=" & CvePersonal & "&TB_iframe=true&height=370&width=600;"
+
+ CargaViaticosPersonal()
+
+ divBitacora.Visible = True
+ CargaGvBitacora()
+ Else
+
+ 'Configuración de Modalidad Insert
+
+ ImgAddObs.Visible = False
+ LblFechaCaptura.Text = Now.ToShortDateString()
+ LblUsuarioCapturo.Text = UsuarioActual.Usuario
+ ViewState("CvePersonal") = -1
+ BtnEliminar.Visible = False
+ CarcaConceptosNomina()
+ For Each Gvr As GridViewRow In GVConceptos.Rows
+ If CBool(Gvr.DataKey("Obligatorio")) Then
+ Gvr.FCCheckBox("ChkAplica").Checked = True
+ Else
+ Gvr.Visible = False
+ End If
+ Next
+ 'Inicia Permisos
+ 'Fin Permisos
+ End If
+ CargaCuentasBancarias()
+
+ If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
+
+ CrearEstructuraFamiliares()
+ CargaFamiliares()
+
+ LIFamiliaresAcciones.Visible = True
+ DivFamiliares.Visible = True
+ DivPadres.Visible = False
+
+
+ End If
+
+
+
+
+ 'If UsuarioActual.TienePermisoProceso(84) Then 'abonar pago
+ ' HplAbonarMasivo.Visible = True
+ ' GvGxC.Columns(7).Visible = True
+ 'End If
+
+
+ If Not CvePersonal > 0 Then
+ DivSuperiorInmediato.Visible = False
+ End If
+
+ '09/05/2018 - Si el Personal tiene consumos, muestra boton para generar reporte
+ If DTConsumos IsNot Nothing Then
+ If DTConsumos.Rows.Count > 0 Then
+ UpDescargaConsumos.Visible = True
+ End If
+ End If
+ CargaLicencias()
LtlTareaNueva.Text = String.Format(" Tarea", CvePersonal)
-
- End If
+
+ End If
AgregarEventosAsincronosGvVacaciones()
End Sub
@@ -811,10 +811,10 @@ Partial Class RH_Personal
Private Sub SetPermisos()
'Permisos
- End Sub
-
+ End Sub
+
#Region "Carga Combos"
-
+
Private Sub CargaEscolaridad()
DdlEscolaridad.DataSource = GlobalDTEscolaridad
DdlEscolaridad.DataBind()
@@ -1043,16 +1043,16 @@ Partial Class RH_Personal
Nom.Dispose()
GvNominas.DataBind()
- End Sub
-
-
-
-
+ End Sub
+
+
+
+
#End Region
-
+
#Region "Asistencias"
-
-
+
+
Protected Sub LnkEliminarAsistencia_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim ObjRH As New ClsRH
@@ -1094,9 +1094,9 @@ Partial Class RH_Personal
End Sub
Protected Sub GVAsistencia_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAsistencia.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
-
-
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
@@ -1160,7 +1160,7 @@ Partial Class RH_Personal
ObjPersonal.Dispose()
BtnConsultarAsistencia_Click(sender, e)
- End Sub
+ End Sub
#End Region
Private Sub CargaConsignacion()
@@ -1233,7 +1233,7 @@ Partial Class RH_Personal
End If
- If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
ImgPersonal.ImageUrl = $"/Empresas/{UsuarioActual.CveEmpresa}/RH/Personal/{ObjPersonal.URL}"
End If
'BtnCargarArchivo_Click(Me, New EventArgs)
@@ -1410,9 +1410,9 @@ Partial Class RH_Personal
Dim ObjCuentasDeposito As New ClsGenerales(ObjPersonal.IniciaTransacSQL())
Dim ObjAF As New ClsAF(ObjPersonal.IniciaTransacSQL())
- Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\RH\" & ViewState("Archivo").ToString)
+ Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\RH\" & ViewState("Archivo").ToString)
Dim URL As String = CvePersonal & Extension
- Dim Ruta = String.Format("{0}Empresas\{1}\Temp\RH\{2}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, ViewState("Archivo").ToString)
+ Dim Ruta = String.Format("{0}Empresas\{1}\Temp\RH\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ViewState("Archivo").ToString)
Dim Archivo As New System.IO.FileInfo(Ruta)
@@ -1434,8 +1434,8 @@ Partial Class RH_Personal
End If
End If
- If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then
- TxtSalarioCotizado.Text = TxtSDI.Text
+ If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then
+ TxtSalarioCotizado.Text = TxtSDI.Text
End If
If CvePersonal = -1 Then
@@ -1475,8 +1475,8 @@ Partial Class RH_Personal
ViewState("CvePersonal") = ObjPersonal.CvePersonal
'Funsion usa RH Familiares
- If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
- ProcesaDTFamiliares(ObjPersonal)
+ If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
+ ProcesaDTFamiliares(ObjPersonal)
End If
If TempDTCuentasBancos.Rows.Count > 0 Then
@@ -1511,7 +1511,7 @@ Partial Class RH_Personal
End If
Else
- 'If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
+ 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
If ObjPersonal.UpdatePersonal(TxtCodigo.Text.Trim, TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtFechaIngreso.Text.ToDate,
DdlTipoPeriodo.SelectedValue.ToEntero, TxtNumeroSS.Text.Trim, ChkSeInscribioSS.Checked, TxtSalarioDiarioPago.Text.Trim.ToDouble,
TxtSalarioDiario.Text.Trim.ToDouble, TxtSDI.Text.Trim.ToDouble, TxtSalarioCotizado.Text.Trim.ToDouble, TxtBono.Text.Trim.ToDouble, TxtNumDiasAguinaldo.Text.Trim.ToEntero,
@@ -1533,11 +1533,11 @@ Partial Class RH_Personal
URL, DdlSupervisor.SelectedValue.ToEntero, TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero, DdlViaticos.SelectedValue.ToEntero, DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero, DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero, DdlSubproyectoZona.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero,
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario,
- FechaActivo:=FechaActivo, FechaReingreso:=FechaReingreso) Then
-
- 'Funsion usa RH Familiares
- If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
- ProcesaDTFamiliares(ObjPersonal)
+ FechaActivo:=FechaActivo, FechaReingreso:=FechaReingreso) Then
+
+ 'Funsion usa RH Familiares
+ If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
+ ProcesaDTFamiliares(ObjPersonal)
End If
@@ -1581,7 +1581,7 @@ Partial Class RH_Personal
ObjPersonal.Commit()
Alert(Mensaje, TipoMensaje.MsgInformacion, Accion)
- 'If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
+ 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL
'End If
@@ -1650,7 +1650,7 @@ Partial Class RH_Personal
' 'GuardaLog("Inicia Petición de Aplicación")
' oWordApp = New Word.Application
' oWordApp.Visible = True
- ' oWordDoc = oWordApp.Documents.Open(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Contratos\" & "SOGO.doc")
+ ' oWordDoc = oWordApp.Documents.Open(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Contratos\" & "SOGO.doc")
' 'GuardaLog("Inicia Petición de Documento")
' If oWordDoc IsNot Nothing Then
' 'GuardaLog("Creación de Documento")
@@ -1679,10 +1679,10 @@ Partial Class RH_Personal
' 'GuardaLog("Termina de reemplazo de variables")
' objSelection.TypeBackspace()
' objSelection.TypeBackspace()
- ' If Not System.IO.Directory.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\") Then
- ' System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\")
+ ' If Not System.IO.Directory.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\") Then
+ ' System.IO.Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\")
' End If
- ' ArchivoPath = AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & UsuarioActual.CveUsuario & ".doc"
+ ' ArchivoPath = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & UsuarioActual.CveUsuario & ".doc"
' oWordDoc.SaveAs(ArchivoPath.ToString)
' oWordDoc.Close()
@@ -1760,11 +1760,11 @@ Partial Class RH_Personal
DdlClienteAsignado.Attributes.Remove("onclick")
DdlClienteAsistenciaC.Attributes.Remove("onclick")
DdlClienteAsistenciaA.Attributes.Remove("onclick")
- End Sub
-
+ End Sub
+
#Region "Buzón de Calidad"
-
-
+
+
Private Sub CargaBuzonCalidad()
Dim ObjPersonal As New ClsRH
@@ -2100,12 +2100,12 @@ Partial Class RH_Personal
End If
GvBuzonCalidad.DataBind()
UpDatos.Update()
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "Resguardos"
-
+
Protected Sub GvResguardos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvResguardos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -2128,13 +2128,13 @@ Partial Class RH_Personal
e.Row.FCLiteral("LtlAF").Text = Liga & e.Row.FCLiteral("LtlAF").Text & ""
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "Nómina"
-
-
+
+
Private Sub CarcaConceptosNomina()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonalConceptos(CvePersonal, UsuarioActual.CveEmpresa) Then
@@ -2182,46 +2182,46 @@ Partial Class RH_Personal
Dim TipoAplicacion As String = e.Row.DBCampo("TipoAplicacion").ToString()
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Clear()
e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Seleccione", "-1"))
- If (e.Row.DBCampo("CveSistema").ToString() = "3") Then
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Movto Permanente)", "5000"))
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Porcentaje)", "5001"))
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Factor Descuento)", "5002"))
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Cuota Fija)", "5003"))
-
- ElseIf (e.Row.DBCampo("CveSistema").ToString() = "4") Then
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Importe fijo)", "3001"))
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Por días Labarados)", "3002"))
- Else
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Saldo", "1"))
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("No. Pagos", "2"))
- e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Permanente", "2600"))
- End If
-
-
- If e.Row.DBCampo("TipoAplicacion").ToEntero > 5 Then
- TipoAplicacion = "2600"
- End If
- e.Row.FCDropDownList("DdlTipoAplicacion").SelectedValueExist(TipoAplicacion)
- End If
-
- 'If e.Row.DBCampo("TipoCalculo") = "False" Then
- ' e.Row.FCTextBox("TxtImporte").Visible = False
- ' e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False
- 'Else
- ' Select Case e.Row.DBCampo("TipoAplicacion").ToEntero
- ' Case 1
- ' 'Saldo
- ' e.Row.FCLiteral("LtlSaldo").Visible = True
- ' e.Row.FCTextBox("TxtSaldoIni").Visible = True
- ' Case 2
- ' 'Numero de Pagos
- ' e.Row.FCLiteral("LtlNoPago").Visible = True
- ' e.Row.FCTextBox("TxtNoPagos").Visible = True
- ' Case 2600
- ' 'Permanente
- ' End Select
- 'End If
-
+ If (e.Row.DBCampo("CveSistema").ToString() = "3") Then
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Movto Permanente)", "5000"))
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Porcentaje)", "5001"))
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Factor Descuento)", "5002"))
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Infonavit(Cuota Fija)", "5003"))
+
+ ElseIf (e.Row.DBCampo("CveSistema").ToString() = "4") Then
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Importe fijo)", "3001"))
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Fonacot(Por días Labarados)", "3002"))
+ Else
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Saldo", "1"))
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("No. Pagos", "2"))
+ e.Row.FCDropDownList("DdlTipoAplicacion").Items.Add(New ListItem("Permanente", "2600"))
+ End If
+
+
+ If e.Row.DBCampo("TipoAplicacion").ToEntero > 5 Then
+ TipoAplicacion = "2600"
+ End If
+ e.Row.FCDropDownList("DdlTipoAplicacion").SelectedValueExist(TipoAplicacion)
+ End If
+
+ 'If e.Row.DBCampo("TipoCalculo") = "False" Then
+ ' e.Row.FCTextBox("TxtImporte").Visible = False
+ ' e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False
+ 'Else
+ ' Select Case e.Row.DBCampo("TipoAplicacion").ToEntero
+ ' Case 1
+ ' 'Saldo
+ ' e.Row.FCLiteral("LtlSaldo").Visible = True
+ ' e.Row.FCTextBox("TxtSaldoIni").Visible = True
+ ' Case 2
+ ' 'Numero de Pagos
+ ' e.Row.FCLiteral("LtlNoPago").Visible = True
+ ' e.Row.FCTextBox("TxtNoPagos").Visible = True
+ ' Case 2600
+ ' 'Permanente
+ ' End Select
+ 'End If
+
End If
End Sub
@@ -2305,9 +2305,9 @@ Partial Class RH_Personal
ObjPersonal.Dispose()
End If
- End Sub
+ End Sub
#End Region
-
+
Protected Sub DdlTipoAplicacion_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim Ddl As DropDownList = DirectCast(sender, DropDownList)
@@ -2389,10 +2389,10 @@ Partial Class RH_Personal
End If
End If
- End Sub
-
+ End Sub
+
#Region "G A S T O S X C O M P R O B A R"
-
+
Protected Sub RBLTipoGastos_SelectedIndexChanged(sender As Object, e As EventArgs)
If RBLTipoGastos.SelectedValue = "1" Then
@@ -2481,10 +2481,10 @@ Partial Class RH_Personal
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "E V E N T O - B I T A C O R A"
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -2560,9 +2560,9 @@ Partial Class RH_Personal
HttpContext.Current.Response.End()
Archivo = Nothing
- End Sub
+ End Sub
#End Region
-
+
Protected Sub GvGxC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGxC.RowDataBound, GvGxCHistorial.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 1 Then
@@ -2615,7 +2615,7 @@ Partial Class RH_Personal
- End Sub
+ End Sub
#Region "TAB BANCOS"
Private Sub CargaMonedas()
DdlMoneda.DataSource = GlobalDTMonedas
@@ -2763,8 +2763,8 @@ Partial Class RH_Personal
ObjCuentasBancos.Dispose()
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
- End Sub
-
+ End Sub
+
#Region "GRIDVIEW - CUENTAS BANCARIAS"
Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -2818,8 +2818,8 @@ Partial Class RH_Personal
Dim Referencia = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim
Dim CveMoneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedValue.ToString.ToEntero
Dim Estatus = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
- Dim Moneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedItem.Text
-
+ Dim Moneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedItem.Text
+
Dim BBVAAlias As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtBBVAAlias").Text
Dim RefCrediProveedor = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtRefCrediProveedor").Text.Trim
@@ -2917,11 +2917,11 @@ Partial Class RH_Personal
CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
ObjCuentasBancos.Dispose()
CargaGvBitacora()
- End Sub
+ End Sub
#End Region
#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 = ""
@@ -2957,10 +2957,10 @@ Partial Class RH_Personal
ViewState("Orden1") = Orden
CargaGvAsistencias()
End If
- End Sub
+ End Sub
#End Region
-
-
+
+
#Region "I M P R I M I R N O M I N A"
Protected Sub LbPDF_Click(sender As Object, e As EventArgs)
@@ -2968,11 +2968,11 @@ Partial Class RH_Personal
ImprimirbytesPDF(GeneraPDFNomina(CvePersonal, LB.CommandArgument.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta), "Recibo")
- End Sub
-
+ End Sub
+
#End Region
-
-
+
+
#Region " ORGANIGRAMA "
Private Sub CargaSuperioresOrganigrama()
Dim ObjRH As New ClsRH
@@ -2993,10 +2993,10 @@ Partial Class RH_Personal
- End Sub
+ End Sub
#End Region
-
-
+
+
#Region "I M P R I M I R "
Private Sub GenerarPDF(Optional Formato As String = "PDF")
@@ -3067,7 +3067,7 @@ Partial Class RH_Personal
- If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL & ".png") Then
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL & ".png") Then
params.Add(New ReportParameter("LogoUri", "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL & ".png"))
Else
params.Add(New ReportParameter("LogoUri", ""))
@@ -3169,7 +3169,7 @@ Partial Class RH_Personal
- If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL & ".png") Then
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL & ".png") Then
params.Add(New ReportParameter("LogoUri", "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL & ".png"))
Else
params.Add(New ReportParameter("LogoUri", ""))
@@ -3215,7 +3215,7 @@ Partial Class RH_Personal
- If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then
params.Add(New ReportParameter("LogoUri", String.Format("{0}://{1}:{2}/Empresas/{3}/RH/Personal/{4}.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, ObjPersonal.CvePersonal)))
Else
params.Add(New ReportParameter("LogoUri", ""))
@@ -3298,12 +3298,12 @@ Partial Class RH_Personal
End Sub
Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
GenerarPDFGastosXComp("Excel")
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "D O C U M E N T A C I O N C O N T R A T O S"
-
+
Private Sub CargaDocumentacionFirmaDecontratos()
If CvePersonal > 0 Then
@@ -3614,7 +3614,7 @@ Partial Class RH_Personal
End Sub
Public Sub DescarFormato(documento As String)
- Dim PathRoot As String = Server.MapPath("/")
+ Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
Dim PathSource As String
Dim pathDesti As String
@@ -3994,10 +3994,10 @@ Partial Class RH_Personal
RegistraScript("Download('" & baseUrl & "')")
- End Sub
-
+ End Sub
+
#End Region
-
+
Protected Sub LBCancelar_Click(sender As Object, e As EventArgs)
Dim FolioFiscal = CType(sender, LinkButton).CommandArgument.ToString
@@ -4018,10 +4018,10 @@ Partial Class RH_Personal
Obj = Nothing
- End Sub
-
+ End Sub
+
#Region "VACACIONES"
-
+
Private Sub CargaVacaciones()
Dim objRH As New ClsRH
@@ -4263,7 +4263,7 @@ Partial Class RH_Personal
'ElseIf UsuarioActual.CveEmpresa = 72 Then
- ' Dim PathRoot As String = Server.MapPath("/")
+ ' Dim PathRoot As String = ModExtensiones.DirectorioBaseEmpresas
' Dim FormatoNombre As String = "PermisoSolicitud.docx"
' Dim RutaFormato As String = $"{PathRoot}\Empresas\{UsuarioActual.CveEmpresa}\Formatos\{FormatoNombre} "
' Dim RutaDocGral As String = $"{PathRoot}\Empresas\Grales\Formatos\{FormatoNombre} "
@@ -4539,59 +4539,59 @@ Partial Class RH_Personal
Response.ContentType = "application/force-download"
Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicitud_Vacaciones_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
Response.BinaryWrite(bytesInStream)
- Response.End()
- Else
- Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia)
+ Response.End()
+ Else
+ Alert("No se encontro el Formato, favor de revisarlo con soporte tecnico.", TipoMensaje.MsgAdvertencia)
End If
End Sub
Public Sub DownLoad_ClickSolicitudPermiso(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- 'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
- 'DescarSolicitudVacaciones(Folio)
- Dim RutaFormato As String = String.Format("{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta)
-
- Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
- Dim Codigo As String = TxtCodigo.Text
- Dim Departamento As String = DdlDepartamento.SelectedItem.Text
- Dim JefeInmediato As String = DdlSupervisorOrganigrama.SelectedItem.Text
- Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
- Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
- Dim diasPermiso As String = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
- Dim HorasPermiso As String = "" 'String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
- Dim MotivoPermiso As String = String.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"))
- If File.Exists(RutaFormato) Then
-
- Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
- Dim ListaTags As New List(Of TagsDocumentos)
-
- ListaTags = GetDatosTagsDocumentos()
-
- ListaTags.Add(New TagsDocumentos("{NombreEmpleado}", NombreEmpleado))
- ListaTags.Add(New TagsDocumentos("{Codigo}", Codigo))
- ListaTags.Add(New TagsDocumentos("{Departamento}", Departamento))
- ListaTags.Add(New TagsDocumentos("{JefeInmediato}", JefeInmediato))
- ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
- ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
- ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
- ListaTags.Add(New TagsDocumentos("{HorasPermiso}", HorasPermiso))
- ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
-
- objGemDocument.SustituirTags(ListaTags)
-
- 'objGemDocument.GuardarStream()
- objGemDocument.GuardarStreamPDF()
- Dim bytesInStream As Byte() = objGemDocument.GetBytesDocumento()
- 'Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
- objGemDocument.Dispose()
-
- Response.Clear()
- Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
- Response.BinaryWrite(bytesInStream)
- Response.End()
- Else
- Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ 'Dim Folio As Integer = GvRow.DataKey("Folio").ToEntero
+ 'DescarSolicitudVacaciones(Folio)
+ Dim RutaFormato As String = String.Format("{0}Formatos\PermisoSolicitud.docx", UsuarioActual.Empresa.Ruta)
+
+ Dim NombreEmpleado As String = String.Format("{0} {1} {2}", TxtAPaterno.Text, TxtAMaterno.Text, TxtNombres.Text)
+ Dim Codigo As String = TxtCodigo.Text
+ Dim Departamento As String = DdlDepartamento.SelectedItem.Text
+ Dim JefeInmediato As String = DdlSupervisorOrganigrama.SelectedItem.Text
+ Dim FechaInicio As String = GvRow.DataKey("FechaInicio").ToDateTime().ToString("dd/MM/yyyy")
+ Dim FechaFin As String = GvRow.DataKey("FechaFin").ToDateTime().ToString("dd/MM/yyyy")
+ Dim diasPermiso As String = $"{(GvRow.DataKey("FechaFin").ToDate() - GvRow.DataKey("FechaInicio").ToDate()).Days}"
+ Dim HorasPermiso As String = "" 'String.Format("{0}", ((GvRow.DataKey("FechaInicio").ToDateTime() - GvRow.DataKey("FechaFin").ToDateTime()).Hours))
+ Dim MotivoPermiso As String = String.Format("{0},{1}", GvRow.DataKey("Descripcion"), GvRow.DataKey("Motivo"))
+ If File.Exists(RutaFormato) Then
+
+ Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
+ Dim ListaTags As New List(Of TagsDocumentos)
+
+ ListaTags = GetDatosTagsDocumentos()
+
+ ListaTags.Add(New TagsDocumentos("{NombreEmpleado}", NombreEmpleado))
+ ListaTags.Add(New TagsDocumentos("{Codigo}", Codigo))
+ ListaTags.Add(New TagsDocumentos("{Departamento}", Departamento))
+ ListaTags.Add(New TagsDocumentos("{JefeInmediato}", JefeInmediato))
+ ListaTags.Add(New TagsDocumentos("{FechaInicio}", FechaInicio))
+ ListaTags.Add(New TagsDocumentos("{FechaFin}", FechaFin))
+ ListaTags.Add(New TagsDocumentos("{diasPermiso}", diasPermiso))
+ ListaTags.Add(New TagsDocumentos("{HorasPermiso}", HorasPermiso))
+ ListaTags.Add(New TagsDocumentos("{MotivoPermiso}", MotivoPermiso))
+
+ objGemDocument.SustituirTags(ListaTags)
+
+ 'objGemDocument.GuardarStream()
+ objGemDocument.GuardarStreamPDF()
+ Dim bytesInStream As Byte() = objGemDocument.GetBytesDocumento()
+ 'Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
+ objGemDocument.Dispose()
+
+ Response.Clear()
+ Response.ContentType = "application/force-download"
+ Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicituddepermiso_" & Now.ToString("yyyyMMddhhmmss") & ".pdf")
+ Response.BinaryWrite(bytesInStream)
+ Response.End()
+ Else
+ Alert("No se encontro el formato de Permisos", TipoMensaje.ToastAdventencia)
End If
End Sub
@@ -4710,12 +4710,12 @@ Partial Class RH_Personal
objRH.Dispose()
Return ListaTags
- End Function
-
+ End Function
+
#End Region
-
+
#Region "CURSOS"
-
+
Private Sub CargaCursos()
Dim objRH As New ClsRH
@@ -4813,11 +4813,11 @@ Partial Class RH_Personal
- End Sub
-
-
+ End Sub
+
+
#End Region
-
+
#Region "UNIFORMES"
Private Sub CargaComboUniformes()
@@ -4942,12 +4942,12 @@ Partial Class RH_Personal
CargaUniformesPersonal()
End If
ObjInv.Dispose()
- End Sub
-
-
-
+ End Sub
+
+
+
#End Region
-
+
#Region "CARGAR IMAGEN"
Private Sub LnkSubirFacturas_Click(sender As Object, e As EventArgs) Handles LnkSubirFacturas.Click
RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo"))
@@ -4963,27 +4963,27 @@ Partial Class RH_Personal
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
filemove = fileItem.filename
- Dim yaExistente As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.jpg", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, CvePersonal)
- If File.Exists(yaExistente) Then
- File.Delete(yaExistente)
- End If
-
+ Dim yaExistente As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.jpg", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal)
+ If File.Exists(yaExistente) Then
+ File.Delete(yaExistente)
+ End If
+
If filemove <> "" Then
filemove.FilesMove(CvePersonal.ToString, String.Format("Empresas\{0}\RH\Personal\", UsuarioActual.CveEmpresa))
End If
ViewState("Archivo") = String.Format("{0}.{1}", CvePersonal.ToString, FileExtension)
Next
- If File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".jpg") Then
- ImgPersonal.ImageUrl = $"/Empresas/{UsuarioActual.CveEmpresa}/RH/Personal/{CvePersonal}.jpg?version={Now}"
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".jpg") Then
+ ImgPersonal.ImageUrl = $"/Empresas/{UsuarioActual.CveEmpresa}/RH/Personal/{CvePersonal}.jpg?version={Now}"
End If
UpImage.Update()
TxtCargaImg.Text = "[]"
UpAddArchivo.Update()
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalArchvivo"))
- End Sub
-
+ End Sub
+
#Region "PERMISOS"
-
+
Public Sub CargaPermisos()
Dim ObjRH As New ClsRH
@@ -5109,57 +5109,57 @@ Partial Class RH_Personal
ObjRH.Dispose()
CargaPermisos()
- End Sub
-
-
-
+ End Sub
+
+
+
#End Region
-
-
-
+
+
+
#End Region
-
-
- 'Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
- ' Preguntar si existe en temporales
- ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
- ' Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
- ' If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal") Then Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal")
- ' If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
- ' File.Delete(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension)
- ' File.Move(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension)
- ' Else
- ' File.Move(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension)
- ' End If
-
- ' Else
- ' Imagen Default
- ' If ImgPersonal.ImageUrl = "../Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" Then
- ' ImgPersonal.ImageUrl = "/Imagenes/SinImagen.jpg"
- ' End If
- ' End If
-
-
- ' Si existe mover de temporales a .../Empresas/RH/Personal, SINO Session("FileUpload") = ""
- ' Si existe en: .../Empresas/RH/Personal Guardar, SINO Session("FileUpload") = ""
-
-
-
-
- ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\" & Session("FileUpload").ToString) Then
- ' Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal" & Session("FileUpload").ToString)
- ' If Not Directory.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal") Then Directory.CreateDirectory(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal")
- ' Session("FileUpload") = ""
-
- ' If File.Exists(Request.PhysicalApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
- ' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & CvePersonal & Extension
-
- ' End If
- ' End If
- 'End Sub
-
+
+
+ 'Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
+ ' Preguntar si existe en temporales
+ ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then
+ ' Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString)
+ ' If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal")
+ ' If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
+ ' File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension)
+ ' File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension)
+ ' Else
+ ' File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension)
+ ' End If
+
+ ' Else
+ ' Imagen Default
+ ' If ImgPersonal.ImageUrl = "../Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" Then
+ ' ImgPersonal.ImageUrl = "/Imagenes/SinImagen.jpg"
+ ' End If
+ ' End If
+
+
+ ' Si existe mover de temporales a .../Empresas/RH/Personal, SINO Session("FileUpload") = ""
+ ' Si existe en: .../Empresas/RH/Personal Guardar, SINO Session("FileUpload") = ""
+
+
+
+
+ ' If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\" & Session("FileUpload").ToString) Then
+ ' Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal" & Session("FileUpload").ToString)
+ ' If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal")
+ ' Session("FileUpload") = ""
+
+ ' If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & Extension) Then
+ ' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & CvePersonal & Extension
+
+ ' End If
+ ' End If
+ 'End Sub
+
#Region "Consumos"
-
+
Private Sub Consumos()
Dim ObjCompras As New ClsCompras
@@ -5202,7 +5202,7 @@ Partial Class RH_Personal
Protected Sub GenerarPDFConsumo(Optional Formato As String = "PDF")
Dim CodigoP As String = ""
Dim NombreCompletoP As String = ""
- Dim Ruta As String = String.Format("{0}Empresas/{1}/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)
+ Dim Ruta As String = String.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
Dim RutaPDF As String = String.Format("{0}/Formatos/RepConsumoPersonal.rdlc", Ruta)
If Not File.Exists(RutaPDF) Then
RutaPDF = "Empresas/Grales/Formatos/RepConsumoPersonal.rdlc"
@@ -5238,10 +5238,10 @@ Partial Class RH_Personal
End Sub
Protected Sub LnkImprimirPDFConsumo_Click(sender As Object, e As EventArgs)
GenerarPDFConsumo()
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region ""
Protected Sub LbMail_Click(sender As Object, e As EventArgs)
@@ -5325,9 +5325,9 @@ Partial Class RH_Personal
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "VIATICOS"
Protected Sub CargaViaticosPersonal()
Dim ObjBancos As ClsBancos = New ClsBancos
@@ -5362,11 +5362,11 @@ Partial Class RH_Personal
If (e.Row.RowType = DataControlRowType.Footer) Then
e.Row.FCLiteral("LtTotalImporte").Text = DTViaticosDetalle.SUM("Importe").FormatoNumero()
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "BITACORA"
-
+
Private Sub CargaGvBitacora()
If CvePersonal > 0 Then
@@ -5379,12 +5379,12 @@ Partial Class RH_Personal
UpHistorialModificacion.Update()
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "PAGO DE FACTURAS"
-
+
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaPagoFactura()
UpnHistorial.Update()
@@ -5397,10 +5397,10 @@ Partial Class RH_Personal
End If
ObjRH.Dispose()
GVPagoFactura.DataBind()
- End Sub
-
+ End Sub
+
#End Region
-
+
Protected Sub BtnSaldoInicial_Click(sender As Object, e As EventArgs)
Dim SaldoInicial As Double = TxtSaldoInicial.Text.ToDouble()
Dim Fecha As DateTime = TxtFechaSaldo.Text.ToDateTime()
@@ -5416,8 +5416,8 @@ Partial Class RH_Personal
End Sub
Private Function AgregarSaldoInicial(SaldoInicial As Double, Fecha As DateTime, CveMoneda As Integer, ObjMov As ClsContabilidad) As Integer
Return ObjMov.AddPrePolizas("RH/Personal", 13, SaldoInicial, SaldoInicial, CveMoneda, Fecha, "Saldo Inicial", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- End Function
-
+ End Function
+
#Region "L I C E N C I A S"
Public Sub CargaLicencias()
If CvePersonal > 0 Then
@@ -5564,7 +5564,7 @@ Partial Class RH_Personal
End If
RegistraScript("$('#DivAddLicencias').modal('hide');")
- End Sub
+ End Sub
#End Region
Protected Sub BtnPDFResguardo_Click(sender As Object, e As EventArgs)
GenerarPDFResguardosAF()
@@ -5640,14 +5640,14 @@ Partial Class RH_Personal
Alert("No se encontraron registros .", TipoMensaje.MsgAdvertencia)
End If
- End Sub
-
-
-#Region "FAMILIARES"
-
-
- Private Sub CargaFamiliares()
-
+ End Sub
+
+
+#Region "FAMILIARES"
+
+
+ Private Sub CargaFamiliares()
+
If CvePersonal <> -1 Then
Dim objRH As New ClsRH
@@ -5672,12 +5672,12 @@ Partial Class RH_Personal
UPTabFamiliares.Update()
End If
- End Sub
-
- Private Sub CrearEstructuraFamiliares()
-
- Dim Familiares As New DataTable
-
+ End Sub
+
+ Private Sub CrearEstructuraFamiliares()
+
+ Dim Familiares As New DataTable
+
Familiares.Columns.Add("CveFamiliar", Type.GetType("System.Int32"))
Familiares.Columns.Add("CvePersonal", Type.GetType("System.Int32"))
Familiares.Columns.Add("CveParentesco", Type.GetType("System.Int32"))
@@ -5693,19 +5693,19 @@ Partial Class RH_Personal
Familiares.Columns.Add("Observaciones", Type.GetType("System.String"))
Familiares.Columns.Add("Beneficiario", Type.GetType("System.Boolean"))
- DTFamiliares = Familiares
-
- End Sub
-
-
+ DTFamiliares = Familiares
+
+ End Sub
+
+
Protected Sub BtnAgregarFamiliar_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliar.Click
ResetFormFamiliares()
RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
- End Sub
-
-
- Private Sub ResetFormFamiliares()
-
+ End Sub
+
+
+ Private Sub ResetFormFamiliares()
+
ActualizarFamiliar = False
CveFamiliar = -1
@@ -5722,8 +5722,8 @@ Partial Class RH_Personal
UpModalFamiliar.Update()
- End Sub
-
+ End Sub
+
Protected Sub BtnAgregarFamiliarModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliarModal.Click
If ActualizarFamiliar Then
@@ -5785,8 +5785,8 @@ Partial Class RH_Personal
CveFamiliar = -1
ActualizarFamiliar = False
- End Sub
-
+ End Sub
+
Public Sub Edit_ClickFamiliar(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim activo As Boolean = True
@@ -5810,9 +5810,9 @@ Partial Class RH_Personal
UpModalFamiliar.Update()
RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
- End Sub
-
-
+ End Sub
+
+
Public Sub Remove_ClickFamiliar(sender As Object, e As EventArgs)
@@ -5826,13 +5826,13 @@ Partial Class RH_Personal
DTFamiliares.Rows(IndexActual)("Accion") = "3"
Dim objRH As New ClsRH
- ProcesaDTFamiliares(objRH)
- objRH.Dispose()
-
- CargaFamiliares()
-
-
-
+ ProcesaDTFamiliares(objRH)
+ objRH.Dispose()
+
+ CargaFamiliares()
+
+
+
Else
DTFamiliares.Rows(IndexActual).Delete()
DTFamiliares.AcceptChanges()
@@ -5842,40 +5842,40 @@ Partial Class RH_Personal
End If
IndexActual = -1
- End Sub
-
- Private Sub ProcesaDTFamiliares(ByRef objRH As ClsRH)
-
- 'Dim objRH As New ClsRH
-
+ End Sub
+
+ Private Sub ProcesaDTFamiliares(ByRef objRH As ClsRH)
+
+ 'Dim objRH As New ClsRH
+
ValPadre = False
ValMadre = False
- For Each dRow As DataRow In DTFamiliares.Rows
-
-
-
- If dRow("Accion").ToString = "1" Then 'Actualiza
-
- Dim Beneficiario As Integer = -1
-
- If Boolean.Parse(dRow("Beneficiario").ToString) Then
- Beneficiario = 1
- Else
- Beneficiario = 0
- End If
-
-
+ For Each dRow As DataRow In DTFamiliares.Rows
+
+
+
+ If dRow("Accion").ToString = "1" Then 'Actualiza
+
+ Dim Beneficiario As Integer = -1
+
+ If Boolean.Parse(dRow("Beneficiario").ToString) Then
+ Beneficiario = 1
+ Else
+ Beneficiario = 0
+ End If
+
+
objRH.PersonalFamiliaresUpdate(dRow("CveFamiliar").ToString.ToEntero, CvePersonal, dRow("CveParentesco").ToString.ToEntero, dRow("Nombre").ToString, dRow("Domicilio").ToString, dRow("Edad").ToString.ToEntero, dRow("Ocupacion").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString, If(dRow("Observaciones").ToString.Trim = "", "-1", dRow("Observaciones").ToString.Trim), Beneficiario)
End If
- If dRow("Accion").ToString = "2" Then 'Inserta
-
-
- Dim Beneficiario As Boolean = Boolean.Parse(dRow("Beneficiario").ToString)
-
-
-
+ If dRow("Accion").ToString = "2" Then 'Inserta
+
+
+ Dim Beneficiario As Boolean = Boolean.Parse(dRow("Beneficiario").ToString)
+
+
+
objRH.PersonalFamiliaresAdd(CvePersonal, dRow("CveParentesco").ToString.ToEntero, dRow("Nombre").ToString, dRow("Domicilio").ToString, dRow("Edad").ToString.ToEntero, dRow("Ocupacion").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, dRow("Telefono").ToString, If(dRow("Observaciones").ToString.Trim = "", "-1", dRow("Observaciones").ToString.Trim), Beneficiario)
End If
@@ -5896,16 +5896,16 @@ Partial Class RH_Personal
'objRH.Dispose()
- End Sub
-
-#End Region
-
-
- Protected Sub DdlTipoAsistencias_SelectedIndexChanged(sender As Object, e As EventArgs)
- Dim ddl As DropDownList = DirectCast(sender, DropDownList)
- Dim gvrow As GridViewRow = DirectCast(ddl.NamingContainer, GridViewRow)
- If ddl.SelectedItem.Text = "Retardo" Then
- gvrow.FCTextBox("TxtPorPago").Text = "87.5"
- End If
- End Sub
+ End Sub
+
+#End Region
+
+
+ Protected Sub DdlTipoAsistencias_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Dim ddl As DropDownList = DirectCast(sender, DropDownList)
+ Dim gvrow As GridViewRow = DirectCast(ddl.NamingContainer, GridViewRow)
+ If ddl.SelectedItem.Text = "Retardo" Then
+ gvrow.FCTextBox("TxtPorPago").Text = "87.5"
+ End If
+ End Sub
End Class
diff --git a/RH/Reclutamiento.aspx.vb b/RH/Reclutamiento.aspx.vb
index 1a334f1a0..9a2d3f88e 100644
--- a/RH/Reclutamiento.aspx.vb
+++ b/RH/Reclutamiento.aspx.vb
@@ -5352,8 +5352,8 @@ Partial Class RH_Reclutamiento
End If
Dim CveCaptacion As Integer = If(DdlCaptacion.SelectedValue.ToEntero = 0, -1, DdlCaptacion.SelectedValue.ToEntero)
- Edad = Now.Year - TxtFechaN4.Text.ToDate.Year
-
+ Edad = Now.Year - TxtFechaN4.Text.ToDate.Year
+
If ValidaGuardaFirmaContratoEvento() Then
If objRh.PersonalReclutamientoUpdate(CvePersonal, TxtNombres4.Text, TxtAPaterno4.Text, TxtAmaterno4.Text, TxtEstatura4.Text.ToDecimal, TxtPeso4.Text.ToDecimal,
TxtLugarnacimiento4.Text, TxtContactoEmergencia4.Text, TxtTipoSangre4.Text, TxtViveCon4.Text, txtCasaDondevive4.Text, DDLEstadoCivil4.Text.ToEntero,
@@ -5449,8 +5449,8 @@ Partial Class RH_Reclutamiento
DDLUsuarioNomina.DataBind()
- If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
- DDLUsuarioNomina.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+ If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
+ DDLUsuarioNomina.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If
DdlUniforme.DataBind()
diff --git a/RH/RepBuzonCalidad.aspx.vb b/RH/RepBuzonCalidad.aspx.vb
index f04d7b913..85ec18f65 100644
--- a/RH/RepBuzonCalidad.aspx.vb
+++ b/RH/RepBuzonCalidad.aspx.vb
@@ -66,7 +66,7 @@ Partial Class RH_RepBuzonCalidad
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
Else
'
- If System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("CvePersonal") & ".png") Then
+ If System.IO.File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("CvePersonal") & ".png") Then
e.Row.FCImage("ImgPersonal").ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & e.Row.DBCampo("CvePersonal") & ".png"
End If
e.Row.Cells(0).Visible = False
diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb
index 5123b5744..7eed1fdc5 100644
--- a/Sistemas/Empresa.aspx.vb
+++ b/Sistemas/Empresa.aspx.vb
@@ -589,8 +589,8 @@ Partial Class Sistemas_Empresa
'verifico si existe la carpeta de la empresa, sino la crea
For Each dr As Data.DataRow In ObjEmpresas.DtResultados.Rows
- If Not IO.Directory.Exists(String.Format("{0}\{1}", AppDomain.CurrentDomain.BaseDirectory, dr("CveEmpresa"))) Then
- IO.Directory.CreateDirectory(String.Format("{0}Empresas\{1}", AppDomain.CurrentDomain.BaseDirectory, dr("CveEmpresa")))
+ If Not IO.Directory.Exists(String.Format("{0}\{1}", ModExtensiones.DirectorioBaseEmpresas, dr("CveEmpresa"))) Then
+ IO.Directory.CreateDirectory(String.Format("{0}Empresas\{1}", ModExtensiones.DirectorioBaseEmpresas, dr("CveEmpresa")))
End If
Next
End If
@@ -1464,8 +1464,8 @@ Partial Class Sistemas_Empresa
Dim Archivopfx As String
Dim Archivokey As Archivo = Nothing
Dim Archivocer As Archivo = Nothing
- Dim dirbase = String.Format("{0}Empresas\{1}\Certificados\Fiel\", AppDomain.CurrentDomain.BaseDirectory, ViewState("CveEmpresa"))
- Dim dirbasepfx = String.Format("{0}Empresas\{1}\Certificados\", AppDomain.CurrentDomain.BaseDirectory, ViewState("CveEmpresa"))
+ Dim dirbase = String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa"))
+ Dim dirbasepfx = String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa"))
If (Not Directory.Exists(dirbase)) Then
Directory.CreateDirectory(dirbase)
End If
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 2fe50ab7a..499b2919a 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -399,8 +399,8 @@ Partial Class Clientes
Set(value As DataTable)
ViewState("DtPagos") = value
End Set
- End Property
-
+ End Property
+
Private Property DtCotizaciones As DataTable
Get
Return CType(ViewState("DtCotizaciones"), DataTable)
@@ -478,8 +478,8 @@ Partial Class Clientes
Set(value As Boolean)
ViewState("BonificacionUsado") = value
End Set
- End Property
-
+ End Property
+
Private Property linkDescargaPagare As String
Get
Return If(IsNothing(ViewState("linkDescargaPagare")), "", ViewState("linkDescargaPagare").ToString)
@@ -487,10 +487,10 @@ Partial Class Clientes
Set(value As String)
ViewState("linkDescargaPagare") = value
End Set
- End Property
-
+ End Property
+
#End Region
-
+
#Region "Documentacion"
Private Property DTDocumentacion As DataTable
Get
@@ -727,11 +727,11 @@ Partial Class Clientes
If UsuarioActual.TienePermisoProceso(180) Then
ChkEstado.Enabled = True
End If
- End If
-
- If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
- DivTipoRetenciones.Visible = True
- DivRetIVA.Visible = False
+ End If
+
+ If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
+ DivTipoRetenciones.Visible = True
+ DivRetIVA.Visible = False
End If
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
@@ -1048,14 +1048,14 @@ Partial Class Clientes
DdlMonedaExtranjeraAnticipos.Attributes.Add("onclick", "CargaCuentas(9);")
End Sub
- Private Sub CargaCuentasyConceptos()
- Dim ObjConta As New ClsContabilidad
- If ObjConta.GetCuentasyConceptos(CveCliente) Then
- GvCuentasContable.DataSource = ObjConta.DtResultados
- End If
- ObjConta.Dispose()
- GvCuentasContable.DataBind()
- UpCuentaConceptos.Update()
+ Private Sub CargaCuentasyConceptos()
+ Dim ObjConta As New ClsContabilidad
+ If ObjConta.GetCuentasyConceptos(CveCliente) Then
+ GvCuentasContable.DataSource = ObjConta.DtResultados
+ End If
+ ObjConta.Dispose()
+ GvCuentasContable.DataBind()
+ UpCuentaConceptos.Update()
End Sub
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
If UsuarioActual.Empresa.ServerContPAQi = "" Then Exit Sub
@@ -1356,9 +1356,9 @@ Partial Class Clientes
'CargaFormaPago33()
'CargaComboCFDI()
- If UsuarioActual.TienePermisoProceso(279) Then
- LnkPorcentajeMarcas.Visible = True
- LnkPorcentajePrecios.Visible = True
+ If UsuarioActual.TienePermisoProceso(279) Then
+ LnkPorcentajeMarcas.Visible = True
+ LnkPorcentajePrecios.Visible = True
End If
If UsuarioActual.TienePermisoProceso(261) Then LnkVerGrafica.Visible = True
@@ -1398,7 +1398,7 @@ Partial Class Clientes
TxtGiro.Text = ObjClientes.Giro
DdlPrecioLista.SelectedValue = ObjClientes.CvePrecioLista.ToString
TxtCC.Text = ObjClientes.NotificarA
- ChkMail.Checked = ObjClientes.EnviarFactura
+ ChkMail.Checked = ObjClientes.EnviarFactura
DdlTipoRetencion.SelectedValueExist(ObjClientes.DtResultados(0)("CveTipoRetencion").ToString)
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
TxtRetIVA.Text = ObjClientes.RetIVA.ToString
@@ -1680,8 +1680,8 @@ Partial Class Clientes
DivBonificacionUsado.Visible = True
CargaUsados()
- If UsuarioActual.TienePermisoProceso(280) Then
- UPUsadosReset.Visible = True
+ If UsuarioActual.TienePermisoProceso(280) Then
+ UPUsadosReset.Visible = True
End If
End If
@@ -1731,7 +1731,7 @@ Partial Class Clientes
GvCxC.DataSource = DtCxCActivas
'solo tomo los 10 ultimos mas el totalizador general
Dim dt As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Hist'")
- DtHistorialCxC = dt
+ DtHistorialCxC = dt
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
GvCxCHistorial.DataSource = dt.AsEnumerable().Take(22).CopyToDataTable()
End If
@@ -1753,10 +1753,10 @@ Partial Class Clientes
Private Sub CargaAnticipos(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1)
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
- DtClientesAnticipo = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 ")
- GVAnticipos.DataSource = DtClientesAnticipo
- DtAnticipoHistorial = ObjMovtos.DtResultados.FiltraParametros("Saldo <= 0 ")
- GVAnticiposHistorial.DataSource = DtAnticipoHistorial
+ DtClientesAnticipo = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 ")
+ GVAnticipos.DataSource = DtClientesAnticipo
+ DtAnticipoHistorial = ObjMovtos.DtResultados.FiltraParametros("Saldo <= 0 ")
+ GVAnticiposHistorial.DataSource = DtAnticipoHistorial
Else
GVAnticipos.DataSource = Nothing
DtClientesAnticipo = Nothing
@@ -1882,9 +1882,9 @@ Partial Class Clientes
Private Sub CargaComboCFDI()
DdlUsoCFDI.Items.Clear()
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
- DdlUsoCFDI.DataBind()
- DdlUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1"))
-
+ DdlUsoCFDI.DataBind()
+ DdlUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
DdlSucursalUsoCFDI.Items.Clear()
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
DdlSucursalUsoCFDI.DataBind()
@@ -1921,12 +1921,12 @@ Partial Class Clientes
CargaBancos(51)
BtnVerMasBancos.Text = "Ver Más"
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "B A N C O S"
- 'CuentasxCobrar Activas (Pagos Recibidos)
+ 'CuentasxCobrar Activas (Pagos Recibidos)
Private Sub CargaBancos(Optional SelectTop As Integer = 51, Optional CveClienteSucursal As Integer = -1)
Dim ObjMovtos As New ClsMovimientos()
'CxC Activas
@@ -2001,7 +2001,7 @@ Partial Class Clientes
If HdnCveVenta.Value <> "-1" AndAlso HdnFolioVenta.Value <> "-1" Then
Dim ObjMail As New ClsSisMail()
- Dim Ruta As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Dim Ruta As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
Dim Cuerpo As String = TxtBody.Text
Dim Asunto As String = ""
@@ -2492,9 +2492,9 @@ Partial Class Clientes
If ErrorProceso Then
ObjClientes.RollBack()
Else
- ObjClientes.Commit()
-
- 'JM 05-02-19: CRM ASIGAN CLIENTE A EMPRESACRM
+ ObjClientes.Commit()
+
+ 'JM 05-02-19: CRM ASIGAN CLIENTE A EMPRESACRM
Dim MensajeCRM As String = ""
If CveEmpresaCRM > 0 Then
If VincularEmpresaCRM() Then
@@ -2532,7 +2532,7 @@ Partial Class Clientes
AplicaComercioExterior:=ChkAplicaComercioExterior.Checked, CveTipoOperacion:=DdlTipoOperacion.SelectedValue.ToEntero, CvePedimento:=DdlClavePedimento.SelectedValue.ToEntero, CveIncoterm:=DdlIncoterm.SelectedValue.ToEntero, CvePais:=DdlPais.SelectedValue.ToEntero, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero,
CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero, NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(),
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(),
- ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(),
+ ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(),
RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero()) Then
@@ -2564,29 +2564,29 @@ Partial Class Clientes
ObjClientes.Commit()
- Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
-
+ Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
+
If EstatusAnteriorCliente <> ChkEstado.Checked Then
Dim DTVendedor As New DataTable
- DTVendedor = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(" CveVendedor = " & DdlVendedor.SelectedValue.ToEntero)
-
- Dim ObjVendedores As New ClsVtaVendedores
- Dim DtVendedores As DataTable = Nothing
- If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
- DtVendedores = ObjVendedores.DtResultados
- End If
+ DTVendedor = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(" CveVendedor = " & DdlVendedor.SelectedValue.ToEntero)
+
+ Dim ObjVendedores As New ClsVtaVendedores
+ Dim DtVendedores As DataTable = Nothing
+ If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
+ DtVendedores = ObjVendedores.DtResultados
+ End If
ObjVendedores.Dispose()
If DTVendedor.Rows.Count > 0 Then
- Dim _CorreoVendedor As String = DTVendedor(0)("Correo").ToString
- Dim _CorreoAsistente As String = ""
- Dim _CorreoCoordinador As String = ""
-
- Dim CveSuperior As Integer = DTVendedor(0)("CveSuperior").ToString.ToEntero
- If DTVendedor.Rows.Count > 0 Then
- _CorreoAsistente = DtVendedores.FiltroPrimeroValor("Correo", "CveSuperior = " & DdlVendedor.SelectedValue.ToEntero)
- _CorreoCoordinador = DtVendedores.FiltroPrimeroValor("Correo", "CveVendedor = " & CveSuperior)
+ Dim _CorreoVendedor As String = DTVendedor(0)("Correo").ToString
+ Dim _CorreoAsistente As String = ""
+ Dim _CorreoCoordinador As String = ""
+
+ Dim CveSuperior As Integer = DTVendedor(0)("CveSuperior").ToString.ToEntero
+ If DTVendedor.Rows.Count > 0 Then
+ _CorreoAsistente = DtVendedores.FiltroPrimeroValor("Correo", "CveSuperior = " & DdlVendedor.SelectedValue.ToEntero)
+ _CorreoCoordinador = DtVendedores.FiltroPrimeroValor("Correo", "CveVendedor = " & CveSuperior)
End If
If (_CorreoVendedor.Length > 0 Or _CorreoAsistente.Length > 0 Or _CorreoCoordinador.Length > 0) And UsuarioActual.Empresa.Funcionalidad(571).ToEntero > 0 Then
@@ -2601,7 +2601,7 @@ Partial Class Clientes
Else
Asunto = "Desactivación de cliente " & TxtNombre.Text
SBBody.Append(String.Format(" Por Medio de la presente se le notifica que el estatus del cliente {0} ha sido desactivado.", TxtNombre.Text))
- End If
+ End If
MandaCorreo(Asunto, Para + "", SBBody.ToString)
End If
End If
@@ -2611,8 +2611,8 @@ Partial Class Clientes
CargaHistorial()
CargaDatos()
UpDatos.Update()
- UpnHistorial.Update()
-
+ UpnHistorial.Update()
+
End If
End If
ObjClientes.Dispose()
@@ -2636,10 +2636,10 @@ Partial Class Clientes
' Application("GlobalDTCliente") = Objclientes.DtResultados
'End If
'Objclientes.Dispose()
- End Sub
+ End Sub
#End Region
-
-
+
+
#Region "G R I D V I E W S"
Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -2998,10 +2998,10 @@ Partial Class Clientes
CargaDdlSucursalCliente()
ObjCliente.Dispose()
- Me.Actualizar = False
- Me.CveClienteSuc = -1
- RegistraScript("hideDivEC();")
-
+ Me.Actualizar = False
+ Me.CveClienteSuc = -1
+ RegistraScript("hideDivEC();")
+
End Sub
Protected Sub LnkAgragarDireccion_Click(sender As Object, e As EventArgs)
@@ -4016,17 +4016,17 @@ Partial Class Clientes
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = File, .NombreArchivo = "EstadoDeCuenta.pdf"})
- Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
-
- If Envio AndAlso GuardarBitacora Then
- Using ObjBitacora As New ClsOIEventos
- ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", CveUsuario, CveEmpresa, CveCliente:=CveCliente)
- End Using
+ Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
+
+ If Envio AndAlso GuardarBitacora Then
+ Using ObjBitacora As New ClsOIEventos
+ ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", CveUsuario, CveEmpresa, CveCliente:=CveCliente)
+ End Using
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "E N V I O C O R R E O"
Private Sub EnviaCorreo(Liga As String, LigaActivar As String)
@@ -5032,20 +5032,20 @@ Partial Class Clientes
End If
End If
- End Sub
+ End Sub
Private Sub CargaClienteDispositivos(CveEmpresa As Integer)
Dim Dt As DataTable = GlobalDTUsuarios(UsuarioActual.CveUsuario)
- If Dt IsNot Nothing AndAlso Dt.Rows.Count > 0 Then
- DdlClienteDispositivo.DataSource = Dt.FiltraParametros($"CvePlataforma = 3 AND CveEmpresa = {CveEmpresa}", "Empresa")
- DdlClienteDispositivo.DataBind()
-
+ If Dt IsNot Nothing AndAlso Dt.Rows.Count > 0 Then
+ DdlClienteDispositivo.DataSource = Dt.FiltraParametros($"CvePlataforma = 3 AND CveEmpresa = {CveEmpresa}", "Empresa")
+ DdlClienteDispositivo.DataBind()
+
DdlClienteDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
End Sub
Protected Sub DdlEmpresaDispositivo_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaClienteDispositivos(DdlEmpresaDispositivo.SelectedValue.ToEntero())
- End Sub
+ End Sub
Protected Sub ImgMoverDispositivo_Click(sender As Object, e As EventArgs)
@@ -5137,7 +5137,7 @@ Partial Class Clientes
If HdnCveVenta2.Value <> "-1" AndAlso HdnFolioVenta2.Value <> "-1" Then
Dim ObjMail As New ClsSisMail()
- Dim Ruta As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Dim Ruta As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
Dim Cuerpo As String = TxtBody2.Text
Dim Asunto As String = ""
@@ -5659,7 +5659,7 @@ Partial Class Clientes
Return stream.ToString()
End Function
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\FormatoClientes.csv"
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\FormatoClientes.csv"
Dim Archivo As New FileInfo(Directorio)
If Archivo.Exists Then
Response.Clear()
@@ -5748,7 +5748,7 @@ Partial Class Clientes
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
a.GuardaLog()
Dim Mail As New ClsSisMail()
- Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
+ Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
End Sub
Protected Sub BtnCobranzaSMS_Click(sender As Object, e As EventArgs)
@@ -6258,11 +6258,11 @@ Partial Class Clientes
ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
- End Sub
+ End Sub
#End Region
-
+
#Region "VENTAS"
-
+
Public Function imprimirFacturaVenta(CveVenta As Integer) As Byte()
Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing
@@ -6876,73 +6876,73 @@ Partial Class Clientes
ObjEdoc.Dispose()
End Sub
- Public Sub DownLoad_ClickDocumentacion(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim Adjunto As String = GvRow.DataKey("Adjunto")
- linkDescargaPagare = AppDomain.CurrentDomain.BaseDirectory & String.Format("Empresas\{0}\DocElectronica\Clientes\{1}\{2}", UsuarioActual.CveEmpresa, CveCliente, Adjunto)
- TxtDireccionAval.Text = ""
- TxtAval.Text = ""
- RegistraScript("$('#ModalDivPagare').modal('show')")
-
+ Public Sub DownLoad_ClickDocumentacion(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim Adjunto As String = GvRow.DataKey("Adjunto")
+ linkDescargaPagare = ModExtensiones.DirectorioBaseEmpresas & String.Format("Empresas\{0}\DocElectronica\Clientes\{1}\{2}", UsuarioActual.CveEmpresa, CveCliente, Adjunto)
+ TxtDireccionAval.Text = ""
+ TxtAval.Text = ""
+ RegistraScript("$('#ModalDivPagare').modal('show')")
+
End Sub
- Protected Sub ImprimirPagare(sender As Object, e As EventArgs) Handles BtnAgregarPagare.Click
- Dim memoryStreamDoc As New System.IO.MemoryStream
- Dim objGemBoxDocument As New clsGemBoxDocument(linkDescargaPagare)
- Dim Tags As New List(Of TagsDocumentos)
- Dim ObjClientes As New ClsClientes
-
- Dim monto As String = ""
- Dim razonSocial As String = ""
- Dim direccion As String = ""
- Dim ciudad As String = ""
- Dim Telefono As String = ""
- Dim mesArray = New String() {"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"}
- Dim hoy As DateTime = DateTime.Now
- Dim fechaConFormato As String = String.Format("{0} de {1} del {2}", hoy.Day, mesArray(hoy.Month), hoy.Year)
-
- If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
- monto = ObjClientes.DtResultados.FiltroPrimeroValor("LimiteCredito").ToDouble.ToString("N")
- razonSocial = ObjClientes.DtResultados.FiltroPrimeroValor("NombreComercial")
- direccion = ObjClientes.DtResultados.FiltroPrimeroValor("Direccion")
- ciudad = ObjClientes.DtResultados.FiltroPrimeroValor("Ciudad")
- Telefono = ObjClientes.DtResultados.FiltroPrimeroValor("Telefono")
- End If
-
- Tags.Add(New TagsDocumentos("{Monto}", monto))
- Tags.Add(New TagsDocumentos("{Fecha}", fechaConFormato))
- Tags.Add(New TagsDocumentos("{FechaConFormato}", fechaConFormato))
- Tags.Add(New TagsDocumentos("{CantidadLetra}", monto.ToDouble.Texto2Letras(1)))
- Tags.Add(New TagsDocumentos("{RazonSocial}", razonSocial))
- Tags.Add(New TagsDocumentos("{Direccion}", direccion))
- Tags.Add(New TagsDocumentos("{Ciudad}", ciudad))
- Tags.Add(New TagsDocumentos("{Telefono}", Telefono))
- Tags.Add(New TagsDocumentos("{RazonSocialAval}", TxtAval.Text))
- Tags.Add(New TagsDocumentos("{DireccionAval}", TxtDireccionAval.Text))
- Tags.Add(New TagsDocumentos("{CiudadAval}", UsuarioActual.Empresa.Ciudad))
- Tags.Add(New TagsDocumentos("{TelefonoAval}", UsuarioActual.Empresa.Telefono))
-
- If Not ObjClientes.AddClientePagare(CveCliente, UsuarioActual.CveEmpresa, TxtAval.Text, TxtDireccionAval.Text) Then
- Alert("no se pudo registrar el pagare")
- Exit Sub
- End If
-
- 'objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0)
- RegistraScript("$('#ModalDivPagare').modal('hide')")
- Alert("Pagaré registrado con exito")
-
- objGemBoxDocument.SustituirTags(Tags)
- objGemBoxDocument.GuardarStream()
- Dim memoryStream As New System.IO.MemoryStream(objGemBoxDocument.GetBytesDocumento())
- objGemBoxDocument.Dispose()
- ObjClientes.Dispose()
- Response.Clear()
- Response.ContentType = "application/text"
- Response.AddHeader("content-disposition", "attachment;filename=pagare.docx")
- Response.Buffer = True
- memoryStream.WriteTo(Response.OutputStream)
- Response.End()
-
+ Protected Sub ImprimirPagare(sender As Object, e As EventArgs) Handles BtnAgregarPagare.Click
+ Dim memoryStreamDoc As New System.IO.MemoryStream
+ Dim objGemBoxDocument As New clsGemBoxDocument(linkDescargaPagare)
+ Dim Tags As New List(Of TagsDocumentos)
+ Dim ObjClientes As New ClsClientes
+
+ Dim monto As String = ""
+ Dim razonSocial As String = ""
+ Dim direccion As String = ""
+ Dim ciudad As String = ""
+ Dim Telefono As String = ""
+ Dim mesArray = New String() {"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"}
+ Dim hoy As DateTime = DateTime.Now
+ Dim fechaConFormato As String = String.Format("{0} de {1} del {2}", hoy.Day, mesArray(hoy.Month), hoy.Year)
+
+ If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
+ monto = ObjClientes.DtResultados.FiltroPrimeroValor("LimiteCredito").ToDouble.ToString("N")
+ razonSocial = ObjClientes.DtResultados.FiltroPrimeroValor("NombreComercial")
+ direccion = ObjClientes.DtResultados.FiltroPrimeroValor("Direccion")
+ ciudad = ObjClientes.DtResultados.FiltroPrimeroValor("Ciudad")
+ Telefono = ObjClientes.DtResultados.FiltroPrimeroValor("Telefono")
+ End If
+
+ Tags.Add(New TagsDocumentos("{Monto}", monto))
+ Tags.Add(New TagsDocumentos("{Fecha}", fechaConFormato))
+ Tags.Add(New TagsDocumentos("{FechaConFormato}", fechaConFormato))
+ Tags.Add(New TagsDocumentos("{CantidadLetra}", monto.ToDouble.Texto2Letras(1)))
+ Tags.Add(New TagsDocumentos("{RazonSocial}", razonSocial))
+ Tags.Add(New TagsDocumentos("{Direccion}", direccion))
+ Tags.Add(New TagsDocumentos("{Ciudad}", ciudad))
+ Tags.Add(New TagsDocumentos("{Telefono}", Telefono))
+ Tags.Add(New TagsDocumentos("{RazonSocialAval}", TxtAval.Text))
+ Tags.Add(New TagsDocumentos("{DireccionAval}", TxtDireccionAval.Text))
+ Tags.Add(New TagsDocumentos("{CiudadAval}", UsuarioActual.Empresa.Ciudad))
+ Tags.Add(New TagsDocumentos("{TelefonoAval}", UsuarioActual.Empresa.Telefono))
+
+ If Not ObjClientes.AddClientePagare(CveCliente, UsuarioActual.CveEmpresa, TxtAval.Text, TxtDireccionAval.Text) Then
+ Alert("no se pudo registrar el pagare")
+ Exit Sub
+ End If
+
+ 'objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0)
+ RegistraScript("$('#ModalDivPagare').modal('hide')")
+ Alert("Pagaré registrado con exito")
+
+ objGemBoxDocument.SustituirTags(Tags)
+ objGemBoxDocument.GuardarStream()
+ Dim memoryStream As New System.IO.MemoryStream(objGemBoxDocument.GetBytesDocumento())
+ objGemBoxDocument.Dispose()
+ ObjClientes.Dispose()
+ Response.Clear()
+ Response.ContentType = "application/text"
+ Response.AddHeader("content-disposition", "attachment;filename=pagare.docx")
+ Response.Buffer = True
+ memoryStream.WriteTo(Response.OutputStream)
+ Response.End()
+
End Sub
Protected Sub GvDocumentosFirma_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentosCliente.RowDataBound
@@ -8935,7 +8935,7 @@ Partial Class Clientes
e.Row.FCCheckBox("ChkCargo").Visible = False
Else
e.Row.FCCheckBox("ChkCargo").Checked = False
- e.Row.FCCheckBox("ChkCargo").Visible = False 'True
+ e.Row.FCCheckBox("ChkCargo").Visible = False 'True
End If
If FacturadoBonificacion Then
@@ -9279,9 +9279,9 @@ Partial Class Clientes
' Serie = SerieNotaAcumulador
'End If
- If ObjFactura IsNot Nothing Then
- ObjFactura.Dispose()
- ObjFactura = Nothing
+ If ObjFactura IsNot Nothing Then
+ ObjFactura.Dispose()
+ ObjFactura = Nothing
End If
ObjFactura = New Modelos.Factura(UsuarioActual)
@@ -9451,596 +9451,596 @@ Partial Class Clientes
'PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
- ObjFactura.FemsaFactura = FM
-
- ' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
-
- End Sub
-
- 'Private Sub PrepararTimbrado(ByRef FM As Modelos.FemsaFactura, ByRef TmpDT7Eleven As DataTable, ByRef TmpDTComplementosTimbrado As DataTable)
- ' FM.AplicaFEMSA = ChkAplicaFEMSA.Checked
- ' FM.FEMSA_NumSociedad = ""
- ' FM.FEMSA_NumProveedor = ""
- ' FM.FEMSA_Mail = ""
- ' FM.FEMSA_Version = "".ToEntero
- ' FM.FEMSA_NumPedido = "".ToEntero
- ' FM.FEMSA_NumEntrada = ""
- ' FM.FEMSA_NumRemision = ""
- ' FM.FEMSA_NumSocio = ""
- ' FM.FEMSA_CentroCosto = ""
- ' FM.FEMSA_IPeriodoLiquidacion = ""
- ' FM.FEMSA_FPeriodoLiquidacion = ""
- ' FM.FEMSA_CodRetencion1 = ""
- ' FM.FEMSA_CodRetencion2 = ""
-
- ' TmpDT7Eleven.Columns.Add("sevenElevenNumProveedor")
- ' TmpDT7Eleven.Columns.Add("sevenElevenFolio")
- ' TmpDT7Eleven.Columns.Add("sevenElevenTienda")
- ' TmpDT7Eleven.Columns.Add("sevenElevenFecha")
-
- ' Dim Row As DataRow = TmpDT7Eleven.NewRow
- ' Row("sevenElevenNumProveedor") = ""
- ' Row("sevenElevenFolio") = ""
- ' Row("sevenElevenTienda") = ""
- ' Row("sevenElevenFecha") = ""
-
- ' TmpDT7Eleven.Rows.Add(Row)
-
- ' TmpDTComplementosTimbrado.Columns.Add("CveComplemento")
- ' TmpDTComplementosTimbrado.Columns.Add("IdContabilidad")
- ' TmpDTComplementosTimbrado.Columns.Add("TipoProceso")
- ' TmpDTComplementosTimbrado.Columns.Add("TipoAmbito")
- ' TmpDTComplementosTimbrado.Columns.Add("Entidad")
-
- ' Dim Row2 As DataRow = TmpDTComplementosTimbrado.NewRow
- ' Row2("CveComplemento") = -1
- ' Row2("IdContabilidad") = -1
- ' Row2("TipoProceso") = -1
- ' Row2("TipoAmbito") = -1
- ' Row2("Entidad") = -1
-
- ' TmpDTComplementosTimbrado.Rows.Add(Row2)
- 'End Sub
-
- 'Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
- ' Dim Timbre As New CFDITimbre
- ' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
- ' Timbre.Comprobante.Folio = Obj.Folio.ToString
- ' Timbre.Comprobante.Serie = Obj.Serie
- ' Timbre.Comprobante.Fecha = Obj.FechaCP
- ' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
- ' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
- ' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
- ' Timbre.Comprobante.Subtotal = Obj.SubTotal
- ' Timbre.Comprobante.Descuentos = Obj.Descuento
- ' Timbre.Comprobante.Moneda = Obj.MonedaSAT
- ' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
- ' Timbre.Comprobante.Total = Obj.Total
-
- ' Try
- ' Obj.SetSubProyecto(Me)
- ' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
- ' Catch ex As Exception
-
- ' End Try
-
- ' Timbre.Comprobante.Confirmacion = ""
-
- ' Timbre.Receptor.RFC = Obj.Cliente.RFC
- ' Timbre.Receptor.Nombre = Obj.Cliente.Nombre
- ' Timbre.Receptor.ResidenciaFiscal = ""
- ' Timbre.Receptor.NumeroRegistroTributario = ""
- ' Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
-
-
- ' If Obj.CveTipoRelacion > 0 Then
- ' Select Case Obj.CveTipoRelacion
- ' Case 1
- ' Timbre.CFDIRelacionados.TipoRelacion = "01"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "01-Nota de Crédito aplicada a Ingreso"
- ' Case 2
- ' Timbre.CFDIRelacionados.TipoRelacion = "02"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "02-Nota de débito de los documentos relacionados"
- ' Case 3
- ' Timbre.CFDIRelacionados.TipoRelacion = "03"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "03-Devolución aplicada a Ingreso"
- ' Case 4
- ' Timbre.CFDIRelacionados.TipoRelacion = "04"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "04-Refacturación de Ingreso"
- ' Case 7
- ' Timbre.CFDIRelacionados.TipoRelacion = "07"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
- ' Case 8
- ' Timbre.CFDIRelacionados.TipoRelacion = "08"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "08-Factura generada por pagos en parcialidades "
- ' Case 9
- ' Timbre.CFDIRelacionados.TipoRelacion = "09"
- ' Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
-
- ' End Select
- ' End If
-
- ' Dim totSubTotal As Decimal = Obj.SubTotal
- ' Dim totIVA As Decimal = Obj.IVA
- ' Dim totRetIVA As Decimal = Obj.RetIVA
- ' Dim totRetISR As Decimal = Obj.RetISR
- ' Dim TasaRetIVA As Decimal = 0
- ' Dim TasaRetISR As Decimal = 0
- ' Dim i As Integer = 1
-
- ' 'detalles
- ' Dim tPS As String = ""
-
- ' For Each drr As DataRow In Obj.DtDetalle.Rows
- ' If drr("PS").ToString.Length = 1 Then
- ' tPS = drr("Obs").ToString
- ' Else
- ' If drr("PS").ToString.Length = 0 Then
- ' tPS = ""
- ' Else
- ' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
- ' End If
- ' End If
- ' 'condicionante, especial
- ' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
-
- ' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
- ' .Descripcion = tPS,
- ' .ValorUnitario = drr("PU").ToString.ToDecimal,
- ' .Importe = drr("TotalImporte").ToString.ToDecimal,
- ' .Descuento = drr("Descuento").ToString.ToDecimal,
- ' .Unidad = drr("UM").ToString,
- ' .ClaveUnidad = drr("SATClaveUM").ToString,
- ' .ClaveProdServ = drr("SATClaveProdServ").ToString,
- ' .Noidentificacion = drr("Noidentificacion").ToString,
- ' .CuentaPredial = drr("CuentaPredial").ToString}
- ' 'verifica suma subtotales
- ' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
- ' concepto.Importe = totSubTotal
- ' End If
- ' totSubTotal = totSubTotal - concepto.Importe
-
- ' 'siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
- ' ' If drr("ImporteIVA").ToString.ToDouble > 0 Then
-
- ' 'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos
- ' If Timbre.Comprobante.Total > 0 Then
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
- ' End If
-
- ' If drr("ImporteIEPS").ToString.ToDouble > 0 Then
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString.ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString.ToDecimal})
- ' End If
-
- ' If drr("ImporteRetIVA").ToString.ToDouble > 0 Then 'si hay retenciones
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetIVA, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString.ToDecimal})
- ' End If
-
- ' If drr("ImporteRetISR").ToString.ToDouble > 0 Then 'retención de ISR
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
- ' End If
-
- ' Timbre.Conceptos.Add(concepto)
- ' i += 1
- ' Next
-
- ' Return Timbre
- 'End Function
-
- 'Private Function GenerarNotaCredito(CvePS As Integer, Tipo As Integer, CveUnidadMedida As Integer, Importe As Decimal, Iva As Decimal, Descripcion As String, CveClasificacion As Integer) As Boolean
-
- ' Dim Respuesta As Boolean = False
-
- ' Dim ObjVentas As New ClsVentas
- ' Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
- ' Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
-
- ' Dim ErrorVentas As Boolean = False
- ' Dim SubTotal As Decimal = Importe
- ' Dim Total As Decimal = Importe + Iva
-
- ' Dim RetIVA As Decimal = 0
- ' Dim RetISR As Decimal = 0
- ' Dim TipoCambio As Decimal = 0
- ' Dim FechaVencimiento As Date = Now
- ' Dim fecha As Date = Now
-
- ' Dim Folio As Integer = 0
- ' Dim Serie As String = ""
-
- ' If FolioNotaCredito() Then
- ' Folio = FolioNotaAcumulador
- ' Serie = SerieNotaAcumulador
- ' End If
-
- ' Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero
-
- ' Dim CveVenta As Integer
-
- ' If Folio > 0 Then
-
- ' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas($"Clientes/{Descripcion}", 1, Total, Total, 1, fecha, "Nota de crédito por Cargo", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
-
- ' If ObjVentas.AddVenta("Egs", Folio, CveCliente.ToEntero, -1, SubTotal, 0, 0, Iva, RetIVA, RetISR, Total, 1, TipoCambio,
- ' 0, 0, 0, FechaVencimiento, fecha, "", "", fecha, -1, "", "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
- ' UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=CveSubProyecto, CveSubProyectoEjecucion:=CveSubProyecto) Then
-
- ' CveVenta = ObjVentas.CveVenta
-
- ' If CveVenta > 0 Then
- ' If ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, 0.16, SubTotal * 0.16, Descripcion, 0, 0, -1, 0) Then
-
- ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio.ToString, 150, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=CveSubProyecto) Then
- ' ErrorVentas = True
- ' End If
- ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio.ToString, 12, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then
- ' ErrorVentas = True
- ' End If
- ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Iva, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Iva) Then
- ' ErrorVentas = True
- ' End If
-
- ' If Not ErrorVentas Then
- ' For Each GvRow As GridViewRow In GvAcum.Rows
- ' Dim CveMovto As Integer = GvRow.DataKey("CveMovto").ToEntero
-
- ' If (Tipo = 1 And GvRow.FCCheckBox("ChkCargo").Checked) Or (Tipo = 2 And GvRow.FCCheckBox("ChkBonificacion").Checked) Then
-
- ' If ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, Tipo, CveVenta) Then
- ' Respuesta = True
- ' ErrorVentas = False
- ' CveVentaNota = CveVenta
- ' Else
- ' Respuesta = False
- ' ErrorVentas = True
- ' CveVentaNota = 0
- ' Exit For
- ' End If
-
- ' End If
- ' Next
- ' End If
-
-
- ' If Not ErrorVentas Then
- ' Alert($"Nota de crédito generada correctamente {Serie}-{Folio}")
- ' End If
-
-
- ' Else
- ' ErrorVentas = True
- ' End If
- ' Else
- ' ErrorVentas = True
- ' End If
-
- ' Else
- ' ErrorVentas = True
- ' End If
- ' Else
- ' Alert("No se pudo obtener el Folio.", TipoMensaje.MsgError)
- ' End If
-
-
-
- ' If ErrorVentas Then
- ' ObjVentas.RollBack()
- ' Else
-
- ' ObjVentas.Commit()
- ' CargaUsados()
-
- ' 'Dim DtDetallesVenta As New DataTable
-
- ' 'If ObjVentas.GetVentaDetalle(CveVenta) Then
-
- ' ' DtDetallesVenta = ObjVentas.DtResultados
- ' ' 'CreaObjetosVenta(CveVenta, Serie, Folio, SubTotal, Iva, DtDetallesVenta)
-
- ' ' ObjFactura.Timbre = PreParaTimbre(ObjFactura, ObjFactura.CveSubProyecto)
-
- ' ' Dim ObjTimbrado As New Timbrado
- ' ' Dim SeTimbro As Boolean = False
-
- ' ' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
-
- ' ' If SeTimbro Then
- ' ' Alert("Se timbro correctamente")
- ' ' Else
- ' ' Alert("No se pudo timbrar, intente mas tarde.", TipoMensaje.MsgError)
- ' ' End If
-
- ' 'Else
- ' ' Alert("No se pudo timbrar, no se pudieron obtener los detalles de la venta.", TipoMensaje.MsgError)
- ' 'End If
-
- ' End If
-
-
-
- ' ObjVentas.Dispose()
- ' Return Respuesta
-
- 'End Function
- 'Private Function generaNC(CveVenta As Integer, ByRef ObjVentas As ClsVentas, ByVal factura As Modelos.Factura) As List(Of Object)
-
- ' Dim Obj As New List(Of Object)
- ' Dim CveVentaNueva As Integer = ObjVentas.CveVenta
- ' Dim BanderaGeneraNC As Boolean = False
- ' If UsuarioActual.CveEmpresa.Contiene(1, 119) Then BanderaGeneraNC = True
-
- ' If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
- ' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
- ' Dim drv As DataRow = ObjVentas.DtResultados.Rows(0)
- ' Dim TmpDTconceptos As DataTable = Nothing
-
- ' ''CargaCliente
-
- ' Dim CveCliente As Integer = drv("CveCliente").ToString.ToEntero
- ' If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not CveCliente.Contiene(10450, 10460, 10458) Then
- ' Return Nothing
- ' ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 AndAlso Not CveCliente.Contiene(27448) Then
- ' Return Nothing
- ' End If
- ' factura.TipoDocto = drv("TipoDocto").ToString
- ' factura.Serie = drv("Serie").ToString
- ' factura.FechaEjecucion = drv("FechaEjecucion").ToString.ToDateTime
- ' factura.Fecha = drv("Fecha").ToString.ToDateTime
- ' factura.CveSubProyectoEjecucion = drv("CveSubProyectoEjecucion").ToString.ToEntero
- ' factura.CveSubProyectoCobranza = drv("CveSubProyectoCobranza").ToString.ToEntero
- ' factura.CveClienteSucursal = drv("CveClienteSucursal").ToString.ToEntero
- ' factura.CveSubProyecto = drv("CveSubProyecto").ToString.ToEntero
-
-
- ' ''CargaDetalle
- ' If ObjVentas.GetVentaDetalle(CveVenta) Then
- ' TmpDTconceptos = ObjVentas.DtResultados
- ' TmpDTconceptos.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
- ' GvPS.DataSource = TmpDTconceptos
- ' GvPS.DataBind()
- ' End If
-
- ' '' Carga Totales
- ' factura.SubTotal = drv("SubTotal").ToString.ToDecimal
- ' factura.Descuento = drv("Descuento").ToString.ToDecimal
- ' factura.Amortizacion = drv("Amortizacion").ToString.ToDecimal
- ' factura.IVA = drv("IVA").ToString.ToDecimal
- ' factura.RetIVA = drv("RetIVA").ToString.ToDecimal
- ' factura.RetISR = drv("RetISR").ToString.ToDecimal
- ' factura.Total = drv("Total").ToString.ToDecimal
- ' factura.MotivoDescuento = drv("MotivoDescuento").ToString
- ' factura.Observaciones = drv("Observaciones").ToString
- ' factura.CveMoneda = drv("CveMoneda").ToString.ToEntero
- ' factura.TipoCambio = drv("TipoCambio").ToString.ToDecimal
- ' factura.CveVendedor = drv("CveVendedor").ToString.ToEntero
- ' factura.RefDocto = drv("Ref").ToString
-
- ' If factura.CveCliente > 0 Then
- ' If Not IsNothing(TmpDTconceptos) AndAlso TmpDTconceptos.Rows.Count > 0 Then
-
- ' If Not drv("Total").ToString.ToDecimal = factura.Total Then
- ' Return Nothing
- ' End If
-
-
-
- ' End If
- ' End If
- ' End If
- ' End If
-
- ' If Obj.Count > 0 Then
- ' Return Obj
- ' Else
- ' Return Nothing
- ' End If
-
- 'End Function
-
- 'Private Function PreParaTimbre(Obj As Modelos.Factura, CveSubProyecto As Integer) As CFDITimbre
-
- ' Dim Timbre As New CFDITimbre
- ' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
- ' Timbre.Comprobante.Folio = Obj.Folio.ToString
- ' Timbre.Comprobante.Serie = Obj.Serie
- ' Timbre.Comprobante.Fecha = Obj.Fecha
- ' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
- ' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
- ' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
- ' Timbre.Comprobante.Subtotal = Obj.SubTotal
-
- ' Timbre.Comprobante.Descuentos = Obj.Descuento
- ' Timbre.Comprobante.Moneda = Obj.MonedaSAT
- ' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
- ' Timbre.Comprobante.Total = Obj.Total
-
- ' Try
- ' Obj.SetSubProyecto(Me)
- ' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
- ' Catch ex As Exception
-
- ' End Try
-
- ' Timbre.Comprobante.Confirmacion = ""
-
- ' Timbre.Receptor.RFC = TxtRFC.Text
- ' Timbre.Receptor.Nombre = TxtNombre.Text
- ' Timbre.Receptor.ResidenciaFiscal = ""
- ' Timbre.Receptor.NumeroRegistroTributario = ""
- ' Timbre.Receptor.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
-
- ' Dim totSubTotal As Decimal = Obj.SubTotal
- ' Dim totIVA As Decimal = Obj.IVA
- ' Dim totRetIVA As Decimal = Obj.RetIVA
- ' Dim totRetISR As Decimal = Obj.RetISR
- ' Dim TasaRetIVA As Decimal = 0
- ' Dim TasaRetISR As Decimal = 0
- ' Dim i As Integer = 1
-
- ' ''detalles
- ' Dim tPS As String = ""
-
- ' For Each drr As DataRow In Obj.DtDetalle.Rows
- ' If drr("PS").ToString.Length = 1 Then
- ' tPS = drr("Obs").ToString
- ' Else
- ' If drr("PS").ToString.Length = 0 Then
- ' tPS = ""
- ' Else
- ' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
- ' End If
- ' End If
- ' '' condicionante, especial
- ' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
-
- ' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
- ' .Descripcion = tPS,
- ' .ValorUnitario = drr("PU").ToString.ToDecimal,
- ' .Importe = drr("TotalImporte").ToString.ToDecimal,
- ' .Descuento = drr("Descuento").ToString.ToDecimal,
- ' .Unidad = drr("UM").ToString,
- ' .ClaveUnidad = drr("SATClaveUM").ToString,
- ' .ClaveProdServ = drr("SATClaveProdServ").ToString,
- ' .Noidentificacion = drr("Noidentificacion").ToString,
- ' .CuentaPredial = drr("CuentaPredial").ToString}
- ' '' verifica suma subtotales
- ' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
- ' concepto.Importe = totSubTotal
- ' End If
- ' totSubTotal = totSubTotal - concepto.Importe
-
- ' ''siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
- ' If drr("ImporteIVA").ToString.ToDouble > 0 Then
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
- ' End If
-
- ' If drr("ImporteIEPS").ToString.ToDouble > 0 Then
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString.ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString.ToDecimal})
- ' End If
-
- ' If drr("ImporteRetIVA").ToString.ToDouble > 0 Then 'si hay retenciones
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetIVA, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString.ToDecimal})
- ' End If
-
- ' If drr("ImporteRetISR").ToString.ToDouble > 0 Then 'retención de ISR
- ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
- ' End If
-
- ' Timbre.Conceptos.Add(concepto)
- ' i += 1
- ' Next
-
- ' Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto)(0)("AplicaComercioExterior").ToString = "True", True, False)
- ' Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
-
- ' If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
-
- ' Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
- ' Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
-
- ' End If
-
- ' Return Timbre
- 'End Function
-
+ ObjFactura.FemsaFactura = FM
+
+ ' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
+
+ End Sub
+
+ 'Private Sub PrepararTimbrado(ByRef FM As Modelos.FemsaFactura, ByRef TmpDT7Eleven As DataTable, ByRef TmpDTComplementosTimbrado As DataTable)
+ ' FM.AplicaFEMSA = ChkAplicaFEMSA.Checked
+ ' FM.FEMSA_NumSociedad = ""
+ ' FM.FEMSA_NumProveedor = ""
+ ' FM.FEMSA_Mail = ""
+ ' FM.FEMSA_Version = "".ToEntero
+ ' FM.FEMSA_NumPedido = "".ToEntero
+ ' FM.FEMSA_NumEntrada = ""
+ ' FM.FEMSA_NumRemision = ""
+ ' FM.FEMSA_NumSocio = ""
+ ' FM.FEMSA_CentroCosto = ""
+ ' FM.FEMSA_IPeriodoLiquidacion = ""
+ ' FM.FEMSA_FPeriodoLiquidacion = ""
+ ' FM.FEMSA_CodRetencion1 = ""
+ ' FM.FEMSA_CodRetencion2 = ""
+
+ ' TmpDT7Eleven.Columns.Add("sevenElevenNumProveedor")
+ ' TmpDT7Eleven.Columns.Add("sevenElevenFolio")
+ ' TmpDT7Eleven.Columns.Add("sevenElevenTienda")
+ ' TmpDT7Eleven.Columns.Add("sevenElevenFecha")
+
+ ' Dim Row As DataRow = TmpDT7Eleven.NewRow
+ ' Row("sevenElevenNumProveedor") = ""
+ ' Row("sevenElevenFolio") = ""
+ ' Row("sevenElevenTienda") = ""
+ ' Row("sevenElevenFecha") = ""
+
+ ' TmpDT7Eleven.Rows.Add(Row)
+
+ ' TmpDTComplementosTimbrado.Columns.Add("CveComplemento")
+ ' TmpDTComplementosTimbrado.Columns.Add("IdContabilidad")
+ ' TmpDTComplementosTimbrado.Columns.Add("TipoProceso")
+ ' TmpDTComplementosTimbrado.Columns.Add("TipoAmbito")
+ ' TmpDTComplementosTimbrado.Columns.Add("Entidad")
+
+ ' Dim Row2 As DataRow = TmpDTComplementosTimbrado.NewRow
+ ' Row2("CveComplemento") = -1
+ ' Row2("IdContabilidad") = -1
+ ' Row2("TipoProceso") = -1
+ ' Row2("TipoAmbito") = -1
+ ' Row2("Entidad") = -1
+
+ ' TmpDTComplementosTimbrado.Rows.Add(Row2)
+ 'End Sub
+
+ 'Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
+ ' Dim Timbre As New CFDITimbre
+ ' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
+ ' Timbre.Comprobante.Folio = Obj.Folio.ToString
+ ' Timbre.Comprobante.Serie = Obj.Serie
+ ' Timbre.Comprobante.Fecha = Obj.FechaCP
+ ' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
+ ' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
+ ' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
+ ' Timbre.Comprobante.Subtotal = Obj.SubTotal
+ ' Timbre.Comprobante.Descuentos = Obj.Descuento
+ ' Timbre.Comprobante.Moneda = Obj.MonedaSAT
+ ' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
+ ' Timbre.Comprobante.Total = Obj.Total
+
+ ' Try
+ ' Obj.SetSubProyecto(Me)
+ ' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
+ ' Catch ex As Exception
+
+ ' End Try
+
+ ' Timbre.Comprobante.Confirmacion = ""
+
+ ' Timbre.Receptor.RFC = Obj.Cliente.RFC
+ ' Timbre.Receptor.Nombre = Obj.Cliente.Nombre
+ ' Timbre.Receptor.ResidenciaFiscal = ""
+ ' Timbre.Receptor.NumeroRegistroTributario = ""
+ ' Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
+
+
+ ' If Obj.CveTipoRelacion > 0 Then
+ ' Select Case Obj.CveTipoRelacion
+ ' Case 1
+ ' Timbre.CFDIRelacionados.TipoRelacion = "01"
+ ' Timbre.CFDIRelacionados.TipoRelacionTexto = "01-Nota de Crédito aplicada a Ingreso"
+ ' Case 2
+ ' Timbre.CFDIRelacionados.TipoRelacion = "02"
+ ' Timbre.CFDIRelacionados.TipoRelacionTexto = "02-Nota de débito de los documentos relacionados"
+ ' Case 3
+ ' Timbre.CFDIRelacionados.TipoRelacion = "03"
+ ' Timbre.CFDIRelacionados.TipoRelacionTexto = "03-Devolución aplicada a Ingreso"
+ ' Case 4
+ ' Timbre.CFDIRelacionados.TipoRelacion = "04"
+ ' Timbre.CFDIRelacionados.TipoRelacionTexto = "04-Refacturación de Ingreso"
+ ' Case 7
+ ' Timbre.CFDIRelacionados.TipoRelacion = "07"
+ ' Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
+ ' Case 8
+ ' Timbre.CFDIRelacionados.TipoRelacion = "08"
+ ' Timbre.CFDIRelacionados.TipoRelacionTexto = "08-Factura generada por pagos en parcialidades "
+ ' Case 9
+ ' Timbre.CFDIRelacionados.TipoRelacion = "09"
+ ' Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
+
+ ' End Select
+ ' End If
+
+ ' Dim totSubTotal As Decimal = Obj.SubTotal
+ ' Dim totIVA As Decimal = Obj.IVA
+ ' Dim totRetIVA As Decimal = Obj.RetIVA
+ ' Dim totRetISR As Decimal = Obj.RetISR
+ ' Dim TasaRetIVA As Decimal = 0
+ ' Dim TasaRetISR As Decimal = 0
+ ' Dim i As Integer = 1
+
+ ' 'detalles
+ ' Dim tPS As String = ""
+
+ ' For Each drr As DataRow In Obj.DtDetalle.Rows
+ ' If drr("PS").ToString.Length = 1 Then
+ ' tPS = drr("Obs").ToString
+ ' Else
+ ' If drr("PS").ToString.Length = 0 Then
+ ' tPS = ""
+ ' Else
+ ' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
+ ' End If
+ ' End If
+ ' 'condicionante, especial
+ ' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
+
+ ' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
+ ' .Descripcion = tPS,
+ ' .ValorUnitario = drr("PU").ToString.ToDecimal,
+ ' .Importe = drr("TotalImporte").ToString.ToDecimal,
+ ' .Descuento = drr("Descuento").ToString.ToDecimal,
+ ' .Unidad = drr("UM").ToString,
+ ' .ClaveUnidad = drr("SATClaveUM").ToString,
+ ' .ClaveProdServ = drr("SATClaveProdServ").ToString,
+ ' .Noidentificacion = drr("Noidentificacion").ToString,
+ ' .CuentaPredial = drr("CuentaPredial").ToString}
+ ' 'verifica suma subtotales
+ ' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
+ ' concepto.Importe = totSubTotal
+ ' End If
+ ' totSubTotal = totSubTotal - concepto.Importe
+
+ ' 'siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
+ ' ' If drr("ImporteIVA").ToString.ToDouble > 0 Then
+
+ ' 'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos
+ ' If Timbre.Comprobante.Total > 0 Then
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
+ ' End If
+
+ ' If drr("ImporteIEPS").ToString.ToDouble > 0 Then
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString.ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString.ToDecimal})
+ ' End If
+
+ ' If drr("ImporteRetIVA").ToString.ToDouble > 0 Then 'si hay retenciones
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetIVA, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString.ToDecimal})
+ ' End If
+
+ ' If drr("ImporteRetISR").ToString.ToDouble > 0 Then 'retención de ISR
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
+ ' End If
+
+ ' Timbre.Conceptos.Add(concepto)
+ ' i += 1
+ ' Next
+
+ ' Return Timbre
+ 'End Function
+
+ 'Private Function GenerarNotaCredito(CvePS As Integer, Tipo As Integer, CveUnidadMedida As Integer, Importe As Decimal, Iva As Decimal, Descripcion As String, CveClasificacion As Integer) As Boolean
+
+ ' Dim Respuesta As Boolean = False
+
+ ' Dim ObjVentas As New ClsVentas
+ ' Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
+ ' Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
+
+ ' Dim ErrorVentas As Boolean = False
+ ' Dim SubTotal As Decimal = Importe
+ ' Dim Total As Decimal = Importe + Iva
+
+ ' Dim RetIVA As Decimal = 0
+ ' Dim RetISR As Decimal = 0
+ ' Dim TipoCambio As Decimal = 0
+ ' Dim FechaVencimiento As Date = Now
+ ' Dim fecha As Date = Now
+
+ ' Dim Folio As Integer = 0
+ ' Dim Serie As String = ""
+
+ ' If FolioNotaCredito() Then
+ ' Folio = FolioNotaAcumulador
+ ' Serie = SerieNotaAcumulador
+ ' End If
+
+ ' Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero
+
+ ' Dim CveVenta As Integer
+
+ ' If Folio > 0 Then
+
+ ' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas($"Clientes/{Descripcion}", 1, Total, Total, 1, fecha, "Nota de crédito por Cargo", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+
+ ' If ObjVentas.AddVenta("Egs", Folio, CveCliente.ToEntero, -1, SubTotal, 0, 0, Iva, RetIVA, RetISR, Total, 1, TipoCambio,
+ ' 0, 0, 0, FechaVencimiento, fecha, "", "", fecha, -1, "", "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza,
+ ' UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=CveSubProyecto, CveSubProyectoEjecucion:=CveSubProyecto) Then
+
+ ' CveVenta = ObjVentas.CveVenta
+
+ ' If CveVenta > 0 Then
+ ' If ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, 0.16, SubTotal * 0.16, Descripcion, 0, 0, -1, 0) Then
+
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio.ToString, 150, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=CveSubProyecto) Then
+ ' ErrorVentas = True
+ ' End If
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio.ToString, 12, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then
+ ' ErrorVentas = True
+ ' End If
+ ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Iva, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Iva) Then
+ ' ErrorVentas = True
+ ' End If
+
+ ' If Not ErrorVentas Then
+ ' For Each GvRow As GridViewRow In GvAcum.Rows
+ ' Dim CveMovto As Integer = GvRow.DataKey("CveMovto").ToEntero
+
+ ' If (Tipo = 1 And GvRow.FCCheckBox("ChkCargo").Checked) Or (Tipo = 2 And GvRow.FCCheckBox("ChkBonificacion").Checked) Then
+
+ ' If ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, Tipo, CveVenta) Then
+ ' Respuesta = True
+ ' ErrorVentas = False
+ ' CveVentaNota = CveVenta
+ ' Else
+ ' Respuesta = False
+ ' ErrorVentas = True
+ ' CveVentaNota = 0
+ ' Exit For
+ ' End If
+
+ ' End If
+ ' Next
+ ' End If
+
+
+ ' If Not ErrorVentas Then
+ ' Alert($"Nota de crédito generada correctamente {Serie}-{Folio}")
+ ' End If
+
+
+ ' Else
+ ' ErrorVentas = True
+ ' End If
+ ' Else
+ ' ErrorVentas = True
+ ' End If
+
+ ' Else
+ ' ErrorVentas = True
+ ' End If
+ ' Else
+ ' Alert("No se pudo obtener el Folio.", TipoMensaje.MsgError)
+ ' End If
+
+
+
+ ' If ErrorVentas Then
+ ' ObjVentas.RollBack()
+ ' Else
+
+ ' ObjVentas.Commit()
+ ' CargaUsados()
+
+ ' 'Dim DtDetallesVenta As New DataTable
+
+ ' 'If ObjVentas.GetVentaDetalle(CveVenta) Then
+
+ ' ' DtDetallesVenta = ObjVentas.DtResultados
+ ' ' 'CreaObjetosVenta(CveVenta, Serie, Folio, SubTotal, Iva, DtDetallesVenta)
+
+ ' ' ObjFactura.Timbre = PreParaTimbre(ObjFactura, ObjFactura.CveSubProyecto)
+
+ ' ' Dim ObjTimbrado As New Timbrado
+ ' ' Dim SeTimbro As Boolean = False
+
+ ' ' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
+
+ ' ' If SeTimbro Then
+ ' ' Alert("Se timbro correctamente")
+ ' ' Else
+ ' ' Alert("No se pudo timbrar, intente mas tarde.", TipoMensaje.MsgError)
+ ' ' End If
+
+ ' 'Else
+ ' ' Alert("No se pudo timbrar, no se pudieron obtener los detalles de la venta.", TipoMensaje.MsgError)
+ ' 'End If
+
+ ' End If
+
+
+
+ ' ObjVentas.Dispose()
+ ' Return Respuesta
+
+ 'End Function
+ 'Private Function generaNC(CveVenta As Integer, ByRef ObjVentas As ClsVentas, ByVal factura As Modelos.Factura) As List(Of Object)
+
+ ' Dim Obj As New List(Of Object)
+ ' Dim CveVentaNueva As Integer = ObjVentas.CveVenta
+ ' Dim BanderaGeneraNC As Boolean = False
+ ' If UsuarioActual.CveEmpresa.Contiene(1, 119) Then BanderaGeneraNC = True
+
+ ' If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
+ ' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
+ ' Dim drv As DataRow = ObjVentas.DtResultados.Rows(0)
+ ' Dim TmpDTconceptos As DataTable = Nothing
+
+ ' ''CargaCliente
+
+ ' Dim CveCliente As Integer = drv("CveCliente").ToString.ToEntero
+ ' If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not CveCliente.Contiene(10450, 10460, 10458) Then
+ ' Return Nothing
+ ' ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 AndAlso Not CveCliente.Contiene(27448) Then
+ ' Return Nothing
+ ' End If
+ ' factura.TipoDocto = drv("TipoDocto").ToString
+ ' factura.Serie = drv("Serie").ToString
+ ' factura.FechaEjecucion = drv("FechaEjecucion").ToString.ToDateTime
+ ' factura.Fecha = drv("Fecha").ToString.ToDateTime
+ ' factura.CveSubProyectoEjecucion = drv("CveSubProyectoEjecucion").ToString.ToEntero
+ ' factura.CveSubProyectoCobranza = drv("CveSubProyectoCobranza").ToString.ToEntero
+ ' factura.CveClienteSucursal = drv("CveClienteSucursal").ToString.ToEntero
+ ' factura.CveSubProyecto = drv("CveSubProyecto").ToString.ToEntero
+
+
+ ' ''CargaDetalle
+ ' If ObjVentas.GetVentaDetalle(CveVenta) Then
+ ' TmpDTconceptos = ObjVentas.DtResultados
+ ' TmpDTconceptos.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
+ ' GvPS.DataSource = TmpDTconceptos
+ ' GvPS.DataBind()
+ ' End If
+
+ ' '' Carga Totales
+ ' factura.SubTotal = drv("SubTotal").ToString.ToDecimal
+ ' factura.Descuento = drv("Descuento").ToString.ToDecimal
+ ' factura.Amortizacion = drv("Amortizacion").ToString.ToDecimal
+ ' factura.IVA = drv("IVA").ToString.ToDecimal
+ ' factura.RetIVA = drv("RetIVA").ToString.ToDecimal
+ ' factura.RetISR = drv("RetISR").ToString.ToDecimal
+ ' factura.Total = drv("Total").ToString.ToDecimal
+ ' factura.MotivoDescuento = drv("MotivoDescuento").ToString
+ ' factura.Observaciones = drv("Observaciones").ToString
+ ' factura.CveMoneda = drv("CveMoneda").ToString.ToEntero
+ ' factura.TipoCambio = drv("TipoCambio").ToString.ToDecimal
+ ' factura.CveVendedor = drv("CveVendedor").ToString.ToEntero
+ ' factura.RefDocto = drv("Ref").ToString
+
+ ' If factura.CveCliente > 0 Then
+ ' If Not IsNothing(TmpDTconceptos) AndAlso TmpDTconceptos.Rows.Count > 0 Then
+
+ ' If Not drv("Total").ToString.ToDecimal = factura.Total Then
+ ' Return Nothing
+ ' End If
+
+
+
+ ' End If
+ ' End If
+ ' End If
+ ' End If
+
+ ' If Obj.Count > 0 Then
+ ' Return Obj
+ ' Else
+ ' Return Nothing
+ ' End If
+
+ 'End Function
+
+ 'Private Function PreParaTimbre(Obj As Modelos.Factura, CveSubProyecto As Integer) As CFDITimbre
+
+ ' Dim Timbre As New CFDITimbre
+ ' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
+ ' Timbre.Comprobante.Folio = Obj.Folio.ToString
+ ' Timbre.Comprobante.Serie = Obj.Serie
+ ' Timbre.Comprobante.Fecha = Obj.Fecha
+ ' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
+ ' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
+ ' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
+ ' Timbre.Comprobante.Subtotal = Obj.SubTotal
+
+ ' Timbre.Comprobante.Descuentos = Obj.Descuento
+ ' Timbre.Comprobante.Moneda = Obj.MonedaSAT
+ ' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString)
+ ' Timbre.Comprobante.Total = Obj.Total
+
+ ' Try
+ ' Obj.SetSubProyecto(Me)
+ ' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
+ ' Catch ex As Exception
+
+ ' End Try
+
+ ' Timbre.Comprobante.Confirmacion = ""
+
+ ' Timbre.Receptor.RFC = TxtRFC.Text
+ ' Timbre.Receptor.Nombre = TxtNombre.Text
+ ' Timbre.Receptor.ResidenciaFiscal = ""
+ ' Timbre.Receptor.NumeroRegistroTributario = ""
+ ' Timbre.Receptor.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
+
+ ' Dim totSubTotal As Decimal = Obj.SubTotal
+ ' Dim totIVA As Decimal = Obj.IVA
+ ' Dim totRetIVA As Decimal = Obj.RetIVA
+ ' Dim totRetISR As Decimal = Obj.RetISR
+ ' Dim TasaRetIVA As Decimal = 0
+ ' Dim TasaRetISR As Decimal = 0
+ ' Dim i As Integer = 1
+
+ ' ''detalles
+ ' Dim tPS As String = ""
+
+ ' For Each drr As DataRow In Obj.DtDetalle.Rows
+ ' If drr("PS").ToString.Length = 1 Then
+ ' tPS = drr("Obs").ToString
+ ' Else
+ ' If drr("PS").ToString.Length = 0 Then
+ ' tPS = ""
+ ' Else
+ ' tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
+ ' End If
+ ' End If
+ ' '' condicionante, especial
+ ' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
+
+ ' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
+ ' .Descripcion = tPS,
+ ' .ValorUnitario = drr("PU").ToString.ToDecimal,
+ ' .Importe = drr("TotalImporte").ToString.ToDecimal,
+ ' .Descuento = drr("Descuento").ToString.ToDecimal,
+ ' .Unidad = drr("UM").ToString,
+ ' .ClaveUnidad = drr("SATClaveUM").ToString,
+ ' .ClaveProdServ = drr("SATClaveProdServ").ToString,
+ ' .Noidentificacion = drr("Noidentificacion").ToString,
+ ' .CuentaPredial = drr("CuentaPredial").ToString}
+ ' '' verifica suma subtotales
+ ' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
+ ' concepto.Importe = totSubTotal
+ ' End If
+ ' totSubTotal = totSubTotal - concepto.Importe
+
+ ' ''siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
+ ' If drr("ImporteIVA").ToString.ToDouble > 0 Then
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
+ ' End If
+
+ ' If drr("ImporteIEPS").ToString.ToDouble > 0 Then
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString.ToDecimal, .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString.ToDecimal})
+ ' End If
+
+ ' If drr("ImporteRetIVA").ToString.ToDouble > 0 Then 'si hay retenciones
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetIVA, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString.ToDecimal})
+ ' End If
+
+ ' If drr("ImporteRetISR").ToString.ToDouble > 0 Then 'retención de ISR
+ ' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString.ToDecimal})
+ ' End If
+
+ ' Timbre.Conceptos.Add(concepto)
+ ' i += 1
+ ' Next
+
+ ' Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto)(0)("AplicaComercioExterior").ToString = "True", True, False)
+ ' Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
+
+ ' If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
+
+ ' Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
+ ' Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
+
+ ' End If
+
+ ' Return Timbre
+ 'End Function
+
#End Region
-
+
#Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel"
Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click
ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones")
- End Sub
+ End Sub
Private Sub LnkCotizacionesExcel_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesExcel.Click
ImprimeGridsProveedores("Excel", DtCotizaciones, "RepClientesCotizaciones")
- End Sub
-
+ End Sub
+
Private Sub LnkCxCActivasPDF_Click(sender As Object, e As EventArgs) Handles LnkCxCActivasPDF.Click
ImprimeGridsProveedores("PDF", DtCxCActivas, "RepClientesCxCActivas")
- End Sub
+ End Sub
Private Sub LnkCxCActivasExcel_Click(sender As Object, e As EventArgs) Handles LnkCxCActivasExcel.Click
ImprimeGridsProveedores("Excel", DtCxCActivas, "RepClientesCxCActivas")
- End Sub
-
+ End Sub
+
Private Sub LnkHistorialCxCPDF_Click(sender As Object, e As EventArgs) Handles LnkHistorialCxCPDF.Click
ImprimeGridsProveedores("PDF", DtHistorialCxC, "RepClientesHistorialCxC")
- End Sub
+ End Sub
Private Sub LnkHistorialCxCExcel_Click(sender As Object, e As EventArgs) Handles LnkHistorialCxCExcel.Click
ImprimeGridsProveedores("Excel", DtHistorialCxC, "RepClientesHistorialCxC")
- End Sub
-
+ End Sub
+
Private Sub LnkAnticipoClientePDF_Click(sender As Object, e As EventArgs) Handles LnkAnticipoClientePDF.Click
ImprimeGridsProveedores("PDF", DtClientesAnticipo, "RepClientesAnticipos")
- End Sub
+ End Sub
Private Sub LnkAnticipoClienteExcel_Click(sender As Object, e As EventArgs) Handles LnkAnticipoClienteExcel.Click
ImprimeGridsProveedores("Excel", DtClientesAnticipo, "RepClientesAnticipos")
- End Sub
-
+ End Sub
+
Private Sub LnkAnticipoHistorialPDF_Click(sender As Object, e As EventArgs) Handles LnkAnticipoHistorialPDF.Click
ImprimeGridsProveedores("PDF", DtAnticipoHistorial, "RepClientesAnticipoHistorial")
- End Sub
+ End Sub
Private Sub LnkAnticipoHistorialExcel_Click(sender As Object, e As EventArgs) Handles LnkAnticipoHistorialExcel.Click
ImprimeGridsProveedores("Excel", DtAnticipoHistorial, "RepClientesAnticipoHistorial")
- End Sub
-
+ End Sub
+
Private Sub LnkCuentasBancariasPDF_Click(sender As Object, e As EventArgs) Handles LnkCuentasBancariasPDF.Click
ImprimeGridsProveedores("PDF", DTCuentasBancos, "RepClientesCuentasBancarias")
- End Sub
+ End Sub
Private Sub LnkCuentasBancariasExcel_Click(sender As Object, e As EventArgs) Handles LnkCuentasBancariasExcel.Click
ImprimeGridsProveedores("Excel", DTCuentasBancos, "RepClientesCuentasBancarias")
- End Sub
-
+ End Sub
+
Private Sub ImprimeGridsProveedores(Formato As String, DtTemp As DataTable, NombreFormato As String)
- If DtTemp IsNot Nothing And DtTemp.Rows.Count > 0 Then
- Dim params As New List(Of ReportParameter)
-
- 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)
-
- params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("AgrupadoPor", "Cliente: " & LtlCliente.Text))
-
- If Imagen.Exists Then
- params.Add(New ReportParameter("LogoPath", logouri))
- Else
- params.Add(New ReportParameter("LogoPath", ""))
- End If
- ImprimirPDF("Empresas\Grales\Formatos\" & NombreFormato & ".rdlc", DtTemp, params, NombreFormato & "_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
- Else
- Alert("No se encontró información.", TipoMensaje.MsgAdvertencia)
+ If DtTemp IsNot Nothing And DtTemp.Rows.Count > 0 Then
+ Dim params As New List(Of ReportParameter)
+
+ 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)
+
+ params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
+ params.Add(New ReportParameter("AgrupadoPor", "Cliente: " & LtlCliente.Text))
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("LogoPath", logouri))
+ Else
+ params.Add(New ReportParameter("LogoPath", ""))
+ End If
+ ImprimirPDF("Empresas\Grales\Formatos\" & NombreFormato & ".rdlc", DtTemp, params, NombreFormato & "_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
+ Else
+ Alert("No se encontró información.", TipoMensaje.MsgAdvertencia)
End If
- End Sub
-
- Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
-
- Dim Acum As New ClsAcumuladores
- Dim Puntos As Decimal = -LblUsadosPuntos.Text.ToDecimal
- If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then
- Alert("Puntuación Inicializada")
- End If
- Acum.Dispose()
-
- End Sub
-#End Region
- Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
- If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
- TxtRetIVA.Text = "0"
- DivRetIVA.Visible = False
-
- If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
- TxtRetIVA.Text = "10"
- DivRetIVA.Visible = True
- ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
- TxtRetIVA.Text = "4"
- DivRetIVA.Visible = True
- ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") Then
- TxtRetIVA.Text = "6"
- DivRetIVA.Visible = True
- End If
-
- End If
- End Sub
- Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
- CargaEventoBitacora()
- End Sub
+ End Sub
+
+ Private Sub LnkUsadosReset_Click(sender As Object, e As EventArgs) Handles LnkUsadosReset.Click
+
+ Dim Acum As New ClsAcumuladores
+ Dim Puntos As Decimal = -LblUsadosPuntos.Text.ToDecimal
+ If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then
+ Alert("Puntuación Inicializada")
+ End If
+ Acum.Dispose()
+
+ End Sub
+#End Region
+ Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
+ If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
+ TxtRetIVA.Text = "0"
+ DivRetIVA.Visible = False
+
+ If DdlTipoRetencion.SelectedValue.Contiene("1", "2") Then
+ TxtRetIVA.Text = "10"
+ DivRetIVA.Visible = True
+ ElseIf DdlTipoRetencion.SelectedValue.Contiene("3") Then
+ TxtRetIVA.Text = "4"
+ DivRetIVA.Visible = True
+ ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") Then
+ TxtRetIVA.Text = "6"
+ DivRetIVA.Visible = True
+ End If
+
+ End If
+ End Sub
+ Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)
+ CargaEventoBitacora()
+ End Sub
End Class
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index 07149a6ab..dee07e6c9 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -226,13 +226,13 @@ Partial Class PV
Private ReadOnly Property Ruta As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
End Get
End Property
Private ReadOnly Property RutaPruebas As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\1\"
+ Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\1\"
End Get
End Property
diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb
index dc21afb62..d628ab5d6 100644
--- a/Ventas/PopUpBuscarFolio.aspx.vb
+++ b/Ventas/PopUpBuscarFolio.aspx.vb
@@ -7,7 +7,7 @@ Partial Class PopUpBuscarFolio
Private ReadOnly Property Ruta As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\"
End Get
End Property
@@ -159,8 +159,8 @@ Partial Class PopUpBuscarFolio
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
Dim Liga As String = String.Format("", e.Row.DBCampo("CveVenta"))
- If UsuarioActual.CveEmpresa = 140 AndAlso e.Row.DBCampo("TipoDocto").Contiene("Rem") Then
- Liga = String.Format("", e.Row.DBCampo("CveVenta"))
+ If UsuarioActual.CveEmpresa = 140 AndAlso e.Row.DBCampo("TipoDocto").Contiene("Rem") Then
+ Liga = String.Format("", e.Row.DBCampo("CveVenta"))
End If
e.Row.FCLiteral("LtlTipo").Text = String.Format("{0}{1} ", Liga, e.Row.DBCampo("TipoDocto"))
diff --git a/Ventas/PopUpImprimir.aspx.vb b/Ventas/PopUpImprimir.aspx.vb
index 90720a9ae..bf9706395 100644
--- a/Ventas/PopUpImprimir.aspx.vb
+++ b/Ventas/PopUpImprimir.aspx.vb
@@ -64,7 +64,7 @@ Partial Class PopUpImprimir
RegistraScript("$get('tdContenido').style.height='520px'")
Else
- Dim Path As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\" & Ext & "\" & CveVenta & "." & Ext
+ Dim Path As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" & Ext & "\" & CveVenta & "." & Ext
Dim Archivo As New System.IO.FileInfo(Path)
If Archivo.Exists Then
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index 27d292fea..5bcf203e4 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -2281,7 +2281,7 @@ Partial Class ProductosyServicios
Dim Archivo = ""
Dim DirectorioTemporal = ""
- Dim DirectorioDestino = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{UsuarioActual.CveEmpresa}\Ecommerce\Productos\Imagenes\"
+ Dim DirectorioDestino = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\Ecommerce\Productos\Imagenes\"
If Not Directory.Exists(DirectorioDestino) Then
Directory.CreateDirectory(DirectorioDestino)
End If
@@ -2316,7 +2316,7 @@ Partial Class ProductosyServicios
If (CveImagenActivoFijo > 0) Then
Dim ObjEcommerce As New ClsECommerce
If ObjEcommerce.ProductosImagenesRemove(CveImagenActivoFijo, UsuarioActual.CveEmpresa) Then
- File.Delete(String.Format("{0}Empresas\{1}\{2}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, ObjEcommerce.DtResultados.Rows(0)("URL")))
+ File.Delete(String.Format("{0}Empresas\{1}\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ObjEcommerce.DtResultados.Rows(0)("URL")))
CargarGaleriaImagenesEcommerce()
RegistraScript("initcarusel();")
End If
diff --git a/Ventas/RepPS.aspx.vb b/Ventas/RepPS.aspx.vb
index 95092920d..fcef61fbb 100644
--- a/Ventas/RepPS.aspx.vb
+++ b/Ventas/RepPS.aspx.vb
@@ -2,13 +2,13 @@
Option Strict On
Imports Extensiones
-Imports System.Data
-Imports Microsoft.Reporting.WebForms
-
-Partial Class Ventas_RepPS
- Inherits ClsPaginas
-
-#Region "P R O P I E D A D E S"
+Imports System.Data
+Imports Microsoft.Reporting.WebForms
+
+Partial Class Ventas_RepPS
+ Inherits ClsPaginas
+
+#Region "P R O P I E D A D E S"
Private Property DtReporte As DataTable
Get
Return DirectCast(ViewState("DtReporte"), DataTable)
@@ -16,25 +16,25 @@ Partial Class Ventas_RepPS
Set(value As DataTable)
ViewState("DtReporte") = value
End Set
- End Property
-#End Region
-
+ End Property
+#End Region
+
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
- If Not IsPostBack Then
- CargaDatosIniciales()
- CargaCombos()
+ If Not IsPostBack Then
+ CargaDatosIniciales()
+ CargaCombos()
CargaDatos()
End If
- End Sub
- Private Sub CargaDatosIniciales()
- txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
- txtFechaF.Text = Now.ToString("dd/MM/yyyy")
- End Sub
-
- Private Sub CargaCombos()
- CargaTipoCentroCosto()
- End Sub
-
+ End Sub
+ Private Sub CargaDatosIniciales()
+ txtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
+ txtFechaF.Text = Now.ToString("dd/MM/yyyy")
+ End Sub
+
+ Private Sub CargaCombos()
+ CargaTipoCentroCosto()
+ End Sub
+
Private Sub CargaTipoCentroCosto()
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
@@ -66,23 +66,23 @@ Partial Class Ventas_RepPS
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then
LblSubProyecto.InnerText = "Sucursal:"
End If
- End Sub
-
- Private Sub CargaDatos()
-
- Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
- Dim Grupo As Integer = DdlGrupo.SelectedValue.ToEntero()
- Dim CvePS As Integer = -1
- Dim CveMoneda As Integer = -1
- Dim TC As Integer = 1
+ End Sub
+
+ Private Sub CargaDatos()
+
+ Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
+ Dim Grupo As Integer = DdlGrupo.SelectedValue.ToEntero()
+ Dim CvePS As Integer = -1
+ Dim CveMoneda As Integer = -1
+ Dim TC As Integer = 1
Dim TCEspecifico As Decimal = -1
Dim FechaI, FechaF As DateTime
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha)
- FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
-
+ FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
+
Dim ObjVentas As New ClsVentas()
- If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then
- DtReporte = ObjVentas.DtResultados.Copy()
+ If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico) Then
+ DtReporte = ObjVentas.DtResultados.Copy()
GvDatos.DataSource = DtReporte
Else
GvDatos.DataSource = Nothing
@@ -92,28 +92,28 @@ Partial Class Ventas_RepPS
GvDatos.DataBind()
UPDatos.Update()
- End Sub
+ End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- Select Case e.Row.DBCampo("Orden").ToString.ToEntero()
- Case 4
- e.Row.CssClass = "Totales"
- Case 3
- e.Row.CssClass = "SubTotales2"
- Case 2
- e.Row.CssClass = "SubTotales"
- Case 1
- e.Row.CssClass = "SubTotalesB"
- Case 0
- e.Row.CssClass = "Texto"
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ Select Case e.Row.DBCampo("Orden").ToString.ToEntero()
+ Case 4
+ e.Row.CssClass = "Totales"
+ Case 3
+ e.Row.CssClass = "SubTotales2"
+ Case 2
+ e.Row.CssClass = "SubTotales"
+ Case 1
+ e.Row.CssClass = "SubTotalesB"
+ Case 0
+ e.Row.CssClass = "Texto"
End Select
End If
- End Sub
- Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
- CargaDatos()
- End Sub
-
-
+ End Sub
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+ CargaDatos()
+ End Sub
+
+
#Region " IMPRIMIR "
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
If GvDatos.Rows.Count > 0 Then
@@ -128,10 +128,10 @@ Partial Class Ventas_RepPS
Private Sub GenerarPDF()
Dim FechaI, FechaF As Date
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.ToDate, MinFecha)
- FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
+ FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
If DtReporte IsNot Nothing AndAlso DtReporte.Rows.Count > 0 Then
Dim SbParametros As New StringBuilder
- SbParametros.AppendFormat("Sucursal:{0}", DdlSubProyecto.SelectedItem.Text)
+ SbParametros.AppendFormat("Sucursal:{0}", DdlSubProyecto.SelectedItem.Text)
SbParametros.AppendFormat(", Orden:{0}", DdlGrupo.SelectedItem.Text)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -147,20 +147,20 @@ Partial Class Ventas_RepPS
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
- End If
- params.Add(New ReportParameter("Parametros", SbParametros.ToString()))
-
- If System.IO.File.Exists($"{Server.MapPath("/")}/Empresas/{UsuarioActual.CveEmpresa}/Formatos/RepPS.rdlc") Then
- ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/RepPS.rdlc", DtReporte, params, "ReportePS")
- Else
- ImprimirPDF($"Empresas/Grales/Formatos/RepPS.rdlc", DtReporte, params, "ReportePS")
+ End If
+ params.Add(New ReportParameter("Parametros", SbParametros.ToString()))
+
+ If System.IO.File.Exists($"{ModExtensiones.DirectorioBaseEmpresas}/Empresas/{UsuarioActual.CveEmpresa}/Formatos/RepPS.rdlc") Then
+ ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/RepPS.rdlc", DtReporte, params, "ReportePS")
+ Else
+ ImprimirPDF($"Empresas/Grales/Formatos/RepPS.rdlc", DtReporte, params, "ReportePS")
End If
Else
Alert("No hay información para mostrar.", TipoMensaje.MsgAdvertencia)
End If
- End Sub
-
+ End Sub
+
#End Region
-
-End Class
+
+End Class
diff --git a/Ventas/RepRecuperacion.aspx.vb b/Ventas/RepRecuperacion.aspx.vb
index ab5d4b57b..5ca328ee7 100644
--- a/Ventas/RepRecuperacion.aspx.vb
+++ b/Ventas/RepRecuperacion.aspx.vb
@@ -92,8 +92,8 @@ Partial Class Ventas_RepRecuperacion
'Carga Bancos'
DdlBanco.DataSource = GlobalDTBancos().FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
- DdlBanco.DataBind()
- DdlBanco.Items.Insert(0, New ListItem("Todos", "-1"))
+ DdlBanco.DataBind()
+ DdlBanco.Items.Insert(0, New ListItem("Todos", "-1"))
DdlBanco.Items.Add(New ListItem("Empresa", "0"))
'Carga Clasificacion Cliente'
@@ -179,7 +179,7 @@ Partial Class Ventas_RepRecuperacion
#Region "SELECTED INDEX CHANGE"
Protected Sub DdlBanco_SelectedIndexChanged(sender As Object, e As EventArgs)
- DdlCuentaBancaria.Items.Clear()
+ DdlCuentaBancaria.Items.Clear()
DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}")
DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1"))
DdlCuentaBancaria.DataBind()
@@ -214,7 +214,7 @@ Partial Class Ventas_RepRecuperacion
If DdlResponsable.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Responsable: {0}", DdlResponsable.SelectedItem.Text)
Dim RutaPDF As String
- Dim Ruta As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{UsuarioActual.CveEmpresa}\"
+ Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\"
RutaPDF = $"{Ruta}\Formatos\RepRecuperacion.rdlc"
If Not File.Exists(RutaPDF) Then
RutaPDF = "Empresas/Grales/Formatos/RepRecuperacion.rdlc"
diff --git a/Ventas/RepRecuperacionDetalle.aspx.vb b/Ventas/RepRecuperacionDetalle.aspx.vb
index 4f2027ccc..fd8ccd5a9 100644
--- a/Ventas/RepRecuperacionDetalle.aspx.vb
+++ b/Ventas/RepRecuperacionDetalle.aspx.vb
@@ -296,7 +296,7 @@ Partial Class Ventas_RepRecuperacionDetalle
If DdlClienteSucursal.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Cliente Sucursal: {0}", DdlClienteSucursal.SelectedItem.Text)
Dim RutaPDF As String
- Dim Ruta As String = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\{UsuarioActual.CveEmpresa}\"
+ Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\"
RutaPDF = $"{Ruta}\Formatos\RepRecuperacionDetalle.rdlc"
If Not File.Exists(RutaPDF) Then
RutaPDF = "Empresas/Grales/Formatos/RepRecuperacionDetalle.rdlc"
diff --git a/Ventas/ReporteDetalle.aspx.cs b/Ventas/ReporteDetalle.aspx.cs
index 2b4086f33..7b17bb50c 100644
--- a/Ventas/ReporteDetalle.aspx.cs
+++ b/Ventas/ReporteDetalle.aspx.cs
@@ -122,11 +122,11 @@ public partial class Ventas_ReporteDetalle : ClsPaginas
Hashtable UrlParametros = Parametros(ModExtensiones.Decripta(Request["Op"].ToString()));
if (Request["Mod"] != null && Request["Mod"].ToString().Equals("Editar"))
{
- Directorio1 = AppDomain.CurrentDomain.BaseDirectory + string.Format(@"Empresas\{0}\Formatos\Factura.mrt", UrlParametros["CVEEMPRESA"].ToString());
+ Directorio1 = ModExtensiones.DirectorioBaseEmpresas + string.Format(@"Empresas\{0}\Formatos\Factura.mrt", UrlParametros["CVEEMPRESA"].ToString());
}
else
{
- Directorio1 = AppDomain.CurrentDomain.BaseDirectory + @"Empresas\Grales\Formatos\Factura.mrt";
+ Directorio1 = ModExtensiones.DirectorioBaseEmpresas + @"Empresas\Grales\Formatos\Factura.mrt";
}
CargaFactura(Directorio1, UrlParametros);
SmdDesigner.Report = Reporte;
@@ -300,7 +300,7 @@ public partial class Ventas_ReporteDetalle : ClsPaginas
{
Hashtable UrlParametros = Parametros(ModExtensiones.Decripta(Request["Op"].ToString()));
CveEmpresa = UrlParametros["CVEEMPRESA"].ToString().ToEntero();
- string DirBase = AppDomain.CurrentDomain.BaseDirectory + string.Format(@"Empresas\{0}\Formatos\", CveEmpresa);
+ string DirBase = ModExtensiones.DirectorioBaseEmpresas + string.Format(@"Empresas\{0}\Formatos\", CveEmpresa);
if (!System.IO.Directory.Exists(DirBase))
{
System.IO.Directory.CreateDirectory(DirBase);
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index c9e1948fa..e828f93c6 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -597,12 +597,12 @@ Partial Class Ventas
End Property
Private ReadOnly Property Ruta As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\" & UsuarioActual.CveEmpresa & "\"
+ Return UsuarioActual.Empresa.Ruta
End Get
End Property
Private ReadOnly Property RutaPruebas As String
Get
- Return AppDomain.CurrentDomain.BaseDirectory & "Empresas\1\"
+ Return String.Format("{0}Empresas/1/", ModExtensiones.DirectorioBaseEmpresas)
End Get
End Property
Private ReadOnly Property TipoCambio As Decimal
@@ -5625,7 +5625,7 @@ Partial Class Ventas
ObjClientes.Dispose()
Me.ObjFacturaNC = Nothing
- Me.ObjFacturaNC = New Modelos.Factura(UsuarioActual, pCveVenta, UsuarioActual.CveEmpresa, DirectorioServidor:=Server.MapPath("/"), EsCancelacion:=False)
+ Me.ObjFacturaNC = New Modelos.Factura(UsuarioActual, pCveVenta, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas, EsCancelacion:=False)
DdlNCFactura.DataSource = DTFacNC
DdlNCFactura.DataBind()
@@ -7188,7 +7188,7 @@ Partial Class Ventas
Try
- Dim DirectoriArchivoXML As String = System.IO.Path.Combine(Server.MapPath("/"), "Empresas", UsuarioActual.CveEmpresa.ToString(), ObjFactura.TipoDocto)
+ Dim DirectoriArchivoXML As String = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas", UsuarioActual.CveEmpresa.ToString(), ObjFactura.TipoDocto)
If Not Directory.Exists(DirectoriArchivoXML) Then
Directory.CreateDirectory(DirectoriArchivoXML)
End If
@@ -18489,7 +18489,7 @@ Partial Class Ventas
Dim RFC As String = ""
Dim XMLDoc As New XmlDocument
- Dim Archivo As String = String.Format("{0}Empresas\{1}\Ventas\{2}\{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, Request("RFC"), $"{Request("CveFactura")}.xml")
+ Dim Archivo As String = String.Format("{0}Empresas\{1}\Ventas\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Request("RFC"), $"{Request("CveFactura")}.xml")
If IO.File.Exists(Archivo) Then
Dim Validada As Boolean = True
@@ -19433,7 +19433,7 @@ Partial Class Ventas
#Region "DESCARGAR E IMPRIMIR LISTADO"
Public Sub DescargarFormato()
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\Formatos\FormatoVentas.xlsx"
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\FormatoVentas.xlsx"
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
@@ -19672,7 +19672,7 @@ Partial Class Ventas
Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
If TxtExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
- Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch
+ Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
diff --git a/Ventas/eFacturas.aspx.vb b/Ventas/eFacturas.aspx.vb
index 93eaabdda..2fe02e10e 100644
--- a/Ventas/eFacturas.aspx.vb
+++ b/Ventas/eFacturas.aspx.vb
@@ -48,7 +48,7 @@ Partial Class Ventas_eFacturas
txtFechaF.Text = Now.ToShortDateString 'txtFechaI.Text.ToDate.AddMonths(1).AddDays(-1).ToShortDateString
- Destino = String.Format("{0}Ventas\", UsuarioActual.Empresa.Ruta) 'string.format("{0}Empresas\{1}\Compras\", AppDomain.CurrentDomain.BaseDirectory ,UsuarioActual.CveEmpresa & "\Compras\"
+ Destino = String.Format("{0}Ventas\", UsuarioActual.Empresa.Ruta) 'string.format("{0}Empresas\{1}\Compras\", ModExtensiones.DirectorioBaseEmpresas ,UsuarioActual.CveEmpresa & "\Compras\"
Ejecutable = String.Format("{0}\Utilerias\eeeFacturas.exe", AppDomain.CurrentDomain.BaseDirectory)
Form.DefaultButton = BtnConsultar.UniqueID
@@ -354,7 +354,7 @@ Partial Class Ventas_eFacturas
Protected Sub LnkNoRecibidas_Click(sender As Object, e As EventArgs) Handles LnkNoRecibias.Click
Dim dt As New DataTable
- Dim Ruta As String = String.Format("{0}\Empresas\{1}\Compras\NoRecibidas-{1}.xml", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)
+ Dim Ruta As String = String.Format("{0}\Empresas\{1}\Compras\NoRecibidas-{1}.xml", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)
Dim Str As New StringBuilder
If IO.File.Exists(Ruta) Then
dt.ReadXml(Ruta)
@@ -440,8 +440,8 @@ Partial Class Ventas_eFacturas
'Dim ObjProcess As Process = Nothing
'Dim Mensajes As String = ""
- 'Dim EjecutableUtilerias = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Utilerias\UtileriasAD.exe")
- 'Dim Folder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Empresas\")
+ 'Dim EjecutableUtilerias = Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Utilerias\UtileriasAD.exe")
+ 'Dim Folder = Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas\")
'Dim error1 As Boolean = False
'Dim en As New CultureInfo("en-US")
'Dim fechai = txtFechaI.Text.Trim.ToDate.ToString("d", en)
@@ -464,7 +464,7 @@ Partial Class Ventas_eFacturas
Dim ObjProcess As Process = Nothing
Dim Mensajes As String = ""
Dim EjecutableUtilerias = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Utilerias\ADSUtilerias.exe")
- Dim Folder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Empresas\")
+ Dim Folder = Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas\")
Dim error1 As Boolean = False
Dim en As New CultureInfo("en-US")
Dim fechai = txtFechaI.Text.Trim.ToDate.ToString("d", en)
diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx
index 92d0c128c..461d63f35 100644
--- a/asmx/WSApp.asmx
+++ b/asmx/WSApp.asmx
@@ -1,5 +1,5 @@
-<%@ WebService Language="VB" Class="WSApp" %>
-
+<%@ WebService Language="VB" Class="WSApp" %>
+
Option Explicit On
Imports System.Data
@@ -22,9 +22,9 @@ Imports Newtonsoft.Json.Linq
Public Class WSApp
- Inherits System.Web.Services.WebService
+ Inherits System.Web.Services.WebService
#Region "G L O B A L - D T"
-
+
Public ReadOnly Property UrlSitio As String
Get
Return ConfigurationManager.AppSettings("UrlSitio").ToString
@@ -73,10 +73,10 @@ Public Class WSApp
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
- If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados
+ If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose()
- Dim msg As String = "aqui no se carga subproyectos"
+ Dim msg As String = "aqui no se carga subproyectos"
msg.GuardaLog()
End If
@@ -97,8 +97,8 @@ Public Class WSApp
End If
End Get
- Set(ByVal value As DataTable)
- Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
+ Set(ByVal value As DataTable)
+ Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
@@ -425,9 +425,9 @@ Public Class WSApp
Set(value As DataTable)
Application("GlobalDTMotivosHorasExtras") = value
End Set
- End Property
+ End Property
#End Region
-
+
Public Property CveEmpresa As Integer = 143
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
@@ -448,7 +448,7 @@ Public Class WSApp
Else
End If
ObjEmpresa.Dispose()
- End Sub
+ End Sub
#Region "M E T O D O S - S E R V I C I O"
Public Function ValidaUsuario(CveUsuario As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing
@@ -728,12 +728,12 @@ Public Class WSApp
If UsuarioActual IsNot Nothing Then
'If UsuarioActual.TienePermisoProceso(159) Then
- ' Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, CveEmpresa, Server.MapPath("/"))
+ ' Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, CveEmpresa, ModExtensiones.DirectorioBaseEmpresas)
' Retorno = Factura.CancelarDocumento()
'Else
' Retorno.Mensajes.Add("Este usuario no tiene permiso para cancelar documento")
'End If
- Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, CveEmpresa, Server.MapPath("/"))
+ Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, CveEmpresa, ModExtensiones.DirectorioBaseEmpresas)
If String.IsNullOrEmpty(Factura.FolioFiscal) Then
Factura.FolioFiscal = ""
End If
@@ -783,9 +783,9 @@ Public Class WSApp
Retorno.Mensajes.Add("Ocurrió un error al eliminar el movimiento. Por favor vuelva a intetar.")
End If
ObjInv.Dispose()
- End Sub
+ End Sub
#End Region
-
+
#Region "P E D I D O S"
Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
Dim Timbre As New CFDITimbre
@@ -899,9 +899,9 @@ Public Class WSApp
i += 1
Next
Return Timbre
- End Function
+ End Function
#End Region
-
+
#Region "R E M I S I O N E S"
Private Function CreaFactura(ByRef Retorno As Modelos.Factura.MMensajeFactura, CveCliente As Integer, CveAlmacen As Integer, CveSubProyecto As Integer, CveMoneda As Integer, UsuarioActual As Usuario, Observaciones As String, ListaPS As List(Of MVentaProductos)) As Modelos.Factura
If CveSubProyecto <= 0 Then
@@ -923,7 +923,7 @@ Public Class WSApp
End If
End If
Dim ObjFactura = New Modelos.Factura(UsuarioActual)
- ObjFactura.DirectorioServidor = Server.MapPath("/")
+ ObjFactura.DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
Dim ObjFolios As New ClsGralFolios()
If ObjFolios.GetFolios("Rem", UsuarioActual.CveEmpresa) Then
@@ -1062,12 +1062,12 @@ Public Class WSApp
ObjFactura.Total = Total
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
- ObjFactura.CveContratoSecciones = ""
-
- 'BORRAR
- ObjFactura.DtRecepcionUsados = New DataTable
- ObjFactura.DtRecepcionUsados.Columns.Add("CvePS", GetType(Integer))
-
+ ObjFactura.CveContratoSecciones = ""
+
+ 'BORRAR
+ ObjFactura.DtRecepcionUsados = New DataTable
+ ObjFactura.DtRecepcionUsados.Columns.Add("CvePS", GetType(Integer))
+
Catch ex As Exception
Retorno.Mensajes.Add(ex.ToString())
Return Nothing
@@ -1159,8 +1159,8 @@ Public Class WSApp
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
- TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
-
+ TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
+
TmpDT.Columns.Add("CveTamaño", GetType(Double))
Try
@@ -1430,9 +1430,9 @@ Public Class WSApp
End Try
ObjVentas.Dispose()
Return strBody.ToString
- End Function
+ End Function
#End Region
-
+
End Class
Namespace WebServiceAppModels2
diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx
index c834e2cd5..fe22ec1bd 100644
--- a/asmx/WSGPSApp.asmx
+++ b/asmx/WSGPSApp.asmx
@@ -1,4 +1,4 @@
-<%@ WebService Language="VB" Class="WSGPSApp" %>
+<%@ WebService Language="VB" Class="WSGPSApp" %>
Option Strict On
Imports System.Web
@@ -31,8 +31,8 @@ Public Class WSGPSApp
Inherits System.Web.Services.WebService
Private Const LongValue As Long = &H100000000
- Public Property Credentials As AuthHeader
-
+ Public Property Credentials As AuthHeader
+
#Region "G L O B A L S"
Property GlobalDTDispositivos(CveCliente As Integer) As DataTable
Get
@@ -90,7 +90,7 @@ Public Class WSGPSApp
Set(value As DataTable)
Application("GlobalDTDispositivosUsuarios") = value
End Set
- End Property
+ End Property
#End Region
@@ -528,7 +528,7 @@ Public Class WSGPSApp
End If
If CveEmpresa > 0 Then
Dim Archivo As String = String.Format("{0}{1}", CveImagenDispositivo, FileExtension)
- Dim Directorio As String = String.Format("{0}\Empresas\{1}\Dispositivos\{2}\Imagenes\", AppDomain.CurrentDomain.BaseDirectory, CveEmpresa, item.CveDispositivo)
+ Dim Directorio As String = String.Format("{0}\Empresas\{1}\Dispositivos\{2}\Imagenes\", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, item.CveDispositivo)
If Not Directory.Exists(Directorio) Then
Directory.CreateDirectory(Directorio)
End If
@@ -936,28 +936,28 @@ Public Class WSGPSApp
Return Retorno
- End Function
-
+ End Function
+
Public Function GetArrastre(CveDispositivo As Integer) As String
- Dim Retorno As String = "[]"
- Using ObjGPS As New ClsGPS
- If ObjGPS.GPS_ArrastreGET(CveDispositivo) Then
- Retorno = ObjGPS.DtResultados.DataTableToJSONIPP()
- End If
+ Dim Retorno As String = "[]"
+ Using ObjGPS As New ClsGPS
+ If ObjGPS.GPS_ArrastreGET(CveDispositivo) Then
+ Retorno = ObjGPS.DtResultados.DataTableToJSONIPP()
+ End If
End Using
Return Retorno
- End Function
+ End Function
Public Function ActivarDesactivarArrastre(CveDispositivo As Integer, Activo As Boolean) As Boolean
- Dim Retorno As Boolean = False
- Using ObjGPS As New ClsGPS
- Retorno = ObjGPS.GPS_ArrastreActivarDesactivar(CveDispositivo, Activo)
+ Dim Retorno As Boolean = False
+ Using ObjGPS As New ClsGPS
+ Retorno = ObjGPS.GPS_ArrastreActivarDesactivar(CveDispositivo, Activo)
End Using
Return Retorno
- End Function
-
+ End Function
+
Public Function GetTrayectos(CveCliente As Integer) As String
Dim Retorno As String = "[]"
@@ -965,8 +965,8 @@ Public Class WSGPSApp
Return Retorno
- End Function
-
+ End Function
+
Public Function GetEstatusTrayectos(CveCliente As Integer) As String
Dim Retorno As String = "[]"
@@ -974,7 +974,7 @@ Public Class WSGPSApp
Return Retorno
- End Function
+ End Function
Public Function GetEstatusTrayectosHistorial(CveCliente As Integer) As String
Dim Retorno As String = "[]"
@@ -982,7 +982,7 @@ Public Class WSGPSApp
Return Retorno
- End Function
+ End Function
Public Function GetTrayectosEstatusHistorial(CveTrayecto As Integer) As String
Dim Retorno As String = "[]"
@@ -990,8 +990,8 @@ Public Class WSGPSApp
Return Retorno
- End Function
-
+ End Function
+
#Region "F U N C I O N E S"
Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
Dim ObjEmpresa As New ClsSisEmpresas()
@@ -1107,7 +1107,7 @@ Public Class WSGPSApp
OnError("Acceso no autorizado", New SoapException("Unauthorized", SoapException.ClientFaultCode))
Return False
End If
- End Function
+ End Function
#End Region
End Class
Namespace ADGPSModels
diff --git a/asmx/WSSIGApp.asmx b/asmx/WSSIGApp.asmx
index b675f7c84..71c1f2945 100644
--- a/asmx/WSSIGApp.asmx
+++ b/asmx/WSSIGApp.asmx
@@ -1366,7 +1366,7 @@ Public Class WSSIGApp
If ObjEventoBitacora.AddEventoBitacora(Ent.Descripcion, FileExtension, Ent.CveUsuario, Ent.CveEmpresa, CveOC:=Ent.CveOC, Prioridad:=Ent.Prioridad.ToEntero()) Then
If Ent.Imagen1 <> "" Then
Try
- Dim FileURL As String = String.Format("{0}Empresas\{1}\OI\", AppDomain.CurrentDomain.BaseDirectory, Ent.CveEmpresa)
+ Dim FileURL As String = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, Ent.CveEmpresa)
If Not IO.Directory.Exists(FileURL) Then
IO.Directory.CreateDirectory(FileURL)
End If
@@ -1824,7 +1824,7 @@ Public Class WSSIGApp
End If
End If
Dim ObjFactura = New Modelos.Factura(UsuarioActual)
- ObjFactura.DirectorioServidor = Server.MapPath("/")
+ ObjFactura.DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
Dim ObjFolios As New ClsGralFolios()
If ObjFolios.GetFolios(TipoDocto, UsuarioActual.CveEmpresa) Then
@@ -2600,7 +2600,7 @@ Public Class WSSIGApp
If ObjOI.AddEventoBitacora(Bit.Descripcion, FileExtension, Ent.CveUsuario, Ent.CveEmpresa, CveOC:=ObjOC.CveOrdenCompra, Prioridad:=Bit.CvePrioridad) Then
If Bit.Imagen1 <> "" Then
Try
- Dim FileURL As String = String.Format("{0}Empresas\{1}\OI\", AppDomain.CurrentDomain.BaseDirectory, Ent.CveEmpresa)
+ Dim FileURL As String = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, Ent.CveEmpresa)
If Not IO.Directory.Exists(FileURL) Then
IO.Directory.CreateDirectory(FileURL)
End If
@@ -3707,7 +3707,7 @@ Public Class WSSIGApp
Exit For
Else
If Not String.IsNullOrEmpty(FileExtension) Then
- Dim Directorio As String = String.Format("{0}\Empresas\{1}\OI\OI{2}{3}", AppDomain.CurrentDomain.BaseDirectory, item.CveEmpresa, ObjBitacora.CveEvento.ToString(), FileExtension)
+ Dim Directorio As String = String.Format("{0}\Empresas\{1}\OI\OI{2}{3}", ModExtensiones.DirectorioBaseEmpresas, item.CveEmpresa, ObjBitacora.CveEvento.ToString(), FileExtension)
File.WriteAllBytes(Directorio, Convert.FromBase64String(item.Base64Archivo))
End If
End If
@@ -3738,7 +3738,7 @@ Public Class WSSIGApp
If Not TieneError Then
If Not String.IsNullOrEmpty(FileExtension) Then
- Dim Directorio As String = String.Format("{0}\Empresas\{1}\OI\OI{2}{3}", AppDomain.CurrentDomain.BaseDirectory, item.CveEmpresa, ObjBitacora.CveEvento.ToString(), FileExtension)
+ Dim Directorio As String = String.Format("{0}\Empresas\{1}\OI\OI{2}{3}", ModExtensiones.DirectorioBaseEmpresas, item.CveEmpresa, ObjBitacora.CveEvento.ToString(), FileExtension)
File.WriteAllBytes(Directorio, Convert.FromBase64String(item.Base64Archivo))
End If
End If
@@ -3768,7 +3768,7 @@ Public Class WSSIGApp
If CveArchivo > 0 Then
If Not String.IsNullOrEmpty(FileExtension) Then
Dim Archivo As String = String.Format("{0}{1}", CveArchivo, FileExtension)
- Dim Directorio As String = String.Format("{0}\Empresas\{1}\Acercamientos\{2}\Imagenes\", AppDomain.CurrentDomain.BaseDirectory, item.CveEmpresa, item.CveAcercamiento)
+ Dim Directorio As String = String.Format("{0}\Empresas\{1}\Acercamientos\{2}\Imagenes\", ModExtensiones.DirectorioBaseEmpresas, item.CveEmpresa, item.CveAcercamiento)
If Not Directory.Exists(Directorio) Then
Directory.CreateDirectory(Directorio)
End If
@@ -4177,8 +4177,8 @@ Public Class WSSIGApp
'
'
'
- Dim idgrupo2 = -1
- Dim FechaI = FechaInicio.ToString("yyyy/MM/dd")
+ Dim idgrupo2 = -1
+ Dim FechaI = FechaInicio.ToString("yyyy/MM/dd")
Dim FechaF = FechaFin.ToString("yyyy/MM/dd")
Select Case AgrupadoPor
@@ -4224,12 +4224,12 @@ Public Class WSSIGApp
Public Function GetRepAcercamientosRechazos(CveEmpresa As Integer, CveVendedor As Integer, FechaInicio As DateTime, FechaFin As DateTime) As String
Dim Retorno = "[]"
- Dim cveTipoProceso = -1
- Dim idgrupo1 = 1
- Dim idgrupo2 = -1
- Dim FechaI = FechaInicio.ToString("yyyy/MM/dd")
- Dim FechaF = FechaFin.ToString("yyyy/MM/dd")
- Dim cveMedioCaptacion = -1
+ Dim cveTipoProceso = -1
+ Dim idgrupo1 = 1
+ Dim idgrupo2 = -1
+ Dim FechaI = FechaInicio.ToString("yyyy/MM/dd")
+ Dim FechaF = FechaFin.ToString("yyyy/MM/dd")
+ Dim cveMedioCaptacion = -1
Dim cveProbabilidadAcercamiento = -1
Using ObjCRM As New ClsCRM
If ObjCRM.RepAcercamientosEtapas(CveEmpresa, cveTipoProceso, idgrupo1, idgrupo2, FechaI, FechaF, CveVendedor, cveMedioCaptacion, cveProbabilidadAcercamiento) Then
diff --git a/asmx/WsTSoft.asmx b/asmx/WsTSoft.asmx
index 626fdbb83..5c10a6d20 100644
--- a/asmx/WsTSoft.asmx
+++ b/asmx/WsTSoft.asmx
@@ -71,10 +71,12 @@ Public Class WsTSoft
ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
Next
End If
+ If ObjGPS.DtResultados IsNot Nothing AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
+ ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString
+ ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString
+ ObjPos.Direccion = ObjGPS.DtResultados.Rows("0")("Direccion").ToString
+ End If
- ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString
- ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString
- ObjPos.Direccion = ObjGPS.DtResultados.Rows("0")("Direccion").ToString
Catch ex As Exception
ObjPos.CurrentError = "No se pudo obtener la posición."
OnError("Ocurrió un error al asignar las direcciones", ex)
diff --git a/vwd.webinfo b/vwd.webinfo
index c6b051639..583fb591e 100644
--- a/vwd.webinfo
+++ b/vwd.webinfo
@@ -54,6 +54,8 @@
+
+
|