diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 4f6329ac5..0fd71e90d 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -4602,7 +4602,7 @@ Public Class ClsInventarios
Return Retorno
End Function
- Public Function GetFletes(CveEmpresa As Integer, Optional CveFlete As Integer = -1, Optional Folio As String = "-1", Optional CveProveedor As Integer = -1, Optional CveOC As Integer = -1, Optional CveCompra As Integer = -1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha) As Boolean
+ Public Function GetFletes(CveEmpresa As Integer, Optional CveFlete As Integer = -1, Optional Folio As String = "-1", Optional CveProveedor As Integer = -1, Optional CveOC As Integer = -1, Optional CveCompra As Integer = -1, Optional FechaInicio As Date = MinFecha, Optional FechaFin As Date = MaxFecha, Optional OpcionInventario As Integer = 0) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_FletesGet")
With SqlAdapter.SelectCommand.Parameters
@@ -4614,6 +4614,7 @@ Public Class ClsInventarios
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
+ .Add("@OpcionInventario", SqlDbType.Int).Value = OpcionInventario
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index 1a939af3d..8afea1057 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -1,2208 +1,2215 @@
-Option Explicit On
-Option Strict On
-
-Imports System.Data
-Imports System.Data.SqlClient
-Imports Extensiones
-Imports System
-Imports System.Configuration
-Imports Modelos
-
-Public Class ClsProductosServicios
- Implements IDisposable
-
-#Region "Campos"
- Private SqlConexion As SqlConnection
- Private SqlAdapter As SqlDataAdapter
- Private SqlCommand As SqlCommand
- Private SqlTransacc As SqlTransaction
- Private Data As DataTable
- Private disposedValue As Boolean = False
- 'PARA REGISTRAR CONEXION
- Private CveConexion As Integer = 0
- Private EsTransaccionCompartida As Boolean = False
-#End Region
-
-#Region "Propiedades"
-
- Public Property CvePS As Integer
- Public Property CveClasificacion As Integer
- Public Property Clasificacion As String
- Public Property CveUnidadMedida As Integer
- Public Property CveSATPS As Integer
- Public Property SATClavePS As String
- Public Property SATDescripcion As String
- Public Property Codigo As String
- Public Property Codigo2 As String
- Public Property CodigoBarras As String
- Public Property PS As String
- Public Property Precio As Double
- Public Property PrecioMinimo As Double
- Public Property Oferta As Double
- Public Property IVA As Double
- Public Property RetIVA As Double
- Public Property MargenGanancia As Double
- Public Property IdCtaContVentas As Integer
- Public Property IdCtaContCompras As Integer
- Public Property IdCtaContInventarios As Integer
- Public Property AsientoContableVentas As Integer
- Public Property AsientoContableCompras As Integer
- Public Property AplicaParaConcepto As Boolean
- Public Property AplicaParaVenta As Boolean
- Public Property Estado As Boolean
- Public Property Fecha As Date
- Public Property Usuario As String
- Public Property CveEmpresa As Integer
- Public Property CveMetodoInventario As Integer
- Public Property CveTipoPS As Integer
- Public Property Estado2 As Integer
- Public Property CveMarca As Integer
-
- Public Property IEPSPorcentaje As Double
-
- Public Property AplicaIEPS As Boolean
- Public Property IEPSGrabaIVA As Boolean
-
- Public Property AplicaSerie As Boolean
- Public Property AplicaLote As Boolean
- Public Property AplicaCaducidad As Boolean
- Public Property AplicaSeccion As Boolean
-
- Public Property CveConceptoContable As Integer
-
- 'Nuevo R: 26/09/2017'
- Public Property Inventariable As Boolean
- Public Property CveProveedorCompra As Integer
- Public Property ProveedorCompra As String
- Public Property VentaMinima As Decimal
- Public Property CveMoneda As Integer
- Public Property RetISR As Double
-
-
- 'Nuevo Rjb: 12/01/2018'
- Public Property CveTipoFactor As Integer
-
- 'Nuevo Raul: 08/03/2018
- Public Property CveFraccionArancelaria As Integer
- Public Property CveUnidadAduana As Integer
- Public Property ClaveSATFraccionArancelariaDescripcion As String
- Public Property ClaveSATUnidadAduanaDescripcion As String
- Public Property ClaveSATFraccionArancelaria As String
- Public Property ClaveSATUnidadAduana As String
-
- 'Nuevo Raul: 10/08/2018
- Public Property CveUsuarioModifico As Integer
- Public Property UsuarioModifico As String
- Public Property FechaUltimaModificacion As Date
-
- 'Nuevo Raul: 11/09/2018
- Public Property CveClasificacionDetalle As Integer
- Public Property ClaveImpuestoTipoProducto As String
- Public Property ClaveImpuestoEmpaque As String
- Public Property ClaveImpuestoUnidadMedida As String
- Public Property ClaveCategoriaToxicidad As String
-
- Public Property EsOutSourcing As Boolean
-
- Public ReadOnly Property DtResultados() As DataTable
- Get
- DtResultados = Data
- End Get
- End Property
-#End Region
-
-
- Sub New()
- SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
- SqlAdapter = New SqlDataAdapter("", SqlConexion)
- Try
- SqlConexion.Open()
- Catch ex As Exception
- OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
- End Try
- ConexionAdd()
- End Sub
-
-
- Public Function IniciaTransacSQL() As SqlTransaction
- If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
-
- Return SqlTransacc
- End Function
- Public Sub RollBack()
- SqlTransacc.Rollback()
- End Sub
- Public Sub Commit()
- SqlTransacc.Commit()
- End Sub
-
- Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
-
- If TransaccionCompartida Is Nothing Then
- SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
- Try
- SqlConexion.Open()
- Catch ex As Exception
- OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
- End Try
- Else
- SqlConexion = TransaccionCompartida.Connection
- SqlTransacc = TransaccionCompartida
- EsTransaccionCompartida = True
- End If
-
- SqlAdapter = New SqlDataAdapter("", SqlConexion)
- ConexionAdd()
- End Sub
- Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
- With SqlAdapter.SelectCommand
- .Parameters.Clear()
- .CommandText = StrSQL
- .CommandType = TipoComando
- End With
- If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
- Data = New DataTable
- End Sub
-#Region "Conexiones"
-
- Private Sub ConexionAdd()
- If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
-
-
- Try
- 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
- DataAdapter("PA_Sis_RegistrarConexion")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
- .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
- .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
- End With
- SqlAdapter.Fill(Data)
- CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
- Catch ex As Exception
- OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- End If
- End Sub
-
- Private Sub ConexionClose()
- If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
-
- DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
-
- Try
- SqlAdapter.Fill(Data)
-
- Catch ex As Exception
- OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
- CveConexion = 0
- End If
-
- End Sub
-#End Region
- Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1",
- Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1,
- Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1,
- Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1", Optional TopSelect As Integer = 10000) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_ProductosServiciosGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
- .Add("@Codigo2", SqlDbType.VarChar).Value = Codigo2
- .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras
- .Add("@PS", SqlDbType.VarChar).Value = PS
- .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
- .Add("@EsPaquete", SqlDbType.SmallInt).Value = EsPaquete
- .Add("@AplicaParaVenta", SqlDbType.Int).Value = pAplicaParaVenta
- .Add("@Estado", SqlDbType.Int).Value = pEstado
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
- .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
- .Add("@SATClavePS", SqlDbType.VarChar).Value = SATClavePS
- .Add("@TopSelect", SqlDbType.Int).Value = TopSelect
- End With
-
- Try
- SqlAdapter.Fill(Data)
- If Data.Rows.Count > 0 Then
- Me.CvePS = Data.Rows(0)("CvePS").ToString().ToEntero
- Me.CveClasificacion = Data.Rows(0)("CveClasificacion").ToString.ToEntero
- Me.Clasificacion = Data.Rows(0)("Clasificacion").ToString
- CveUnidadMedida = Data.Rows(0)("CveUnidadMedida").ToString.ToEntero
- CveSATPS = Data.Rows(0)("CveSATPS").ToString.ToEntero
- Me.SATClavePS = Data.Rows(0)("SATClavePS").ToString
- 'SATDescripcion = Data.Rows(0)("SATDescripcion").ToString
- Me.CveTipoPS = Data.Rows(0)("CveTipoPS").ToString.ToEntero
- Me.Codigo = Data.Rows(0)("Codigo").ToString
- Me.Codigo2 = Data.Rows(0)("Codigo2").ToString
- Me.CodigoBarras = Data.Rows(0)("CodigoBarras").ToString
- Me.PS = Data.Rows(0)("PS").ToString
- Precio = Data.Rows(0)("Precio").ToString.ToDouble
- PrecioMinimo = Data.Rows(0)("PrecioMinimo").ToString.ToDouble
- Oferta = Data.Rows(0)("Oferta").ToString.ToDouble
- IVA = Data.Rows(0)("IVA").ToString.ToDouble
- RetIVA = Data.Rows(0)("RetIVA").ToString.ToDouble
- CveMarca = Data.Rows(0)("CveMarca").ToString.ToEntero
- AplicaParaConcepto = CBool(Data.Rows(0)("AplicaParaConcepto").ToString)
- AplicaParaVenta = Data.Rows(0)("AplicaParaVenta").ToString = "True"
- Estado = Data.Rows(0)("Estado").ToString = "Activo"
- Estado2 = Data.Rows(0)("Estado2").ToString.ToEntero
- Fecha = Data.Rows(0)("Fecha").ToString.ToDate
- Usuario = Data.Rows(0)("Usuario").ToString
-
- 'AlmacenSeccion = Data.Rows(0)("AlmacenSeccion").ToString
- AplicaIEPS = (Data.Rows(0)("AplicaIEPS").ToString) = "True"
- IEPSGrabaIVA = (Data.Rows(0)("IEPSGrabaIVA").ToString) = "True"
- IEPSPorcentaje = Data.Rows(0)("IEPSPorcentaje").ToString.ToDouble
- CveConceptoContable = Data.Rows(0)("CveConceptoContable").ToString.ToEntero
-
- AplicaSerie = (Data.Rows(0)("AplicaSerie").ToString) = "True"
- AplicaLote = (Data.Rows(0)("AplicaLote").ToString) = "True"
- AplicaCaducidad = (Data.Rows(0)("AplicaCaducidad").ToString) = "True"
- AplicaSeccion = (Data.Rows(0)("AplicaSeccion").ToString) = "True"
-
- 'Nuevo R: 26/09/2017'
-
- Inventariable = Data.Rows(0)("Inventariable").ToString = "True"
- CveProveedorCompra = Data.Rows(0)("CveProveedorCompra").ToString.ToEntero
- ProveedorCompra = Data.Rows(0)("ProveedorCompra").ToString
-
- 'Nuevo R: 12/01/2018'
- CveTipoFactor = Data.Rows(0)("CveTipoFactor").ToString.ToEntero
-
- Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
- CveMetodoInventario = Data.Rows(0)("Inv_CveMetodoInventario").ToString.ToEntero
- VentaMinima = Data.Rows(0)("VentaMinima").ToString.ToDecimal
- CveMoneda = Data.Rows(0)("CveMoneda").ToString.ToEntero
- RetISR = Data.Rows(0)("RetISR").ToString.ToDouble
-
- 'Nuevo Raul: 08/03/2018
- CveFraccionArancelaria = Data.Rows(0)("CveFraccionArancelaria").ToString.ToEntero
- CveUnidadAduana = Data.Rows(0)("CveUnidadAduana").ToString.ToEntero
- ClaveSATFraccionArancelaria = Data.Rows(0)("ClaveSATFraccionArancelaria").ToString
- ClaveSATUnidadAduana = Data.Rows(0)("ClaveSATUnidadAduana").ToString
- ClaveSATFraccionArancelariaDescripcion = Data.Rows(0)("ClaveSATFraccionArancelariaDescripcion").ToString
- ClaveSATUnidadAduanaDescripcion = Data.Rows(0)("ClaveSATUnidadAduanaDescripcion").ToString
-
- 'Nuevo Raul: 10/08/2018
- CveUsuarioModifico = Data.Rows(0)("CveUsuarioModifico").ToString.ToEntero
- UsuarioModifico = Data.Rows(0)("UsuarioModifico").ToString
- FechaUltimaModificacion = Data.Rows(0)("FechaUltimaModificacion").ToString.ToDate
-
- 'Nuevo Raul: 11/09/2018
- CveClasificacionDetalle = Data.Rows(0)("CveClasificacionDetalle").ToString.ToEntero
-
- ClaveImpuestoTipoProducto = Data.Rows(0)("ClaveImpuestoTipoProducto").ToString
- ClaveImpuestoEmpaque = Data.Rows(0)("ClaveImpuestoEmpaque").ToString
- ClaveImpuestoUnidadMedida = Data.Rows(0)("ClaveImpuestoUM").ToString
- ClaveCategoriaToxicidad = Data.Rows(0)("ClaveCategoriaToxicidad").ToString
- EsOutSourcing = Data.Rows(0)("EsOutSourcing").ToString = "True"
- End If
- Retorno = True
- Catch ex As SqlException
- If CvePS <> -1 Then
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
- End Try
-
- Return Retorno
- End Function
- Public Function GetPSSimplificado(CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_ProductosServiciosSimplificadoGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
-
- Retorno = True
- Catch ex As SqlException
- If CvePS <> -1 Then
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
- End Try
-
- Return Retorno
- End Function
- Public Function GetPSLite(CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveTipoPS As Integer = -1, Optional UsoClasificacion As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- ' @CveClasificacion int, @Codigo varchar(50) = '-1', @PS varchar(300) = '-1', @AplicaParaVenta int = -1, @Estado int = -1, @CodigoBarras varchar(50) = '-1', @CveTipoPS int = -1, @CveEmpresa int
- DataAdapter("PA_ProductosServiciosLiteGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
- .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras
- .Add("@PS", SqlDbType.VarChar).Value = PS
- .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
- .Add("@AplicaParaVenta", SqlDbType.Int).Value = pAplicaParaVenta
- .Add("@Estado", SqlDbType.Int).Value = pEstado
- .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@UsoClasificacion", SqlDbType.Int).Value = UsoClasificacion
- End With
-
- Try
- SqlAdapter.Fill(Data)
-
- Retorno = True
- Catch ex As SqlException
- If CvePS <> -1 Then
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
- End Try
-
- Return Retorno
- End Function
- Public Function GetPSClasificados(CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_ProductosServiciosClasificadosGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
-
- End With
- Try
- SqlAdapter.Fill(Data)
-
- Retorno = True
- Catch ex As SqlException
- If CvePS <> -1 Then
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
- End Try
- Return Retorno
- End Function
- Public Function AddPS(CveClasificacion As Integer, CveClasificacionCosto As Integer, CveUnidadMedida As Integer, Codigo As String, Codigo2 As String, CodigoBarras As String, PS As String, Precio As Double, IVA As Double, RetIVA As Double, Inventariable As Boolean, CveProveedorCompra As Integer,
- AplicaParaConcepto As Boolean, AplicaParaVenta As Boolean, CveUsuario As Integer, CveEmpresa As Integer, CveMetodoInventario As Integer, EsPaquete As Integer,
- Optional CveTipoPS As Integer = -1, Optional FuePorXML As Boolean = True, Optional TipoServicio As Integer = -1, Optional CveClasificacion2 As Integer = -1,
- Optional CveMarca As Integer = -1, Optional AlmacenSeccion As String = "", Optional AplicaIEPS As Boolean = False, Optional IEPSPorcentaje As Decimal = -1,
- Optional CveConceptoContable As Integer = -1, Optional CveCompuesto As Integer = -1, Optional CveSATPS As Integer = -1, Optional IEPSGrabaIVA As Boolean = False, Optional VentaMinima As Decimal = 0,
- Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
- Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1,
- Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
- Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False,
- Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1) As Integer
- Dim Retorno As Integer = -1
-
- DataAdapter("PA_ProductosServiciosAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
- .Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
- .Add("@Codigo2", SqlDbType.VarChar).Value = If(Codigo2 = "", "-1", Codigo2)
- .Add("@CodigoBarras", SqlDbType.VarChar).Value = If(CodigoBarras = "", "-1", CodigoBarras)
- .Add("@PS", SqlDbType.VarChar).Value = If(PS.Length > 845, PS.Substring(0, 845), PS)
- .Add("@Precio", SqlDbType.Float).Value = Precio
- .Add("@IVA", SqlDbType.Float).Value = IVA
- .Add("@RetIVA", SqlDbType.Float).Value = RetIVA
- .Add("@AplicaParaConcepto", SqlDbType.Bit).Value = AplicaParaConcepto
- .Add("@AplicaParaVenta", SqlDbType.Bit).Value = AplicaParaVenta
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@EsPaquete", SqlDbType.Bit).Value = EsPaquete
- .Add("@CveMetodoInventario", SqlDbType.Int).Value = CveMetodoInventario
- .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
- .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
- .Add("@FuePorXML", SqlDbType.Bit).Value = If(FuePorXML, 1, 0)
- .Add("@TipoServicio", SqlDbType.Int).Value = TipoServicio
- .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2
- .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
- .Add("@AlmacenSeccion", SqlDbType.VarChar).Value = AlmacenSeccion
- .Add("@AplicaIEPS", SqlDbType.Bit).Value = AplicaIEPS
- .Add("@IEPSGrabaIVA", SqlDbType.Bit).Value = IEPSGrabaIVA
- .Add("@IEPSPorcentaje", SqlDbType.SmallMoney).Value = IEPSPorcentaje
- .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
- .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
- .Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
-
- 'Nuevo R: 26/09/2017'
- .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable
- .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra
- .Add("@VentaMinima", SqlDbType.Decimal).Value = VentaMinima
-
- 'Nuevo R: 08/11/2017'
- .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
-
- 'Nuevo R: 30/11/2017
- .Add("@RetISR", SqlDbType.Float).Value = RetISR
-
-
- 'Nuevo Oscar 29/12/2017
- .Add("@PrecioMinimo", SqlDbType.Money).Value = PrecioMinimo
-
- 'Nuevo Rigo 12/01/2018
- .Add("@CveTipoFactor", SqlDbType.Int).Value = CveTipoFactor
-
- 'Nuevo Raul 08/03/2018
- .Add("@CveFraccionArancelaria", SqlDbType.Int).Value = CveFraccionArancelaria
-
- 'Nuevo Raul 11/09/2018
- .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle
-
- 'Nuevo Oscar 31/10/2018
- .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
-
- 'Nuevo Happy 25/04/2019
- .Add("@CveModelo", SqlDbType.Int).Value = CveModelo
- .Add("@CveMedida", SqlDbType.Int).Value = CveMedida
- .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
-
- .Add("@ClaveImpuestoTipoProducto", SqlDbType.VarChar).Value = ClaveImpuestoTipoProducto
- .Add("@ClaveImpuestoEmpaque", SqlDbType.VarChar).Value = ClaveImpuestoEmpaque
- .Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
- .Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
- .Add("@Litraje", SqlDbType.Float).Value = Litraje
- .Add("@EsOutSourcing", SqlDbType.Bit).Value = EsOutSourcing
-
- .Add("@AplicaSerie", SqlDbType.Bit).Value = AplicaSerie
- .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote
- .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad
- .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion
+Option Explicit On
+Option Strict On
+
+Imports System.Data
+Imports System.Data.SqlClient
+Imports Extensiones
+Imports System
+Imports System.Configuration
+Imports Modelos
+
+Public Class ClsProductosServicios
+ Implements IDisposable
+
+#Region "Campos"
+ Private SqlConexion As SqlConnection
+ Private SqlAdapter As SqlDataAdapter
+ Private SqlCommand As SqlCommand
+ Private SqlTransacc As SqlTransaction
+ Private Data As DataTable
+ Private disposedValue As Boolean = False
+ 'PARA REGISTRAR CONEXION
+ Private CveConexion As Integer = 0
+ Private EsTransaccionCompartida As Boolean = False
+#End Region
+
+#Region "Propiedades"
+
+ Public Property CvePS As Integer
+ Public Property CveClasificacion As Integer
+ Public Property Clasificacion As String
+ Public Property CveUnidadMedida As Integer
+ Public Property CveSATPS As Integer
+ Public Property SATClavePS As String
+ Public Property SATDescripcion As String
+ Public Property Codigo As String
+ Public Property Codigo2 As String
+ Public Property CodigoBarras As String
+ Public Property PS As String
+ Public Property Precio As Double
+ Public Property PrecioMinimo As Double
+ Public Property Oferta As Double
+ Public Property IVA As Double
+ Public Property RetIVA As Double
+ Public Property MargenGanancia As Double
+ Public Property IdCtaContVentas As Integer
+ Public Property IdCtaContCompras As Integer
+ Public Property IdCtaContInventarios As Integer
+ Public Property AsientoContableVentas As Integer
+ Public Property AsientoContableCompras As Integer
+ Public Property AplicaParaConcepto As Boolean
+ Public Property AplicaParaVenta As Boolean
+ Public Property Estado As Boolean
+ Public Property Fecha As Date
+ Public Property Usuario As String
+ Public Property CveEmpresa As Integer
+ Public Property CveMetodoInventario As Integer
+ Public Property CveTipoPS As Integer
+ Public Property Estado2 As Integer
+ Public Property CveMarca As Integer
+
+ Public Property IEPSPorcentaje As Double
+
+ Public Property AplicaIEPS As Boolean
+ Public Property IEPSGrabaIVA As Boolean
+
+ Public Property AplicaSerie As Boolean
+ Public Property AplicaLote As Boolean
+ Public Property AplicaCaducidad As Boolean
+ Public Property AplicaSeccion As Boolean
+
+ Public Property CveConceptoContable As Integer
+
+ 'Nuevo R: 26/09/2017'
+ Public Property Inventariable As Boolean
+ Public Property CveProveedorCompra As Integer
+ Public Property ProveedorCompra As String
+ Public Property VentaMinima As Decimal
+ Public Property CveMoneda As Integer
+ Public Property RetISR As Double
+
+
+ 'Nuevo Rjb: 12/01/2018'
+ Public Property CveTipoFactor As Integer
+
+ 'Nuevo Raul: 08/03/2018
+ Public Property CveFraccionArancelaria As Integer
+ Public Property CveUnidadAduana As Integer
+ Public Property ClaveSATFraccionArancelariaDescripcion As String
+ Public Property ClaveSATUnidadAduanaDescripcion As String
+ Public Property ClaveSATFraccionArancelaria As String
+ Public Property ClaveSATUnidadAduana As String
+
+ 'Nuevo Raul: 10/08/2018
+ Public Property CveUsuarioModifico As Integer
+ Public Property UsuarioModifico As String
+ Public Property FechaUltimaModificacion As Date
+
+ 'Nuevo Raul: 11/09/2018
+ Public Property CveClasificacionDetalle As Integer
+ Public Property ClaveImpuestoTipoProducto As String
+ Public Property ClaveImpuestoEmpaque As String
+ Public Property ClaveImpuestoUnidadMedida As String
+ Public Property ClaveCategoriaToxicidad As String
+
+ Public Property EsOutSourcing As Boolean
+ Public Property PrecioLibre As Boolean
+
+ Public ReadOnly Property DtResultados() As DataTable
+ Get
+ DtResultados = Data
+ End Get
+ End Property
+#End Region
+
+
+ Sub New()
+ SqlConexion = New SqlConnection
+ SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
+ SqlAdapter = New SqlDataAdapter("", SqlConexion)
+ Try
+ SqlConexion.Open()
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
+ End Try
+ ConexionAdd()
+ End Sub
+
+
+ Public Function IniciaTransacSQL() As SqlTransaction
+ If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
+
+ Return SqlTransacc
+ End Function
+ Public Sub RollBack()
+ SqlTransacc.Rollback()
+ End Sub
+ Public Sub Commit()
+ SqlTransacc.Commit()
+ End Sub
+
+ Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing)
+
+ If TransaccionCompartida Is Nothing Then
+ SqlConexion = New SqlConnection
+ SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString
+ Try
+ SqlConexion.Open()
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex)
+ End Try
+ Else
+ SqlConexion = TransaccionCompartida.Connection
+ SqlTransacc = TransaccionCompartida
+ EsTransaccionCompartida = True
+ End If
+
+ SqlAdapter = New SqlDataAdapter("", SqlConexion)
+ ConexionAdd()
+ End Sub
+ Private Sub DataAdapter(StrSQL As String, Optional TipoComando As CommandType = CommandType.StoredProcedure)
+ With SqlAdapter.SelectCommand
+ .Parameters.Clear()
+ .CommandText = StrSQL
+ .CommandType = TipoComando
+ End With
+ If Not SqlTransacc Is Nothing Then SqlAdapter.SelectCommand.Transaction = SqlTransacc
+ Data = New DataTable
+ End Sub
+#Region "Conexiones"
+
+ Private Sub ConexionAdd()
+ If Not EsTransaccionCompartida AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
+
+
+ Try
+ 'DataAdapter(String.Format("INSERT INTO Sis_Conexiones (Clase,Modulo) VALUES ('ClsRH','{0}')", "RH/CatMotivosBaja"), CommandType.Text) ' pendiente de terminar parra registrar el cveconexion, falta el rarámetro de módulo
+ DataAdapter("PA_Sis_RegistrarConexion")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Clase", SqlDbType.VarChar).Value = Me.GetType().Name
+ .Add("@Modulo", SqlDbType.VarChar).Value = String.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString, HttpContext.Current.Request.QueryString.ToString)
+ .Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output
+ End With
+ SqlAdapter.Fill(Data)
+ CveConexion = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero
+ Catch ex As Exception
+ OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ End If
+ End Sub
+
+ Private Sub ConexionClose()
+ If CveConexion > 0 AndAlso ConfigurationManager.AppSettings("RegistraConexion") IsNot Nothing AndAlso ConfigurationManager.AppSettings("RegistraConexion").ToString() = "1" Then
+
+ DataAdapter(String.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text)
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Catch ex As Exception
+ OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ CveConexion = 0
+ End If
+
+ End Sub
+#End Region
+ Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1",
+ Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1,
+ Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1,
+ Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1", Optional TopSelect As Integer = 10000) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_ProductosServiciosGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@Codigo2", SqlDbType.VarChar).Value = Codigo2
+ .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras
+ .Add("@PS", SqlDbType.VarChar).Value = PS
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@EsPaquete", SqlDbType.SmallInt).Value = EsPaquete
+ .Add("@AplicaParaVenta", SqlDbType.Int).Value = pAplicaParaVenta
+ .Add("@Estado", SqlDbType.Int).Value = pEstado
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
+ .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
+ .Add("@SATClavePS", SqlDbType.VarChar).Value = SATClavePS
+ .Add("@TopSelect", SqlDbType.Int).Value = TopSelect
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ If Data.Rows.Count > 0 Then
+ Me.CvePS = Data.Rows(0)("CvePS").ToString().ToEntero
+ Me.CveClasificacion = Data.Rows(0)("CveClasificacion").ToString.ToEntero
+ Me.Clasificacion = Data.Rows(0)("Clasificacion").ToString
+ CveUnidadMedida = Data.Rows(0)("CveUnidadMedida").ToString.ToEntero
+ CveSATPS = Data.Rows(0)("CveSATPS").ToString.ToEntero
+ Me.SATClavePS = Data.Rows(0)("SATClavePS").ToString
+ 'SATDescripcion = Data.Rows(0)("SATDescripcion").ToString
+ Me.CveTipoPS = Data.Rows(0)("CveTipoPS").ToString.ToEntero
+ Me.Codigo = Data.Rows(0)("Codigo").ToString
+ Me.Codigo2 = Data.Rows(0)("Codigo2").ToString
+ Me.CodigoBarras = Data.Rows(0)("CodigoBarras").ToString
+ Me.PS = Data.Rows(0)("PS").ToString
+ Precio = Data.Rows(0)("Precio").ToString.ToDouble
+ PrecioMinimo = Data.Rows(0)("PrecioMinimo").ToString.ToDouble
+ Oferta = Data.Rows(0)("Oferta").ToString.ToDouble
+ IVA = Data.Rows(0)("IVA").ToString.ToDouble
+ RetIVA = Data.Rows(0)("RetIVA").ToString.ToDouble
+ CveMarca = Data.Rows(0)("CveMarca").ToString.ToEntero
+ AplicaParaConcepto = CBool(Data.Rows(0)("AplicaParaConcepto").ToString)
+ AplicaParaVenta = Data.Rows(0)("AplicaParaVenta").ToString = "True"
+ Estado = Data.Rows(0)("Estado").ToString = "Activo"
+ Estado2 = Data.Rows(0)("Estado2").ToString.ToEntero
+ Fecha = Data.Rows(0)("Fecha").ToString.ToDate
+ Usuario = Data.Rows(0)("Usuario").ToString
+
+ 'AlmacenSeccion = Data.Rows(0)("AlmacenSeccion").ToString
+ AplicaIEPS = (Data.Rows(0)("AplicaIEPS").ToString) = "True"
+ IEPSGrabaIVA = (Data.Rows(0)("IEPSGrabaIVA").ToString) = "True"
+ IEPSPorcentaje = Data.Rows(0)("IEPSPorcentaje").ToString.ToDouble
+ CveConceptoContable = Data.Rows(0)("CveConceptoContable").ToString.ToEntero
+
+ AplicaSerie = (Data.Rows(0)("AplicaSerie").ToString) = "True"
+ AplicaLote = (Data.Rows(0)("AplicaLote").ToString) = "True"
+ AplicaCaducidad = (Data.Rows(0)("AplicaCaducidad").ToString) = "True"
+ AplicaSeccion = (Data.Rows(0)("AplicaSeccion").ToString) = "True"
+
+ 'Nuevo R: 26/09/2017'
+
+ Inventariable = Data.Rows(0)("Inventariable").ToString = "True"
+ CveProveedorCompra = Data.Rows(0)("CveProveedorCompra").ToString.ToEntero
+ ProveedorCompra = Data.Rows(0)("ProveedorCompra").ToString
+
+ 'Nuevo R: 12/01/2018'
+ CveTipoFactor = Data.Rows(0)("CveTipoFactor").ToString.ToEntero
+
+ Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
+ CveMetodoInventario = Data.Rows(0)("Inv_CveMetodoInventario").ToString.ToEntero
+ VentaMinima = Data.Rows(0)("VentaMinima").ToString.ToDecimal
+ CveMoneda = Data.Rows(0)("CveMoneda").ToString.ToEntero
+ RetISR = Data.Rows(0)("RetISR").ToString.ToDouble
+
+ 'Nuevo Raul: 08/03/2018
+ CveFraccionArancelaria = Data.Rows(0)("CveFraccionArancelaria").ToString.ToEntero
+ CveUnidadAduana = Data.Rows(0)("CveUnidadAduana").ToString.ToEntero
+ ClaveSATFraccionArancelaria = Data.Rows(0)("ClaveSATFraccionArancelaria").ToString
+ ClaveSATUnidadAduana = Data.Rows(0)("ClaveSATUnidadAduana").ToString
+ ClaveSATFraccionArancelariaDescripcion = Data.Rows(0)("ClaveSATFraccionArancelariaDescripcion").ToString
+ ClaveSATUnidadAduanaDescripcion = Data.Rows(0)("ClaveSATUnidadAduanaDescripcion").ToString
+
+ 'Nuevo Raul: 10/08/2018
+ CveUsuarioModifico = Data.Rows(0)("CveUsuarioModifico").ToString.ToEntero
+ UsuarioModifico = Data.Rows(0)("UsuarioModifico").ToString
+ FechaUltimaModificacion = Data.Rows(0)("FechaUltimaModificacion").ToString.ToDate
+
+ 'Nuevo Raul: 11/09/2018
+ CveClasificacionDetalle = Data.Rows(0)("CveClasificacionDetalle").ToString.ToEntero
+
+ ClaveImpuestoTipoProducto = Data.Rows(0)("ClaveImpuestoTipoProducto").ToString
+ ClaveImpuestoEmpaque = Data.Rows(0)("ClaveImpuestoEmpaque").ToString
+ ClaveImpuestoUnidadMedida = Data.Rows(0)("ClaveImpuestoUM").ToString
+ ClaveCategoriaToxicidad = Data.Rows(0)("ClaveCategoriaToxicidad").ToString
+ EsOutSourcing = Data.Rows(0)("EsOutSourcing").ToString = "True"
+ PrecioLibre = Data.Rows(0)("PrecioLibre").ToString = "True"
+
+ End If
+ Retorno = True
+ Catch ex As SqlException
+ If CvePS <> -1 Then
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function GetPSSimplificado(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_ProductosServiciosSimplificadoGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As SqlException
+ If CvePS <> -1 Then
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function GetPSLite(CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveTipoPS As Integer = -1, Optional UsoClasificacion As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ ' @CveClasificacion int, @Codigo varchar(50) = '-1', @PS varchar(300) = '-1', @AplicaParaVenta int = -1, @Estado int = -1, @CodigoBarras varchar(50) = '-1', @CveTipoPS int = -1, @CveEmpresa int
+ DataAdapter("PA_ProductosServiciosLiteGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras
+ .Add("@PS", SqlDbType.VarChar).Value = PS
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@AplicaParaVenta", SqlDbType.Int).Value = pAplicaParaVenta
+ .Add("@Estado", SqlDbType.Int).Value = pEstado
+ .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@UsoClasificacion", SqlDbType.Int).Value = UsoClasificacion
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As SqlException
+ If CvePS <> -1 Then
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function GetPSClasificados(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_ProductosServiciosClasificadosGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As SqlException
+ If CvePS <> -1 Then
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+ End Try
+ Return Retorno
+ End Function
+ Public Function AddPS(CveClasificacion As Integer, CveClasificacionCosto As Integer, CveUnidadMedida As Integer, Codigo As String, Codigo2 As String, CodigoBarras As String, PS As String, Precio As Double, IVA As Double, RetIVA As Double, Inventariable As Boolean, CveProveedorCompra As Integer,
+ AplicaParaConcepto As Boolean, AplicaParaVenta As Boolean, CveUsuario As Integer, CveEmpresa As Integer, CveMetodoInventario As Integer, EsPaquete As Integer,
+ Optional CveTipoPS As Integer = -1, Optional FuePorXML As Boolean = True, Optional TipoServicio As Integer = -1, Optional CveClasificacion2 As Integer = -1,
+ Optional CveMarca As Integer = -1, Optional AlmacenSeccion As String = "", Optional AplicaIEPS As Boolean = False, Optional IEPSPorcentaje As Decimal = -1,
+ Optional CveConceptoContable As Integer = -1, Optional CveCompuesto As Integer = -1, Optional CveSATPS As Integer = -1, Optional IEPSGrabaIVA As Boolean = False, Optional VentaMinima As Decimal = 0,
+ Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
+ Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1,
+ Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
+ Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False,
+ Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False) As Integer
+ Dim Retorno As Integer = -1
+
+ DataAdapter("PA_ProductosServiciosAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@Codigo2", SqlDbType.VarChar).Value = If(Codigo2 = "", "-1", Codigo2)
+ .Add("@CodigoBarras", SqlDbType.VarChar).Value = If(CodigoBarras = "", "-1", CodigoBarras)
+ .Add("@PS", SqlDbType.VarChar).Value = If(PS.Length > 845, PS.Substring(0, 845), PS)
+ .Add("@Precio", SqlDbType.Float).Value = Precio
+ .Add("@IVA", SqlDbType.Float).Value = IVA
+ .Add("@RetIVA", SqlDbType.Float).Value = RetIVA
+ .Add("@AplicaParaConcepto", SqlDbType.Bit).Value = AplicaParaConcepto
+ .Add("@AplicaParaVenta", SqlDbType.Bit).Value = AplicaParaVenta
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@EsPaquete", SqlDbType.Bit).Value = EsPaquete
+ .Add("@CveMetodoInventario", SqlDbType.Int).Value = CveMetodoInventario
+ .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
+ .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
+ .Add("@FuePorXML", SqlDbType.Bit).Value = If(FuePorXML, 1, 0)
+ .Add("@TipoServicio", SqlDbType.Int).Value = TipoServicio
+ .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@AlmacenSeccion", SqlDbType.VarChar).Value = AlmacenSeccion
+ .Add("@AplicaIEPS", SqlDbType.Bit).Value = AplicaIEPS
+ .Add("@IEPSGrabaIVA", SqlDbType.Bit).Value = IEPSGrabaIVA
+ .Add("@IEPSPorcentaje", SqlDbType.SmallMoney).Value = IEPSPorcentaje
+ .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
+ .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
+ .Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
+
+ 'Nuevo R: 26/09/2017'
+ .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable
+ .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra
+ .Add("@VentaMinima", SqlDbType.Decimal).Value = VentaMinima
+
+ 'Nuevo R: 08/11/2017'
+ .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+
+ 'Nuevo R: 30/11/2017
+ .Add("@RetISR", SqlDbType.Float).Value = RetISR
+
+
+ 'Nuevo Oscar 29/12/2017
+ .Add("@PrecioMinimo", SqlDbType.Money).Value = PrecioMinimo
+
+ 'Nuevo Rigo 12/01/2018
+ .Add("@CveTipoFactor", SqlDbType.Int).Value = CveTipoFactor
+
+ 'Nuevo Raul 08/03/2018
+ .Add("@CveFraccionArancelaria", SqlDbType.Int).Value = CveFraccionArancelaria
+
+ 'Nuevo Raul 11/09/2018
+ .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle
+
+ 'Nuevo Oscar 31/10/2018
+ .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
+
+ 'Nuevo Happy 25/04/2019
+ .Add("@CveModelo", SqlDbType.Int).Value = CveModelo
+ .Add("@CveMedida", SqlDbType.Int).Value = CveMedida
+ .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
+
+ .Add("@ClaveImpuestoTipoProducto", SqlDbType.VarChar).Value = ClaveImpuestoTipoProducto
+ .Add("@ClaveImpuestoEmpaque", SqlDbType.VarChar).Value = ClaveImpuestoEmpaque
+ .Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
+ .Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
+ .Add("@Litraje", SqlDbType.Float).Value = Litraje
+ .Add("@EsOutSourcing", SqlDbType.Bit).Value = EsOutSourcing
+
+ .Add("@AplicaSerie", SqlDbType.Bit).Value = AplicaSerie
+ .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote
+ .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad
+ .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion
.Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad
- .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia
- End With
-
- Try
- SqlAdapter.Fill(Data)
- _CvePS = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
- Retorno = _CvePS
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
- ElseIf Ex1.Message.Contains("Número: 2601;") Then
- Alert("El Nuevo Producto o Servicio tiene Codigo duplicado:" & Codigo, TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
- Public Function AddPSApp(PS As MProductoServicio) As Integer
- Dim Retorno As Integer = -1
-
- DataAdapter("PA_ProductosServiciosAppAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveClasificacion", SqlDbType.Int).Value = PS.CveClasificacion
- .Add("@CveClasificacionCosto", SqlDbType.Int).Value = PS.CveClasificacionCosto
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = PS.CveUnidadMedida
- .Add("@Codigo", SqlDbType.VarChar).Value = PS.Codigo
- .Add("@Codigo2", SqlDbType.VarChar).Value = If(PS.Codigo2 = "", "-1", PS.Codigo2)
- .Add("@CodigoBarras", SqlDbType.VarChar).Value = If(PS.CodigoBarras = "", "-1", PS.CodigoBarras)
- .Add("@PS", SqlDbType.VarChar).Value = If(PS.PS.Length > 845, PS.PS.Substring(0, 845), PS.PS)
- .Add("@Precio", SqlDbType.Float).Value = PS.Precio
- .Add("@IVA", SqlDbType.Float).Value = PS.IVA
- .Add("@RetIVA", SqlDbType.Float).Value = PS.RetIVA
- .Add("@AplicaParaConcepto", SqlDbType.Bit).Value = PS.AplicaParaConcepto
- .Add("@AplicaParaVenta", SqlDbType.Bit).Value = PS.AplicaParaVenta
- .Add("@CveUsuario", SqlDbType.Int).Value = PS.CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = PS.CveEmpresa
- .Add("@EsPaquete", SqlDbType.Bit).Value = PS.EsPaquete
- .Add("@CveMetodoInventario", SqlDbType.Int).Value = PS.CveMetodoInventario
- .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
- .Add("@CveTipoPS", SqlDbType.Int).Value = PS.CveTipoPS
- .Add("@FuePorXML", SqlDbType.Bit).Value = PS.FuePorXML
- .Add("@TipoServicio", SqlDbType.Int).Value = PS.TipoServicio
- .Add("@CveClasificacion2", SqlDbType.Int).Value = PS.CveClasificacion2
- .Add("@CveMarca", SqlDbType.Int).Value = PS.CveMarca
- .Add("@AlmacenSeccion", SqlDbType.VarChar).Value = PS.AlmacenSeccion
- .Add("@AplicaIEPS", SqlDbType.Bit).Value = PS.AplicaIEPS
- .Add("@IEPSGrabaIVA", SqlDbType.Bit).Value = PS.IEPSGrabaIVA
- .Add("@IEPSPorcentaje", SqlDbType.SmallMoney).Value = PS.IEPSPorcentaje
- .Add("@CveConceptoContable", SqlDbType.Int).Value = PS.CveConceptoContable
- .Add("@CveCompuesto", SqlDbType.Int).Value = PS.CveCompuesto
- .Add("@CveSATPS", SqlDbType.Int).Value = PS.CveSATPS
-
- 'Nuevo R: 26/09/2017'
- .Add("@Inventariable", SqlDbType.Bit).Value = PS.Inventariable
- .Add("@CveProveedorCompra", SqlDbType.Int).Value = PS.CveProveedorCompra
- .Add("@VentaMinima", SqlDbType.Decimal).Value = PS.VentaMinima
-
- 'Nuevo R: 08/11/2017'
- .Add("@CveMoneda", SqlDbType.Int).Value = PS.CveMoneda
-
- 'Nuevo R: 30/11/2017
- .Add("@RetISR", SqlDbType.Float).Value = PS.RetISR
-
-
- 'Nuevo Oscar 29/12/2017
- .Add("@PrecioMinimo", SqlDbType.Money).Value = PS.PrecioMinimo
-
- 'Nuevo Rigo 12/01/2018
- .Add("@CveTipoFactor", SqlDbType.Int).Value = PS.CveTipoFactor
-
- 'Nuevo Raul 08/03/2018
- .Add("@CveFraccionArancelaria", SqlDbType.Int).Value = PS.CveFraccionArancelaria
-
- 'Nuevo Raul 11/09/2018
- .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = PS.CveClasificacionDetalle
-
- 'Nuevo Oscar 31/10/2018
- .Add("@CveTamaño", SqlDbType.Int).Value = PS.CveTamaño
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
- _CvePS = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
- Retorno = _CvePS
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
- ElseIf Ex1.Message.Contains("Número: 2601;") Then
- Alert("El Nuevo Producto o Servicio tiene Codigo duplicado.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
- Public Function AddPSSimplificado(PS As MProductoServicio) As Integer
- Dim Retorno As Integer = -1
-
- DataAdapter("PA_ProductosServiciosSimplificadoAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveClasificacion", SqlDbType.Int).Value = PS.CveClasificacion
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = PS.CveUnidadMedida
- .Add("@Codigo", SqlDbType.VarChar).Value = PS.Codigo
- .Add("@PS", SqlDbType.VarChar).Value = If(PS.PS.Length > 845, PS.PS.Substring(0, 845), PS.PS)
- .Add("@AplicaParaVenta", SqlDbType.Bit).Value = PS.AplicaParaVenta
- .Add("@CveTipoPS", SqlDbType.Int).Value = PS.CveTipoPS
- .Add("@CveUsuario", SqlDbType.Int).Value = PS.CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = PS.CveEmpresa
- .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
- End With
-
- Try
- SqlAdapter.Fill(Data)
- _CvePS = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
- Retorno = _CvePS
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
- ElseIf Ex1.Message.Contains("Número: 2601;") Then
- Alert("El Nuevo Producto o Servicio tiene Codigo duplicado.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
- Public Function UpdatePS(CveClasificacion As Integer, CveClasificacionCosto As Integer, CveUnidadMedida As Integer, Codigo As String, Codigo2 As String, CodigoBarras As String, PS As String, Precio As Double, IVA As Double, RetIVA As Double, Inventariable As Boolean, CveProveedorCompra As Integer,
- AplicaParaConcepto As Boolean, AplicaParaVenta As Boolean, Estado As Boolean, CveUsuario As Integer, CvePS As Integer, CveMetodoInventario As Integer, EsPaquete As Integer, CveSATPS As Integer, Optional CveTipoPS As Integer = -1, Optional TipoServicio As Integer = -1,
- Optional CveClasificacion2 As Integer = -1, Optional CveMarca As Integer = -1, Optional AlmacenSeccion As String = "", Optional AplicaIEPS As Boolean = False, Optional IEPSPorcentaje As Decimal = -1,
- Optional CveConceptoContable As Integer = -1, Optional CveCompuesto As Integer = -1, Optional IEPSGrabaIVA As Boolean = False, Optional VentaMinima As Decimal = 0,
- Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
- Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1,
- Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
- Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False,
- Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1) As Boolean
-
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_ProductosServiciosUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
- .Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
- .Add("@Codigo2", SqlDbType.VarChar).Value = If(Codigo2 = "", "-1", Codigo2)
- .Add("@CodigoBarras", SqlDbType.VarChar).Value = If(CodigoBarras = "", "-1", CodigoBarras)
- .Add("@PS", SqlDbType.VarChar).Value = PS
- .Add("@Precio", SqlDbType.Float).Value = Precio
- .Add("@IVA", SqlDbType.Float).Value = IVA
- .Add("@RetIVA", SqlDbType.Float).Value = RetIVA
- .Add("@AplicaParaConcepto", SqlDbType.Bit).Value = AplicaParaConcepto
- .Add("@AplicaParaVenta", SqlDbType.Bit).Value = AplicaParaVenta
- .Add("@Estado", SqlDbType.Bit).Value = Estado
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@EsPaquete", SqlDbType.Bit).Value = EsPaquete
- .Add("@CveMetodoInventario", SqlDbType.Int).Value = CveMetodoInventario
- .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
- .Add("@TipoServicio", SqlDbType.Int).Value = TipoServicio
- .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2
- .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
- .Add("@AlmacenSeccion", SqlDbType.VarChar).Value = AlmacenSeccion
- .Add("@AplicaIEPS", SqlDbType.Bit).Value = AplicaIEPS
- .Add("@IEPSGrabaIVA", SqlDbType.Bit).Value = IEPSGrabaIVA
- .Add("@IEPSPorcentaje", SqlDbType.SmallMoney).Value = IEPSPorcentaje
- .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
- .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
- .Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
-
- 'Nuevo R: 26/09/2017'
- .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable
- .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra
- .Add("@VentaMinima", SqlDbType.Decimal).Value = VentaMinima
-
- 'Nuevo R: 08/11/2017'
- .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
-
- 'Nuevo R: 30/11/2017
- .Add("@RetISR", SqlDbType.Float).Value = RetISR
-
- 'Nuevo Oscar 29/12/2017
- .Add("@PrecioMinimo", SqlDbType.Money).Value = PrecioMinimo
-
- 'Nuevo Rigo 12/01/2018
- .Add("@CveTipoFactor", SqlDbType.Int).Value = CveTipoFactor
-
- 'Nuevo Raul 08/03/2018
- .Add("@CveFraccionArancelaria", SqlDbType.Int).Value = CveFraccionArancelaria
-
- 'Nuevo Raul 10/08/2018
- .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
-
- 'Nuevo Raul 11/09/2018
- .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle
-
- 'Nuevo Oscar 31/10/2018
- .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
-
- 'Nuevo Happy 25/04/2019
- .Add("@CveModelo", SqlDbType.Int).Value = CveModelo
- .Add("@CveMedida", SqlDbType.Int).Value = CveMedida
- .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
-
- .Add("@ClaveImpuestoTipoProducto", SqlDbType.VarChar).Value = ClaveImpuestoTipoProducto
- .Add("@ClaveImpuestoEmpaque", SqlDbType.VarChar).Value = ClaveImpuestoEmpaque
- .Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
- .Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
- .Add("@Litraje", SqlDbType.Float).Value = Litraje
- .Add("@EsOutSourcing", SqlDbType.Bit).Value = EsOutSourcing
-
- .Add("@AplicaSerie", SqlDbType.Bit).Value = AplicaSerie
- .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote
- .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad
- .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion
+ .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia
+ .Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ _CvePS = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
+ Retorno = _CvePS
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
+ ElseIf Ex1.Message.Contains("Número: 2601;") Then
+ Alert("El Nuevo Producto o Servicio tiene Codigo duplicado:" & Codigo, TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function AddPSApp(PS As MProductoServicio) As Integer
+ Dim Retorno As Integer = -1
+
+ DataAdapter("PA_ProductosServiciosAppAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveClasificacion", SqlDbType.Int).Value = PS.CveClasificacion
+ .Add("@CveClasificacionCosto", SqlDbType.Int).Value = PS.CveClasificacionCosto
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = PS.CveUnidadMedida
+ .Add("@Codigo", SqlDbType.VarChar).Value = PS.Codigo
+ .Add("@Codigo2", SqlDbType.VarChar).Value = If(PS.Codigo2 = "", "-1", PS.Codigo2)
+ .Add("@CodigoBarras", SqlDbType.VarChar).Value = If(PS.CodigoBarras = "", "-1", PS.CodigoBarras)
+ .Add("@PS", SqlDbType.VarChar).Value = If(PS.PS.Length > 845, PS.PS.Substring(0, 845), PS.PS)
+ .Add("@Precio", SqlDbType.Float).Value = PS.Precio
+ .Add("@IVA", SqlDbType.Float).Value = PS.IVA
+ .Add("@RetIVA", SqlDbType.Float).Value = PS.RetIVA
+ .Add("@AplicaParaConcepto", SqlDbType.Bit).Value = PS.AplicaParaConcepto
+ .Add("@AplicaParaVenta", SqlDbType.Bit).Value = PS.AplicaParaVenta
+ .Add("@CveUsuario", SqlDbType.Int).Value = PS.CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = PS.CveEmpresa
+ .Add("@EsPaquete", SqlDbType.Bit).Value = PS.EsPaquete
+ .Add("@CveMetodoInventario", SqlDbType.Int).Value = PS.CveMetodoInventario
+ .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
+ .Add("@CveTipoPS", SqlDbType.Int).Value = PS.CveTipoPS
+ .Add("@FuePorXML", SqlDbType.Bit).Value = PS.FuePorXML
+ .Add("@TipoServicio", SqlDbType.Int).Value = PS.TipoServicio
+ .Add("@CveClasificacion2", SqlDbType.Int).Value = PS.CveClasificacion2
+ .Add("@CveMarca", SqlDbType.Int).Value = PS.CveMarca
+ .Add("@AlmacenSeccion", SqlDbType.VarChar).Value = PS.AlmacenSeccion
+ .Add("@AplicaIEPS", SqlDbType.Bit).Value = PS.AplicaIEPS
+ .Add("@IEPSGrabaIVA", SqlDbType.Bit).Value = PS.IEPSGrabaIVA
+ .Add("@IEPSPorcentaje", SqlDbType.SmallMoney).Value = PS.IEPSPorcentaje
+ .Add("@CveConceptoContable", SqlDbType.Int).Value = PS.CveConceptoContable
+ .Add("@CveCompuesto", SqlDbType.Int).Value = PS.CveCompuesto
+ .Add("@CveSATPS", SqlDbType.Int).Value = PS.CveSATPS
+
+ 'Nuevo R: 26/09/2017'
+ .Add("@Inventariable", SqlDbType.Bit).Value = PS.Inventariable
+ .Add("@CveProveedorCompra", SqlDbType.Int).Value = PS.CveProveedorCompra
+ .Add("@VentaMinima", SqlDbType.Decimal).Value = PS.VentaMinima
+
+ 'Nuevo R: 08/11/2017'
+ .Add("@CveMoneda", SqlDbType.Int).Value = PS.CveMoneda
+
+ 'Nuevo R: 30/11/2017
+ .Add("@RetISR", SqlDbType.Float).Value = PS.RetISR
+
+
+ 'Nuevo Oscar 29/12/2017
+ .Add("@PrecioMinimo", SqlDbType.Money).Value = PS.PrecioMinimo
+
+ 'Nuevo Rigo 12/01/2018
+ .Add("@CveTipoFactor", SqlDbType.Int).Value = PS.CveTipoFactor
+
+ 'Nuevo Raul 08/03/2018
+ .Add("@CveFraccionArancelaria", SqlDbType.Int).Value = PS.CveFraccionArancelaria
+
+ 'Nuevo Raul 11/09/2018
+ .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = PS.CveClasificacionDetalle
+
+ 'Nuevo Oscar 31/10/2018
+ .Add("@CveTamaño", SqlDbType.Int).Value = PS.CveTamaño
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ _CvePS = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
+ Retorno = _CvePS
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
+ ElseIf Ex1.Message.Contains("Número: 2601;") Then
+ Alert("El Nuevo Producto o Servicio tiene Codigo duplicado.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function AddPSSimplificado(PS As MProductoServicio) As Integer
+ Dim Retorno As Integer = -1
+
+ DataAdapter("PA_ProductosServiciosSimplificadoAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveClasificacion", SqlDbType.Int).Value = PS.CveClasificacion
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = PS.CveUnidadMedida
+ .Add("@Codigo", SqlDbType.VarChar).Value = PS.Codigo
+ .Add("@PS", SqlDbType.VarChar).Value = If(PS.PS.Length > 845, PS.PS.Substring(0, 845), PS.PS)
+ .Add("@AplicaParaVenta", SqlDbType.Bit).Value = PS.AplicaParaVenta
+ .Add("@CveTipoPS", SqlDbType.Int).Value = PS.CveTipoPS
+ .Add("@CveUsuario", SqlDbType.Int).Value = PS.CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = PS.CveEmpresa
+ .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ _CvePS = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
+ Retorno = _CvePS
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
+ ElseIf Ex1.Message.Contains("Número: 2601;") Then
+ Alert("El Nuevo Producto o Servicio tiene Codigo duplicado.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function UpdatePS(CveClasificacion As Integer, CveClasificacionCosto As Integer, CveUnidadMedida As Integer, Codigo As String, Codigo2 As String, CodigoBarras As String, PS As String, Precio As Double, IVA As Double, RetIVA As Double, Inventariable As Boolean, CveProveedorCompra As Integer,
+ AplicaParaConcepto As Boolean, AplicaParaVenta As Boolean, Estado As Boolean, CveUsuario As Integer, CvePS As Integer, CveMetodoInventario As Integer, EsPaquete As Integer, CveSATPS As Integer, Optional CveTipoPS As Integer = -1, Optional TipoServicio As Integer = -1,
+ Optional CveClasificacion2 As Integer = -1, Optional CveMarca As Integer = -1, Optional AlmacenSeccion As String = "", Optional AplicaIEPS As Boolean = False, Optional IEPSPorcentaje As Decimal = -1,
+ Optional CveConceptoContable As Integer = -1, Optional CveCompuesto As Integer = -1, Optional IEPSGrabaIVA As Boolean = False, Optional VentaMinima As Decimal = 0,
+ Optional CveMoneda As Integer = 1, Optional RetISR As Double = 0, Optional PrecioMinimo As Decimal = Nothing, Optional CveTipoFactor As Integer = 1,
+ Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1,
+ Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
+ Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False,
+ Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_ProductosServiciosUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@Codigo2", SqlDbType.VarChar).Value = If(Codigo2 = "", "-1", Codigo2)
+ .Add("@CodigoBarras", SqlDbType.VarChar).Value = If(CodigoBarras = "", "-1", CodigoBarras)
+ .Add("@PS", SqlDbType.VarChar).Value = PS
+ .Add("@Precio", SqlDbType.Float).Value = Precio
+ .Add("@IVA", SqlDbType.Float).Value = IVA
+ .Add("@RetIVA", SqlDbType.Float).Value = RetIVA
+ .Add("@AplicaParaConcepto", SqlDbType.Bit).Value = AplicaParaConcepto
+ .Add("@AplicaParaVenta", SqlDbType.Bit).Value = AplicaParaVenta
+ .Add("@Estado", SqlDbType.Bit).Value = Estado
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@EsPaquete", SqlDbType.Bit).Value = EsPaquete
+ .Add("@CveMetodoInventario", SqlDbType.Int).Value = CveMetodoInventario
+ .Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
+ .Add("@TipoServicio", SqlDbType.Int).Value = TipoServicio
+ .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@AlmacenSeccion", SqlDbType.VarChar).Value = AlmacenSeccion
+ .Add("@AplicaIEPS", SqlDbType.Bit).Value = AplicaIEPS
+ .Add("@IEPSGrabaIVA", SqlDbType.Bit).Value = IEPSGrabaIVA
+ .Add("@IEPSPorcentaje", SqlDbType.SmallMoney).Value = IEPSPorcentaje
+ .Add("@CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable
+ .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
+ .Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
+
+ 'Nuevo R: 26/09/2017'
+ .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable
+ .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra
+ .Add("@VentaMinima", SqlDbType.Decimal).Value = VentaMinima
+
+ 'Nuevo R: 08/11/2017'
+ .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+
+ 'Nuevo R: 30/11/2017
+ .Add("@RetISR", SqlDbType.Float).Value = RetISR
+
+ 'Nuevo Oscar 29/12/2017
+ .Add("@PrecioMinimo", SqlDbType.Money).Value = PrecioMinimo
+
+ 'Nuevo Rigo 12/01/2018
+ .Add("@CveTipoFactor", SqlDbType.Int).Value = CveTipoFactor
+
+ 'Nuevo Raul 08/03/2018
+ .Add("@CveFraccionArancelaria", SqlDbType.Int).Value = CveFraccionArancelaria
+
+ 'Nuevo Raul 10/08/2018
+ .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
+
+ 'Nuevo Raul 11/09/2018
+ .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle
+
+ 'Nuevo Oscar 31/10/2018
+ .Add("@CveTamaño", SqlDbType.Int).Value = CveTamaño
+
+ 'Nuevo Happy 25/04/2019
+ .Add("@CveModelo", SqlDbType.Int).Value = CveModelo
+ .Add("@CveMedida", SqlDbType.Int).Value = CveMedida
+ .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
+
+ .Add("@ClaveImpuestoTipoProducto", SqlDbType.VarChar).Value = ClaveImpuestoTipoProducto
+ .Add("@ClaveImpuestoEmpaque", SqlDbType.VarChar).Value = ClaveImpuestoEmpaque
+ .Add("@ClaveImpuestoUM", SqlDbType.VarChar).Value = ClaveImpuestoUM
+ .Add("@ClaveCategoriaToxicidad", SqlDbType.VarChar).Value = ClaveCategoriaToxicidad
+ .Add("@Litraje", SqlDbType.Float).Value = Litraje
+ .Add("@EsOutSourcing", SqlDbType.Bit).Value = EsOutSourcing
+
+ .Add("@AplicaSerie", SqlDbType.Bit).Value = AplicaSerie
+ .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote
+ .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad
+ .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion
.Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad
- .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("El Producto o Servicio no se guardo debido a que actualmente se encuentra registrado.", TipoMensaje.MsgAdvertencia)
- ElseIf Ex1.Message.Contains("Número: 2601;") Then
- Alert("El Nuevo Producto o Servicio tiene Codigo duplicado.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al intentar guardar los cambios en el Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al intentar guardar los cambios en el Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
- Public Function UpdateClasificacionPS(CveClasificacion As Integer, CveUsuario As Integer, CvePS As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_ProductosServiciosClasificacionUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("El Producto o Servicio no se guardo debido a que actualmente se encuentra registrado.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al intentar guardar los cambios de clasificación del Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al intentar guardar los cambio de clasificación del Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
- Public Function RemovePS(CvePS As Integer) As Boolean
- Dim OnError As Boolean = False
- DataAdapter("PA_ProductosServiciosRemove")
-
- SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS
-
- Try
- SqlAdapter.Fill(Data)
- OnError = True
- Catch ex As Exception
- Me.OnError("Ocurrió un error al eliminar El Producto Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return OnError
- End Function
- Public Function GetAllPS(CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_ProductosServiciosGetAll")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As SqlException
- If CvePS <> -1 Then
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
- End Try
-
- Return Retorno
- End Function
- Public Function GetPrecioUnitarioPS(CveEmpresa As Integer, CvePS As Integer) As Double
-
- Dim Retorno As Double = -1
-
- DataAdapter("PA_Inv_PrecioUnitarioSalidaGet")
-
- With SqlAdapter.SelectCommand.Parameters
-
-
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@PU", SqlDbType.Money).Direction = ParameterDirection.Output
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = CDbl(SqlAdapter.SelectCommand.Parameters("@PU").Value)
-
- Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al obtener el precio unitario.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- Catch ex As Exception
- OnError("Ocurrió un error al obtener el precio unitario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
-#Region "P R O D U C T O S - E Q U I V A L E N C I A S "
-
- Public Function GetPSEquivalencias(CvePS As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosEquivalenciasGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las equivalencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function AddPSEquivalencias(CvePS As Integer, CveUM As Integer, Cantidad As Decimal, UnidadBase As Boolean, Precio As Double, CveUsuario As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosEquivalenciasAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveUM", SqlDbType.Int).Value = CveUM
- .Add("@Cantidad", SqlDbType.Float).Value = Cantidad
- .Add("@UnidadBase", SqlDbType.Bit).Value = UnidadBase
- .Add("@Precio", SqlDbType.Money).Value = Precio
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
-
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe una equivalencia con la misma unidad de medida.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar la Equivalencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
-
- Catch ex As Exception
- OnError("Ocurrió un error al Guardar la Equivalencia", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdatePSEquivalencias(CvePS As Integer, CveUM As Integer, Cantidad As Decimal, UnidadBase As Boolean, Precio As Double, CveUsuario As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosEquivalenciasUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveUM", SqlDbType.Int).Value = CveUM
- .Add("@Cantidad", SqlDbType.Float).Value = Cantidad
- .Add("@UnidadBase", SqlDbType.Bit).Value = UnidadBase
- .Add("@Precio", SqlDbType.Money).Value = Precio
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe una equivalencia con la misma unidad de medida." + Ex1.Message.ToString, TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar la Equivalencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar la Equivalencia", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function RemovePSEquivalencias(CvePS As Integer, CveUM As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosEquivalenciasRemove")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveUM", SqlDbType.Int).Value = CveUM
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al eliminar la equivalencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
-
- Catch ex As Exception
- Me.OnError("Ocurrió un error al eliminar la equivalencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-
-
-#End Region
-
-#Region "P R O D U C T O S A D I C I O N A L E S "
-
- Public Function GetPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosAdicionalesGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los Productos/Servicios Adicionales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function AddPSAdicionales(CvePS As Integer, CvePSAdicional As Integer, Cantidad As Decimal) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosAdicionalesAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CvePSAdicional", SqlDbType.Int).Value = CvePSAdicional
- .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe una equivalencia con el mismo Producto/Servicio Adicional.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar el Producto/Servicio Adicional.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
-
- Catch ex As Exception
- OnError("Ocurrió un error al Guardar el Producto/Servicio Adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdatePSAdicionales(CvePS As Integer, CvePSAdicional As Integer, CvePSAdicionalAnterior As Integer, Cantidad As Decimal) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosAdicionalesUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CvePSAdicional", SqlDbType.Int).Value = CvePSAdicional
- .Add("@CvePSAdicionalAnterior", SqlDbType.Int).Value = CvePSAdicionalAnterior
- .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe una equivalencia con el mismo Producto/Servicio Adicional." + Ex1.Message.ToString, TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar el Producto/Servicio Adicional.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar el Producto/Servicio Adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function RemovePSAdicionales(CvePS As Integer, CvePSAdicional As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosAdicionalesRemove")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CvePSAdicional", SqlDbType.Int).Value = CvePSAdicional
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al eliminar el Producto/Servicio Adicional.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
-
- Catch ex As Exception
- Me.OnError("Ocurrió un error al eliminar el Producto/Servicio Adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-
-
-#End Region
-
-#Region "P A Q U E T E S"
-
- Public Function UpdatePaquete(CvePS As Integer, PS As String, Precio As Double, Estado As Boolean) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Inv_PaqueteUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@PS", SqlDbType.VarChar).Value = PS
- .Add("@Precio", SqlDbType.Money).Value = Precio
- .Add("@Estado", SqlDbType.Bit).Value = Estado
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar el paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function GetPaqueteDetalle(CvePSPaquete As Integer, CveEmpresa As Integer, Optional CveUMPaquete As Integer = -1, Optional Cantidad As Double = 0, Optional CveAlmacen As Integer = -1, Optional Fecha As Date = MinFecha, Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Inv_PaqueteDetallesGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
- .Add("@CveUMPaquete", SqlDbType.Int).Value = CveUMPaquete
- .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
- .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
- .Add("@Fecha", SqlDbType.Date).Value = Fecha
- .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los Productos y servicios del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function AddPaqueteDetalle(CvePSPaquete As Integer, CvePS As Integer, Cantidad As Double, Tipo As Integer, CveUnidadMedida As Integer, Optional CveUsuarioModifico As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Inv_PaquetesAdd")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- .Add("@Tipo", SqlDbType.Int).Value = Tipo
- .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe en el Paquete el Producto o Servicio.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al guardar el Paquete.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al guardar el Paquete", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
- Return Retorno
- End Function
-
- Public Function DeletePaqueteDetalle(CvePSPaquete As Integer, CvePS As Integer, Cantidad As Double, Tipo As Integer, CveUnidadMedida As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Inv_PaqueteDetalleDelete")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
- .Add("@Tipo", SqlDbType.Int).Value = Tipo
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al ingresar el producto al paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdatePaqueteDetalle(CvePSPaquete As Integer, CvePS As Integer, Cantidad As Double, Tipo As Integer, CveUnidadMedida As Integer, Optional CveUsuarioModifico As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Inv_PaqueteDetalleUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
- .Add("@Tipo", SqlDbType.SmallInt).Value = Tipo
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar el paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-#End Region
-
-#Region "P R O D U C T O S - S U C U R S A L E S"
-
- Public Function GetPSSucursales(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosSucursalesGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las Sucursales habilitadas para el Producto y/o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function GetPSSucursalesALL(CvePS As Integer, CveEmpresa As Integer, Optional Codigo As String = "", Optional CodigoBarras As String = "", Optional CveSubProyecto As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosSucursalesGetAll")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
- .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las Sucursales habilitadas para el Producto y/o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function AddPSSucursales(CvePS As Integer, Importe As Double, Minimo As Double, Maximo As Double, CveUsuario As Integer, CveSubProyecto As Integer, Optional PrecioMinimo As Decimal = Nothing) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosSucursalesAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@Importe", SqlDbType.Float).Value = Importe
- .Add("@Minimo", SqlDbType.Float).Value = Minimo
- .Add("@Maximo", SqlDbType.Float).Value = Maximo
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe una Sucursal para el mismo Producto y/o Servicio.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
-
- Catch ex As Exception
- OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdatePSSucursales(CvePS As Integer, Importe As Double, Minimo As Double, Maximo As Double, CveUsuario As Integer, CveSubProyecto As Integer, Optional PrecioMinimo As Decimal = Nothing) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosSucursalesUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@Importe", SqlDbType.Float).Value = Importe
- .Add("@Minimo", SqlDbType.Float).Value = Minimo
- .Add("@Maximo", SqlDbType.Float).Value = Maximo
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe una Sucursal para el mismo Producto y/o Servicio.", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function RemovePSSucursales(CvePS As Integer, CveSubProyecto As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosSucursalesRemove")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al eliminar la Sucursal para Producto y/o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
-
- Catch ex As Exception
- Me.OnError("Ocurrió un error al eliminar la Sucursal para Producto y/o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-#End Region
-
- 'Ubicacion temporal
- Public Function GetMetodosInv() As Boolean
- Dim Retorno = False
-
- DataAdapter("PA_Inv_MetodosGet")
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al obtener los Metodos de Inventario.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los Metodos de Inventario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
-
- End Function
-
-#Region " Marcas "
- Public Function GetPSAlias(CvePS As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosAliasGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
-
- Try
- SqlAdapter.Fill(Data)
-
- Retorno = True
- Catch ex As SqlException
- If CvePS <> -1 Then
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- Else
- OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End If
- End Try
-
- Return Retorno
- End Function
-
- Public Function AddPSAlias(PS As String, CvePS As Integer, Optional CveUsuarioModifico As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosAliasAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@PSAlias", SqlDbType.VarChar).Value = If(PS.Length > 845, PS.Substring(0, 845), PS)
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
- End With
-
- Try
- SqlAdapter.Fill(Data)
-
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- OnError("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- Else
- Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function RemovePSAlias(CvePS As Integer, PSAlias As String, CveUsuarioModifico As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosAliasRemove")
-
- SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS
- SqlAdapter.SelectCommand.Parameters.Add("@PSAlias", SqlDbType.VarChar).Value = PSAlias
- SqlAdapter.SelectCommand.Parameters.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- Me.OnError("Ocurrió un error al eliminar el Alias del Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdateAplicaSeccionAlmacen(CvePS As Integer, CveEmpresa As Integer, AplicaSeccionAlmacen As Boolean) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_ProductosServiciosSeccionAlmacenUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@AplicaSeccionAlmacen", SqlDbType.Bit).Value = AplicaSeccionAlmacen
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
-
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar aplica seccion almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
- Public Function GetMarcas(CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_MarcasGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener el Catálogo de Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-
-
- Public Function AddMarcas(Marca As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_MarcasAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Marca", SqlDbType.VarChar).Value = Marca
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe una Marca del Producto o Servicio con el mismo nombre: " & Marca & ".", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar la Marca.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al Guardar la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
-
-
- Public Function RemoveMarca(CveMarca As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_MarcasRemove")
-
- SqlAdapter.SelectCommand.Parameters.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al eliminar la Marca.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- Catch ex As Exception
- Me.OnError("Ocurrió un error al eliminar la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-
-
-
- Public Function UpdateMarca(Marca As String, CveMarca As Integer, Estatus As Boolean) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_MarcasUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Marca", SqlDbType.VarChar).Value = Marca
- .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
-
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
-
-#End Region
- Public Function GetPSMarcas(CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_GRAL_PSMarcasGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener el Catálogo de Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-
-#Region "IMPUESTOS LOCALES"
- Public Function GetPSImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_PSImpuestosLocalesGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los datos de impuestos locales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
-
-
- Public Function AddPSImpuestosLocales(CvePS As Integer, CveImpuestoLocal As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_PSImpuestosLocalesAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveImpuestoLocal", SqlDbType.Int).Value = CveImpuestoLocal
- End With
-
- Try
- SqlAdapter.Fill(Data)
-
- Catch ex As Exception
- OnError("Ocurrió un error al tratar de agregar datos a la base de datos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
- Return Retorno
- End Function
-
- Public Function LimpiaImpuestosLocales(CveCliente As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_PSImpuestosLocalesRemove")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CveCliente
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al limpiar la lista de deducciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
-#End Region
-
-#Region "C O M P U E S T O S"
- Public Function GetCompuestosActivos(CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_CompuestosGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener el Catálogo de Compuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
- Return Retorno
- End Function
-
-
-
- Public Function AddCompuestoActivo(Compuesto As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_CompuestosAdd")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Compuesto", SqlDbType.VarChar).Value = Compuesto
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- If Ex1.Message.Contains("Número: 2627;") Then
- Alert("Ya existe un compuesto activo con el mismo nombre: " & Compuesto & ".", TipoMensaje.MsgAdvertencia)
- Else
- Me.OnError("Ocurrió un error al Guardar el compuesto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End If
- Catch ex As Exception
- OnError("Ocurrió un error al Guardar el compuesto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-
-
-
- Public Function RemoveCompuestoActivo(CveCompuesto As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_CompuestosRemove")
-
- SqlAdapter.SelectCommand.Parameters.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- Me.OnError("Ocurrió un error al eliminar el compuesto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- Catch ex As Exception
- Me.OnError("Ocurrió un error al eliminar el compuesto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-
-
-
- Public Function UpdateCompuestoActivo(Compuesto As String, CveCompuesto As Integer, Estatus As Boolean) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_Gral_CompuestoUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Compuesto", SqlDbType.VarChar).Value = Compuesto
- .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
- .Add("@Estatus", SqlDbType.Bit).Value = Estatus
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
-
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar el compuesto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-#End Region
-
-#Region "UNIFICAR PRODUCTO"
- Public Function UnificarPS(CvePSPrincipal As Integer, CvePSUnificado As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
-
- DataAdapter("PA_PS_PSUnificar")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePSPrincipal", SqlDbType.Int).Value = CvePSPrincipal
- .Add("@CvePSUnificado", SqlDbType.Int).Value = CvePSUnificado
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch Ex1 As SqlException
- OnError("Ocurrió un error al intentar Unificar los Productos o Servicios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- Catch ex As Exception
- OnError("Ocurrió un error al intentar Unificar los Productos o Servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
- End Try
-
- Return Retorno
- End Function
-#End Region
-
-
-#Region "Precios Lista"
- Public Function GetPSPreciosLista(CveEmpresa As Integer, CvePrecioLista As Integer, Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1,
- Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PSPrecioListaGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
- .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
- .Add("@Estado", SqlDbType.Int).Value = Estado
- .Add("@Marcas", SqlDbType.VarChar).Value = Marcas
- .Add("@CveModelo", SqlDbType.Int).Value = CveModelo
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener el Catálogo de PS con precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdatePSPreciosLista(Importe As Decimal, CvePrecioLista As Integer, Porcentaje As Decimal, CvePS As Integer, CveUsuario As Integer, Fecha As DateTime, Fijo As Boolean, Optional PrecioMinimo As Decimal = Nothing) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PSPrecioListaAdd")
-
- With SqlAdapter.SelectCommand.Parameters
-
- If Importe = -1 Then
- .Add("@Importe", SqlDbType.Float).Value = DBNull.Value
- Else
- .Add("@Importe", SqlDbType.Float).Value = Importe
- End If
-
- .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
-
- If Porcentaje = -1 Then
- .Add("@Porcentaje", SqlDbType.Money).Value = DBNull.Value
- Else
- .Add("@Porcentaje", SqlDbType.Money).Value = Porcentaje
- End If
-
- .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
-
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
- .Add("@Fijo", SqlDbType.Bit).Value = Fijo
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar los precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdatePSPrecios(Importe As Decimal, CvePrecioLista As Integer, Porcentaje As Decimal, CvePS As Integer, CveUsuario As Integer, Fecha As DateTime, Fijo As Boolean, Optional PrecioMinimo As Decimal = Nothing) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PSPrecioUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
-
- If Importe = -1 Then
- .Add("@Importe", SqlDbType.Float).Value = DBNull.Value
- Else
- .Add("@Importe", SqlDbType.Float).Value = Importe
- End If
-
- If Porcentaje = -1 Then
- .Add("@Porcentaje", SqlDbType.Money).Value = DBNull.Value
- Else
- .Add("@Porcentaje", SqlDbType.Money).Value = Porcentaje
- End If
-
- .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
- .Add("@Fijo", SqlDbType.Bit).Value = Fijo
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar los precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-
- Public Function GetPSPrecioLista(CvePS As Integer, CveEmpresa As Integer, Optional CvePrecioLista As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosPrecioListaGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
-
- End With
-
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los precios de lista para el Producto/Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
-
- End Function
-
- Public Function GetPSExistencias(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
- CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
- Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
- Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
- Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_ProductosExistenciasGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
- .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
- .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
- .Add("@Serie", SqlDbType.VarChar).Value = Serie
- .Add("@Lote", SqlDbType.VarChar).Value = Lote
- .Add("@Batch", SqlDbType.VarChar).Value = Batch
- .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
- .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
- .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
- .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
- Public Function GetPSExistenciasWS(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
- CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
- Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
- Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
- Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_ProductosExistenciasWSGet")
-
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
- .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
- .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
- .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
- .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
- .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
- .Add("@Serie", SqlDbType.VarChar).Value = Serie
- .Add("@Lote", SqlDbType.VarChar).Value = Lote
- .Add("@Batch", SqlDbType.VarChar).Value = Batch
- .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
- .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
- .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
- .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
-#End Region
-
-#Region "Porcentaje Productos"
- Public Function GetPorcentajeProductos(CveCliente As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeProductosGet")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los porcentajes de los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function AddPorcentajeProductos(CveCliente As Integer, CvePS As Integer, PorcentajeProducto As Decimal, CveUsuario As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeProductosAdd")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al agregar el porcentaje del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
- Public Function UpdatePorcentajeProductos(CveCliente As Integer, CvePS As Integer, PorcentajeProducto As Decimal) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeProductosUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar el porcentaje del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
- Public Function RemovePorcentajeProductos(CveCliente As Integer, CvePS As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeProductosRemove")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al eliminar el porcentaje del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-#End Region
-
-#Region "Porcentaje Marcas de Productos"
- Public Function GetPorcentajeMarcas(CveCliente As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeMarcasGet")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los porcentajes de las Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function AddPorcentajeMarcas(CveCliente As Integer, CveMarca As Integer, PorcentajeProducto As Decimal, PorcentajeProducto2 As Decimal, PorcentajeProducto3 As Decimal, CveUsuario As Integer, Optional ProntoPago As Decimal = -1, Optional Plazo As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeMarcasAdd")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
- .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
- .Add("@PorcentajeProducto2", SqlDbType.SmallMoney).Value = PorcentajeProducto2
- .Add("@PorcentajeProducto3", SqlDbType.SmallMoney).Value = PorcentajeProducto3
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@ProntoPago", SqlDbType.SmallMoney).Value = ProntoPago
- .Add("@Plazo", SqlDbType.SmallInt).Value = Plazo
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al agregar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
- Public Function UpdatePorcentajeMarcas(CveCliente As Integer, CveMarca As Integer, PorcentajeProducto As Decimal, PorcentajeProducto2 As Decimal, PorcentajeProducto3 As Decimal, Optional ProntoPago As Decimal = -1, Optional Plazo As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeMarcasUpdate")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
- .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
- .Add("@PorcentajeProducto2", SqlDbType.SmallMoney).Value = PorcentajeProducto2
- .Add("@PorcentajeProducto3", SqlDbType.SmallMoney).Value = PorcentajeProducto3
- .Add("@ProntoPago", SqlDbType.SmallMoney).Value = ProntoPago
- .Add("@Plazo", SqlDbType.SmallInt).Value = Plazo
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
- Public Function RemovePorcentajeMarcas(CveCliente As Integer, CveMarca As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Vta_PorcentajeMarcasRemove")
-
- With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
-
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al eliminar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-#End Region
-#Region "IDisposable Support"
-
-
- ' IDisposable
- Protected Overridable Sub Dispose(disposing As Boolean)
- If Not Me.disposedValue Then
- If disposing Then
- ' TODO: dispose managed state (managed objects).
- If Not Data Is Nothing Then Data.Dispose()
- If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose()
- If Not SqlCommand Is Nothing Then SqlCommand.Dispose()
- If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
- If Not SqlConexion Is Nothing Then SqlConexion.Dispose()
- End If
-
- ' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
- ' TODO: set large fields to null.
- End If
- Me.disposedValue = True
- End Sub
-
- ' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
- 'Protected Overrides Sub Finalize()
- ' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
- ' Dispose(False)
- ' MyBase.Finalize()
- 'End Sub
-
- ' This code added by Visual Basic to correctly implement the disposable pattern.
- Public Sub Dispose() Implements IDisposable.Dispose
- ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
- ConexionClose()
- Dispose(True)
- GC.SuppressFinalize(Me)
- End Sub
-#End Region
-
-
-
- Public Function GetProductosServiciosSinSAT(Opcion As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosSinSATGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Opcion", SqlDbType.Int).Value = Opcion
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los productos sin SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-
- Public Function UpdateProductosServiciosSAT(CvePS As Integer, CveSATPS As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_Gral_ProductosServiciosSATUpdate")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CvePS", SqlDbType.Int).Value = CvePS
- .Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
- .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al actualizar la clave SAT del producto o servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
+ .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia
+ .Add("@PrecioLibre", SqlDbType.Bit).Value = PrecioLibre
- Public Function GetProductosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_ProductosModificadosGet")
- With SqlAdapter.SelectCommand.Parameters
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("El Producto o Servicio no se guardo debido a que actualmente se encuentra registrado.", TipoMensaje.MsgAdvertencia)
+ ElseIf Ex1.Message.Contains("Número: 2601;") Then
+ Alert("El Nuevo Producto o Servicio tiene Codigo duplicado.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al intentar guardar los cambios en el Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar guardar los cambios en el Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function UpdateClasificacionPS(CveClasificacion As Integer, CveUsuario As Integer, CvePS As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_ProductosServiciosClasificacionUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("El Producto o Servicio no se guardo debido a que actualmente se encuentra registrado.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al intentar guardar los cambios de clasificación del Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar guardar los cambio de clasificación del Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function RemovePS(CvePS As Integer) As Boolean
+ Dim OnError As Boolean = False
+ DataAdapter("PA_ProductosServiciosRemove")
+
+ SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS
+
+ Try
+ SqlAdapter.Fill(Data)
+ OnError = True
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar El Producto Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return OnError
+ End Function
+ Public Function GetAllPS(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_ProductosServiciosGetAll")
+
+ With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
- .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los productos modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As SqlException
+ If CvePS <> -1 Then
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+ End Try
+
+ Return Retorno
End Function
- Public Function GetPreciosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_ProductosPreciosModificadosGet")
- With SqlAdapter.SelectCommand.Parameters
+ Public Function GetPrecioUnitarioPS(CveEmpresa As Integer, CvePS As Integer) As Double
+
+ Dim Retorno As Double = -1
+
+ DataAdapter("PA_Inv_PrecioUnitarioSalidaGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
- .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los precios modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@PU", SqlDbType.Money).Direction = ParameterDirection.Output
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = CDbl(SqlAdapter.SelectCommand.Parameters("@PU").Value)
+
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al obtener el precio unitario.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el precio unitario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
End Function
- Public Function GetExistenciasEmpresa(Codigo As String, CveEmpresa As Integer) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_ProductosExistenciasEmpresaGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
+#Region "P R O D U C T O S - E Q U I V A L E N C I A S "
+
+ Public Function GetPSEquivalencias(CvePS As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosEquivalenciasGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las equivalencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
End Function
- Public Function GetVendedoresModificados(CveEmpresa As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
- Dim Retorno As Boolean = False
- DataAdapter("PA_VendedoresModificadosGet")
- With SqlAdapter.SelectCommand.Parameters
- .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
- .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
- End With
- Try
- SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As Exception
- OnError("Ocurrió un error al obtener los vendedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
- End Try
-
- Return Retorno
- End Function
-End Class
+ Public Function AddPSEquivalencias(CvePS As Integer, CveUM As Integer, Cantidad As Decimal, UnidadBase As Boolean, Precio As Double, CveUsuario As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosEquivalenciasAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveUM", SqlDbType.Int).Value = CveUM
+ .Add("@Cantidad", SqlDbType.Float).Value = Cantidad
+ .Add("@UnidadBase", SqlDbType.Bit).Value = UnidadBase
+ .Add("@Precio", SqlDbType.Money).Value = Precio
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe una equivalencia con la misma unidad de medida.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar la Equivalencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al Guardar la Equivalencia", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdatePSEquivalencias(CvePS As Integer, CveUM As Integer, Cantidad As Decimal, UnidadBase As Boolean, Precio As Double, CveUsuario As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosEquivalenciasUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveUM", SqlDbType.Int).Value = CveUM
+ .Add("@Cantidad", SqlDbType.Float).Value = Cantidad
+ .Add("@UnidadBase", SqlDbType.Bit).Value = UnidadBase
+ .Add("@Precio", SqlDbType.Money).Value = Precio
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe una equivalencia con la misma unidad de medida." + Ex1.Message.ToString, TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar la Equivalencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la Equivalencia", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemovePSEquivalencias(CvePS As Integer, CveUM As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosEquivalenciasRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveUM", SqlDbType.Int).Value = CveUM
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al eliminar la equivalencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar la equivalencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+#End Region
+
+#Region "P R O D U C T O S A D I C I O N A L E S "
+
+ Public Function GetPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosAdicionalesGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los Productos/Servicios Adicionales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddPSAdicionales(CvePS As Integer, CvePSAdicional As Integer, Cantidad As Decimal) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosAdicionalesAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CvePSAdicional", SqlDbType.Int).Value = CvePSAdicional
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe una equivalencia con el mismo Producto/Servicio Adicional.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar el Producto/Servicio Adicional.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al Guardar el Producto/Servicio Adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdatePSAdicionales(CvePS As Integer, CvePSAdicional As Integer, CvePSAdicionalAnterior As Integer, Cantidad As Decimal) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosAdicionalesUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CvePSAdicional", SqlDbType.Int).Value = CvePSAdicional
+ .Add("@CvePSAdicionalAnterior", SqlDbType.Int).Value = CvePSAdicionalAnterior
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe una equivalencia con el mismo Producto/Servicio Adicional." + Ex1.Message.ToString, TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar el Producto/Servicio Adicional.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el Producto/Servicio Adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemovePSAdicionales(CvePS As Integer, CvePSAdicional As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosAdicionalesRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CvePSAdicional", SqlDbType.Int).Value = CvePSAdicional
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al eliminar el Producto/Servicio Adicional.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar el Producto/Servicio Adicional.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+#End Region
+
+#Region "P A Q U E T E S"
+
+ Public Function UpdatePaquete(CvePS As Integer, PS As String, Precio As Double, Estado As Boolean) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_PaqueteUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@PS", SqlDbType.VarChar).Value = PS
+ .Add("@Precio", SqlDbType.Money).Value = Precio
+ .Add("@Estado", SqlDbType.Bit).Value = Estado
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetPaqueteDetalle(CvePSPaquete As Integer, CveEmpresa As Integer, Optional CveUMPaquete As Integer = -1, Optional Cantidad As Double = 0, Optional CveAlmacen As Integer = -1, Optional Fecha As Date = MinFecha, Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_PaqueteDetallesGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
+ .Add("@CveUMPaquete", SqlDbType.Int).Value = CveUMPaquete
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los Productos y servicios del paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddPaqueteDetalle(CvePSPaquete As Integer, CvePS As Integer, Cantidad As Double, Tipo As Integer, CveUnidadMedida As Integer, Optional CveUsuarioModifico As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_PaquetesAdd")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ .Add("@Tipo", SqlDbType.Int).Value = Tipo
+ .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe en el Paquete el Producto o Servicio.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al guardar el Paquete.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el Paquete", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
+ Public Function DeletePaqueteDetalle(CvePSPaquete As Integer, CvePS As Integer, Cantidad As Double, Tipo As Integer, CveUnidadMedida As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_PaqueteDetalleDelete")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+ .Add("@Tipo", SqlDbType.Int).Value = Tipo
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al ingresar el producto al paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdatePaqueteDetalle(CvePSPaquete As Integer, CvePS As Integer, Cantidad As Double, Tipo As Integer, CveUnidadMedida As Integer, Optional CveUsuarioModifico As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Inv_PaqueteDetalleUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePSPaquete", SqlDbType.Int).Value = CvePSPaquete
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+ .Add("@Tipo", SqlDbType.SmallInt).Value = Tipo
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el paquete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+#End Region
+
+#Region "P R O D U C T O S - S U C U R S A L E S"
+
+ Public Function GetPSSucursales(CvePS As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosSucursalesGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las Sucursales habilitadas para el Producto y/o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetPSSucursalesALL(CvePS As Integer, CveEmpresa As Integer, Optional Codigo As String = "", Optional CodigoBarras As String = "", Optional CveSubProyecto As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosSucursalesGetAll")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@CodigoBarras", SqlDbType.VarChar).Value = CodigoBarras
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las Sucursales habilitadas para el Producto y/o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddPSSucursales(CvePS As Integer, Importe As Double, Minimo As Double, Maximo As Double, CveUsuario As Integer, CveSubProyecto As Integer, Optional PrecioMinimo As Decimal = Nothing) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosSucursalesAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Importe", SqlDbType.Float).Value = Importe
+ .Add("@Minimo", SqlDbType.Float).Value = Minimo
+ .Add("@Maximo", SqlDbType.Float).Value = Maximo
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe una Sucursal para el mismo Producto y/o Servicio.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdatePSSucursales(CvePS As Integer, Importe As Double, Minimo As Double, Maximo As Double, CveUsuario As Integer, CveSubProyecto As Integer, Optional PrecioMinimo As Decimal = Nothing) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosSucursalesUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@Importe", SqlDbType.Float).Value = Importe
+ .Add("@Minimo", SqlDbType.Float).Value = Minimo
+ .Add("@Maximo", SqlDbType.Float).Value = Maximo
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe una Sucursal para el mismo Producto y/o Servicio.", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al Guardar la Sucursal para Producto y/o Servicio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemovePSSucursales(CvePS As Integer, CveSubProyecto As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosSucursalesRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al eliminar la Sucursal para Producto y/o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar la Sucursal para Producto y/o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+#End Region
+
+ 'Ubicacion temporal
+ Public Function GetMetodosInv() As Boolean
+ Dim Retorno = False
+
+ DataAdapter("PA_Inv_MetodosGet")
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al obtener los Metodos de Inventario.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los Metodos de Inventario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+#Region " Marcas "
+ Public Function GetPSAlias(CvePS As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosAliasGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As SqlException
+ If CvePS <> -1 Then
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al consultar El Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddPSAlias(PS As String, CvePS As Integer, Optional CveUsuarioModifico As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosAliasAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@PSAlias", SqlDbType.VarChar).Value = If(PS.Length > 845, PS.Substring(0, 845), PS)
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ OnError("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Else
+ Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function RemovePSAlias(CvePS As Integer, PSAlias As String, CveUsuarioModifico As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosAliasRemove")
+
+ SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS
+ SqlAdapter.SelectCommand.Parameters.Add("@PSAlias", SqlDbType.VarChar).Value = PSAlias
+ SqlAdapter.SelectCommand.Parameters.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar el Alias del Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateAplicaSeccionAlmacen(CvePS As Integer, CveEmpresa As Integer, AplicaSeccionAlmacen As Boolean) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_ProductosServiciosSeccionAlmacenUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@AplicaSeccionAlmacen", SqlDbType.Bit).Value = AplicaSeccionAlmacen
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar aplica seccion almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetMarcas(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_MarcasGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el Catálogo de Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+ Public Function AddMarcas(Marca As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_MarcasAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Marca", SqlDbType.VarChar).Value = Marca
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe una Marca del Producto o Servicio con el mismo nombre: " & Marca & ".", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar la Marca.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al Guardar la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+ Public Function RemoveMarca(CveMarca As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_MarcasRemove")
+
+ SqlAdapter.SelectCommand.Parameters.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al eliminar la Marca.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+
+ Public Function UpdateMarca(Marca As String, CveMarca As Integer, Estatus As Boolean) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_MarcasUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Marca", SqlDbType.VarChar).Value = Marca
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+
+#End Region
+ Public Function GetPSMarcas(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_GRAL_PSMarcasGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el Catálogo de Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+#Region "IMPUESTOS LOCALES"
+ Public Function GetPSImpuestosLocales(CvePS As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_PSImpuestosLocalesGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los datos de impuestos locales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+ Public Function AddPSImpuestosLocales(CvePS As Integer, CveImpuestoLocal As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_PSImpuestosLocalesAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveImpuestoLocal", SqlDbType.Int).Value = CveImpuestoLocal
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al tratar de agregar datos a la base de datos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
+ Public Function LimpiaImpuestosLocales(CveCliente As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_PSImpuestosLocalesRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CveCliente
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al limpiar la lista de deducciones.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+#End Region
+
+#Region "C O M P U E S T O S"
+ Public Function GetCompuestosActivos(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_CompuestosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el Catálogo de Compuestos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+ End Function
+
+
+
+ Public Function AddCompuestoActivo(Compuesto As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_CompuestosAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Compuesto", SqlDbType.VarChar).Value = Compuesto
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("Ya existe un compuesto activo con el mismo nombre: " & Compuesto & ".", TipoMensaje.MsgAdvertencia)
+ Else
+ Me.OnError("Ocurrió un error al Guardar el compuesto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al Guardar el compuesto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+ Public Function RemoveCompuestoActivo(CveCompuesto As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_CompuestosRemove")
+
+ SqlAdapter.SelectCommand.Parameters.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ Me.OnError("Ocurrió un error al eliminar el compuesto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar el compuesto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+
+ Public Function UpdateCompuestoActivo(Compuesto As String, CveCompuesto As Integer, Estatus As Boolean) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_Gral_CompuestoUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Compuesto", SqlDbType.VarChar).Value = Compuesto
+ .Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el compuesto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "UNIFICAR PRODUCTO"
+ Public Function UnificarPS(CvePSPrincipal As Integer, CvePSUnificado As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_PS_PSUnificar")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePSPrincipal", SqlDbType.Int).Value = CvePSPrincipal
+ .Add("@CvePSUnificado", SqlDbType.Int).Value = CvePSUnificado
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+ OnError("Ocurrió un error al intentar Unificar los Productos o Servicios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ Catch ex As Exception
+ OnError("Ocurrió un error al intentar Unificar los Productos o Servicios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+
+
+#Region "Precios Lista"
+ Public Function GetPSPreciosLista(CveEmpresa As Integer, CvePrecioLista As Integer, Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1,
+ Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PSPrecioListaGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@Estado", SqlDbType.Int).Value = Estado
+ .Add("@Marcas", SqlDbType.VarChar).Value = Marcas
+ .Add("@CveModelo", SqlDbType.Int).Value = CveModelo
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el Catálogo de PS con precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdatePSPreciosLista(Importe As Decimal, CvePrecioLista As Integer, Porcentaje As Decimal, CvePS As Integer, CveUsuario As Integer, Fecha As DateTime, Fijo As Boolean, Optional PrecioMinimo As Decimal = Nothing) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PSPrecioListaAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ If Importe = -1 Then
+ .Add("@Importe", SqlDbType.Float).Value = DBNull.Value
+ Else
+ .Add("@Importe", SqlDbType.Float).Value = Importe
+ End If
+
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+
+ If Porcentaje = -1 Then
+ .Add("@Porcentaje", SqlDbType.Money).Value = DBNull.Value
+ Else
+ .Add("@Porcentaje", SqlDbType.Money).Value = Porcentaje
+ End If
+
+ .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
+
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
+ .Add("@Fijo", SqlDbType.Bit).Value = Fijo
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar los precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdatePSPrecios(Importe As Decimal, CvePrecioLista As Integer, Porcentaje As Decimal, CvePS As Integer, CveUsuario As Integer, Fecha As DateTime, Fijo As Boolean, Optional PrecioMinimo As Decimal = Nothing) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PSPrecioUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ If Importe = -1 Then
+ .Add("@Importe", SqlDbType.Float).Value = DBNull.Value
+ Else
+ .Add("@Importe", SqlDbType.Float).Value = Importe
+ End If
+
+ If Porcentaje = -1 Then
+ .Add("@Porcentaje", SqlDbType.Money).Value = DBNull.Value
+ Else
+ .Add("@Porcentaje", SqlDbType.Money).Value = Porcentaje
+ End If
+
+ .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@Fecha", SqlDbType.DateTime).Value = Fecha
+ .Add("@Fijo", SqlDbType.Bit).Value = Fijo
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar los precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+
+ Public Function GetPSPrecioLista(CvePS As Integer, CveEmpresa As Integer, Optional CvePrecioLista As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosPrecioListaGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los precios de lista para el Producto/Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function GetPSExistencias(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
+ CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
+ Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
+ Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
+ Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ProductosExistenciasGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
+ .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
+ .Add("@Serie", SqlDbType.VarChar).Value = Serie
+ .Add("@Lote", SqlDbType.VarChar).Value = Lote
+ .Add("@Batch", SqlDbType.VarChar).Value = Batch
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
+ .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
+ .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
+ .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function GetPSExistenciasWS(CvePS As Integer, CvePrecioLista As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer,
+ CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
+ Optional FechaMovto As String = "-1", Optional Serie As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
+ Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
+ Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ProductosExistenciasWSGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
+ .Add("@CveSeccionAlmacen", SqlDbType.Int).Value = CveSeccionAlmacen
+ .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@FechaMovto", SqlDbType.DateTime).Value = DateTime.ParseExact(FechaMovto, "yyyy/MM/dd HH:mm", Nothing)
+ .Add("@Serie", SqlDbType.VarChar).Value = Serie
+ .Add("@Lote", SqlDbType.VarChar).Value = Lote
+ .Add("@Batch", SqlDbType.VarChar).Value = Batch
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado
+ .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
+ .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
+ .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las productos y sus existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+#End Region
+
+#Region "Porcentaje Productos"
+ Public Function GetPorcentajeProductos(CveCliente As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeProductosGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los porcentajes de los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddPorcentajeProductos(CveCliente As Integer, CvePS As Integer, PorcentajeProducto As Decimal, CveUsuario As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeProductosAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el porcentaje del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function UpdatePorcentajeProductos(CveCliente As Integer, CvePS As Integer, PorcentajeProducto As Decimal) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeProductosUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el porcentaje del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function RemovePorcentajeProductos(CveCliente As Integer, CvePS As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeProductosRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el porcentaje del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+
+#Region "Porcentaje Marcas de Productos"
+ Public Function GetPorcentajeMarcas(CveCliente As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeMarcasGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los porcentajes de las Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function AddPorcentajeMarcas(CveCliente As Integer, CveMarca As Integer, PorcentajeProducto As Decimal, PorcentajeProducto2 As Decimal, PorcentajeProducto3 As Decimal, CveUsuario As Integer, Optional ProntoPago As Decimal = -1, Optional Plazo As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeMarcasAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
+ .Add("@PorcentajeProducto2", SqlDbType.SmallMoney).Value = PorcentajeProducto2
+ .Add("@PorcentajeProducto3", SqlDbType.SmallMoney).Value = PorcentajeProducto3
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@ProntoPago", SqlDbType.SmallMoney).Value = ProntoPago
+ .Add("@Plazo", SqlDbType.SmallInt).Value = Plazo
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function UpdatePorcentajeMarcas(CveCliente As Integer, CveMarca As Integer, PorcentajeProducto As Decimal, PorcentajeProducto2 As Decimal, PorcentajeProducto3 As Decimal, Optional ProntoPago As Decimal = -1, Optional Plazo As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeMarcasUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+ .Add("@PorcentajeProducto", SqlDbType.SmallMoney).Value = PorcentajeProducto
+ .Add("@PorcentajeProducto2", SqlDbType.SmallMoney).Value = PorcentajeProducto2
+ .Add("@PorcentajeProducto3", SqlDbType.SmallMoney).Value = PorcentajeProducto3
+ .Add("@ProntoPago", SqlDbType.SmallMoney).Value = ProntoPago
+ .Add("@Plazo", SqlDbType.SmallInt).Value = Plazo
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function RemovePorcentajeMarcas(CveCliente As Integer, CveMarca As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PorcentajeMarcasRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
+
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el porcentaje de la Marca.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+#End Region
+#Region "IDisposable Support"
+
+
+ ' IDisposable
+ Protected Overridable Sub Dispose(disposing As Boolean)
+ If Not Me.disposedValue Then
+ If disposing Then
+ ' TODO: dispose managed state (managed objects).
+ If Not Data Is Nothing Then Data.Dispose()
+ If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose()
+ If Not SqlCommand Is Nothing Then SqlCommand.Dispose()
+ If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close()
+ If Not SqlConexion Is Nothing Then SqlConexion.Dispose()
+ End If
+
+ ' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
+ ' TODO: set large fields to null.
+ End If
+ Me.disposedValue = True
+ End Sub
+
+ ' TODO: override Finalize() only if Dispose(disposing As Boolean) above has code to free unmanaged resources.
+ 'Protected Overrides Sub Finalize()
+ ' ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
+ ' Dispose(False)
+ ' MyBase.Finalize()
+ 'End Sub
+
+ ' This code added by Visual Basic to correctly implement the disposable pattern.
+ Public Sub Dispose() Implements IDisposable.Dispose
+ ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above.
+ ConexionClose()
+ Dispose(True)
+ GC.SuppressFinalize(Me)
+ End Sub
+#End Region
+
+
+
+ Public Function GetProductosServiciosSinSAT(Opcion As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosSinSATGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los productos sin SAT.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function UpdateProductosServiciosSAT(CvePS As Integer, CveSATPS As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_ProductosServiciosSATUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveSATPS", SqlDbType.Int).Value = CveSATPS
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la clave SAT del producto o servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetProductosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_ProductosModificadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los productos modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+ Public Function GetPreciosModificados(CveEmpresa As Integer, CvePrecioLista As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_ProductosPreciosModificadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+ .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los precios modificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetExistenciasEmpresa(Codigo As String, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_ProductosExistenciasEmpresaGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Codigo", SqlDbType.VarChar).Value = Codigo
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las existencias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
+ Public Function GetVendedoresModificados(CveEmpresa As Integer, Optional HorasDiferencia As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_VendedoresModificadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@HorasDiferencia", SqlDbType.Int).Value = HorasDiferencia
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los vendedores.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+End Class
diff --git a/App_Code/ClsSisUsuarios.vb b/App_Code/ClsSisUsuarios.vb
index c1f9e640a..d1ff35a2d 100644
--- a/App_Code/ClsSisUsuarios.vb
+++ b/App_Code/ClsSisUsuarios.vb
@@ -191,7 +191,7 @@ Public Class ClsSisUsuarios
End Try
Return Retorno
End Function
- Public Function ValidaUsuario(Usuario As String, Password As String, tIMEI As String, Optional CveEmpresa As Integer = -1) As Usuario
+ Public Function ValidaUsuario(Usuario As String, Password As String, tIMEI As String, Optional CveEmpresa As Integer = -1, Optional CvePlataforma As Integer = -1) As Usuario
Dim Retorno As Usuario = Nothing
DataAdapter("PA_Sis_UsuariosGet")
With SqlAdapter.SelectCommand.Parameters
@@ -199,6 +199,7 @@ Public Class ClsSisUsuarios
.Add("@CveRol", SqlDbType.Int).Value = -1
.Add("@Usuario", SqlDbType.VarChar).Value = Usuario
.Add("@Contraseña", SqlDbType.VarChar).Value = Password
+ .Add("@CvePlataforma", SqlDbType.Int).Value = CvePlataforma
.Add("@EsLogIn", SqlDbType.Bit).Value = 1
End With
Try
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index e36774723..807954b16 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -382,7 +382,7 @@ Namespace Modelos
Me.ListaMensajes = New List(Of String)
Me.FolioFiscal = ""
Me.GenerarPDFFactura = False
- IniciaValores()
+ IniciaValores()
Dim ObjVentas As New ClsVentas()
If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
@@ -414,49 +414,49 @@ Namespace Modelos
TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
- Dim DR As DataRow = TmpDTImpuestos.NewRow()
- If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
- If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
- If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
- If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
- If dtVentas(0)("IVA").ToString.ToDouble >= 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
-
- 'solo para eclipse, que muesre un subtotal debajo de IVA
- If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
- If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
- If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
-
- If dtVentas(0)("IEPS").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IEPS" : DR("Importe") = dtVentas(0)("IEPS").ToString.ToDouble : DR("Orden") = 80 : TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
-
- If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 100 : TmpDTImpuestos.Rows.Add(DR)
+ Dim DR As DataRow = TmpDTImpuestos.NewRow()
+ If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+ If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+ If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+ If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+ If dtVentas(0)("IVA").ToString.ToDouble >= 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
+
+ 'solo para eclipse, que muesre un subtotal debajo de IVA
+ If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+ If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+ If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
- If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
-
- Dim dtImpuesto As DataTable = ObjVentas.DtResultados
- If dtImpuesto.Rows.Count > 0 Then
- For Each Row As DataRow In dtImpuesto.Rows
- Dim Orden = 80
- If Row("Importe").ToString.ToDouble <> 0 Then
- DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
- DR("Importe") = Row("Importe").ToString.ToDouble
- DR("Orden") = Orden
- TmpDTImpuestos.Rows.Add(DR)
- DR = TmpDTImpuestos.NewRow()
- Orden = Orden + 1
- End If
- Next
- End If
- Me.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
-
+ If dtVentas(0)("IEPS").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IEPS" : DR("Importe") = dtVentas(0)("IEPS").ToString.ToDouble : DR("Orden") = 80 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+
+ If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 100 : TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+
+ If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
+
+ Dim dtImpuesto As DataTable = ObjVentas.DtResultados
+ If dtImpuesto.Rows.Count > 0 Then
+ For Each Row As DataRow In dtImpuesto.Rows
+ Dim Orden = 80
+ If Row("Importe").ToString.ToDouble <> 0 Then
+ DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
+ DR("Importe") = Row("Importe").ToString.ToDouble
+ DR("Orden") = Orden
+ TmpDTImpuestos.Rows.Add(DR)
+ DR = TmpDTImpuestos.NewRow()
+ Orden = Orden + 1
+ End If
+ Next
+ End If
+ Me.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
+
End If
End Sub
diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb
index 11f73ffd5..8f1a3f8bf 100644
--- a/Bancos/PopIECompras.aspx.vb
+++ b/Bancos/PopIECompras.aspx.vb
@@ -122,6 +122,14 @@ Partial Class Bancos_PopIECompras
Set(value As Integer)
ViewState("IdCuentaBancaria") = value
End Set
+ End Property
+ Private Property IdCuentaBancariaComplementaria As Integer
+ Get
+ Return ViewState("IdCuentaBancariaComplementaria").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("IdCuentaBancariaComplementaria") = value
+ End Set
End Property
Private ReadOnly Property IdCtaContMonedaExtranjera As Integer
Get
@@ -482,6 +490,7 @@ Partial Class Bancos_PopIECompras
ViewState("IdCtaContRetIVA") = 0
ViewState("IdCtaContRetISR") = 0
ViewState("IdCuentaBancaria") = 0
+ ViewState("IdCuentaBancariaComplementaria") = 0
ViewState("IdCtaAnticipo") = 0
ViewState("CveCuentaMonedaExtranjera") = 0
@@ -1107,9 +1116,9 @@ Partial Class Bancos_PopIECompras
RegistraScript("CambiaDolaresPesos();")
End If
- IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
- CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
-
+ IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
+ IdCuentaBancariaComplementaria = dr("IdCtaContableComplementaria").ToString.ToEntero
+
If dr("UsaTarjeta").ToString = "True" Then
CargaGridTarjetas()
Else
@@ -2814,15 +2823,13 @@ Partial Class Bancos_PopIECompras
CveCuenta = CveCuentaCliente
End If
Else
- IdCtaContable = IdCtaContComplementaria
- CveCuenta = CveCuentaComplementaria
+ IdCtaContable = IdCuentaBancariaComplementaria
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, TxtObservaciones.Text, 204, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, -1, CveProveedor:=CveProveedor2, CvePersonal:=CvePersonal, ImporteMX:=ImporteMovimiento * tipoCambioPago - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioPago, CveCuenta:=CveCuenta) Then
MsgError = "No se pudo insertar la póliza"
End If
ImporteMX = ImporteMovimiento
- IdCtaContable = IdCtaContMonedaExtranjera
- CveCuenta = CveCuentaMonedaExtranjera
+ IdCtaContable = IdCuentaBancaria
End If
End If
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 12b6e23e7..e568e6b2e 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -19628,7 +19628,7 @@ Private Sub CargaNCINV()
If DdlFletes.SelectedValue.ToEntero > 0 Then
Dim ObjInventario As New ClsInventarios
Dim Dr As DataRow = Nothing
- If ObjInventario.GetFletes(UsuarioActual.CveEmpresa, DdlFletes.SelectedValue.ToEntero) Then
+ If ObjInventario.GetFletes(UsuarioActual.CveEmpresa, DdlFletes.SelectedValue.ToEntero, OpcionInventario:=1) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
Dr = ObjInventario.DtResultados.Rows(0)
End If
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 1cd5bf0c5..f70555c28 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -2357,8 +2357,8 @@ Partial Class PopUpVerFactura
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
- params.Add(New ReportParameter("Origen", Almacen))
- params.Add(New ReportParameter("Destino", AlmacenDestino))
+ params.Add(New ReportParameter("Origen", AlmacenDestino)) ' se invierte
+ params.Add(New ReportParameter("Destino", Almacen))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx
index 3f7b5b01f..89b63605c 100644
--- a/Compras/eFacturas.aspx
+++ b/Compras/eFacturas.aspx
@@ -210,7 +210,7 @@
-
+
@@ -236,7 +236,7 @@
<%----%>
-
+
@@ -250,7 +250,7 @@
<%----%>
-
+
@@ -324,7 +324,7 @@
-
+
@@ -348,7 +348,7 @@
-
+
@@ -361,7 +361,7 @@
-
+
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index ed6cba02e..0f8199f3a 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -898,7 +898,7 @@ Partial Class Compras_eFacturas
End If
If e.Row.DBCampo("CveCompra") <> "" Then
- e.Row.FCLiteral("LtlFolio").Text = String.Format("{1}", e.Row.DBCampo("CveCompra"), e.Row.DBCampo("SerieFolio")) '1\Compras\GAPC480413QL3\A-69.xml
+ e.Row.FCLiteral("LtlFolio").Text = String.Format("{1}", e.Row.DBCampo("CveCompra"), e.Row.DBCampo("SerieFolio")) '1\Compras\GAPC480413QL3\A-69.xml
End If
If e.Row.DBCampo("CveProveedor") = "" Then
@@ -1059,7 +1059,7 @@ Partial Class Compras_eFacturas
End If
If e.Row.DBCampo("CveCompra") <> "" Then
- e.Row.FCLiteral("LtlFolio").Text = String.Format("{1}", e.Row.DBCampo("CveCompra"), e.Row.DBCampo("SerieFolio")) '1\Compras\GAPC480413QL3\A-69.xml
+ e.Row.FCLiteral("LtlFolio").Text = String.Format("{1}", e.Row.DBCampo("CveCompra"), e.Row.DBCampo("SerieFolio")) '1\Compras\GAPC480413QL3\A-69.xml
End If
If e.Row.DBCampo("CveProveedor") = "" Then
diff --git a/GPS/WizardDispositivos.aspx.cs b/GPS/WizardDispositivos.aspx.cs
index d82f32cbb..d5d2dcbf0 100644
--- a/GPS/WizardDispositivos.aspx.cs
+++ b/GPS/WizardDispositivos.aspx.cs
@@ -153,7 +153,7 @@ public partial class GPS_WizardDispositivos : ClsPaginas
if (CveDispositivo < 0)
{
TabContainer.ActiveTabIndex = 0;
- Alert("Debe guardar el dispositivo primero");
+ Alert("Debe guardar el dispositivo primero",ModExtensiones.TipoMensaje.MsgAdvertencia );
}
}
@@ -376,7 +376,13 @@ public partial class GPS_WizardDispositivos : ClsPaginas
CargaDatos(CveDispositivo);
Updatos.Update();
string script = "";
- if (GPSNEW == 1) { TabContainer.ActiveTabIndex = 1; script = $"RegresaValor({CveDispositivo})"; }
+ if (GPSNEW == 1) {
+ TabContainer.ActiveTabIndex = 1; script = $"RegresaValor({CveDispositivo})";
+ ClsSisMail correo = new ClsSisMail();
+ Correo.SendMail(UsuarioActual.EmpresaNotificaciones, "paola@adssistemas.mx;Caudillo.90d@gmail.com", "Alta nuevo dispositivo",
+ $"se le informa la alta de un nuevo dispositivo en la empresa \"{UsuarioActual.Empresa.Empresa}\"\r\nIMEI : \"{IMEI}\"\r\nSerie : \"{Serie}\"\r\nModelo : \"{modelo}\"");
+
+ }
Alert("El dispositivo y sus configuraciones, se han guardado correctamente", ModExtensiones.TipoMensaje.MsgInformacion, script);
if (TipoDispositivo == 2)
diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb
index 9fc766030..262c974ff 100644
--- a/Inventarios/AjustesSeccionAlmacen.aspx.vb
+++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb
@@ -13,7 +13,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
End Sub
Private Sub CargaCombos()
- Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,14,16)")
+ Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,12,14,16)")
DdlAlmacen.DataSource = DtAlmacenes
DdlAlmacen.DataBind()
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 8bdefd9e1..48be46fa4 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -952,7 +952,7 @@ Partial Class Inventarios_RecepcionAlmacen
ElseIf CveTipoCompra = 10 Then
CargaAlmacenes(-1, CveTipoCompra:=CveTipoCompra)
ElseIf TipoMovimiento = 3 Then 'devolucion al proveedor
- CargaAlmacenes(-1, "21,2", CveTipoCompra)
+ CargaAlmacenes(-1, "21,2,27", CveTipoCompra)
Else
CargaAlmacenes(-1)
End If
@@ -1021,6 +1021,7 @@ Partial Class Inventarios_RecepcionAlmacen
If UsuarioActual.Empresa.Funcionalidad(594) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(314) Then
DivDocumentos.Visible = True
+ UpDocumentos.Update()
End If
DtDatosDetalle = Nothing
@@ -1184,6 +1185,11 @@ Partial Class Inventarios_RecepcionAlmacen
DivCodigoSeriePS.Visible = False
End If
+ If UsuarioActual.Empresa.Funcionalidad(594) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(314) Then
+ DivDocumentos.Visible = True
+ UpDocumentos.Update()
+ End If
+
End If
Else
BtnGuardar.Visible = False
@@ -1235,6 +1241,11 @@ Partial Class Inventarios_RecepcionAlmacen
DivCodigoSeriePS.Visible = False
End If
+ If UsuarioActual.Empresa.Funcionalidad(594) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(314) Then
+ DivDocumentos.Visible = True
+ UpDocumentos.Update()
+ End If
+
End If
Else
BtnGuardar.Visible = False
@@ -4072,6 +4083,13 @@ Partial Class Inventarios_RecepcionAlmacen
Else
DivCodigoSeriePS.Visible = False
End If
+
+ If UsuarioActual.Empresa.Funcionalidad(594) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(314) Then
+ DivDocumentos.Visible = True
+ UpDocumentos.Update()
+ End If
+
+
CargaGVInv()
Else
diff --git a/LogIn.aspx.vb b/LogIn.aspx.vb
index bff8ad86f..e82ce6868 100644
--- a/LogIn.aspx.vb
+++ b/LogIn.aspx.vb
@@ -198,19 +198,14 @@ Partial Class LogIn
Dim Usuario As Usuario = Nothing
'Dim UsuarioAsignaciones As Usuario = Nothing
- Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI)
+ Dim isgps = Request.Url.Host.ToUpper().Contains("SIGNALSGPS".ToUpper())
+ Usuario = ObjUsuario.ValidaUsuario(txtUsuario.Text, Encripta(TxtContraseña.Text.Trim), IMEI, CvePlataforma:=If(isgps, 3, 1))
'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa)
ADSSessionConfig.sessionUser = Usuario
ADSSessionConfig.sessionDpage = False
ObjUsuario.Dispose()
- Dim isgps = Request.Url.Host.ToUpper().Contains("SIGNALSGPS".ToUpper())
- If Usuario IsNot Nothing AndAlso (
- Usuario.CveRol = 1 OrElse (
- (isgps AndAlso (Usuario.CvePlataforma = 3 OrElse Usuario.CveRol = 1200)) OrElse
- ((Not isgps) AndAlso (Usuario.CvePlataforma <> 3 AndAlso Usuario.CveRol <> 1200))
- )
- ) Then
+ If Usuario IsNot Nothing Then
If Not Usuario.AutorizadoxIP OrElse (HddAdsCodex.Text.Length > 0 AndAlso Usuario.CodigoAutorizado = HddAdsCodex.Text) Then
CreaObjetoEmpresa(Usuario)
diff --git a/OC/RepSolicitudesAnticipo.aspx b/OC/RepSolicitudesAnticipo.aspx
index c5dff3a24..940525eab 100644
--- a/OC/RepSolicitudesAnticipo.aspx
+++ b/OC/RepSolicitudesAnticipo.aspx
@@ -117,7 +117,9 @@
-
+
+
+
@@ -125,12 +127,12 @@
-
+
-
+
diff --git a/RH/Personal.aspx b/RH/Personal.aspx
index bdcf23ec5..f98389e8e 100644
--- a/RH/Personal.aspx
+++ b/RH/Personal.aspx
@@ -3923,12 +3923,21 @@
+
+
+
+
+
+
+
+
+
Cantidad:
-
+
diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb
index 55f7be7e1..0224875e2 100644
--- a/RH/Personal.aspx.vb
+++ b/RH/Personal.aspx.vb
@@ -1,948 +1,948 @@
-Option Explicit On
-Option Strict On
-
-Imports Extensiones
-'Imports System.Runtime.InteropServices
-Imports System.IO
-'Imports Word = Microsoft.Office.Interop.Word
-Imports System.Data
-Imports Microsoft.Reporting.WebForms
-Imports System.Globalization
-Imports System.Xml
-Imports System.Web.Script.Services
-
-Partial Class RH_Personal
+Option Explicit On
+Option Strict On
+
+Imports Extensiones
+'Imports System.Runtime.InteropServices
+Imports System.IO
+'Imports Word = Microsoft.Office.Interop.Word
+Imports System.Data
+Imports Microsoft.Reporting.WebForms
+Imports System.Globalization
+Imports System.Xml
+Imports System.Web.Script.Services
+
+Partial Class RH_Personal
Inherits ClsPaginas
-#Region "P R O P I E D A D E S"
- Private Property DTCuentasBancos As DataTable
- Get
- Return CType(ViewState("DTCuentasBancos"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DTCuentasBancos") = value
- End Set
- End Property
- Private Property DTLicencias As DataTable
- Get
- Return CType(ViewState("DTLicencias"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DTLicencias") = value
- End Set
- End Property
- Private Property TempDTCuentasBancos As DataTable
- Get
- Return CType(ViewState("TempDTCuentasBancos"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("TempDTCuentasBancos") = value
- End Set
- End Property
- Private Property DTDocumentacion As DataTable
- Get
- If ViewState("DTDocumentacion") Is Nothing Then
- Return New DataTable
- Else
- Return DirectCast(ViewState("DTDocumentacion"), DataTable)
- End If
- End Get
- Set(value As DataTable)
- ViewState("DTDocumentacion") = value
- End Set
- End Property
- Property NombreCompleto As String
- Get
- If ViewState("NombreCompleto") Is Nothing Then
- Return ""
- Else
- Return ViewState("NombreCompleto").ToString()
- End If
- End Get
- Set(value As String)
- ViewState("NombreCompleto") = value
- End Set
- End Property
- Property CredencialElector As String
- Get
- If ViewState("CredencialElector") Is Nothing Then
- Return "-1"
- Else
- Return ViewState("CredencialElector").ToString()
- End If
- End Get
- Set(value As String)
- ViewState("CredencialElector") = value
- End Set
- End Property
- Property Documentacion As String
- Get
- If ViewState("Documentacion") Is Nothing Then
- Return "-1"
- Else
- Return ViewState("Documentacion").ToString()
- End If
- End Get
- Set(value As String)
- ViewState("Documentacion") = value
- End Set
- End Property
- Property CveDocumentacion As Integer
- Get
- If ViewState("CveDocumentacion") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("CveDocumentacion"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("CveDocumentacion") = value
- End Set
- End Property
- Property CveDocumentacionElectronica As Integer
- Get
- If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("CvePersonalClienteDocumentacion") = value
- End Set
- End Property
- Property ActualizarDocumentacion As Boolean
- Get
- If ViewState("ActualizarDocumentacion") Is Nothing Then
- Return True
- Else
- Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean)
- End If
- End Get
- Set(value As Boolean)
- ViewState("ActualizarDocumentacion") = value
- End Set
- End Property
- Private Property FechaLimite As Date
- Get
- If ViewState("FechaLimite") Is Nothing Then
- Return Date.Now.AddDays(15)
- Else
- Return ViewState("FechaLimite").ToString().ToDate
- End If
- End Get
- Set(value As Date)
- ViewState("FechaLimite") = value
- End Set
-
- End Property
- Property Estatus As Integer
- Get
- If ViewState("Estatus") Is Nothing Then
- Return 0
- Else
- Return DirectCast(ViewState("Estatus"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("Estatus") = value
- End Set
- End Property
- Property ObservacionDocumentacion As String
- Get
- If ViewState("ObservacionDocumentacion") Is Nothing Then
- Return ""
- Else
- Return ViewState("ObservacionDocumentacion").ToString()
- End If
- End Get
- Set(value As String)
- ViewState("ObservacionDocumentacion") = value
- End Set
- End Property
- Property AdjuntoDocumentacion As String
- Get
- If ViewState("AdjuntoDocumentacion") Is Nothing Then
- Return ""
- Else
- Return ViewState("AdjuntoDocumentacion").ToString()
- End If
- End Get
- Set(value As String)
- ViewState("AdjuntoDocumentacion") = value
- End Set
- End Property
- Private ReadOnly Property CvePersonal As Integer
- Get
- If ViewState("CvePersonal") Is Nothing Then
- Return -1
- Else
- Return ViewState("CvePersonal").ToString().ToEntero
- End If
- End Get
- End Property
- Private Property DtCuentasContables As Data.DataTable
- Get
- Return CType(ViewState("DtCuentasContables"), DataTable)
- End Get
- Set(value As Data.DataTable)
- ViewState("DtCuentasContables") = value
- End Set
- End Property
- Private ReadOnly Property SendMail As String
- Get
- Return ViewState("SendMail").ToString()
- End Get
- End Property
- Private ReadOnly Property SendMailPassword As String
- Get
- Return ViewState("SendMailPassword").ToString()
- End Get
- End Property
-
- Private ReadOnly Property CveUniforme As Integer
- Get
- If ViewState("CveUniforme") Is Nothing Then
- Return -1
- Else
- Return ViewState("CveUniforme").ToString().ToEntero
- End If
- End Get
- End Property
- Private Property DTConsumos As DataTable
- Get
- Return CType(ViewState("DTConsumos"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DTConsumos") = value
- End Set
- End Property
- Private Property DTViaticosDetalle As DataTable
- Get
- Return CType(ViewState("DTViaticosDetalle"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DTViaticosDetalle") = value
- End Set
- End Property
- Private Property DTGastosSinComp As DataTable
- Get
- Return CType(ViewState("DTGastosSinComp"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DTGastosSinComp") = value
- End Set
- End Property
- Private Property DTGastosPorCheque As DataTable
- Get
- Return CType(ViewState("DTGastosPorCheque"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DTGastosPorCheque") = value
- End Set
- End Property
-
- Private Property CvePersonalEstatusInicial As Integer
- Get
- If ViewState("CvePersonalEstatusInicial") Is Nothing Then
- Return -1
- Else
- Return ViewState("CvePersonalEstatusInicial").ToString().ToEntero
- End If
- End Get
- Set(value As Integer)
- ViewState("CvePersonalEstatusInicial") = value
- End Set
- End Property
-
- Private Property UniformesInfo As DataTable
- Get
- Return CType(ViewState("UniformesInfo"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("UniformesInfo") = value
- End Set
- End Property
-
- Private Property CveAlmacenUniforme As Integer
- Get
- Return CInt(ViewState("CveAlmacenUniforme"))
- End Get
- Set(value As Integer)
- ViewState("CveAlmacenUniforme") = value
- End Set
+#Region "P R O P I E D A D E S"
+ Private Property DTCuentasBancos As DataTable
+ Get
+ Return CType(ViewState("DTCuentasBancos"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTCuentasBancos") = value
+ End Set
End Property
- Private Property CveSeccionAlmacenUniforme As Integer
- Get
- Return CInt(ViewState("CveSeccionAlmacenUniforme"))
- End Get
- Set(value As Integer)
- ViewState("CveSeccionAlmacenUniforme") = value
- End Set
- End Property
-
- Private Property DescripcionUniforme As String
- Get
- Return CStr(ViewState("DescripcionUniforme"))
- End Get
- Set(value As String)
- ViewState("DescripcionUniforme") = value
- End Set
- End Property
-
- Private Property CveUM As Integer
- Get
- Return CInt(ViewState("CveUM"))
- End Get
- Set(value As Integer)
- ViewState("CveUM") = value
- End Set
- End Property
-
- Private Property CvePS As Integer
- Get
- Return CInt(ViewState("CvePS"))
- End Get
- Set(value As Integer)
- ViewState("CvePS") = value
- End Set
- End Property
-
- Private Property PU As Decimal
- Get
- Return ViewState("PU").ToString.ToDecimal
- End Get
- Set(value As Decimal)
- ViewState("PU") = value
- End Set
- End Property
- Private Property CveMovimientoUniforme As Integer
- Get
- Return CInt(ViewState("CveMovimientoUniforme"))
- End Get
- Set(value As Integer)
- ViewState("CveMovimientoUniforme") = value
- End Set
- End Property
- Private Property CveMovimientoDetalleUniforme As Integer
- Get
- Return CInt(ViewState("CveMovimientoDetalleUniforme"))
- End Get
- Set(value As Integer)
- ViewState("CveMovimientoDetalleUniforme") = value
- End Set
+ Private Property DTLicencias As DataTable
+ Get
+ Return CType(ViewState("DTLicencias"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTLicencias") = value
+ End Set
+ End Property
+ Private Property TempDTCuentasBancos As DataTable
+ Get
+ Return CType(ViewState("TempDTCuentasBancos"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("TempDTCuentasBancos") = value
+ End Set
+ End Property
+ Private Property DTDocumentacion As DataTable
+ Get
+ If ViewState("DTDocumentacion") Is Nothing Then
+ Return New DataTable
+ Else
+ Return DirectCast(ViewState("DTDocumentacion"), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ ViewState("DTDocumentacion") = value
+ End Set
+ End Property
+ Property NombreCompleto As String
+ Get
+ If ViewState("NombreCompleto") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("NombreCompleto").ToString()
+ End If
+ End Get
+ Set(value As String)
+ ViewState("NombreCompleto") = value
+ End Set
+ End Property
+ Property CredencialElector As String
+ Get
+ If ViewState("CredencialElector") Is Nothing Then
+ Return "-1"
+ Else
+ Return ViewState("CredencialElector").ToString()
+ End If
+ End Get
+ Set(value As String)
+ ViewState("CredencialElector") = value
+ End Set
+ End Property
+ Property Documentacion As String
+ Get
+ If ViewState("Documentacion") Is Nothing Then
+ Return "-1"
+ Else
+ Return ViewState("Documentacion").ToString()
+ End If
+ End Get
+ Set(value As String)
+ ViewState("Documentacion") = value
+ End Set
+ End Property
+ Property CveDocumentacion As Integer
+ Get
+ If ViewState("CveDocumentacion") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("CveDocumentacion"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CveDocumentacion") = value
+ End Set
+ End Property
+ Property CveDocumentacionElectronica As Integer
+ Get
+ If ViewState("CvePersonalClienteDocumentacion") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("CvePersonalClienteDocumentacion"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CvePersonalClienteDocumentacion") = value
+ End Set
+ End Property
+ Property ActualizarDocumentacion As Boolean
+ Get
+ If ViewState("ActualizarDocumentacion") Is Nothing Then
+ Return True
+ Else
+ Return DirectCast(ViewState("ActualizarDocumentacion"), Boolean)
+ End If
+ End Get
+ Set(value As Boolean)
+ ViewState("ActualizarDocumentacion") = value
+ End Set
+ End Property
+ Private Property FechaLimite As Date
+ Get
+ If ViewState("FechaLimite") Is Nothing Then
+ Return Date.Now.AddDays(15)
+ Else
+ Return ViewState("FechaLimite").ToString().ToDate
+ End If
+ End Get
+ Set(value As Date)
+ ViewState("FechaLimite") = value
+ End Set
+
+ End Property
+ Property Estatus As Integer
+ Get
+ If ViewState("Estatus") Is Nothing Then
+ Return 0
+ Else
+ Return DirectCast(ViewState("Estatus"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("Estatus") = value
+ End Set
+ End Property
+ Property ObservacionDocumentacion As String
+ Get
+ If ViewState("ObservacionDocumentacion") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("ObservacionDocumentacion").ToString()
+ End If
+ End Get
+ Set(value As String)
+ ViewState("ObservacionDocumentacion") = value
+ End Set
+ End Property
+ Property AdjuntoDocumentacion As String
+ Get
+ If ViewState("AdjuntoDocumentacion") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("AdjuntoDocumentacion").ToString()
+ End If
+ End Get
+ Set(value As String)
+ ViewState("AdjuntoDocumentacion") = value
+ End Set
+ End Property
+ Private ReadOnly Property CvePersonal As Integer
+ Get
+ If ViewState("CvePersonal") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CvePersonal").ToString().ToEntero
+ End If
+ End Get
+ End Property
+ Private Property DtCuentasContables As Data.DataTable
+ Get
+ Return CType(ViewState("DtCuentasContables"), DataTable)
+ End Get
+ Set(value As Data.DataTable)
+ ViewState("DtCuentasContables") = value
+ End Set
+ End Property
+ Private ReadOnly Property SendMail As String
+ Get
+ Return ViewState("SendMail").ToString()
+ End Get
+ End Property
+ Private ReadOnly Property SendMailPassword As String
+ Get
+ Return ViewState("SendMailPassword").ToString()
+ End Get
+ End Property
+
+ Private ReadOnly Property CveUniforme As Integer
+ Get
+ If ViewState("CveUniforme") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CveUniforme").ToString().ToEntero
+ End If
+ End Get
+ End Property
+ Private Property DTConsumos As DataTable
+ Get
+ Return CType(ViewState("DTConsumos"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTConsumos") = value
+ End Set
+ End Property
+ Private Property DTViaticosDetalle As DataTable
+ Get
+ Return CType(ViewState("DTViaticosDetalle"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTViaticosDetalle") = value
+ End Set
+ End Property
+ Private Property DTGastosSinComp As DataTable
+ Get
+ Return CType(ViewState("DTGastosSinComp"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTGastosSinComp") = value
+ End Set
+ End Property
+ Private Property DTGastosPorCheque As DataTable
+ Get
+ Return CType(ViewState("DTGastosPorCheque"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTGastosPorCheque") = value
+ End Set
+ End Property
+
+ Private Property CvePersonalEstatusInicial As Integer
+ Get
+ If ViewState("CvePersonalEstatusInicial") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CvePersonalEstatusInicial").ToString().ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CvePersonalEstatusInicial") = value
+ End Set
+ End Property
+
+ Private Property UniformesInfo As DataTable
+ Get
+ Return CType(ViewState("UniformesInfo"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("UniformesInfo") = value
+ End Set
+ End Property
+
+ Private Property CveAlmacenUniforme As Integer
+ Get
+ Return CInt(ViewState("CveAlmacenUniforme"))
+ End Get
+ Set(value As Integer)
+ ViewState("CveAlmacenUniforme") = value
+ End Set
+ End Property
+ Private Property CveSeccionAlmacenUniforme As Integer
+ Get
+ Return CInt(ViewState("CveSeccionAlmacenUniforme"))
+ End Get
+ Set(value As Integer)
+ ViewState("CveSeccionAlmacenUniforme") = value
+ End Set
+ End Property
+
+ Private Property DescripcionUniforme As String
+ Get
+ Return CStr(ViewState("DescripcionUniforme"))
+ End Get
+ Set(value As String)
+ ViewState("DescripcionUniforme") = value
+ End Set
+ End Property
+
+ Private Property CveUM As Integer
+ Get
+ Return CInt(ViewState("CveUM"))
+ End Get
+ Set(value As Integer)
+ ViewState("CveUM") = value
+ End Set
+ End Property
+
+ Private Property CvePS As Integer
+ Get
+ Return CInt(ViewState("CvePS"))
+ End Get
+ Set(value As Integer)
+ ViewState("CvePS") = value
+ End Set
+ End Property
+
+ Private Property PU As Decimal
+ Get
+ Return ViewState("PU").ToString.ToDecimal
+ End Get
+ Set(value As Decimal)
+ ViewState("PU") = value
+ End Set
+ End Property
+ Private Property CveMovimientoUniforme As Integer
+ Get
+ Return CInt(ViewState("CveMovimientoUniforme"))
+ End Get
+ Set(value As Integer)
+ ViewState("CveMovimientoUniforme") = value
+ End Set
+ End Property
+ Private Property CveMovimientoDetalleUniforme As Integer
+ Get
+ Return CInt(ViewState("CveMovimientoDetalleUniforme"))
+ End Get
+ Set(value As Integer)
+ ViewState("CveMovimientoDetalleUniforme") = value
+ End Set
End Property
-#End Region
+#End Region
-#Region "V A C A C I O N E S - P E R M I S O S"
+#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
- Return Now
- Else
- Return DirectCast(ViewState("VacInicioPeriodo"), Date)
- End If
- End Get
- Set(value As Date)
- ViewState("VacInicioPeriodo") = value
- End Set
- End Property
- Private Property VacFinPeriodo As Date
- Get
- If ViewState("VacFinPeriodo") Is Nothing Then
- Return Now
- Else
- Return DirectCast(ViewState("VacFinPeriodo"), Date)
- End If
- End Get
- Set(value As Date)
- ViewState("VacFinPeriodo") = value
- End Set
- End Property
-
- Private Property VacAnios As Integer
- Get
- If ViewState("VacAnios") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("VacAnios"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("VacAnios") = value
- End Set
- End Property
-
-
- Private Property VacDias As Integer
- Get
- If ViewState("VacDias") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("VacDias"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("VacDias") = value
- End Set
- End Property
-
- Private Property VacDiasUsados As Integer
- Get
- If ViewState("VacDiasUsados") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("VacDiasUsados"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("VacDiasUsados") = value
- End Set
- End Property
-
- Private Property VacDiasCancelados As Integer
- Get
- If ViewState("VacDiasCancelados") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("VacDiasCancelados"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("VacDiasCancelados") = value
- End Set
- End Property
-
- Private Property VacDiasDisponibles As Integer
- Get
- If ViewState("VacDiasDisponibles") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("VacDiasDisponibles"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("VacDiasDisponibles") = value
- End Set
- End Property
-
-
- Private Property VacSupervisorNombre As String
- Get
- If ViewState("VacSupervisorNombre") Is Nothing Then
- Return ""
- Else
- Return ViewState("VacSupervisorNombre").ToString()
- End If
- End Get
- Set(value As String)
- ViewState("VacSupervisorNombre") = value
- End Set
- End Property
-
- Private Property VacSupervisorCorreo As String
- Get
- If ViewState("VacSupervisorCorreo") Is Nothing Then
- Return ""
- Else
- Return ViewState("VacSupervisorCorreo").ToString()
- End If
- End Get
- Set(value As String)
- ViewState("VacSupervisorCorreo") = value
- End Set
- End Property
-
- Private Property VacCveSupervisor As Integer
- Get
- If ViewState("VacCveSupervisor") Is Nothing Then
- Return -1
- Else
- Return ViewState("VacCveSupervisor").ToString().ToEntero
- End If
- End Get
- Set(value As Integer)
- ViewState("VacCveSupervisor") = value
- End Set
- End Property
-
-
- Private Property VacFolioActual As Integer
- Get
- If ViewState("VacFolioActual") Is Nothing Then
- Return 0
- Else
- Return DirectCast(ViewState("VacFolioActual"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("VacFolioActual") = value
- End Set
- End Property
-
- Private Property CvePersonalVacaciones As Integer
- Get
- If ViewState("CvePersonalVacaciones") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("CvePersonalVacaciones"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("CvePersonalVacaciones") = value
- End Set
- End Property
-
-
- Private Property VacDiaActivo As Boolean
- Get
- If ViewState("VacDiaActivo") Is Nothing Then
- Return False
- Else
- Return DirectCast(ViewState("VacDiaActivo"), Boolean)
- End If
- End Get
- Set(value As Boolean)
- ViewState("VacDiaActivo") = value
- End Set
- End Property
-
-
- Private Property VacFolio As Integer
- Get
- If ViewState("VacFolio") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("VacFolio"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("VacFolio") = value
- End Set
- End Property
-
-
-
- Private Property CvePermiso As Integer
- Get
- If ViewState("CvePermiso") Is Nothing Then
- Return -1
- Else
- Return ViewState("CvePermiso").ToString().ToEntero
- End If
- End Get
- Set(value As Integer)
- ViewState("CvePermiso") = value
- End Set
+ Private Property VacInicioPeriodo As Date
+ Get
+ If ViewState("VacInicioPeriodo") Is Nothing Then
+ Return Now
+ Else
+ Return DirectCast(ViewState("VacInicioPeriodo"), Date)
+ End If
+ End Get
+ Set(value As Date)
+ ViewState("VacInicioPeriodo") = value
+ End Set
+ End Property
+ Private Property VacFinPeriodo As Date
+ Get
+ If ViewState("VacFinPeriodo") Is Nothing Then
+ Return Now
+ Else
+ Return DirectCast(ViewState("VacFinPeriodo"), Date)
+ End If
+ End Get
+ Set(value As Date)
+ ViewState("VacFinPeriodo") = value
+ End Set
End Property
-#End Region
-
-
-#Region "PROPIEDADES FAMILIARES"
-
- Private Property ActualizarFamiliar As Boolean
- Get
- If ViewState("ActualizarFamiliar") Is Nothing Then
- Return True
- Else
- Return DirectCast(ViewState("ActualizarFamiliar"), Boolean)
-
- End If
- End Get
- Set(value As Boolean)
- ViewState("ActualizarFamiliar") = value
- End Set
- End Property
- Private Property CveFamiliar As Integer
- Get
- If ViewState("CveFamiliar") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("CveFamiliar"), Integer)
- End If
-
- End Get
- Set(value As Integer)
- ViewState("CveFamiliar") = value
- End Set
- End Property
-
- Private Property IndexActual As Integer
- Get
- If ViewState("IndexActual") Is Nothing Then
- Return -1
- Else
- Return DirectCast(ViewState("IndexActual"), Integer)
- End If
- End Get
- Set(value As Integer)
- ViewState("IndexActual") = value
- End Set
- End Property
-
- Property DTFamiliares As DataTable
- Get
- Return DirectCast(ViewState("DTFamiliares"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DTFamiliares") = value
- End Set
- End Property
-
-
- Private Property ValPadre As Boolean
- Get
- If ViewState("ValPadre") Is Nothing Then
- Return False
- Else
- Return DirectCast(ViewState("ValPadre"), Boolean)
- End If
- End Get
- Set(value As Boolean)
- ViewState("ValPadre") = value
- End Set
- End Property
-
- Private Property ValMadre As Boolean
- Get
- If ViewState("ValMadre") Is Nothing Then
- Return False
- Else
- Return DirectCast(ViewState("ValMadre"), Boolean)
- End If
- End Get
- Set(value As Boolean)
- ViewState("ValMadre") = value
- End Set
+ Private Property VacAnios As Integer
+ Get
+ If ViewState("VacAnios") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("VacAnios"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacAnios") = value
+ End Set
End Property
- Private Property DocumentoParametros As String
- Get
- If ViewState("DocumentoParametros") Is Nothing Then
- Return ""
- Else
+ Private Property VacDias As Integer
+ Get
+ If ViewState("VacDias") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("VacDias"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacDias") = value
+ End Set
+ End Property
+
+ Private Property VacDiasUsados As Integer
+ Get
+ If ViewState("VacDiasUsados") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("VacDiasUsados"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacDiasUsados") = value
+ End Set
+ End Property
+
+ Private Property VacDiasCancelados As Integer
+ Get
+ If ViewState("VacDiasCancelados") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("VacDiasCancelados"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacDiasCancelados") = value
+ End Set
+ End Property
+
+ Private Property VacDiasDisponibles As Integer
+ Get
+ If ViewState("VacDiasDisponibles") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("VacDiasDisponibles"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacDiasDisponibles") = value
+ End Set
+ End Property
+
+
+ Private Property VacSupervisorNombre As String
+ Get
+ If ViewState("VacSupervisorNombre") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("VacSupervisorNombre").ToString()
+ End If
+ End Get
+ Set(value As String)
+ ViewState("VacSupervisorNombre") = value
+ End Set
+ End Property
+
+ Private Property VacSupervisorCorreo As String
+ Get
+ If ViewState("VacSupervisorCorreo") Is Nothing Then
+ Return ""
+ Else
+ Return ViewState("VacSupervisorCorreo").ToString()
+ End If
+ End Get
+ Set(value As String)
+ ViewState("VacSupervisorCorreo") = value
+ End Set
+ End Property
+
+ Private Property VacCveSupervisor As Integer
+ Get
+ If ViewState("VacCveSupervisor") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("VacCveSupervisor").ToString().ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacCveSupervisor") = value
+ End Set
+ End Property
+
+
+ Private Property VacFolioActual As Integer
+ Get
+ If ViewState("VacFolioActual") Is Nothing Then
+ Return 0
+ Else
+ Return DirectCast(ViewState("VacFolioActual"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacFolioActual") = value
+ End Set
+ End Property
+
+ Private Property CvePersonalVacaciones As Integer
+ Get
+ If ViewState("CvePersonalVacaciones") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("CvePersonalVacaciones"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CvePersonalVacaciones") = value
+ End Set
+ End Property
+
+
+ Private Property VacDiaActivo As Boolean
+ Get
+ If ViewState("VacDiaActivo") Is Nothing Then
+ Return False
+ Else
+ Return DirectCast(ViewState("VacDiaActivo"), Boolean)
+ End If
+ End Get
+ Set(value As Boolean)
+ ViewState("VacDiaActivo") = value
+ End Set
+ End Property
+
+
+ Private Property VacFolio As Integer
+ Get
+ If ViewState("VacFolio") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("VacFolio"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("VacFolio") = value
+ End Set
+ End Property
+
+
+
+ Private Property CvePermiso As Integer
+ Get
+ If ViewState("CvePermiso") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CvePermiso").ToString().ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CvePermiso") = value
+ End Set
+ End Property
+
+#End Region
+
+
+#Region "PROPIEDADES FAMILIARES"
+
+ Private Property ActualizarFamiliar As Boolean
+ Get
+ If ViewState("ActualizarFamiliar") Is Nothing Then
+ Return True
+ Else
+ Return DirectCast(ViewState("ActualizarFamiliar"), Boolean)
+
+ End If
+ End Get
+ Set(value As Boolean)
+ ViewState("ActualizarFamiliar") = value
+ End Set
+ End Property
+ Private Property CveFamiliar As Integer
+ Get
+ If ViewState("CveFamiliar") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("CveFamiliar"), Integer)
+ End If
+
+ End Get
+ Set(value As Integer)
+ ViewState("CveFamiliar") = value
+ End Set
+ End Property
+
+ Private Property IndexActual As Integer
+ Get
+ If ViewState("IndexActual") Is Nothing Then
+ Return -1
+ Else
+ Return DirectCast(ViewState("IndexActual"), Integer)
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("IndexActual") = value
+ End Set
+ End Property
+
+ Property DTFamiliares As DataTable
+ Get
+ Return DirectCast(ViewState("DTFamiliares"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DTFamiliares") = value
+ End Set
+ End Property
+
+
+ Private Property ValPadre As Boolean
+ Get
+ If ViewState("ValPadre") Is Nothing Then
+ Return False
+ Else
+ Return DirectCast(ViewState("ValPadre"), Boolean)
+ End If
+ End Get
+ Set(value As Boolean)
+ ViewState("ValPadre") = value
+ End Set
+ End Property
+
+ Private Property ValMadre As Boolean
+ Get
+ If ViewState("ValMadre") Is Nothing Then
+ Return False
+ Else
+ Return DirectCast(ViewState("ValMadre"), Boolean)
+ End If
+ End Get
+ Set(value As Boolean)
+ ViewState("ValMadre") = value
+ End Set
+ End Property
+
+
+ Private Property DocumentoParametros As String
+ Get
+ If ViewState("DocumentoParametros") Is Nothing Then
+ Return ""
+ Else
Return ViewState("DocumentoParametros").ToString
- End If
- End Get
- Set(value As String)
- ViewState("DocumentoParametros") = value
- End Set
+ End If
+ End Get
+ Set(value As String)
+ ViewState("DocumentoParametros") = value
+ End Set
End Property
-#End Region
+#End Region
- Private Shared Function sendURL(ByVal URL As String, Optional Methodo As String = "POST", Optional Cookie As String = "", Optional maxTimeMilliseconds As Integer = 120000) As String
- Dim resultado As String = ""
-
- Try
- Dim request As Net.HttpWebRequest = CType(Net.HttpWebRequest.Create(URL), Net.HttpWebRequest)
- request.Timeout = maxTimeMilliseconds
- request.Method = Methodo
- request.ContentType = "text/html; charset=utf-8" '"text/xml; charset=utf-8"
-
- If Not String.IsNullOrEmpty(Cookie) Then
- request.Headers.Add("Cookie", Cookie)
- End If
-
- 'Using stream As IO.Stream = request.GetRequestStream()
-
- ' Using stmw As IO.StreamWriter = New IO.StreamWriter(stream)
- ' stmw.Write("")
- ' End Using
- 'End Using
-
- Dim response As Net.WebResponse = CType(request.GetResponse(), Net.WebResponse)
- Dim sr As IO.StreamReader = New IO.StreamReader(response.GetResponseStream())
- resultado = sr.ReadToEnd()
- sr.Close()
- Catch ex As Exception
- ex.ToString().GuardaLog()
- 'Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}")
- End Try
-
- Return resultado
- End Function
- '
-
- Public Shared Function gettingCURP(ByVal Curp As String, year As Integer) As String
- Dim abc As String() = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
- Dim numeric01 As String() = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
- Dim rule1 As String() = If(year < 2000, numeric01, abc)
- Dim curpresult As String = ""
- Dim i As Integer = 0
- While Curp.Length = 0 AndAlso i < rule1.Length
- Dim z As Integer = 0
- While Curp.Length = 0 AndAlso z < numeric01.Length
- curpresult = String.Format("{0}{1}{2}", Curp, rule1(i), numeric01(z))
- Dim respuesta As String = sendURL(String.Format("http://www.renapo.sep.gob.mx/wsrenapo/MainControllerParam?curp={0}", curpresult), "GET")
-
- Dim trlines As New List(Of String)
- Dim keydict As New System.Collections.Concurrent.ConcurrentDictionary(Of String, String)
-
- Dim indexttr As Integer = 0
- Dim indexttrB As Integer = 0
- Dim indexttd As Integer = 0
- Dim indextdiv As Integer = 0
- Dim indexinittext As Integer = 0
- While Not IsNothing(respuesta) AndAlso respuesta.Length > 0
- indexttr = respuesta.IndexOf("
= 0 Then
- indexttrB = respuesta.Substring(indexttr + 3).IndexOf("
= 0 Then
- trlines.Add(respuesta.Substring(indexttr, indexttrB))
- Else
- trlines.Add(respuesta.Substring(indexttr))
-
- End If
- respuesta = respuesta.Substring(indexttr + 3)
- Else
- respuesta = ""
- End If
-
- End While
-
- Dim key As String = ""
- Dim keyvalue As String = ""
- For Each item As String In trlines
- key = ""
- keyvalue = ""
- indexttd = item.IndexOf("
= 0 Then
- indexttr = indextdiv
- indexttrB = item.IndexOf("= 0 Then
- indexinittext = item.Substring(indexttr + 3).IndexOf(">")
- keyvalue = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4)))
-
- item = item.Substring(indexttr + 3)
- Else
- item = ""
- End If
-
- End If
- If key.Length > 0 Then
- keydict.TryAdd(key.Replace(":", "").Trim(), keyvalue.Trim().ToLower())
- End If
- Next
- Dim Apellido1 As String = "" : keydict.TryGetValue("Apellido1", Apellido1)
- Dim Apellido2 As String = "" : keydict.TryGetValue("Apellido1", Apellido1)
- Dim Nombres As String = "" : keydict.TryGetValue("Nombres", Nombres)
- If Nombres Is Nothing OrElse Nombres.Length = 0 Then
- curpresult = ""
- End If
- z = z + 1
- End While
- i = i + 1
- End While
- Return curpresult
- End Function
-
- Const wdPageBreak As Integer = 7
+ Private Shared Function sendURL(ByVal URL As String, Optional Methodo As String = "POST", Optional Cookie As String = "", Optional maxTimeMilliseconds As Integer = 120000) As String
+ Dim resultado As String = ""
+
+ Try
+ Dim request As Net.HttpWebRequest = CType(Net.HttpWebRequest.Create(URL), Net.HttpWebRequest)
+ request.Timeout = maxTimeMilliseconds
+ request.Method = Methodo
+ request.ContentType = "text/html; charset=utf-8" '"text/xml; charset=utf-8"
+
+ If Not String.IsNullOrEmpty(Cookie) Then
+ request.Headers.Add("Cookie", Cookie)
+ End If
+
+ 'Using stream As IO.Stream = request.GetRequestStream()
+
+ ' Using stmw As IO.StreamWriter = New IO.StreamWriter(stream)
+ ' stmw.Write("")
+ ' End Using
+ 'End Using
+
+ Dim response As Net.WebResponse = CType(request.GetResponse(), Net.WebResponse)
+ Dim sr As IO.StreamReader = New IO.StreamReader(response.GetResponseStream())
+ resultado = sr.ReadToEnd()
+ sr.Close()
+ Catch ex As Exception
+ ex.ToString().GuardaLog()
+ 'Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}")
+ End Try
+
+ Return resultado
+ End Function
+ '
+
+ Public Shared Function gettingCURP(ByVal Curp As String, year As Integer) As String
+ Dim abc As String() = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
+ Dim numeric01 As String() = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
+ Dim rule1 As String() = If(year < 2000, numeric01, abc)
+ Dim curpresult As String = ""
+ Dim i As Integer = 0
+ While Curp.Length = 0 AndAlso i < rule1.Length
+ Dim z As Integer = 0
+ While Curp.Length = 0 AndAlso z < numeric01.Length
+ curpresult = String.Format("{0}{1}{2}", Curp, rule1(i), numeric01(z))
+ Dim respuesta As String = sendURL(String.Format("http://www.renapo.sep.gob.mx/wsrenapo/MainControllerParam?curp={0}", curpresult), "GET")
+
+ Dim trlines As New List(Of String)
+ Dim keydict As New System.Collections.Concurrent.ConcurrentDictionary(Of String, String)
+
+ Dim indexttr As Integer = 0
+ Dim indexttrB As Integer = 0
+ Dim indexttd As Integer = 0
+ Dim indextdiv As Integer = 0
+ Dim indexinittext As Integer = 0
+ While Not IsNothing(respuesta) AndAlso respuesta.Length > 0
+ indexttr = respuesta.IndexOf("
= 0 Then
+ indexttrB = respuesta.Substring(indexttr + 3).IndexOf("
= 0 Then
+ trlines.Add(respuesta.Substring(indexttr, indexttrB))
+ Else
+ trlines.Add(respuesta.Substring(indexttr))
+
+ End If
+ respuesta = respuesta.Substring(indexttr + 3)
+ Else
+ respuesta = ""
+ End If
+
+ End While
+
+ Dim key As String = ""
+ Dim keyvalue As String = ""
+ For Each item As String In trlines
+ key = ""
+ keyvalue = ""
+ indexttd = item.IndexOf("
= 0 Then
+ indexttr = indextdiv
+ indexttrB = item.IndexOf("= 0 Then
+ indexinittext = item.Substring(indexttr + 3).IndexOf(">")
+ keyvalue = item.Substring(indexinittext + indexttr + 4, (indexttrB - (indexinittext + indexttr + 4)))
+
+ item = item.Substring(indexttr + 3)
+ Else
+ item = ""
+ End If
+
+ End If
+ If key.Length > 0 Then
+ keydict.TryAdd(key.Replace(":", "").Trim(), keyvalue.Trim().ToLower())
+ End If
+ Next
+ Dim Apellido1 As String = "" : keydict.TryGetValue("Apellido1", Apellido1)
+ Dim Apellido2 As String = "" : keydict.TryGetValue("Apellido1", Apellido1)
+ Dim Nombres As String = "" : keydict.TryGetValue("Nombres", Nombres)
+ If Nombres Is Nothing OrElse Nombres.Length = 0 Then
+ curpresult = ""
+ End If
+ z = z + 1
+ End While
+ i = i + 1
+ End While
+ Return curpresult
+ End Function
+
+ Const wdPageBreak As Integer = 7
Const wdCharacter As Integer = 1
- Public ReadOnly Property showsalarios As Boolean
+ Public ReadOnly Property showsalarios As Boolean
Get
Return UsuarioActual.Empresa.Funcionalidad(701) = "1"
End Get
- End Property
- '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
- '
- PnlSalarios.Visible = showsalarios
-
- 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
- AgregarEventosAsincronosGvVacaciones()
- End Sub
-
- Private Sub CargaCuentasContables()
- Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
- If ObjContabilidad.GetCuentas(-1, "-1", -1) Then
- DtCuentasContables = ObjContabilidad.DtResultados
-
- Else
- DtCuentasContables = Nothing
-
- End If
- ObjContabilidad.Dispose()
-
- End Sub
- Private Sub SetValues()
- ViewState("Orden") = String.Empty
- DdlClienteAsignado.Attributes.Add("onclick", "CargaClientes();")
- DdlClienteAsistenciaC.Attributes.Add("onclick", "CargaClientes();")
- DdlClienteAsistenciaA.Attributes.Add("onclick", "CargaClientes();")
- CargaClientes()
+ End Property
+ '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
+ '
+ PnlSalarios.Visible = showsalarios
+
+ 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
+ AgregarEventosAsincronosGvVacaciones()
+ End Sub
+
+ Private Sub CargaCuentasContables()
+ Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
+ If ObjContabilidad.GetCuentas(-1, "-1", -1) Then
+ DtCuentasContables = ObjContabilidad.DtResultados
+
+ Else
+ DtCuentasContables = Nothing
+
+ End If
+ ObjContabilidad.Dispose()
+
+ End Sub
+ Private Sub SetValues()
+ ViewState("Orden") = String.Empty
+ DdlClienteAsignado.Attributes.Add("onclick", "CargaClientes();")
+ DdlClienteAsistenciaC.Attributes.Add("onclick", "CargaClientes();")
+ DdlClienteAsistenciaA.Attributes.Add("onclick", "CargaClientes();")
+ CargaClientes()
Dim fechainicioasistencia As String
Dim fechaFinasistencia As String
If Now.Day >= 15 Then
@@ -952,153 +952,153 @@ Partial Class RH_Personal
Dim dateendasis As DateTime = String.Format("{0:01/MM/yyyy}", Now).ToDateTime().AddDays(-1)
fechainicioasistencia = String.Format("{0:16/MM/yyyy}", dateendasis)
fechaFinasistencia = String.Format("{0:dd/MM/yyyy}", dateendasis)
- End If
- If Request("FechaI") IsNot Nothing AndAlso IsDate(Request("FechaI")) Then
- txtFechaI.Text = Request("FechaI")
- Else
- txtFechaI.Text = fechainicioasistencia
- End If
-
- If Request("FechaF") IsNot Nothing AndAlso IsDate(Request("FechaF")) Then
- txtFechaF.Text = Request("FechaF")
- Else
+ End If
+ If Request("FechaI") IsNot Nothing AndAlso IsDate(Request("FechaI")) Then
+ txtFechaI.Text = Request("FechaI")
+ Else
+ txtFechaI.Text = fechainicioasistencia
+ End If
+
+ If Request("FechaF") IsNot Nothing AndAlso IsDate(Request("FechaF")) Then
+ txtFechaF.Text = Request("FechaF")
+ Else
txtFechaF.Text = fechaFinasistencia
- End If
-
- If Request("CveSubProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveSubProyecto")) Then
- Dim DTSub As DataTable = GlobalDTSubProyectos(-1, Request("CveSubProyecto").ToEntero) 'Cambiame
- If DTSub.Rows.Count > 0 Then
- Dim DTProy As DataTable = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("CveProyecto = " & DTSub.Rows(0)("CveProyecto").ToString())
- If DTProy.Rows.Count > 0 Then
- DdlProyectoAsistenciaC.SelectedValue = DTProy.Rows(0)("CveProyecto").ToString()
- DdlProyectoAsistenciaA_SelectedIndexChanged(Me, New EventArgs)
- DdlSubProyectoAsistenciasC.SelectedValue = Request("CveSubProyecto")
- End If
- End If
- 'DdlProyectoAsistenciaC
- 'DdlSubProyectoAsistenciasC
- End If
-
- TxtFechaICredito.Text = $"01/01/{Now.Year}"
- TxtFechaFCredito.Text = Now.ToShortDateString
- End Sub
- Private Sub SetPermisos()
- 'Permisos
-
+ End If
+
+ If Request("CveSubProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveSubProyecto")) Then
+ Dim DTSub As DataTable = GlobalDTSubProyectos(-1, Request("CveSubProyecto").ToEntero) 'Cambiame
+ If DTSub.Rows.Count > 0 Then
+ Dim DTProy As DataTable = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("CveProyecto = " & DTSub.Rows(0)("CveProyecto").ToString())
+ If DTProy.Rows.Count > 0 Then
+ DdlProyectoAsistenciaC.SelectedValue = DTProy.Rows(0)("CveProyecto").ToString()
+ DdlProyectoAsistenciaA_SelectedIndexChanged(Me, New EventArgs)
+ DdlSubProyectoAsistenciasC.SelectedValue = Request("CveSubProyecto")
+ End If
+ End If
+ 'DdlProyectoAsistenciaC
+ 'DdlSubProyectoAsistenciasC
+ End If
+
+ TxtFechaICredito.Text = $"01/01/{Now.Year}"
+ TxtFechaFCredito.Text = Now.ToShortDateString
+ End Sub
+ Private Sub SetPermisos()
+ 'Permisos
+
End Sub
-#Region "Carga Combos"
+#Region "Carga Combos"
+
+ Private Sub CargaEscolaridad()
+ DdlEscolaridad.DataSource = GlobalDTEscolaridad
+ DdlEscolaridad.DataBind()
+ End Sub
+
+ Private Sub CargaGenero()
+ DdlGenero.DataSource = GlobalDTGenero
+ DdlGenero.DataBind()
+ End Sub
+
+ Private Sub CargaEstadoCivil()
+ DdlEstadoCivil.DataSource = GlobalDTEstadoCivil
+ DdlEstadoCivil.DataBind()
+ End Sub
+
+ Private Sub CargaTipoPeriodo()
+ DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
+ DdlTipoPeriodo.DataBind()
+ End Sub
- Private Sub CargaEscolaridad()
- DdlEscolaridad.DataSource = GlobalDTEscolaridad
- DdlEscolaridad.DataBind()
- End Sub
-
- Private Sub CargaGenero()
- DdlGenero.DataSource = GlobalDTGenero
- DdlGenero.DataBind()
- End Sub
-
- Private Sub CargaEstadoCivil()
- DdlEstadoCivil.DataSource = GlobalDTEstadoCivil
- DdlEstadoCivil.DataBind()
- End Sub
-
- Private Sub CargaTipoPeriodo()
- DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo
- DdlTipoPeriodo.DataBind()
- End Sub
-
Private Sub CargaTiposContrato()
- Dim dt As DataTable = GlobalDTTiposContrato
- DdlTipoContrato.DataSource = dt
- DdlTipoContrato.DataBind()
- End Sub
-
- Private Sub CargaTurno()
- DdlTurno.DataSource = GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- DdlTurno.DataBind()
- End Sub
-
- Private Sub CargaJornadas()
- DdlJornada.DataSource = GlobalDTJornadas
- DdlJornada.DataBind()
- End Sub
-
- 'Private Sub CargaMotivoHoraExtra()
- ' DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- ' DdlMotivoHoraExtra.DataBind()
- 'End Sub
-
- Private Sub CargaDepartamento()
- DdlDepartamento.DataSource = GlobalDTDepartamentos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- DdlDepartamento.DataBind()
- End Sub
-
- Private Sub CargaPuestos()
- DdlPuesto.DataSource = GlobalDTRHPuestos(UsuarioActual.CveEmpresa)
- DdlPuesto.DataBind()
- End Sub
-
- Private Sub CargaRuta()
- DdlRuta.DataSource = GlobalDTRutas.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- DdlRuta.DataBind()
- End Sub
-
- Private Sub CargaMotivoBaja()
- DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- DdlMotivoBaja.DataBind()
- End Sub
-
- Private Sub CargaEstatusPersonal()
- DdlEstatusPersonal.DataSource = GlobalDTEstatusPersonal
- DdlEstatusPersonal.DataBind()
- End Sub
-
- Private Sub CargaUsuariosNomina()
-
- DDLUsuarioNomina.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
- DDLUsuarioNomina.DataBind()
-
- DDLUsuarioNomina.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
-
- End Sub
- Private Sub CargaClientes()
- Dim ObjClientes As New ClsClientes
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
- DdlClienteAsignado.DataSource = ObjClientes.DtResultados
- DdlClienteAsistenciaC.DataSource = ObjClientes.DtResultados
- DdlClienteAsistenciaA.DataSource = ObjClientes.DtResultados
- Else
- DdlClienteAsignado.DataSource = Nothing
- DdlClienteAsistenciaC.DataSource = Nothing
- DdlClienteAsistenciaA.DataSource = Nothing
- End If
- ObjClientes.Dispose()
- DdlClienteAsignado.DataBind()
- DdlClienteAsistenciaC.DataBind()
- DdlClienteAsistenciaA.DataBind()
- End Sub
-
- Private Sub CargaProyecto()
-
- CargarCentrosDeCosto(DdlProyectoAsignado, DdlSubProyectoAsignado, LblProyectoAsignado, LblSubProyectoAsignado)
- DivProyectosAsignado.Visible = LblProyectoAsignado.Visible
- 'DdlProyectoAsignado.Items.Clear()
- 'DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 1)
- 'DdlProyectoAsignado.DataBind()
-
- 'DdlProyectoAsignado.Items.Insert(0, New ListItem("Sin Proyecto asignado", "-1"))
-
- DdlProyectoAsistenciaC.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"})
- DdlProyectoAsistenciaC.DataBind()
-
- DdlProyectoAsistenciaA.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"})
- DdlProyectoAsistenciaA.DataBind()
-
- End Sub
-
- Private Sub CargaSubProyectoAsignado()
+ Dim dt As DataTable = GlobalDTTiposContrato
+ DdlTipoContrato.DataSource = dt
+ DdlTipoContrato.DataBind()
+ End Sub
+
+ Private Sub CargaTurno()
+ DdlTurno.DataSource = GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ DdlTurno.DataBind()
+ End Sub
+
+ Private Sub CargaJornadas()
+ DdlJornada.DataSource = GlobalDTJornadas
+ DdlJornada.DataBind()
+ End Sub
+
+ 'Private Sub CargaMotivoHoraExtra()
+ ' DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ ' DdlMotivoHoraExtra.DataBind()
+ 'End Sub
+
+ Private Sub CargaDepartamento()
+ DdlDepartamento.DataSource = GlobalDTDepartamentos.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ DdlDepartamento.DataBind()
+ End Sub
+
+ Private Sub CargaPuestos()
+ DdlPuesto.DataSource = GlobalDTRHPuestos(UsuarioActual.CveEmpresa)
+ DdlPuesto.DataBind()
+ End Sub
+
+ Private Sub CargaRuta()
+ DdlRuta.DataSource = GlobalDTRutas.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ DdlRuta.DataBind()
+ End Sub
+
+ Private Sub CargaMotivoBaja()
+ DdlMotivoBaja.DataSource = GlobalDTMotivoBaja.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ DdlMotivoBaja.DataBind()
+ End Sub
+
+ Private Sub CargaEstatusPersonal()
+ DdlEstatusPersonal.DataSource = GlobalDTEstatusPersonal
+ DdlEstatusPersonal.DataBind()
+ End Sub
+
+ Private Sub CargaUsuariosNomina()
+
+ DDLUsuarioNomina.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
+ DDLUsuarioNomina.DataBind()
+
+ DDLUsuarioNomina.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+
+ End Sub
+ Private Sub CargaClientes()
+ Dim ObjClientes As New ClsClientes
+ If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
+ DdlClienteAsignado.DataSource = ObjClientes.DtResultados
+ DdlClienteAsistenciaC.DataSource = ObjClientes.DtResultados
+ DdlClienteAsistenciaA.DataSource = ObjClientes.DtResultados
+ Else
+ DdlClienteAsignado.DataSource = Nothing
+ DdlClienteAsistenciaC.DataSource = Nothing
+ DdlClienteAsistenciaA.DataSource = Nothing
+ End If
+ ObjClientes.Dispose()
+ DdlClienteAsignado.DataBind()
+ DdlClienteAsistenciaC.DataBind()
+ DdlClienteAsistenciaA.DataBind()
+ End Sub
+
+ Private Sub CargaProyecto()
+
+ CargarCentrosDeCosto(DdlProyectoAsignado, DdlSubProyectoAsignado, LblProyectoAsignado, LblSubProyectoAsignado)
+ DivProyectosAsignado.Visible = LblProyectoAsignado.Visible
+ 'DdlProyectoAsignado.Items.Clear()
+ 'DdlProyectoAsignado.DataSource = GlobalDTProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 1)
+ 'DdlProyectoAsignado.DataBind()
+
+ 'DdlProyectoAsignado.Items.Insert(0, New ListItem("Sin Proyecto asignado", "-1"))
+
+ DdlProyectoAsistenciaC.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"})
+ DdlProyectoAsistenciaC.DataBind()
+
+ DdlProyectoAsistenciaA.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"})
+ DdlProyectoAsistenciaA.DataBind()
+
+ End Sub
+
+ Private Sub CargaSubProyectoAsignado()
If DivProyectosAsignado.Visible Then
DdlSubProyectoAsignado.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1))
@@ -1109,2730 +1109,2730 @@ Partial Class RH_Personal
'DdlSubProyectoAsignado.DataSource = GlobalDTSubProyectos(DdlProyectoAsignado.SelectedValue.ToEntero)
'DdlSubProyectoAsignado.DataBind()
- 'DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Sin SubProyecto asignado", "-1"))
- End If
- End Sub
-
- Private Sub CargaSubProyectoAsistenciaC()
- DdlSubProyectoAsistenciasC.Items.Clear()
- DdlSubProyectoAsistenciasC.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaC.SelectedValue.ToEntero)
- DdlSubProyectoAsistenciasC.DataBind()
-
- DdlSubProyectoAsistenciasC.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End Sub
-
- Private Sub CargaSubProyectoAsistenciaA()
- DdlSubProyectoAsistenciasA.Items.Clear()
- DdlSubProyectoAsistenciasA.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaA.SelectedValue.ToEntero)
- DdlSubProyectoAsistenciasA.DataBind()
-
- DdlSubProyectoAsistenciasA.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End Sub
-
- Private Sub CargaTiposAsistencia()
- DdlTipoAsistencias.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- DdlTipoAsistencias.DataBind()
- End Sub
-
- Private Sub CargaMotivosHorasExtras()
- DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- DdlMotivoHoraExtra.DataBind()
- End Sub
-
- Private Sub CargaSupervisores()
- DdlSupervisor.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa & " AND EsSupervisorRH = 1 ")
- DdlSupervisor.DataBind()
- End Sub
-
-
-
- Private Sub CargaPermisosReemplazos()
-
- Dim ObjRH As New ClsRH
-
- If ObjRH.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
- DdlPermisosReemplazo.DataSource = ObjRH.DtResultados
- Else
- DdlPermisosReemplazo.DataSource = Nothing
- ' Alert("Ocurrió un error al cargar el catálogo de Jefes Inmediatos")
- End If
- ObjRH.Dispose()
-
-
- DdlPermisosReemplazo.DataBind()
-
-
-
-
- ' DdlPermisosReemplazo.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- 'DdlPermisosReemplazo.DataBind()
- End Sub
- Private Sub CargaMetodosPago()
- DdlMetodoPago.DataSource = GlobalDTMetodosPago
- DdlMetodoPago.DataBind()
- End Sub
-
- Private Sub CargaTipoRegimen()
- DdlRegimenContratacion.DataSource = GlobalDTNomSatRegimenContratacion
- DdlRegimenContratacion.DataBind()
- End Sub
-
- Private Sub CargaRiesgoPuesto()
- DdlRiesgoPuesto.DataSource = GlobalDTNomSatRiesgoPuesto
- DdlRiesgoPuesto.DataBind()
- End Sub
-
- Private Sub CargaBancos()
- DdlBanco.DataSource = GlobalDTNomSatBancos
- DdlBanco.DataBind()
- End Sub
-
- Private Sub CargaEstados(pCvePais As Integer)
- DdlEstados.DataSource = GlobalDTGralEstados(pCvePais)
- DdlEstados.DataBind()
- End Sub
-
- 'Private Sub CargaSucursales()
- ' DdlSucursal.DataSource = GlobalDTSucursales.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- ' DdlSucursal.DataBind()
-
- ' If UsuarioActual.CveSucursal = -1 Then
- ' DdlSucursal.Items.Insert(0, New ListItem("Seleccione", "-1"))
- ' Else
- ' DdlSucursal.SelectedValue = UsuarioActual.CveSucursal.ToString()
- ' End If
- 'End Sub
-
- Private Sub CargaSubProyectosZona()
- Dim objRH As New ClsRH
-
- If objRH.SubproyectoZonaGet(-1, -1, UsuarioActual.Empresa.CveEmpresa) Then
- DdlSubproyectoZona.DataSource = objRH.DtResultados.FiltraParametros("Estatus=1")
- Else
- DdlSubproyectoZona.DataSource = Nothing
- End If
-
- objRH.Dispose()
- DdlSubproyectoZona.DataBind()
-
- End Sub
- Private Sub CargaNominas()
- Dim Nom As New ClsRH
-
- If Nom.GetNominas(CvePersonal, UsuarioActual.CveEmpresa) Then
- GvNominas.DataSource = Nom.DtResultados
- End If
- If UsuarioActual.CveRol = 1 Then GvNominas.Columns(10).Visible = True
-
- Nom.Dispose()
- GvNominas.DataBind()
-
+ 'DdlSubProyectoAsignado.Items.Insert(0, New ListItem("Sin SubProyecto asignado", "-1"))
+ End If
+ End Sub
+
+ Private Sub CargaSubProyectoAsistenciaC()
+ DdlSubProyectoAsistenciasC.Items.Clear()
+ DdlSubProyectoAsistenciasC.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaC.SelectedValue.ToEntero)
+ DdlSubProyectoAsistenciasC.DataBind()
+
+ DdlSubProyectoAsistenciasC.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End Sub
+
+ Private Sub CargaSubProyectoAsistenciaA()
+ DdlSubProyectoAsistenciasA.Items.Clear()
+ DdlSubProyectoAsistenciasA.DataSource = GlobalDTSubProyectos(DdlProyectoAsistenciaA.SelectedValue.ToEntero)
+ DdlSubProyectoAsistenciasA.DataBind()
+
+ DdlSubProyectoAsistenciasA.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End Sub
+
+ Private Sub CargaTiposAsistencia()
+ DdlTipoAsistencias.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ DdlTipoAsistencias.DataBind()
+ End Sub
+
+ Private Sub CargaMotivosHorasExtras()
+ DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ DdlMotivoHoraExtra.DataBind()
+ End Sub
+
+ Private Sub CargaSupervisores()
+ DdlSupervisor.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa & " AND EsSupervisorRH = 1 ")
+ DdlSupervisor.DataBind()
+ End Sub
+
+
+
+ Private Sub CargaPermisosReemplazos()
+
+ Dim ObjRH As New ClsRH
+
+ If ObjRH.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
+ DdlPermisosReemplazo.DataSource = ObjRH.DtResultados
+ Else
+ DdlPermisosReemplazo.DataSource = Nothing
+ ' Alert("Ocurrió un error al cargar el catálogo de Jefes Inmediatos")
+ End If
+ ObjRH.Dispose()
+
+
+ DdlPermisosReemplazo.DataBind()
+
+
+
+
+ ' DdlPermisosReemplazo.DataSource = GlobalDTUsuarios.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ 'DdlPermisosReemplazo.DataBind()
+ End Sub
+ Private Sub CargaMetodosPago()
+ DdlMetodoPago.DataSource = GlobalDTMetodosPago
+ DdlMetodoPago.DataBind()
+ End Sub
+
+ Private Sub CargaTipoRegimen()
+ DdlRegimenContratacion.DataSource = GlobalDTNomSatRegimenContratacion
+ DdlRegimenContratacion.DataBind()
+ End Sub
+
+ Private Sub CargaRiesgoPuesto()
+ DdlRiesgoPuesto.DataSource = GlobalDTNomSatRiesgoPuesto
+ DdlRiesgoPuesto.DataBind()
+ End Sub
+
+ Private Sub CargaBancos()
+ DdlBanco.DataSource = GlobalDTNomSatBancos
+ DdlBanco.DataBind()
+ End Sub
+
+ Private Sub CargaEstados(pCvePais As Integer)
+ DdlEstados.DataSource = GlobalDTGralEstados(pCvePais)
+ DdlEstados.DataBind()
+ End Sub
+
+ 'Private Sub CargaSucursales()
+ ' DdlSucursal.DataSource = GlobalDTSucursales.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ ' DdlSucursal.DataBind()
+
+ ' If UsuarioActual.CveSucursal = -1 Then
+ ' DdlSucursal.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ ' Else
+ ' DdlSucursal.SelectedValue = UsuarioActual.CveSucursal.ToString()
+ ' End If
+ 'End Sub
+
+ Private Sub CargaSubProyectosZona()
+ Dim objRH As New ClsRH
+
+ If objRH.SubproyectoZonaGet(-1, -1, UsuarioActual.Empresa.CveEmpresa) Then
+ DdlSubproyectoZona.DataSource = objRH.DtResultados.FiltraParametros("Estatus=1")
+ Else
+ DdlSubproyectoZona.DataSource = Nothing
+ End If
+
+ objRH.Dispose()
+ DdlSubproyectoZona.DataBind()
+
+ End Sub
+ Private Sub CargaNominas()
+ Dim Nom As New ClsRH
+
+ If Nom.GetNominas(CvePersonal, UsuarioActual.CveEmpresa) Then
+ GvNominas.DataSource = Nom.DtResultados
+ End If
+ If UsuarioActual.CveRol = 1 Then GvNominas.Columns(10).Visible = True
+
+ Nom.Dispose()
+ GvNominas.DataBind()
+
End Sub
-#End Region
+#End Region
-#Region "Asistencias"
+#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
- If ObjRH.RemovePersonalAsistencias(GvRow.DataKey("CveAsistencia").ToEntero) Then
- Alert("La asistencia ha sido eliminada correctamente.")
- CargaGvAsistencias()
- End If
- ObjRH.Dispose()
- End Sub
- Protected Sub BtnConsultarAsistencia_Click(sender As Object, e As System.EventArgs) Handles BtnConsultarAsistencia.Click
- CargaGvAsistencias()
- 'Dim FechaI, FechaF As Date
- 'Dim CveTurno, CveSubProyecto As Integer
- End Sub
-
- Protected Sub CargaGvAsistencias(Optional Orden As String = "")
- Dim objpersonal As New ClsRH
- If objpersonal.GetAsistencias(CvePersonal, DdlClienteAsistenciaC.SelectedValue.ToEntero, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero, DdlTurno.SelectedValue.ToEntero, -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then
- GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL")
- Else
- GVAsistencia.DataSource = Nothing
- End If
- objpersonal.Dispose()
- GVAsistencia.DataBind()
- UpDatos.Update()
- End Sub
- Protected Sub LbGuardarAsistencia_Click(sender As Object, e As System.EventArgs) Handles LbGuardarAsistencia.Click
- Dim ObjPersonal As New ClsRH()
- If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero, DdlSubProyectoAsistenciasA.SelectedValue.ToEntero, TxtFechaAsistencia.Text.Trim.ToDate,
- DdlTipoAsistencias.SelectedValue.ToEntero, TxtPorPago.Text.Trim.ToDouble, TxtHorasDobles.Text.Trim.ToDouble,
- TxtHorasTriples.Text.Trim.ToDouble, DdlMotivoHoraExtra.SelectedValue.ToEntero, TxtObservaciones.Text.Trim,
- UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
-
- Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
- BtnConsultarAsistencia_Click(sender, e)
- End If
-
- ObjPersonal.Dispose()
- 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
-
-
- e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
- e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
- e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
-
- If IsDate(e.Row.DBCampo("Fecha")) Then e.Row.FCLiteral("LtlFecha").Text = e.Row.DBCampo("Fecha").ToDate.ToShortDateString
- If e.Row.FCLiteral("LtlCliente").Text <> "N/A" Then e.Row.FCLiteral("LtlCliente").Text = "" & e.Row.DBCampo("Cliente") & ""
- e.Row.FCTextBox("TxtPorPago").Text = e.Row.DBCampo("PorcentajePago")
- e.Row.FCTextBox("TxtHorasDobles").Text = e.Row.DBCampo("HorasDobles")
- e.Row.FCTextBox("TxtHorasTriples").Text = e.Row.DBCampo("HorasTriples")
-
- 'Carga Tipos de Asistencia
- e.Row.FCDropDownList("DdlTipoAsistencias").DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlTipoAsistencias").DataBind()
- If e.Row.DBCampo("CveAsistenciasInasistencias") <> "-1" Then e.Row.FCDropDownList("DdlTipoAsistencias").SelectedValue = e.Row.DBCampo("CveAsistenciasInasistencias")
-
- 'Carga Motivos Horas Extras
- e.Row.FCDropDownList("DdlMotivoHoraExtra").DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlMotivoHoraExtra").DataBind()
- If e.Row.DBCampo("CveMotivoHoraExtra") <> "-1" Then e.Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue = e.Row.DBCampo("CveMotivoHoraExtra")
-
- e.Row.FCTextBox("TxtObservaciones").Text = e.Row.DBCampo("Observacion")
-
- If e.Row.DBCampo("SeModifico") = "0" Then
- e.Row.Cells(0).BackColor = Drawing.Color.LightBlue
- e.Row.Cells(1).BackColor = Drawing.Color.LightBlue
- e.Row.Cells(2).BackColor = Drawing.Color.LightBlue
- e.Row.Cells(3).BackColor = Drawing.Color.LightBlue
- ElseIf e.Row.DBCampo("SeModifico") = "1" Then
- e.Row.Cells(0).ForeColor = Drawing.Color.Red
- e.Row.Cells(1).ForeColor = Drawing.Color.Red
- e.Row.Cells(2).ForeColor = Drawing.Color.Red
- e.Row.Cells(3).ForeColor = Drawing.Color.Red
- End If
-
- End If
- End Sub
-
- Protected Sub BtnGuardarAsistenciaCambios_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarAsistenciaCambios.Click
- Dim ObjPersonal As New ClsRH()
- ObjPersonal.IniciaTransacSQL()
- Dim OcurrioError As Boolean = False
-
- For Each Row As GridViewRow In GVAsistencia.Rows
- If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero, DdlClienteAsistenciaC.SelectedValue.ToEntero, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero, Row.FCLiteral("LtlFecha").Text.Trim.ToDate,
- Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero, Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble,
- Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero, Row.FCTextBox("TxtObservaciones").Text.Trim,
- UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
- OcurrioError = True
- Exit For
- End If
- Next
-
- If OcurrioError Then
- ObjPersonal.RollBack()
- Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError)
- Else
- ObjPersonal.Commit()
- Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
- End If
-
- ObjPersonal.Dispose()
-
- BtnConsultarAsistencia_Click(sender, e)
+ 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
+ If ObjRH.RemovePersonalAsistencias(GvRow.DataKey("CveAsistencia").ToEntero) Then
+ Alert("La asistencia ha sido eliminada correctamente.")
+ CargaGvAsistencias()
+ End If
+ ObjRH.Dispose()
End Sub
-#End Region
- Private Sub CargaConsignacion()
-
- Dim ObjInventario As New ClsInventarios
-
- If ObjInventario.GetConsignaciones(UsuarioActual.CveEmpresa, CvePersonal) Then
- GvConsignacion.DataSource = ObjInventario.DtResultados
- GvConsignacion.DataBind()
- End If
- ObjInventario.Dispose()
- End Sub
- Private Sub CargaDatos()
- Dim ObjPersonal As New ClsRH()
- If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
- If ObjPersonal.DtResultados.Rows.Count > 0 Then
- Dim drow As DataRow = ObjPersonal.DtResultados.Rows(0)
- ChkEstemporal.Checked = drow("esTemporal").ToString() = "1"
- CHKRFCValidado.Checked = drow("RFCValidado").ToString() = "1"
+ Protected Sub BtnConsultarAsistencia_Click(sender As Object, e As System.EventArgs) Handles BtnConsultarAsistencia.Click
+ CargaGvAsistencias()
+ 'Dim FechaI, FechaF As Date
+ 'Dim CveTurno, CveSubProyecto As Integer
+ End Sub
+
+ Protected Sub CargaGvAsistencias(Optional Orden As String = "")
+ Dim objpersonal As New ClsRH
+ If objpersonal.GetAsistencias(CvePersonal, DdlClienteAsistenciaC.SelectedValue.ToEntero, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero, DdlTurno.SelectedValue.ToEntero, -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then
+ GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL")
+ Else
+ GVAsistencia.DataSource = Nothing
+ End If
+ objpersonal.Dispose()
+ GVAsistencia.DataBind()
+ UpDatos.Update()
+ End Sub
+ Protected Sub LbGuardarAsistencia_Click(sender As Object, e As System.EventArgs) Handles LbGuardarAsistencia.Click
+ Dim ObjPersonal As New ClsRH()
+ If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero, DdlSubProyectoAsistenciasA.SelectedValue.ToEntero, TxtFechaAsistencia.Text.Trim.ToDate,
+ DdlTipoAsistencias.SelectedValue.ToEntero, TxtPorPago.Text.Trim.ToDouble, TxtHorasDobles.Text.Trim.ToDouble,
+ TxtHorasTriples.Text.Trim.ToDouble, DdlMotivoHoraExtra.SelectedValue.ToEntero, TxtObservaciones.Text.Trim,
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+
+ Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
+ BtnConsultarAsistencia_Click(sender, e)
+ End If
+
+ ObjPersonal.Dispose()
+ 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
+
+
+ e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
+ e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
+ e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
+
+ If IsDate(e.Row.DBCampo("Fecha")) Then e.Row.FCLiteral("LtlFecha").Text = e.Row.DBCampo("Fecha").ToDate.ToShortDateString
+ If e.Row.FCLiteral("LtlCliente").Text <> "N/A" Then e.Row.FCLiteral("LtlCliente").Text = "" & e.Row.DBCampo("Cliente") & ""
+ e.Row.FCTextBox("TxtPorPago").Text = e.Row.DBCampo("PorcentajePago")
+ e.Row.FCTextBox("TxtHorasDobles").Text = e.Row.DBCampo("HorasDobles")
+ e.Row.FCTextBox("TxtHorasTriples").Text = e.Row.DBCampo("HorasTriples")
+
+ 'Carga Tipos de Asistencia
+ e.Row.FCDropDownList("DdlTipoAsistencias").DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlTipoAsistencias").DataBind()
+ If e.Row.DBCampo("CveAsistenciasInasistencias") <> "-1" Then e.Row.FCDropDownList("DdlTipoAsistencias").SelectedValue = e.Row.DBCampo("CveAsistenciasInasistencias")
+
+ 'Carga Motivos Horas Extras
+ e.Row.FCDropDownList("DdlMotivoHoraExtra").DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ e.Row.FCDropDownList("DdlMotivoHoraExtra").DataBind()
+ If e.Row.DBCampo("CveMotivoHoraExtra") <> "-1" Then e.Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue = e.Row.DBCampo("CveMotivoHoraExtra")
+
+ e.Row.FCTextBox("TxtObservaciones").Text = e.Row.DBCampo("Observacion")
+
+ If e.Row.DBCampo("SeModifico") = "0" Then
+ e.Row.Cells(0).BackColor = Drawing.Color.LightBlue
+ e.Row.Cells(1).BackColor = Drawing.Color.LightBlue
+ e.Row.Cells(2).BackColor = Drawing.Color.LightBlue
+ e.Row.Cells(3).BackColor = Drawing.Color.LightBlue
+ ElseIf e.Row.DBCampo("SeModifico") = "1" Then
+ e.Row.Cells(0).ForeColor = Drawing.Color.Red
+ e.Row.Cells(1).ForeColor = Drawing.Color.Red
+ e.Row.Cells(2).ForeColor = Drawing.Color.Red
+ e.Row.Cells(3).ForeColor = Drawing.Color.Red
+ End If
+
+ End If
+ End Sub
+
+ Protected Sub BtnGuardarAsistenciaCambios_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarAsistenciaCambios.Click
+ Dim ObjPersonal As New ClsRH()
+ ObjPersonal.IniciaTransacSQL()
+ Dim OcurrioError As Boolean = False
+
+ For Each Row As GridViewRow In GVAsistencia.Rows
+ If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero, DdlClienteAsistenciaC.SelectedValue.ToEntero, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero, Row.FCLiteral("LtlFecha").Text.Trim.ToDate,
+ Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero, Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble,
+ Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero, Row.FCTextBox("TxtObservaciones").Text.Trim,
+ UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ OcurrioError = True
+ Exit For
+ End If
+ Next
+
+ If OcurrioError Then
+ ObjPersonal.RollBack()
+ Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError)
+ Else
+ ObjPersonal.Commit()
+ Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
+ End If
+
+ ObjPersonal.Dispose()
+
+ BtnConsultarAsistencia_Click(sender, e)
+ End Sub
+#End Region
+ Private Sub CargaConsignacion()
+
+ Dim ObjInventario As New ClsInventarios
+
+ If ObjInventario.GetConsignaciones(UsuarioActual.CveEmpresa, CvePersonal) Then
+ GvConsignacion.DataSource = ObjInventario.DtResultados
+ GvConsignacion.DataBind()
+ End If
+ ObjInventario.Dispose()
+ End Sub
+ Private Sub CargaDatos()
+ Dim ObjPersonal As New ClsRH()
+ If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
+ If ObjPersonal.DtResultados.Rows.Count > 0 Then
+ Dim drow As DataRow = ObjPersonal.DtResultados.Rows(0)
+ ChkEstemporal.Checked = drow("esTemporal").ToString() = "1"
+ CHKRFCValidado.Checked = drow("RFCValidado").ToString() = "1"
TxtMailrecibonomina.Text = drow("MaiReciboNomina").ToString()
'Carga Datos Personales
- LtlPersonal.Text = ObjPersonal.NombreCompleto
- NombreCompleto = ObjPersonal.NombreCompleto
- 'TxtNombre.Text = ObjPersonal.Nombre
- TxtAPaterno.Text = ObjPersonal.APaterno
- TxtAMaterno.Text = ObjPersonal.AMaterno
- TxtNombres.Text = ObjPersonal.Nombres
- TxtCorreo.Text = ObjPersonal.Correo
- TxtCodigo.Text = ObjPersonal.Codigo
- DdlEscolaridad.SelectedValue = ObjPersonal.CveEscolaridad.ToString()
- DdlEstadoCivil.SelectedValueExist(ObjPersonal.CveEstadoCivil.ToString())
- DdlGenero.SelectedValue = ObjPersonal.CveGenero.ToString()
- TxtFechaNacimiento.Text = ObjPersonal.FechaNacimiento.ToShortDateString
- TxtRFC.Text = ObjPersonal.RFC
- TxtCURP.Text = ObjPersonal.CURP
- 'Localización
- 'TxtDireccion.Text = ObjPersonal.Direccion
- TxtCalle.Text = ObjPersonal.Calle
- TxtNumExt.Text = ObjPersonal.NumExt
- TxtNumInt.Text = ObjPersonal.NumInt
- TxtColonia.Text = ObjPersonal.Colonia
- DdlEstados.SelectedValueExist(ObjPersonal.CveEstado.ToString())
- TxtCP.Text = ObjPersonal.CP
- TxtColonia.Text = ObjPersonal.Colonia
- TxtCiudad.Text = ObjPersonal.Ciudad
- TxtEstado.Text = ObjPersonal.Estado
- TxtTelefono.Text = ObjPersonal.Telefono
- TxtCelular.Text = ObjPersonal.Celular
- TxtLugarNacimiento.Text = ObjPersonal.LugarNacimiento.ToString()
- TxtNombrePadre.Text = ObjPersonal.NombrePadre
- TxtNombreMadre.Text = ObjPersonal.NombreMadre
- Session("FileUpload") = ObjPersonal.URL
- ViewState("Archivo") = ObjPersonal.URL
- TxtTelefonoExtension.Text = ObjPersonal.TelefonoExtension
- TxtCelularPersonal.Text = ObjPersonal.CelularPersonal
- TxtTelefonoMarcadoRapido.Text = ObjPersonal.TelefonoMarcadoRapido
- 'TxtContactoAlterno.Text = ObjPersonal.ContactoAlterno
-
-
- If ObjPersonal.CveUniforme > 0 Then
- LnkSurtir.Visible = True
- ViewState("CveUniforme") = ObjPersonal.CveUniforme
- DdlUniforme.SelectedValueExist(CveUniforme)
- LnkSurtir.PostBackUrl = $"../Inventarios/ResguardoMaterial.aspx?CvePersonal={CvePersonal}"
- CargaUniformesPersonal()
- End If
-
- If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
-
- LnkSurtir.Visible = True
- DdlUniforme.Visible = False
- LnkSurtir.PostBackUrl = $"../Inventarios/ResguardoMaterial.aspx?CvePersonal={CvePersonal}&EsSurtidoUniforme=1"
- CargaUniformesPersonal()
-
- End If
-
- If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".jpg") Then
- Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.jpg", UsuarioActual.CveEmpresa, CvePersonal)
- Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
-
- ImgPersonal.ImageUrl = logouri
- ElseIf File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".png") Then
- Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.png", UsuarioActual.CveEmpresa, CvePersonal)
- Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
-
- ImgPersonal.ImageUrl = logouri
- ElseIf File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".bmp") Then
- Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.bmp", UsuarioActual.CveEmpresa, CvePersonal)
- Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
-
- ImgPersonal.ImageUrl = logouri
- End If
- 'BtnCargarArchivo_Click(Me, New EventArgs)
-
-
- 'Carga RH
- TxtFechaInicioContrato.Text = ObjPersonal.FechaInicioContrato.ToShortDateString
- TxtFechaFinContrato.Text = If(ObjPersonal.FechaFinContrato.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaFinContrato.ToShortDateString)
- DDlTipoSalario.SelectedValue = drow("CveTipodeSalario").ToString()
- DdlTipoContrato.SelectedValue = ObjPersonal.CveTipoContrato.ToString()
- DdlTurno.SelectedValue = ObjPersonal.CveTurno.ToString()
- DdlJornada.SelectedValue = ObjPersonal.CveJornada.ToString()
- DdlDepartamento.SelectedValue = ObjPersonal.CveDepartamento.ToString()
- DdlSubproyectoZona.SelectedValueExist(ObjPersonal.CveSubproyectoZona)
- DDLUsuarioNomina.SelectedValueExist(ObjPersonal.CveUsuarioNomina)
- 'DdlViaticos.SelectedValue = ObjPersonal.IdCtaContViaticos.ToString()
-
- 'For i As Integer = DdlDepartamento.Items.Count - 1 To 1 Step -1
- ' If DdlDepartamento.Items(i).Value.Contains(ObjPersonal.CveDepartamento.ToString()) Then
- ' DdlDepartamento.Items(i).Selected = True
- ' Exit For
- ' End If
- 'Next
-
- DdlPuesto.SelectedValue = ObjPersonal.CvePuesto.ToString()
- DdlRuta.SelectedValue = ObjPersonal.CveRuta.ToString()
- DdlMotivoBaja.SelectedValue = ObjPersonal.CveMotivoBaja.ToString()
-
- TxtFechaBaja.Text = If(ObjPersonal.FechaBaja.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaBaja.ToShortDateString)
-
- If ObjPersonal.DtResultados IsNot Nothing AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then
- TxtFechaActivo.Text = If(drow("FechaActivo").ToString().Length > 0, drow("FechaActivo").ToString().ToDate.ToString("dd/MM/yyyy"), drow("FechaIng").ToString().ToDate.ToString("dd/MM/yyyy"))
- TxtFechaReingreso.Text = If(drow("FechaReingreso").ToString().Length > 0, drow("FechaReingreso").ToString().ToDate.ToString("dd/MM/yyyy"), "")
- End If
-
- DdlEstatusPersonal.SelectedValue = ObjPersonal.CveEstatusPersonal.ToString()
-
- MostrarOcultarFechasEstatus()
-
- CvePersonalEstatusInicial = ObjPersonal.CveEstatusPersonal
- ViewState("CveEstatusOriginal") = ObjPersonal.CveEstatusPersonal.ToString()
- 'Asignación
- If ObjPersonal.CveCliente <> -1 Then
- DdlClienteAsignado.Items.Insert(1, New ListItem(ObjPersonal.Cliente, ObjPersonal.CveCliente.ToString()))
- DdlClienteAsignado.SelectedValue = ObjPersonal.CveCliente.ToString()
- Else
- DdlClienteAsignado.SelectedValue = ObjPersonal.CveCliente.ToString()
- End If
- DdlProyectoAsignado.SelectedValue = ObjPersonal.CveProyecto.ToString()
- If ObjPersonal.CveProyecto <> -1 Then DdlProyectoAsignado_SelectedIndexChanged(Me, New System.EventArgs())
- DdlSubProyectoAsignado.SelectedValue = ObjPersonal.CveSubProyecto.ToString()
- DdlSupervisor.SelectedValue = ObjPersonal.CveSupervisor.ToString()
- 'Carga Nómina
- TxtFechaIngreso.Text = ObjPersonal.FechaIngreso.ToShortDateString
- DdlTipoPeriodo.SelectedValue = ObjPersonal.CveTipoPeriodo.ToString()
- TxtNumeroSS.Text = ObjPersonal.NumeroSS
- ChkSeInscribioSS.Checked = ObjPersonal.SeInscribioSS
- TxtSalarioDiarioPago.Text = ObjPersonal.SalarioDiarioPago.ToString()
- TxtSalarioDiario.Text = ObjPersonal.SalarioDiario.ToString()
- TxtSDI.Text = ObjPersonal.SDI.ToString()
- TxtSalarioCotizado.Text = ObjPersonal.SalarioDiarioSS.ToString()
- TxtFISalariodiario.Text = ObjPersonal.SalarioDiario.ToString()
- TxtBono.Text = ObjPersonal.Bono.ToString()
- TxtNumDiasAguinaldo.Text = ObjPersonal.NumDiasAguinaldo.ToString()
- TxtFIAguinaldo.Text = ObjPersonal.NumDiasAguinaldo.ToString()
- TxtPorPrimaVacacional.Text = ObjPersonal.PorPrimaVacacional.ToString()
- TxtFIPrimaVacacional.Text = ObjPersonal.PorPrimaVacacional.ToString()
-
- DdlMetodoPago.SelectedValue = ObjPersonal.CveMetodoPago.ToString()
- TxtBancoNumCuenta.Text = ObjPersonal.BancoNumCuenta
- TxtCLABE.Text = ObjPersonal.CLABE
- DdlSupervisorOrganigrama.SelectedValueExist(If(ObjPersonal.CvePersonalPadre = ObjPersonal.CvePersonal, "0", If(ObjPersonal.CvePersonalPadre.ToString() = "0", "-1", ObjPersonal.CvePersonalPadre.ToString())))
-
-
- DdlRegimenContratacion.SelectedValue = ObjPersonal.CveSATRegimenContratacion.ToString()
- DdlBanco.SelectedValue = If(ObjPersonal.CveSATBanco = 0, "-1", ObjPersonal.CveSATBanco.ToString())
- DdlRiesgoPuesto.SelectedValue = ObjPersonal.CveSATRiesgoPuesto.ToString()
-
- 'Carga Incidencias
- BtnConsultarAsistencia_Click(Me, New System.EventArgs)
-
- 'Carga Buzón de Calidad
- If ObjPersonal.GetBuzonCalidad(CvePersonal, UsuarioActual.CveEmpresa) Then
- ViewState("DTBuzonCalidad") = ObjPersonal.DtResultados
- GvBuzonCalidad.DataSource = ObjPersonal.DtResultados
- Else
- GvBuzonCalidad.DataSource = Nothing
- ViewState("DTBuzonCalidad") = Nothing
- End If
- GvBuzonCalidad.DataBind()
-
- 'Carga Conceptos de Nómina
- CarcaConceptosNomina()
- 'Carga Pagos no Bancarios
- CargarPagosNoBancarios()
- 'Carga Resguardos
- Dim ObjResguardos As New ClsAF
- If ObjResguardos.GetActivosFijosResguardos(-1, -1, CvePersonal, -1) Then
- GvResguardos.DataSource = ObjResguardos.DtResultados
- Else
- GvResguardos.DataSource = Nothing
- End If
- ObjResguardos.Dispose()
- GvResguardos.DataBind()
-
- If UsuarioActual.Empresa.UsaContabilidad Then
- DdlViaticos.AutoPostBack = True
- DdlPrestamos.AutoPostBack = True
-
- DdlViaticos.Attributes.Add("onclick", "CargaCuentas(1);")
- DdlPrestamos.Attributes.Add("onclick", "CargaCuentas(2);")
-
- If ObjPersonal.IdCtaContPersonal > 0 Then DdlViaticos.Items.Add(New ListItem(ObjPersonal.CtaContPersonal, ObjPersonal.IdCtaContPersonal.ToString())) : DdlViaticos.SelectedValue = ObjPersonal.IdCtaContPersonal.ToString()
- If ObjPersonal.IdCtaContPrestamos > 0 Then DdlPrestamos.Items.Add(New ListItem(ObjPersonal.CtaContPrestamos, ObjPersonal.IdCtaContPrestamos.ToString())) : DdlPrestamos.SelectedValue = ObjPersonal.IdCtaContPrestamos.ToString()
-
- End If
-
- LblFechaCaptura.Text = ObjPersonal.FechaIngreso.ToShortDateString
- LblUsuarioCapturo.Text = ObjPersonal.Usuario
- CargaNominas()
- CargaCastosSinComprobar()
- CargaGastosPorCheque()
- CargaEventoBitacora()
- CargaConsignacion()
- CargaCursos()
- CargaVacaciones()
- CargaVacacionesResumenPeriodoActual()
- Consumos()
- CargaPagoFactura()
- 'DescarSolicitudVacaciones(-1)
-
- TabVacaciones.Visible = True
- If UsuarioActual.CveEmpresa = 7 Or UsuarioActual.CveEmpresa = 72 Then
-
- 'If UsuarioActual.CveEmpresa = 72 Then
-
- ' GvVacacionesResumen.Visible = False
- ' DvHistorialVacaiones.Visible = False
- ' FvPerimososVacaciones.Visible = False
- ' 'DVSolicitudVacaiones.Attributes.Add("class", "col-md-12")
- ' BtnSolicitarVacaciones.Text = "Solicitar"
- ' DvPermisosMotivos1.Visible = True
- ' DvPermisosMotivos2.Visible = True
-
- 'End If
-
- Else
- 'TabVacaciones.Visible = False
- End If
-
- If VacDiasDisponibles > 0 Then
- TxtFechaInicioVac.Text = Now.AddDays(1).ToString("dd/MM/yyyy")
- Else
- TxtFechaInicioVac.Text = Now.ToString("dd/MM/yyyy")
- End If
-
-
- TxtFechaFinVac.Text = Now.AddDays(VacDiasDisponibles).ToString("dd/MM/yyyy")
-
- 'PERSONAL ALTAS
- If ObjPersonal.GetPersonalAltas(CvePersonal) Then
- GvPersonalAltas.DataSource = ObjPersonal.DtResultados
- GvPersonalAltas.DataBind()
- End If
- 'Cargar Almacenes en DropDown GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 8)
- DdlAlmacenDestinoLiberarUniforme.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 19")
- DdlAlmacenDestinoLiberarUniforme.DataBind()
-
- Else
- Alert("El Personal Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
- BtnGuardar.Enabled = False
- End If
- End If
- ObjPersonal.Dispose()
- End Sub
-
- Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
- 'System.Threading.Thread.Sleep(3000)
- Dim ObjPersonal As New ClsRH()
- Dim ObjCuentasDeposito As New ClsGenerales(ObjPersonal.IniciaTransacSQL())
- Dim ObjAF As New ClsAF(ObjPersonal.IniciaTransacSQL())
-
- 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}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ViewState("Archivo").ToString())
- Dim Archivo As New System.IO.FileInfo(Ruta)
-
-
- Dim TieneError = False
- Dim Mensaje = ""
- Dim Accion = ""
-
- Dim FechaBaja As Date = MinFecha
- Dim FechaActivo As Date = MinFecha
- Dim FechaReingreso As Date = MinFecha
-
- If DdlEstatusPersonal.SelectedValue.ToEntero <> CvePersonalEstatusInicial Then
- If DdlEstatusPersonal.SelectedValue.ToEntero = 1 Then
- FechaActivo = TxtFechaActivo.Text.ToDate
- ElseIf DdlEstatusPersonal.SelectedValue.ToEntero = 2 Then
- FechaBaja = TxtFechaBaja.Text.ToDate
- ElseIf DdlEstatusPersonal.SelectedValue.ToEntero = 5 Then
- FechaReingreso = TxtFechaReingreso.Text.ToDate
- End If
- End If
-
- If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then
- TxtSalarioCotizado.Text = TxtSDI.Text
- End If
-
- If CvePersonal = -1 Then
- URL = ""
-
- If ObjPersonal.AddPersonal(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,
- TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero, TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
- DdlTipoContrato.SelectedValue.ToEntero, TxtUbicacion.Text.Trim,
- DdlTurno.SelectedValue.ToEntero, DdlPuesto.SelectedValue.ToEntero,
- DdlDepartamento.SelectedValue.ToEntero,
- DdlRuta.SelectedValue.ToEntero,
- DdlEscolaridad.SelectedValue.ToEntero,
- DdlEstadoCivil.SelectedValue.ToEntero,
- DdlGenero.SelectedValue.ToEntero,
- DdlMotivoBaja.SelectedValue.ToEntero, If(DdlEstatusPersonal.SelectedValue = "2", TxtFechaBaja.Text.Trim, "-1"),
- DdlEstatusPersonal.SelectedValue.ToEntero, TxtFechaNacimiento.Text.ToDate,
- TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
- DdlEstados.SelectedValue.ToEntero, TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim,
- TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero, DdlRiesgoPuesto.SelectedValue.ToEntero, DdlRegimenContratacion.SelectedValue.ToEntero,
- DdlClienteAsignado.SelectedValue.ToEntero, DdlSubProyectoAsignado.SelectedValue.ToEntero, 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.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero, DdlSubproyectoZona.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero,
- TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero()) Then
-
- If Archivo.Exists Then
-
- If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
- File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
- End If
- System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
-
- End If
-
- 'Agregar Cuentas Bancarias
- ViewState("CvePersonal") = ObjPersonal.CvePersonal
-
- 'Funsion usa RH Familiares
- If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
- ProcesaDTFamiliares(ObjPersonal)
- End If
-
- If TempDTCuentasBancos.Rows.Count > 0 Then
- For Each row As DataRow In TempDTCuentasBancos.Rows
- If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString(), row("Plaza").ToString(), row("Sucursal").ToString(), row("Cuenta").ToString(), row("CLABE").ToString(), row("CIE").ToString(), row("SWIFT").ToString(), row("Referencia").ToString(), "", UsuarioActual.CveUsuario, row("CveMoneda").ToString().ToEntero, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=row("BBVAAlias").ToString()) Then
- TieneError = True
- Exit For
- End If
- Next
- End If
- If DTLicencias IsNot Nothing AndAlso DTLicencias.Rows.Count > 0 Then
- For Each Dr As DataRow In DTLicencias.Rows
- If Not ObjAF.AddLicencia(-1, Dr("Licencia").ToString(), Dr("FechaExpedicion").ToString().ToDateTime(), Dr("FechaVencimiento").ToString().ToDateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=ObjPersonal.CvePersonal) Then
- TieneError = True
- Exit For
- End If
- Next
- End If
-
- If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
- GlobalDTGralColectivas(-1) = ObjPersonal.DtResultados
- Else
- TieneError = True
- End If
-
- Mensaje = "El Personal se guardó correctamente."
- Accion = If(Request("CveFactura") Is Nothing, "document.location.href=""/RH/CatPersonal.aspx""", "window.opener.location.href = window.opener.location.href; window.close();")
-
- 'Alert("El Personal se guardó correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/RH/CatPersonal.aspx"";")
- Else
- TieneError = True
- End If
-
- Else
- '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,
- TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero, TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
- DdlTipoContrato.SelectedValue.ToEntero, TxtUbicacion.Text.Trim,
- DdlTurno.SelectedValue.ToEntero, DdlPuesto.SelectedValue.ToEntero,
- DdlDepartamento.SelectedValue.ToEntero,
- DdlRuta.SelectedValue.ToEntero,
- DdlEscolaridad.SelectedValue.ToEntero,
- DdlEstadoCivil.SelectedValue.ToEntero,
- DdlGenero.SelectedValue.ToEntero,
- DdlMotivoBaja.SelectedValue.ToEntero, If(DdlEstatusPersonal.SelectedValue = "2", TxtFechaBaja.Text.Trim, "-1"),
- DdlEstatusPersonal.SelectedValue.ToEntero, TxtFechaNacimiento.Text.ToDate,
- TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
- DdlEstados.SelectedValue.ToEntero, TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim,
- TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim,
- DdlBanco.SelectedValue.ToEntero, DdlRiesgoPuesto.SelectedValue.ToEntero, DdlRegimenContratacion.SelectedValue.ToEntero,
- DdlClienteAsignado.SelectedValue.ToEntero, DdlSubProyectoAsignado.SelectedValue.ToEntero, CvePersonal,
- 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, CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero()) Then
-
- 'Funsion usa RH Familiares
- If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
- ProcesaDTFamiliares(ObjPersonal)
- End If
-
-
- If Archivo.Exists Then
-
- If Not Directory.Exists(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta)) Then Directory.CreateDirectory(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta))
-
- If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
- File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
- End If
- System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
-
- End If
-
- Mensaje = "Los cambios se guardaron correctamente."
- 'If ViewState("CveEstatusOriginal").ToString() <> DdlEstatusPersonal.SelectedValue Then
- ' 'Manda Mail con bajas
- 'End If
-
-
- Else
- TieneError = True
- End If
-
-
- 'GUARDA ORGANIGRAMA
- If Not TieneError Then
- If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero)) Then
- TieneError = True
- End If
- End If
-
- End If
-
-
-
- If TieneError Then
- ObjPersonal.RollBack()
- Alert("Ocurrio un error guardar el Personal. Por favor vuelva a intentar.", TipoMensaje.MsgError)
- Else
- ObjPersonal.Commit()
- Alert(Mensaje, TipoMensaje.MsgInformacion, Accion)
-
- 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
- ' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL
- 'End If
- GlobalDTRHPersonal(UsuarioActual.CveEmpresa) = Nothing
-
- If CvePersonal > 0 Then
- CargaDatos()
- End If
-
- End If
-
- GuardarDocumentosFirmaContrato()
- Session("FileUpload") = ""
-
- ViewState("Archivo") = ""
- ObjPersonal.Dispose()
- ObjCuentasDeposito.Dispose()
- ObjAF.Dispose()
- UpDatos.Update()
- CargaGvBitacora()
-
- End Sub
-
- 'Private Sub MandaMails(Rutas As Object)
- ' Try
- ' Dim ObjMail As New ClsSisMail()
- ' Dim ResultadoMail As Integer = 0
-
- ' If ObjMail.Mandacorreo(SendMail, SendMailPassword, "valfredo@ford.com", "Notificación", "Notificación de empleado nuevo. Nombre: " & TxtNombre.Text & " Turno: " & DdlTurno.SelectedItem.Text & " Proyecto: " & DdlSubProyectoAsignado.SelectedItem.Text) Then
- ' ResultadoMail = 1
- ' Else
- ' ResultadoMail = 3
- ' End If
-
- ' Catch ex As Exception
- ' OnError("Ocurrió error al mandar MAIL", ex)
- ' End Try
- 'End Sub
-
- Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
- Dim ObjPersonal As New ClsRH()
- If ObjPersonal.RemovePersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
- Alert("El Personal se Eliminó correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/RH/CatPersonal.aspx""")
- End If
- ObjPersonal.Dispose()
- End Sub
-
- Protected Sub DdlProyectoAsignado_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyectoAsignado.SelectedIndexChanged
- CargaSubProyectoAsignado()
- End Sub
-
- Protected Sub DdlProyectoAsistenciaC_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyectoAsistenciaC.SelectedIndexChanged
- CargaSubProyectoAsistenciaC()
- End Sub
-
- Protected Sub DdlProyectoAsistenciaA_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyectoAsistenciaA.SelectedIndexChanged
- CargaSubProyectoAsistenciaA()
- End Sub
-
- Protected Sub LbContrato_Click(sender As Object, e As System.EventArgs) Handles LbContrato.Click
- 'Dim oWordApp As Word.Application = Nothing
- 'Dim oWordDoc As Word.Document = Nothing
- 'Dim objSelection As Word.Selection = Nothing
-
- 'Dim ArchivoPath As String = ""
-
- 'Try
- ' 'GuardaLog("Inicia Petición de Aplicación")
- ' oWordApp = New Word.Application
- ' oWordApp.Visible = True
- ' 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")
- ' oWordDoc.Activate()
- ' objSelection = oWordApp.Selection
-
- ' objSelection.WholeStory()
- ' objSelection.Copy()
- ' objSelection.Delete(Unit:=wdCharacter, Count:=1)
- ' 'GuardaLog("Recorrer de reemplazo de variables")
-
- ' objSelection.PasteAndFormat(Word.WdRecoveryType.wdPasteDefault)
- ' 'ReemplazaTexto(objSelection, "{NOMBRE_PERSONAL}", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim))
- ' 'ReemplazaTexto(objSelection, "{DIRECCION}", String.Format("{0} {1} {2}", TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim))
- ' 'ReemplazaTexto(objSelection, "{CP}", TxtCP.Text.Trim)
- ' 'ReemplazaTexto(objSelection, "{CIUDAD}", TxtCiudad.Text.Trim)
- ' 'ReemplazaTexto(objSelection, "{ESTADO}", TxtEstado.Text.Trim)
- ' 'ReemplazaTexto(objSelection, "{DIA_INICIA_CONTRATO}", TxtFechaInicioContrato.Text.ToDate.Day.ToString())
- ' 'ReemplazaTexto(objSelection, "{MES_INICIA_CONTRATO}", MonthName(TxtFechaInicioContrato.Text.ToDate.Month).ToUpper)
- ' 'ReemplazaTexto(objSelection, "{ANIO_INICIA_CONTRATO}", TxtFechaInicioContrato.Text.ToDate.Year.ToString())
- ' 'ReemplazaTexto(objSelection, "{DIA_FIN_CONTRATO}", TxtFechaFinContrato.Text.ToDate.Day.ToString())
- ' 'ReemplazaTexto(objSelection, "{MES_FIN_CONTRATO}", MonthName(TxtFechaFinContrato.Text.ToDate.Month).ToUpper)
- ' 'ReemplazaTexto(objSelection, "{ANIO_FIN_CONTRATO}", TxtFechaFinContrato.Text.ToDate.Year.ToString())
-
- ' 'objSelection.InsertBreak(Type:=wdPageBreak)
- ' 'GuardaLog("Termina de reemplazo de variables")
- ' objSelection.TypeBackspace()
- ' objSelection.TypeBackspace()
- ' 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 = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & UsuarioActual.CveUsuario & ".doc"
-
- ' oWordDoc.SaveAs(ArchivoPath.ToString())
- ' oWordDoc.Close()
- ' Else
- ' Alert("No se pudo generar el archivo", TipoMensaje.MsgError)
- ' End If
-
- 'Catch ex As Exception
- ' Alert(ex.Message, TipoMensaje.MsgError)
- ' OnError("", ex)
- ' ArchivoPath = ""
- 'Finally
-
- ' If oWordDoc IsNot Nothing Then
- ' 'GuardaLog("Documento Destruido")
- ' While (Marshal.ReleaseComObject(oWordDoc) > 0)
- ' End While
- ' 'GuardaLog("Documento Destruido")
- ' oWordDoc = Nothing
- ' End If
-
- ' If oWordApp IsNot Nothing Then
- ' oWordApp.Quit(False)
- ' While (Marshal.ReleaseComObject(oWordApp) > 0)
- ' End While
- ' 'GuardaLog("Aplicación Destruida")
- ' oWordApp = Nothing
- ' End If
- ' System.GC.Collect()
- ' objSelection = Nothing
-
- 'End Try
-
-
- 'If ArchivoPath <> "" Then
-
- ' Dim Archivo As New System.IO.FileInfo(ArchivoPath)
-
- ' 'If Archivo.Exists Then
- ' 'HttpContext.Current.Response.Clear()
- ' 'HttpContext.Current.Response.ClearContent()
- ' ''HttpContext.Current.Response.ContentType = "application/msword"
- ' 'HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
- ' 'HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
- ' 'HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
- ' 'HttpContext.Current.Response.TransmitFile(ArchivoPath)
- ' 'HttpContext.Current.Response.Flush()
- ' 'HttpContext.Current.Response.End()
- ' RegistraScript("AbrirVentana('/Ventas/PopUpImprimir.aspx?RH=True&Ext=" & Archivo.Extension & "', 700, 400, 'N', 'ImpRH')")
- ' 'End If
- ' Archivo = Nothing
-
- 'End If
-
- End Sub
-
- 'Private Sub ReemplazaTexto(ByRef ObjSelection As Word.Selection, ByVal Texto As String, ByVal Reemplazar As String)
- ' With ObjSelection.Find
- ' .Text = Texto
- ' .Replacement.Text = Reemplazar
- ' .Forward = True
- ' .Wrap = Word.WdFindWrap.wdFindContinue
- ' .Format = False
- ' .MatchCase = True
- ' .MatchWholeWord = False
- ' .MatchWildcards = False
- ' .MatchSoundsLike = False
- ' .MatchAllWordForms = False
- ' End With
- ' ObjSelection.Find.Execute(Replace:=Word.WdReplace.wdReplaceAll)
- 'End Sub
-
- Protected Sub BtnCargarClientes_Click(sender As Object, e As System.EventArgs) Handles BtnCargarClientes.Click
- CargaClientes()
- DdlClienteAsignado.Attributes.Remove("onclick")
- DdlClienteAsistenciaC.Attributes.Remove("onclick")
- DdlClienteAsistenciaA.Attributes.Remove("onclick")
+ LtlPersonal.Text = ObjPersonal.NombreCompleto
+ NombreCompleto = ObjPersonal.NombreCompleto
+ 'TxtNombre.Text = ObjPersonal.Nombre
+ TxtAPaterno.Text = ObjPersonal.APaterno
+ TxtAMaterno.Text = ObjPersonal.AMaterno
+ TxtNombres.Text = ObjPersonal.Nombres
+ TxtCorreo.Text = ObjPersonal.Correo
+ TxtCodigo.Text = ObjPersonal.Codigo
+ DdlEscolaridad.SelectedValue = ObjPersonal.CveEscolaridad.ToString()
+ DdlEstadoCivil.SelectedValueExist(ObjPersonal.CveEstadoCivil.ToString())
+ DdlGenero.SelectedValue = ObjPersonal.CveGenero.ToString()
+ TxtFechaNacimiento.Text = ObjPersonal.FechaNacimiento.ToShortDateString
+ TxtRFC.Text = ObjPersonal.RFC
+ TxtCURP.Text = ObjPersonal.CURP
+ 'Localización
+ 'TxtDireccion.Text = ObjPersonal.Direccion
+ TxtCalle.Text = ObjPersonal.Calle
+ TxtNumExt.Text = ObjPersonal.NumExt
+ TxtNumInt.Text = ObjPersonal.NumInt
+ TxtColonia.Text = ObjPersonal.Colonia
+ DdlEstados.SelectedValueExist(ObjPersonal.CveEstado.ToString())
+ TxtCP.Text = ObjPersonal.CP
+ TxtColonia.Text = ObjPersonal.Colonia
+ TxtCiudad.Text = ObjPersonal.Ciudad
+ TxtEstado.Text = ObjPersonal.Estado
+ TxtTelefono.Text = ObjPersonal.Telefono
+ TxtCelular.Text = ObjPersonal.Celular
+ TxtLugarNacimiento.Text = ObjPersonal.LugarNacimiento.ToString()
+ TxtNombrePadre.Text = ObjPersonal.NombrePadre
+ TxtNombreMadre.Text = ObjPersonal.NombreMadre
+ Session("FileUpload") = ObjPersonal.URL
+ ViewState("Archivo") = ObjPersonal.URL
+ TxtTelefonoExtension.Text = ObjPersonal.TelefonoExtension
+ TxtCelularPersonal.Text = ObjPersonal.CelularPersonal
+ TxtTelefonoMarcadoRapido.Text = ObjPersonal.TelefonoMarcadoRapido
+ 'TxtContactoAlterno.Text = ObjPersonal.ContactoAlterno
+
+
+ If ObjPersonal.CveUniforme > 0 Then
+ LnkSurtir.Visible = True
+ ViewState("CveUniforme") = ObjPersonal.CveUniforme
+ DdlUniforme.SelectedValueExist(CveUniforme)
+ LnkSurtir.PostBackUrl = $"../Inventarios/ResguardoMaterial.aspx?CvePersonal={CvePersonal}"
+ CargaUniformesPersonal()
+ End If
+
+ If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
+
+ LnkSurtir.Visible = True
+ DdlUniforme.Visible = False
+ LnkSurtir.PostBackUrl = $"../Inventarios/ResguardoMaterial.aspx?CvePersonal={CvePersonal}&EsSurtidoUniforme=1"
+ CargaUniformesPersonal()
+
+ End If
+
+ If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".jpg") Then
+ Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.jpg", UsuarioActual.CveEmpresa, CvePersonal)
+ Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
+
+ ImgPersonal.ImageUrl = logouri
+ ElseIf File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".png") Then
+ Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.png", UsuarioActual.CveEmpresa, CvePersonal)
+ Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
+
+ ImgPersonal.ImageUrl = logouri
+ ElseIf File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".bmp") Then
+ Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.bmp", UsuarioActual.CveEmpresa, CvePersonal)
+ Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica))
+
+ ImgPersonal.ImageUrl = logouri
+ End If
+ 'BtnCargarArchivo_Click(Me, New EventArgs)
+
+
+ 'Carga RH
+ TxtFechaInicioContrato.Text = ObjPersonal.FechaInicioContrato.ToShortDateString
+ TxtFechaFinContrato.Text = If(ObjPersonal.FechaFinContrato.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaFinContrato.ToShortDateString)
+ DDlTipoSalario.SelectedValue = drow("CveTipodeSalario").ToString()
+ DdlTipoContrato.SelectedValue = ObjPersonal.CveTipoContrato.ToString()
+ DdlTurno.SelectedValue = ObjPersonal.CveTurno.ToString()
+ DdlJornada.SelectedValue = ObjPersonal.CveJornada.ToString()
+ DdlDepartamento.SelectedValue = ObjPersonal.CveDepartamento.ToString()
+ DdlSubproyectoZona.SelectedValueExist(ObjPersonal.CveSubproyectoZona)
+ DDLUsuarioNomina.SelectedValueExist(ObjPersonal.CveUsuarioNomina)
+ 'DdlViaticos.SelectedValue = ObjPersonal.IdCtaContViaticos.ToString()
+
+ 'For i As Integer = DdlDepartamento.Items.Count - 1 To 1 Step -1
+ ' If DdlDepartamento.Items(i).Value.Contains(ObjPersonal.CveDepartamento.ToString()) Then
+ ' DdlDepartamento.Items(i).Selected = True
+ ' Exit For
+ ' End If
+ 'Next
+
+ DdlPuesto.SelectedValue = ObjPersonal.CvePuesto.ToString()
+ DdlRuta.SelectedValue = ObjPersonal.CveRuta.ToString()
+ DdlMotivoBaja.SelectedValue = ObjPersonal.CveMotivoBaja.ToString()
+
+ TxtFechaBaja.Text = If(ObjPersonal.FechaBaja.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaBaja.ToShortDateString)
+
+ If ObjPersonal.DtResultados IsNot Nothing AndAlso ObjPersonal.DtResultados.Rows.Count > 0 Then
+ TxtFechaActivo.Text = If(drow("FechaActivo").ToString().Length > 0, drow("FechaActivo").ToString().ToDate.ToString("dd/MM/yyyy"), drow("FechaIng").ToString().ToDate.ToString("dd/MM/yyyy"))
+ TxtFechaReingreso.Text = If(drow("FechaReingreso").ToString().Length > 0, drow("FechaReingreso").ToString().ToDate.ToString("dd/MM/yyyy"), "")
+ End If
+
+ DdlEstatusPersonal.SelectedValue = ObjPersonal.CveEstatusPersonal.ToString()
+
+ MostrarOcultarFechasEstatus()
+
+ CvePersonalEstatusInicial = ObjPersonal.CveEstatusPersonal
+ ViewState("CveEstatusOriginal") = ObjPersonal.CveEstatusPersonal.ToString()
+ 'Asignación
+ If ObjPersonal.CveCliente <> -1 Then
+ DdlClienteAsignado.Items.Insert(1, New ListItem(ObjPersonal.Cliente, ObjPersonal.CveCliente.ToString()))
+ DdlClienteAsignado.SelectedValue = ObjPersonal.CveCliente.ToString()
+ Else
+ DdlClienteAsignado.SelectedValue = ObjPersonal.CveCliente.ToString()
+ End If
+ DdlProyectoAsignado.SelectedValue = ObjPersonal.CveProyecto.ToString()
+ If ObjPersonal.CveProyecto <> -1 Then DdlProyectoAsignado_SelectedIndexChanged(Me, New System.EventArgs())
+ DdlSubProyectoAsignado.SelectedValue = ObjPersonal.CveSubProyecto.ToString()
+ DdlSupervisor.SelectedValue = ObjPersonal.CveSupervisor.ToString()
+ 'Carga Nómina
+ TxtFechaIngreso.Text = ObjPersonal.FechaIngreso.ToShortDateString
+ DdlTipoPeriodo.SelectedValue = ObjPersonal.CveTipoPeriodo.ToString()
+ TxtNumeroSS.Text = ObjPersonal.NumeroSS
+ ChkSeInscribioSS.Checked = ObjPersonal.SeInscribioSS
+ TxtSalarioDiarioPago.Text = ObjPersonal.SalarioDiarioPago.ToString()
+ TxtSalarioDiario.Text = ObjPersonal.SalarioDiario.ToString()
+ TxtSDI.Text = ObjPersonal.SDI.ToString()
+ TxtSalarioCotizado.Text = ObjPersonal.SalarioDiarioSS.ToString()
+ TxtFISalariodiario.Text = ObjPersonal.SalarioDiario.ToString()
+ TxtBono.Text = ObjPersonal.Bono.ToString()
+ TxtNumDiasAguinaldo.Text = ObjPersonal.NumDiasAguinaldo.ToString()
+ TxtFIAguinaldo.Text = ObjPersonal.NumDiasAguinaldo.ToString()
+ TxtPorPrimaVacacional.Text = ObjPersonal.PorPrimaVacacional.ToString()
+ TxtFIPrimaVacacional.Text = ObjPersonal.PorPrimaVacacional.ToString()
+
+ DdlMetodoPago.SelectedValue = ObjPersonal.CveMetodoPago.ToString()
+ TxtBancoNumCuenta.Text = ObjPersonal.BancoNumCuenta
+ TxtCLABE.Text = ObjPersonal.CLABE
+ DdlSupervisorOrganigrama.SelectedValueExist(If(ObjPersonal.CvePersonalPadre = ObjPersonal.CvePersonal, "0", If(ObjPersonal.CvePersonalPadre.ToString() = "0", "-1", ObjPersonal.CvePersonalPadre.ToString())))
+
+
+ DdlRegimenContratacion.SelectedValue = ObjPersonal.CveSATRegimenContratacion.ToString()
+ DdlBanco.SelectedValue = If(ObjPersonal.CveSATBanco = 0, "-1", ObjPersonal.CveSATBanco.ToString())
+ DdlRiesgoPuesto.SelectedValue = ObjPersonal.CveSATRiesgoPuesto.ToString()
+
+ 'Carga Incidencias
+ BtnConsultarAsistencia_Click(Me, New System.EventArgs)
+
+ 'Carga Buzón de Calidad
+ If ObjPersonal.GetBuzonCalidad(CvePersonal, UsuarioActual.CveEmpresa) Then
+ ViewState("DTBuzonCalidad") = ObjPersonal.DtResultados
+ GvBuzonCalidad.DataSource = ObjPersonal.DtResultados
+ Else
+ GvBuzonCalidad.DataSource = Nothing
+ ViewState("DTBuzonCalidad") = Nothing
+ End If
+ GvBuzonCalidad.DataBind()
+
+ 'Carga Conceptos de Nómina
+ CarcaConceptosNomina()
+ 'Carga Pagos no Bancarios
+ CargarPagosNoBancarios()
+ 'Carga Resguardos
+ Dim ObjResguardos As New ClsAF
+ If ObjResguardos.GetActivosFijosResguardos(-1, -1, CvePersonal, -1) Then
+ GvResguardos.DataSource = ObjResguardos.DtResultados
+ Else
+ GvResguardos.DataSource = Nothing
+ End If
+ ObjResguardos.Dispose()
+ GvResguardos.DataBind()
+
+ If UsuarioActual.Empresa.UsaContabilidad Then
+ DdlViaticos.AutoPostBack = True
+ DdlPrestamos.AutoPostBack = True
+
+ DdlViaticos.Attributes.Add("onclick", "CargaCuentas(1);")
+ DdlPrestamos.Attributes.Add("onclick", "CargaCuentas(2);")
+
+ If ObjPersonal.IdCtaContPersonal > 0 Then DdlViaticos.Items.Add(New ListItem(ObjPersonal.CtaContPersonal, ObjPersonal.IdCtaContPersonal.ToString())) : DdlViaticos.SelectedValue = ObjPersonal.IdCtaContPersonal.ToString()
+ If ObjPersonal.IdCtaContPrestamos > 0 Then DdlPrestamos.Items.Add(New ListItem(ObjPersonal.CtaContPrestamos, ObjPersonal.IdCtaContPrestamos.ToString())) : DdlPrestamos.SelectedValue = ObjPersonal.IdCtaContPrestamos.ToString()
+
+ End If
+
+ LblFechaCaptura.Text = ObjPersonal.FechaIngreso.ToShortDateString
+ LblUsuarioCapturo.Text = ObjPersonal.Usuario
+ CargaNominas()
+ CargaCastosSinComprobar()
+ CargaGastosPorCheque()
+ CargaEventoBitacora()
+ CargaConsignacion()
+ CargaCursos()
+ CargaVacaciones()
+ CargaVacacionesResumenPeriodoActual()
+ Consumos()
+ CargaPagoFactura()
+ 'DescarSolicitudVacaciones(-1)
+
+ TabVacaciones.Visible = True
+ If UsuarioActual.CveEmpresa = 7 Or UsuarioActual.CveEmpresa = 72 Then
+
+ 'If UsuarioActual.CveEmpresa = 72 Then
+
+ ' GvVacacionesResumen.Visible = False
+ ' DvHistorialVacaiones.Visible = False
+ ' FvPerimososVacaciones.Visible = False
+ ' 'DVSolicitudVacaiones.Attributes.Add("class", "col-md-12")
+ ' BtnSolicitarVacaciones.Text = "Solicitar"
+ ' DvPermisosMotivos1.Visible = True
+ ' DvPermisosMotivos2.Visible = True
+
+ 'End If
+
+ Else
+ 'TabVacaciones.Visible = False
+ End If
+
+ If VacDiasDisponibles > 0 Then
+ TxtFechaInicioVac.Text = Now.AddDays(1).ToString("dd/MM/yyyy")
+ Else
+ TxtFechaInicioVac.Text = Now.ToString("dd/MM/yyyy")
+ End If
+
+
+ TxtFechaFinVac.Text = Now.AddDays(VacDiasDisponibles).ToString("dd/MM/yyyy")
+
+ 'PERSONAL ALTAS
+ If ObjPersonal.GetPersonalAltas(CvePersonal) Then
+ GvPersonalAltas.DataSource = ObjPersonal.DtResultados
+ GvPersonalAltas.DataBind()
+ End If
+ 'Cargar Almacenes en DropDown GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 8)
+ DdlAlmacenDestinoLiberarUniforme.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 19")
+ DdlAlmacenDestinoLiberarUniforme.DataBind()
+
+ Else
+ Alert("El Personal Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
+ BtnGuardar.Enabled = False
+ End If
+ End If
+ ObjPersonal.Dispose()
End Sub
-#Region "Buzón de Calidad"
+ Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
+ 'System.Threading.Thread.Sleep(3000)
+ Dim ObjPersonal As New ClsRH()
+ Dim ObjCuentasDeposito As New ClsGenerales(ObjPersonal.IniciaTransacSQL())
+ Dim ObjAF As New ClsAF(ObjPersonal.IniciaTransacSQL())
+
+ 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}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ViewState("Archivo").ToString())
+ Dim Archivo As New System.IO.FileInfo(Ruta)
- Private Sub CargaBuzonCalidad()
-
- Dim ObjPersonal As New ClsRH
- If ObjPersonal.GetBuzonCalidad(CvePersonal, UsuarioActual.CveEmpresa) Then
- ViewState("DTBuzonCalidad") = ObjPersonal.DtResultados
- GvBuzonCalidad.DataSource = ObjPersonal.DtResultados
- Else
- GvBuzonCalidad.DataSource = Nothing
- ViewState("DTBuzonCalidad") = Nothing
- End If
- ObjPersonal.Dispose()
- GvBuzonCalidad.DataBind()
-
- UpBuzonCalidad.Update()
-
- End Sub
-
-
- Private Sub LnkBuzonDeCalidad_Click(sender As Object, e As EventArgs) Handles LnkBuzonDeCalidad.Click
-
- ChkSeAtendio.Visible = False
- DvSeguimiento.Visible = False
- BuzonCalidadLimpiaModal(True)
- RegistraScript("$('#ModalBuzonCalidad').modal({ backdrop: 'static', keyboard: false});")
- End Sub
- Private Sub LnkSaldoI_Click(sender As Object, e As EventArgs) Handles LnkSaldoI.Click
- RegistraScript("$('#ModalSaldoInicial').modal({ backdrop: 'static', keyboard: false});")
- End Sub
-
-
- Private Sub BuzonCalidadLimpiaModal(ControlesActivos As Boolean)
-
- DdlClienteBuzon.SelectedIndex = 0
- DdlClienteBuzon.Enabled = ControlesActivos
-
- DdlSucursalClienteBuzon.SelectedIndex = 0
- DdlSucursalClienteBuzon.Enabled = ControlesActivos
-
- DdlTipoBuzonCalidad.SelectedIndex = 0
- DdlTipoBuzonCalidad.Enabled = ControlesActivos
-
- TxtFechaBuzonCalidad.Text = ""
- TxtFechaBuzonCalidad.Enabled = ControlesActivos
-
- TxtBuzonDescriptcion.Text = ""
- TxtBuzonDescriptcion.Enabled = ControlesActivos
-
- TxtNombreClienteBuzonCalidad.Text = ""
- TxtNombreClienteBuzonCalidad.Enabled = ControlesActivos
-
- TxtTelefonoBuzonCalidad.Text = ""
- TxtTelefonoBuzonCalidad.Enabled = ControlesActivos
-
- TxtMailBuzonCalidad.Text = ""
- TxtMailBuzonCalidad.Enabled = ControlesActivos
-
- LnkFechaBuzonCalidad.Visible = ControlesActivos
-
- BtnModalGuardarBuzonCalidad.Visible = ControlesActivos
-
- TxtObservacionesBuzon.Text = ""
- TxtObservacionesBuzon.Visible = ControlesActivos
-
- UpModalBuzonCalidad.Update()
- RegistraScript("$('#ModalBuzonCalidad').modal({ backdrop: 'static', keyboard: false});")
-
- End Sub
-
- Public Sub BuzonCalidadVerInfo_Click(sender As Object, e As EventArgs)
-
- BuzonCalidadLimpiaModal(True)
- DvSeguimiento.Visible = True
-
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- CvePersonalBuzon = GvRow.DataKey("CvePersonalBuzon").ToEntero
- CargaBuzonCalidadSeguimiento()
- DdlClienteBuzon.SelectedValueExist(GvRow.DataKey("CveCliente"))
- ' DdlClienteBuzon.Enabled = False
-
- If GvRow.DataKey("CveClienteSucursal").ToEntero > 0 Then
- CargaClienteSucursal()
- DdlSucursalClienteBuzon.SelectedValueExist(GvRow.DataKey("CveClienteSucursal"))
- Else
- DdlSucursalClienteBuzon.DataSource = Nothing
- DdlSucursalClienteBuzon.DataBind()
- DdlSucursalClienteBuzon.SelectedIndex = 0
- ' DdlSucursalCliente.Enabled = False
- End If
-
- DdlTipoBuzonCalidad.SelectedValueExist(GvRow.DataKey("CveTipoBuzon"))
- ChkSeAtendio.Visible = True
-
- ChkSeAtendio.Checked = If(GvRow.DataKey("SeAtendioChk").ToString().ToEntero = 1, True, False)
-
- TxtFechaBuzonCalidad.Text = GvRow.DataKey("FechaQueja").ToDate.ToString("dd/MM/yyyy")
- TxtBuzonDescriptcion.Text = GvRow.DataKey("Descripcion")
- TxtNombreClienteBuzonCalidad.Text = GvRow.DataKey("NombreReporto")
- TxtTelefonoBuzonCalidad.Text = GvRow.DataKey("TelefonoReporto")
- TxtMailBuzonCalidad.Text = GvRow.DataKey("MailReporto")
- TxtObservacionesBuzon.Text = GvRow.DataKey("Observaciones")
-
- UpModalBuzonCalidad.Update()
- RegistraScript("$('#ModalBuzonCalidad').modal({ backdrop: 'static', keyboard: false});")
-
-
- End Sub
-
-
-
-
-
- Public Sub BuzonCalidadSeguimiento_Click(sender As Object, e As EventArgs)
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- 'CvePersonalBuzon,CveCliente,Cliente,TipoBuzon,FechaQueja,Descripcion,NombreReporto,TelefonoReporto,MailReporto,FechaIng,SeAtendio,Observaciones,SucursalCliente
-
-
- End Sub
-
- Public Sub BuzonCalidadFinalizar_Cllick(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- End Sub
-
- Property CvePersonalBuzon As Integer
- Get
- If ViewState("CvePersonalBuzon") Is Nothing Then
- Return -1
- Else
- Return ViewState("CvePersonalBuzon").ToString().ToEntero
- End If
- End Get
- Set(value As Integer)
- ViewState("CvePersonalBuzon") = value
- End Set
- End Property
-
-
- Private Sub BtnModalGuardarBuzonCalidad_Click(sender As Object, e As EventArgs) Handles BtnModalGuardarBuzonCalidad.Click
- Dim objRH As New ClsRH
-
- If CvePersonalBuzon = -1 Then
- objRH.AddBuzonCalidad(CvePersonal, DdlClienteBuzon.SelectedValue.ToEntero, DdlSucursalClienteBuzon.SelectedValue.ToEntero, DdlTipoBuzonCalidad.SelectedValue.ToEntero, TxtFechaBuzonCalidad.Text.ToDate, TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario)
-
- RegistraScript(" $('#ModalBuzonCalidad').modal('hide')", "HideModalCalidadAgregar")
- Else
- objRH.UpdateBuzonCalidad(CvePersonalBuzon, If(ChkSeAtendio.Checked, 1, 0), DdlClienteBuzon.SelectedValue.ToEntero, DdlSucursalClienteBuzon.SelectedValue.ToEntero, DdlTipoBuzonCalidad.SelectedValue.ToEntero, TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.CveUsuario)
- RegistraScript(" $('#ModalBuzonCalidad').modal('hide')", "HideModalCalidadAgregar")
- End If
- CargaBuzonCalidad()
-
- CargaGridBC(ViewState("Orden").ToString())
-
- objRH.Dispose()
-
- End Sub
-
-
-
- Private Sub BtnModalGuardarBuzonDetalleCalidad_Click(sender As Object, e As EventArgs) Handles BtnModalGuardarBuzonDetalleCalidad.Click
- Dim objRH As New ClsRH
-
- If objRH.AddBuzonCalidadDetalle(CvePersonalBuzon, TxtObserbacionBuzonDetalle.Text.Trim, If(chkBuzonDetalleNotiificar.Checked, 1, 0), TxtMailBuzonCalidad.Text.Trim, UsuarioActual.CveUsuario) Then
-
-
- If chkBuzonDetalleNotiificar.Checked Then
- Dim Correo As New ClsSisMail
- Dim Asunto As String = $"{UsuarioActual.Empresa.Empresa} Seguimiento {DdlTipoBuzonCalidad.SelectedItem.Text} Empleado {NombreCompleto}"
-
- Dim Cuerpo As New StringBuilder
-
- Cuerpo.AppendLine($"Seguimiento {DdlTipoBuzonCalidad.SelectedItem.Text} ")
- Cuerpo.AppendLine($" {UsuarioActual.Nombre} ")
- Cuerpo.AppendLine($"Actualización: {TxtObserbacionBuzonDetalle.Text} ")
- Cuerpo.AppendLine($" ")
-
-
- Correo.SendMail(EmpresaNotificaciones, TxtMailBuzonCalidad.Text.Trim, Asunto, Body:=Cuerpo.ToString())
-
- End If
-
-
-
-
- TxtObserbacionBuzonDetalle.Text = ""
- chkBuzonDetalleNotiificar.Checked = False
-
- End If
- objRH.Dispose()
-
- CargaBuzonCalidadSeguimiento()
-
- End Sub
-
-
- Private Sub CargaBuzonCalidadSeguimiento()
- If CvePersonalBuzon > 0 Then
- Dim objRH As New ClsRH
-
- If objRH.GetBuzonCalidadDetalle(CvePersonalBuzon) Then
- GvBuzonDetalles.DataSource = objRH.DtResultados
- Else
- GvBuzonDetalles.DataSource = Nothing
-
- End If
-
-
-
- objRH.Dispose()
- GvBuzonDetalles.DataBind()
- UpModalBuzonCalidad.Update()
-
- End If
- End Sub
-
-
-
-
- Private Sub CargaCombosBuzon()
-
-
- Dim ObjClientes As New ClsClientes
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
- DdlClienteBuzon.DataSource = ObjClientes.DtResultados
- DdlClienteBuzon.DataSource = ObjClientes.DtResultados
- DdlClienteBuzon.DataSource = ObjClientes.DtResultados
- Else
- DdlClienteBuzon.DataSource = Nothing
- DdlClienteBuzon.DataSource = Nothing
- DdlClienteBuzon.DataSource = Nothing
- End If
- ObjClientes.Dispose()
- DdlClienteBuzon.DataBind()
-
-
- Dim objRH As New ClsRH
-
- If objRH.GetBuzonCalidadTipo(1) Then
- DdlTipoBuzonCalidad.DataSource = objRH.DtResultados
-
- Else
- DdlTipoBuzonCalidad.DataSource = Nothing
- End If
- objRH.Dispose()
- DdlTipoBuzonCalidad.DataBind()
-
- UpModalBuzonCalidad.Update()
- End Sub
-
-
- Private Sub DdlClienteBuzon_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClienteBuzon.SelectedIndexChanged
- CargaClienteSucursal()
- End Sub
-
- Private Sub CargaClienteSucursal()
-
- Dim ObjCliente As New ClsClientes()
-
- If ObjCliente.GetSucursales(DdlClienteBuzon.SelectedValue.ToEntero) Then
- DdlSucursalClienteBuzon.DataSource = ObjCliente.DtResultados
- If ObjCliente.DtResultados.Rows.Count > 0 Then
- Divsucursalciente.Visible = True
- Else
- Divsucursalciente.Visible = False
- End If
- Else
- Divsucursalciente.Visible = False
- DdlSucursalClienteBuzon.DataSource = Nothing
- End If
- DdlSucursalClienteBuzon.DataBind()
- UpModalBuzonCalidad.Update()
- End Sub
-
- Protected Sub GvBuzonCalidad_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBuzonCalidad.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.FCLiteral("LtlCliente").Text = "" & e.Row.DBCampo("Cliente") & ""
- If e.Row.DBCampo("SeAtendio") = "Si" Then
- e.Row.BackColor = Drawing.Color.LightBlue
- End If
- End If
- End Sub
-
- Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBuzonCalidad.RowCancelingEdit
- GvBuzonCalidad.EditIndex = -1
- If ViewState("Orden").ToString() <> String.Empty Then
- CargaGridBC(ViewState("Orden").ToString())
- Else
- CargaGridBC("")
- End If
- End Sub
-
- 'Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBuzonCalidad.RowUpdating
- ' Dim ObjBuzonCalidad As New ClsRH
-
- ' Dim Observaciones As String = DirectCast(GvBuzonCalidad.Rows(e.RowIndex).FindControl("TxtObs"), TextBox).Text.Trim
- ' Dim SeAtendio As Boolean = GvBuzonCalidad.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
- ' Dim CveBuzonCalidad As Integer = GvBuzonCalidad.DataKeys(e.RowIndex).Value.ToString().ToEntero
-
- ' If ObjBuzonCalidad.UpdateBuzonCalidad(SeAtendio, Observaciones, CveBuzonCalidad, UsuarioActual.CveUsuario) Then
- ' GvBuzonCalidad.EditIndex = -1
- ' ViewState("DTBuzonCalidad") = ObjBuzonCalidad.DtResultados
- ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
- ' End If
-
- ' ObjBuzonCalidad.Dispose()
-
- ' If ViewState("Orden").ToString() <> String.Empty Then
- ' CargaGridBC(ViewState("Orden").ToString())
- ' Else
- ' CargaGridBC("")
- ' End If
-
- 'End Sub
-
- Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBuzonCalidad.RowEditing
- GvBuzonCalidad.EditIndex = e.NewEditIndex
-
- If ViewState("Orden").ToString() <> String.Empty Then
- CargaGridBC(ViewState("Orden").ToString())
- Else
- CargaGridBC("")
- End If
- End Sub
-
- Private Sub CargaGridBC(Orden As String)
- If Orden <> String.Empty Then
- Dim DV As New DataView(CType(ViewState("DTBuzonCalidad"), DataTable), "", Orden, DataViewRowState.CurrentRows)
- GvBuzonCalidad.DataSource = DV.ToTable()
- DV.Dispose()
- Else
- GvBuzonCalidad.DataSource = CType(ViewState("DTBuzonCalidad"), DataTable)
- End If
- GvBuzonCalidad.DataBind()
- UpDatos.Update()
+ Dim TieneError = False
+ Dim Mensaje = ""
+ Dim Accion = ""
+
+ Dim FechaBaja As Date = MinFecha
+ Dim FechaActivo As Date = MinFecha
+ Dim FechaReingreso As Date = MinFecha
+
+ If DdlEstatusPersonal.SelectedValue.ToEntero <> CvePersonalEstatusInicial Then
+ If DdlEstatusPersonal.SelectedValue.ToEntero = 1 Then
+ FechaActivo = TxtFechaActivo.Text.ToDate
+ ElseIf DdlEstatusPersonal.SelectedValue.ToEntero = 2 Then
+ FechaBaja = TxtFechaBaja.Text.ToDate
+ ElseIf DdlEstatusPersonal.SelectedValue.ToEntero = 5 Then
+ FechaReingreso = TxtFechaReingreso.Text.ToDate
+ End If
+ End If
+
+ If UsuarioActual.CveEmpresa = 72 OrElse UsuarioActual.CveEmpresa = 80 Then
+ TxtSalarioCotizado.Text = TxtSDI.Text
+ End If
+
+ If CvePersonal = -1 Then
+ URL = ""
+
+ If ObjPersonal.AddPersonal(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,
+ TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero, TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
+ DdlTipoContrato.SelectedValue.ToEntero, TxtUbicacion.Text.Trim,
+ DdlTurno.SelectedValue.ToEntero, DdlPuesto.SelectedValue.ToEntero,
+ DdlDepartamento.SelectedValue.ToEntero,
+ DdlRuta.SelectedValue.ToEntero,
+ DdlEscolaridad.SelectedValue.ToEntero,
+ DdlEstadoCivil.SelectedValue.ToEntero,
+ DdlGenero.SelectedValue.ToEntero,
+ DdlMotivoBaja.SelectedValue.ToEntero, If(DdlEstatusPersonal.SelectedValue = "2", TxtFechaBaja.Text.Trim, "-1"),
+ DdlEstatusPersonal.SelectedValue.ToEntero, TxtFechaNacimiento.Text.ToDate,
+ TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
+ DdlEstados.SelectedValue.ToEntero, TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim,
+ TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero, DdlRiesgoPuesto.SelectedValue.ToEntero, DdlRegimenContratacion.SelectedValue.ToEntero,
+ DdlClienteAsignado.SelectedValue.ToEntero, DdlSubProyectoAsignado.SelectedValue.ToEntero, 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.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero, DdlSubproyectoZona.SelectedValue.ToEntero, CveUniforme:=DdlUniforme.SelectedValue.ToEntero,
+ TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero()) Then
+
+ If Archivo.Exists Then
+
+ If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
+ File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
+ End If
+ System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
+
+ End If
+
+ 'Agregar Cuentas Bancarias
+ ViewState("CvePersonal") = ObjPersonal.CvePersonal
+
+ 'Funsion usa RH Familiares
+ If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
+ ProcesaDTFamiliares(ObjPersonal)
+ End If
+
+ If TempDTCuentasBancos.Rows.Count > 0 Then
+ For Each row As DataRow In TempDTCuentasBancos.Rows
+ If Not ObjCuentasDeposito.AddCuentasDepositos(row("BancoNombre").ToString(), row("Plaza").ToString(), row("Sucursal").ToString(), row("Cuenta").ToString(), row("CLABE").ToString(), row("CIE").ToString(), row("SWIFT").ToString(), row("Referencia").ToString(), "", UsuarioActual.CveUsuario, row("CveMoneda").ToString().ToEntero, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=row("BBVAAlias").ToString()) Then
+ TieneError = True
+ Exit For
+ End If
+ Next
+ End If
+ If DTLicencias IsNot Nothing AndAlso DTLicencias.Rows.Count > 0 Then
+ For Each Dr As DataRow In DTLicencias.Rows
+ If Not ObjAF.AddLicencia(-1, Dr("Licencia").ToString(), Dr("FechaExpedicion").ToString().ToDateTime(), Dr("FechaVencimiento").ToString().ToDateTime(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=ObjPersonal.CvePersonal) Then
+ TieneError = True
+ Exit For
+ End If
+ Next
+ End If
+
+ If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
+ GlobalDTGralColectivas(-1) = ObjPersonal.DtResultados
+ Else
+ TieneError = True
+ End If
+
+ Mensaje = "El Personal se guardó correctamente."
+ Accion = If(Request("CveFactura") Is Nothing, "document.location.href=""/RH/CatPersonal.aspx""", "window.opener.location.href = window.opener.location.href; window.close();")
+
+ 'Alert("El Personal se guardó correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/RH/CatPersonal.aspx"";")
+ Else
+ TieneError = True
+ End If
+
+ Else
+ '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,
+ TxtPorPrimaVacacional.Text.Trim.ToDouble, DdlMetodoPago.SelectedValue.ToEntero, TxtFechaInicioContrato.Text.Trim.ToDate, If(IsDate(TxtFechaFinContrato.Text.Trim()), TxtFechaFinContrato.Text.Trim(), "-1"),
+ DdlTipoContrato.SelectedValue.ToEntero, TxtUbicacion.Text.Trim,
+ DdlTurno.SelectedValue.ToEntero, DdlPuesto.SelectedValue.ToEntero,
+ DdlDepartamento.SelectedValue.ToEntero,
+ DdlRuta.SelectedValue.ToEntero,
+ DdlEscolaridad.SelectedValue.ToEntero,
+ DdlEstadoCivil.SelectedValue.ToEntero,
+ DdlGenero.SelectedValue.ToEntero,
+ DdlMotivoBaja.SelectedValue.ToEntero, If(DdlEstatusPersonal.SelectedValue = "2", TxtFechaBaja.Text.Trim, "-1"),
+ DdlEstatusPersonal.SelectedValue.ToEntero, TxtFechaNacimiento.Text.ToDate,
+ TxtLugarNacimiento.Text.Trim, TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim, TxtColonia.Text.Trim, TxtCP.Text.Trim, TxtCiudad.Text.Trim,
+ DdlEstados.SelectedValue.ToEntero, TxtTelefono.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim,
+ TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim,
+ DdlBanco.SelectedValue.ToEntero, DdlRiesgoPuesto.SelectedValue.ToEntero, DdlRegimenContratacion.SelectedValue.ToEntero,
+ DdlClienteAsignado.SelectedValue.ToEntero, DdlSubProyectoAsignado.SelectedValue.ToEntero, CvePersonal,
+ 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, CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero()) Then
+
+ 'Funsion usa RH Familiares
+ If UsuarioActual.Empresa.Funcionalidad(568) = "1" Then
+ ProcesaDTFamiliares(ObjPersonal)
+ End If
+
+
+ If Archivo.Exists Then
+
+ If Not Directory.Exists(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta)) Then Directory.CreateDirectory(String.Format("{0}\RH\Personal", UsuarioActual.Empresa.Ruta))
+
+ If File.Exists(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL)) Then
+ File.Delete(String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
+ End If
+ System.IO.File.Move(String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, URL), String.Format("{0}RH\Personal\{1}", UsuarioActual.Empresa.Ruta, URL))
+
+ End If
+
+ Mensaje = "Los cambios se guardaron correctamente."
+ 'If ViewState("CveEstatusOriginal").ToString() <> DdlEstatusPersonal.SelectedValue Then
+ ' 'Manda Mail con bajas
+ 'End If
+
+
+ Else
+ TieneError = True
+ End If
+
+
+ 'GUARDA ORGANIGRAMA
+ If Not TieneError Then
+ If Not ObjPersonal.AddUpdatePersonalOrganigrama(CvePersonal, If(DdlSupervisorOrganigrama.SelectedValue.ToEntero = 0, CvePersonal, DdlSupervisorOrganigrama.SelectedValue.ToEntero)) Then
+ TieneError = True
+ End If
+ End If
+
+ End If
+
+
+
+ If TieneError Then
+ ObjPersonal.RollBack()
+ Alert("Ocurrio un error guardar el Personal. Por favor vuelva a intentar.", TipoMensaje.MsgError)
+ Else
+ ObjPersonal.Commit()
+ Alert(Mensaje, TipoMensaje.MsgInformacion, Accion)
+
+ 'If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then
+ ' ImgPersonal.ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL
+ 'End If
+ GlobalDTRHPersonal(UsuarioActual.CveEmpresa) = Nothing
+
+ If CvePersonal > 0 Then
+ CargaDatos()
+ End If
+
+ End If
+
+ GuardarDocumentosFirmaContrato()
+ Session("FileUpload") = ""
+
+ ViewState("Archivo") = ""
+ ObjPersonal.Dispose()
+ ObjCuentasDeposito.Dispose()
+ ObjAF.Dispose()
+ UpDatos.Update()
+ CargaGvBitacora()
+
End Sub
-#End Region
+ 'Private Sub MandaMails(Rutas As Object)
+ ' Try
+ ' Dim ObjMail As New ClsSisMail()
+ ' Dim ResultadoMail As Integer = 0
-#Region "Resguardos"
+ ' If ObjMail.Mandacorreo(SendMail, SendMailPassword, "valfredo@ford.com", "Notificación", "Notificación de empleado nuevo. Nombre: " & TxtNombre.Text & " Turno: " & DdlTurno.SelectedItem.Text & " Proyecto: " & DdlSubProyectoAsignado.SelectedItem.Text) Then
+ ' ResultadoMail = 1
+ ' Else
+ ' ResultadoMail = 3
+ ' End If
- Protected Sub GvResguardos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvResguardos.RowDataBound
-
- If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.RowIndex = 0 Then
- e.Row.Cells(0).Width = Unit.Pixel(50) 'Código
- e.Row.Cells(1).Width = Unit.Pixel(250) 'AF
- e.Row.Cells(2).Width = Unit.Pixel(150) 'Tipo AF
- e.Row.Cells(3).Width = Unit.Pixel(65) 'Inició
- e.Row.Cells(4).Width = Unit.Pixel(65) 'Finalizó
- e.Row.Cells(5).Width = Unit.Pixel(80) 'Estado
- e.Row.Cells(6).Width = Unit.Pixel(280) 'Observaciones
- End If
-
- e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
- e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
- e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Left
-
- Dim Liga As String = ""
- e.Row.FCLiteral("LtlCodigo").Text = Liga & e.Row.FCLiteral("LtlCodigo").Text & ""
- e.Row.FCLiteral("LtlAF").Text = Liga & e.Row.FCLiteral("LtlAF").Text & ""
-
- End If
+ ' Catch ex As Exception
+ ' OnError("Ocurrió error al mandar MAIL", ex)
+ ' End Try
+ 'End Sub
+
+ Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
+ Dim ObjPersonal As New ClsRH()
+ If ObjPersonal.RemovePersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
+ Alert("El Personal se Eliminó correctamente.", TipoMensaje.MsgInformacion, "window.location.href=""/RH/CatPersonal.aspx""")
+ End If
+ ObjPersonal.Dispose()
End Sub
-#End Region
-
-#Region "Nómina"
-
-
- Private Sub CarcaConceptosNomina()
- Dim ObjPersonal As New ClsRH
- If ObjPersonal.GetPersonalConceptos(CvePersonal, UsuarioActual.CveEmpresa) Then
- GVConceptos.DataSource = ObjPersonal.DtResultados.FiltraParametros("(CveSistema <>3 AND CveSistema <>4) OR CveSistema IS NULL")
- Dim frow As DataRow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =3")
- If Not IsNothing(frow) Then
- TxtInfoValor.Text = String.Format("{0:###,###.##}", frow("Importe"))
- DdlInfoTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString())
-
- Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero
- TxtInfoDescripcion.Text = String.Format("{0}", frow("Descripcion02"))
- TxtInfoNumCredito.Text = String.Format("{0}", frow("Descripcion01"))
- TxtInfoFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion"))
- ChkInfo.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE")
- End If
-
-
- frow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =4")
- TxtFonValor.Text = ""
- DdlFonTipoAplicacion.SelectedValueExist("-1")
- TxtFonDescripcion.Text = ""
- TxtFonNumCredito.Text = ""
- TxtFonFechaInicio.Text = ""
- ChkFonacot.Checked = False
- If Not IsNothing(frow) Then
- TxtFonValor.Text = String.Format("{0:###,###.##}", frow("Importe"))
- DdlFonTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString())
-
- TxtFonDescripcion.Text = String.Format("{0}", frow("Descripcion02"))
- TxtFonNumCredito.Text = String.Format("{0}", frow("Descripcion01"))
- TxtFonFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion"))
- ChkFonacot.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE")
- End If
- Else
- GVConceptos.DataSource = Nothing
- End If
- ObjPersonal.Dispose()
- GVConceptos.DataBind()
-
- For Each Row As GridViewRow In GVConceptos.Rows
- Dim Ddl As DropDownList = DirectCast(GVConceptos.Rows(Row.RowIndex).FCDropDownList("DdlTipoAplicacion"), DropDownList)
- DdlTipoAplicacion_SelectedIndexChanged(Ddl, Nothing)
- Next
- End Sub
-
- Protected Sub GVConceptos_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVConceptos.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
-
- e.Row.Cells(0).Width = Unit.Pixel(50)
- e.Row.Cells(1).Width = Unit.Pixel(50)
- e.Row.Cells(3).Width = Unit.Pixel(70)
- e.Row.Cells(4).Width = Unit.Pixel(70)
- e.Row.Cells(5).Width = Unit.Pixel(160)
-
-
- If e.Row.DBCampo("Aplica").ToEntero = 1 Then e.Row.FCCheckBox("ChkAplica").Checked = True
-
- If e.Row.DBCampo("Formula") = "S" Then
- e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(3).Text = "Calculado"
- e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(4).Text = "Permanente"
- Else
- 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
-
- End If
- End Sub
-
- Protected Sub BtnGuardarInfornavit_Click(sender As Object, e As EventArgs)
- Dim importe As Decimal = TxtInfoValor.Text.ToDecimal()
- Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero
- Dim NoPagos As Integer = 0
- Dim SaldoIni As Decimal = 0
- Dim descripcion02 As String = TxtInfoDescripcion.Text
- Dim descripcion01 As String = TxtInfoNumCredito.Text
- Dim fecha As String = TxtInfoFechaInicio.Text.Replace("_", "")
- Dim estatus As Integer = If(ChkInfo.Checked, 1, 0)
- If fecha.Length > 8 Then
- fecha = fecha.ToDateTime().ToString("yyyy/MM/dd")
- Else
- fecha = ""
- End If
- Dim OcurrioError As Boolean = False
- Using ObjPersonal As New ClsRH
-
- If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 3, descripcion01, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then
- OcurrioError = True
- End If
- End Using
- If Not OcurrioError Then
- Alert("Se actualizo el calculo de infonavit")
- CarcaConceptosNomina()
- End If
- End Sub
- Protected Sub BtnGuardarConceptos_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarConceptos.Click
- If CvePersonal > 0 Then
- Dim ObjPersonal As New ClsRH
- ObjPersonal.IniciaTransacSQL()
-
- Dim OcurrioError As Boolean = False
- For Each Row As GridViewRow In GVConceptos.Rows
- If Row.FCCheckBox("ChkAplica").Checked = True Then
- Dim CveConcepto As Integer = Row.DataKey("CveConcepto").ToEntero
- Dim Importe As Double = Row.FCTextBox("TxtImporte").Text.ToDouble
- Dim TipoAplicacion As Integer = Row.FCDropDownList("DdlTipoAplicacion").SelectedValue.ToEntero
- Dim NoPagos As Integer = If(Row.FCTextBox("TxtNoPagos").Text.ToEntero = 0, -1, Row.FCTextBox("TxtNoPagos").Text.ToEntero)
- Dim SaldoIni As Double = If(Row.FCTextBox("TxtSaldoIni").Text.ToDouble = 0, -1, Row.FCTextBox("TxtSaldoIni").Text.ToDouble)
-
- Select Case TipoAplicacion
- Case 1
- 'Saldo
- NoPagos = -1
- Case 2
- 'Numero de Pagos
- SaldoIni = -1
- Case 2600
- 'Permanente
- NoPagos = -1
- SaldoIni = -1
- End Select
-
- 'Insertarlo o Actualizarlo
- If Not ObjPersonal.AddConcepto(CvePersonal, CveConcepto, Importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario) Then
- OcurrioError = True
- ObjPersonal.RollBack()
- Exit For
- End If
- Else
- 'Borrarlo
- If Row.DataKey("CvePersonalConcepto") <> "" Then
- If Not ObjPersonal.RemoveConcepto(Row.DataKey("CvePersonalConcepto").ToEntero) Then
- OcurrioError = True
- ObjPersonal.RollBack()
- Exit For
- End If
- End If
- End If
- Next
-
- If Not OcurrioError Then
- ObjPersonal.Commit()
- Alert("La información se guardó correctamente.", TipoMensaje.MsgInformacion)
- Else
- Alert("Ocurrió un error al guardar la información.", TipoMensaje.MsgError)
- End If
-
- ObjPersonal.Dispose()
- End If
- End Sub
-#End Region
-
- Protected Sub DdlTipoAplicacion_SelectedIndexChanged(sender As Object, e As EventArgs)
- Dim Ddl As DropDownList = DirectCast(sender, DropDownList)
-
- Dim gvr As GridViewRow = DirectCast(Ddl.NamingContainer, GridViewRow)
-
- Select Case Ddl.SelectedValue.ToEntero
- Case 1
- 'Descontar hasta pagar el saldo prestado
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = True
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = False
- Case 2
- 'Descontar el numero de pagos
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = False
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = True
- Case 2600
- 'Permanente
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = False
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = False
- Case -1
- 'Seleccione
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = False
- GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = False
- End Select
- End Sub
-
- Protected Sub DdlEstatusPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstatusPersonal.SelectedIndexChanged
-
- MostrarOcultarFechasEstatus()
- End Sub
-
- Private Sub MostrarOcultarFechasEstatus()
-
-
- If DdlEstatusPersonal.SelectedValue.ToEntero.Contiene(1, 2, 5) Then
- DivFechaActivo.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 1, True, False)
- DivFechaBaja.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 2, True, False)
- DivFechaReingreso.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 5, True, False)
- Else
- DivFechaActivo.Visible = False
- DivFechaBaja.Visible = False
- DivFechaReingreso.Visible = False
- End If
-
- End Sub
-
- Protected Sub GvNominas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvNominas.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.RowIndex = 0 Then
-
- e.Row.Cells(0).Width = Unit.Pixel(35)
- e.Row.Cells(1).Width = Unit.Pixel(75)
- e.Row.Cells(2).Width = Unit.Pixel(75)
- e.Row.Cells(3).Width = Unit.Pixel(95)
- e.Row.Cells(4).Width = Unit.Pixel(95)
- e.Row.Cells(5).Width = Unit.Pixel(95)
- e.Row.Cells(6).Width = Unit.Pixel(95)
-
- End If
-
-
-
- e.Row.FCLinkButton("LBCancelar").Visible = True
- e.Row.FCLinkButton("LBCancelar").CommandArgument = e.Row.DBCampo("FolioFiscal")
-
- If e.Row.DBCampo("SeTimbro") = "True" Then
-
- e.Row.FCLinkButton("LbMail").CommandArgument = e.Row.DBCampo("FolioFiscal")
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LbMail"))
- e.Row.FCLinkButton("LbMail").Visible = True
-
- e.Row.FCLinkButton("LbPDF").CommandArgument = e.Row.DataKey("CvePeriodo")
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LbPDF")) ' registro el evento postback
- 'e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Empresas/{0}/PDF/Nomina/{1}.pdf", e.Row.DBCampo("CveEmpresa"), e.Row.DBCampo("SerieFolio"))
- 'e.Row.FCHyperLink("HplSeTimbro").NavigateUrl = String.Format("/Empresas/{0}/XML/Nomina/{1}.xml", e.Row.DBCampo("CveEmpresa"), e.Row.DBCampo("SerieFolio"))
- e.Row.FCLinkButton("LbPDF").Visible = True
-
- e.Row.FCLinkButton("LBCancelar").Visible = True
- e.Row.FCLinkButton("LBCancelar").CommandArgument = e.Row.DBCampo("FolioFiscal")
- End If
-
- End If
+ Protected Sub DdlProyectoAsignado_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyectoAsignado.SelectedIndexChanged
+ CargaSubProyectoAsignado()
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
- PnlGastoGeneral.Visible = True
- PnlGastoCheque.Visible = False
- Else
- PnlGastoGeneral.Visible = False
- PnlGastoCheque.Visible = True
- End If
-
- End Sub
-
- Private Sub CargaCastosSinComprobar()
- 'Dim objGXC As New ClsMovimientos
-
- 'If objGXC.GetEgresosSinComprobar("-1", "-1", -1, CvePersonal, -1, -1, -1, -1, 0, UsuarioActual.CveEmpresa) Then
- ' GvGxC.DataSource = objGXC.DtResultados.FiltraParametros("Saldo > 0")
-
- ' GvGxCHistorial.DataSource = objGXC.DtResultados.FiltraParametros("Saldo = 0")
-
- 'End If
-
- 'objGXC.Dispose()
- 'GvGxC.DataBind()
- 'GvGxCHistorial.DataBind()
-
- Dim Conta As New ClsContabilidad
- If Conta.GetPersonalAuxiliar(CvePersonal, UsuarioActual.CveEmpresa) Then
- DTGastosSinComp = Conta.DtResultados
- GvGxC.DataSource = DTGastosSinComp
- LblSaldoGxC.Text = (Conta.DtResultados.SUM("Cargo", "CveMovimiento Is NULL") - Conta.DtResultados.SUM("Abono", "CveMovimiento Is NULL")).FormatoNumero()
- End If
- Conta.Dispose()
- GvGxC.DataBind()
-
- Dim ObjBancos As New ClsBancos
- If ObjBancos.GetPersonalPrestamoAuxiliar(CvePersonal, "-1", "-1", UsuarioActual.CveEmpresa) Then
- GvAuxiliar.DataSource = ObjBancos.DtResultados
- End If
- ObjBancos.Dispose()
- GvAuxiliar.DataBind()
-
- End Sub
-
- Private Sub CargaGastosPorCheque()
- Dim RH As New ClsRH
-
- If RH.GetRepPersonalBancos(CvePersonal, "-1", "-1", -1) Then
- DTGastosPorCheque = RH.DtResultados
- GvGastosCheque.DataSource = DTGastosPorCheque
- Else
- GvGastosCheque.DataSource = Nothing
- Alert("Ocurrió un error al consultar los Gastos X Comprobar agrupados por cheque.", TipoMensaje.MsgError)
- End If
-
- RH.Dispose()
-
- GvGastosCheque.DataBind()
- End Sub
-
- Protected Sub GvGastosCheque_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvGastosCheque.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- If e.Row.RowIndex = 0 Then
- e.Row.Cells(0).Width = Unit.Pixel(120)
- e.Row.Cells(1).Width = Unit.Pixel(70)
- e.Row.Cells(2).Width = Unit.Pixel(80)
- e.Row.Cells(3).Width = Unit.Pixel(80)
- e.Row.Cells(4).Width = Unit.Pixel(90)
- e.Row.Cells(5).Width = Unit.Pixel(90)
- e.Row.Cells(6).Width = Unit.Pixel(105)
- e.Row.Cells(7).Width = Unit.Pixel(90)
-
- End If
-
- If e.Row.DBCampo("CveCompra") = "" Then
- If e.Row.DBCampo("CveIE") <> "" Then
- e.Row.Cells(0).Text = String.Format("{0} - {1} - {2}", e.Row.DBCampo("Banco"), e.Row.DBCampo("NumCuenta"), e.Row.DBCampo("Moneda"))
-
- e.Row.FCLiteral("LtlFechaVenci").Text = e.Row.DBCampo("FechaDocumento").ToDate.ToShortDateString
- e.Row.FCHyperLink("HplCheque").Visible = True
- End If
- e.Row.BackColor = Drawing.Color.LightGray
-
- End If
-
- End If
-
+ Protected Sub DdlProyectoAsistenciaC_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyectoAsistenciaC.SelectedIndexChanged
+ CargaSubProyectoAsistenciaC()
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
- If e.Row.RowIndex = 0 Then
- e.Row.Cells(0).Width = Unit.Pixel(200)
- e.Row.Cells(1).Width = Unit.Pixel(200)
- e.Row.Cells(2).Width = Unit.Pixel(100)
- e.Row.Cells(3).Width = Unit.Pixel(500)
- End If
-
- If e.Row.DBCampo("Archivo").ToString() <> "" Then
- e.Row.FCLinkButton("LinkArchivo").Visible = True
- e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString())
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
- End If
-
- e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
- End If
- End Sub
- Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
-
- Dim ObjEventoBitacora As New ClsOIEventos
-
- Dim FileExtension As String = "-1"
- Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
- Dim filemove As String = ""
-
- For Each fileItem As Archivo In filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
- filemove = fileItem.filename
- Next
-
- If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
- If filemove <> "" Then
- filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa))
- End If
-
- GvEB.DataSource = ObjEventoBitacora.DtResultados
- TxtEventoDescripcion.Text = ""
- Anexo.Text = "[]"
- Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
- RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
- End If
- ObjEventoBitacora.Dispose()
- GvEB.DataBind()
-
- UPEventoBitacora.Update()
- CargaEventoBitacora()
- UPAddEventoBitacora.Update()
- End Sub
- Private Sub CargaEventoBitacora()
-
- Dim ObjEventoBitacora As New ClsOIEventos()
- If ObjEventoBitacora.GetAgendaBitacora(-1, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
- GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento = 6 OR CveTipoEvento = 2")
- Else
- GvEB.DataSource = Nothing
- End If
- GvEB.DataBind()
- End Sub
-
- Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
- Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
- Dim Archivo As New System.IO.FileInfo(filePath)
-
- HttpContext.Current.Response.Clear()
- HttpContext.Current.Response.ClearContent()
- HttpContext.Current.Response.ContentType = "application/octet-stream"
- HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + 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 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
- e.Row.Cells(0).Width = Unit.Pixel(100)
- e.Row.Cells(1).Width = Unit.Pixel(200)
- e.Row.Cells(2).Width = Unit.Pixel(350)
- e.Row.Cells(3).Width = Unit.Pixel(100)
- e.Row.Cells(4).Width = Unit.Pixel(100)
- 'e.Row.Cells(5).Width = Unit.Pixel(100)
- 'e.Row.Cells(6).Width = Unit.Pixel(80)
- 'e.Row.Cells(7).Width = Unit.Pixel(100)
- End If
-
- If e.Row.DBCampo("FechaDocumento") = "" Then e.Row.BackColor = Drawing.Color.LightGray
-
- If e.Row.DBCampo("CveIE").ToEntero > 0 Then
- e.Row.FCHyperLink("HplRef").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
- e.Row.FCLabel("LtlC").CssClass = "label label-sm label-success"
- e.Row.FCLabel("LtlC").ForeColor = Drawing.Color.White
- End If
- If e.Row.DBCampo("CveCompra").ToEntero > 0 Then
- e.Row.FCHyperLink("HplRef").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
- e.Row.FCLabel("LtlC").CssClass = "label label-sm label-warning"
- e.Row.FCLabel("LtlC").ForeColor = Drawing.Color.White
- End If
-
- End If
-
- End Sub
-
- Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
- If DtCuentasContables Is Nothing Then
- CargaCuentasContables()
- End If
- Dim SeleccionadoContViaticos As String
- Dim SeleccionadoContPrestamos As String
- Select Case HdnCuenta.Value
- Case "1"
- SeleccionadoContViaticos = DdlViaticos.SelectedValue
- DdlViaticos.Items.Clear() : DdlViaticos.Items.Add(New ListItem("Seleccione", "0"))
- DdlViaticos.DataSource = DtCuentasContables : DdlViaticos.DataBind() : DdlViaticos.SelectedValueExist(SeleccionadoContViaticos)
- DdlViaticos.AutoPostBack = False : DdlViaticos.Attributes.Remove("onclick") : DdlViaticos.CssClass &= " select2me"
- Case "2"
- SeleccionadoContPrestamos = DdlPrestamos.SelectedValue
- DdlPrestamos.Items.Clear() : DdlPrestamos.Items.Add(New ListItem("Seleccione", "0"))
- DdlPrestamos.DataSource = DtCuentasContables : DdlPrestamos.DataBind() : DdlPrestamos.SelectedValueExist(SeleccionadoContPrestamos)
- DdlPrestamos.AutoPostBack = False : DdlPrestamos.Attributes.Remove("onclick") : DdlPrestamos.CssClass &= " select2me"
- End Select
-
-
-
-
- End Sub
-#Region "TAB BANCOS"
- Private Sub CargaMonedas()
- DdlMoneda.DataSource = GlobalDTMonedas
- DdlMoneda.DataBind()
- DdlMoneda.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End Sub
-
- Protected Sub LbAgregarCuentaBanco_Click(sender As Object, e As EventArgs)
- Dim EsBancomer = False
-
- If TxtNombreBanco.Text.ToUpper.Contains("BBVA") Or TxtNombreBanco.Text.ToUpper.Contains("BANCOMER") Or (TxtCLABECB.Text.Length = 18 AndAlso TxtCLABECB.Text.Substring(0, 3) = "012") Then
- EsBancomer = True
- End If
-
- If EsBancomer AndAlso (TxtCLABECB.Text.Length = 18 AndAlso Not TxtCLABECB.Text.Substring(0, 3) = "012") Then
- Alert("La CLABE ingresada no pertenece a BANCOMER.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- ''CLABE SIEMPRE OBLIGATORIA CUANDO NO ES BANCOMER CON CIE
- 'If (TxtCLABECB.Text.Trim.Length <> 18 And Not EsBancomer) Or (EsBancomer And TxtConvenioCIE.Text.Trim.Length <> 6 And TxtCLABECB.Text.Trim.Length <> 18) Then
- ' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- 'End If
-
- 'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER
- If TxtCLABECB.Text.Trim.Length <> 18 And TxtCLABECB.Text.Trim.Length = 0 And Not EsBancomer Then
- Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'SI CUENTA TIENE ALGO Y BANCO BANCOMER DEBE TENER UNA LOGITUD EXACTA DE 10
- If TxtNumeroCuenta.Text.Trim.Length <> 0 AndAlso TxtNumeroCuenta.Text.Trim.Length <> 10 AndAlso EsBancomer Then
- Alert("El número de cuenta debe tener una longitud de 10 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18
- If TxtCLABECB.Text.Trim.Length <> 0 AndAlso TxtCLABECB.Text.Trim.Length <> 18 Then
- Alert("La CLABE debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'SI CIE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 6 Y REFERENCIA OBLIGATORIA
- If (TxtConvenioCIE.Text.Trim.Length <> 0 And TxtConvenioCIE.Text.Trim.Length <> 6) Or (TxtConvenioCIE.Text.Trim.Length = 6 And TxtReferenciaCB.Text.Trim.Length < 3) Then
- Alert("El Convenio CIE debe tener una longitud de 6 dígitos y se debe especificar una referencia. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA"
- If EsBancomer AndAlso Not (TxtNumeroCuenta.Text.Trim.Length = 10 Or TxtConvenioCIE.Text.Trim.Length = 6) Then
- Alert("Para cuentas BBVA BANCOMER es obligatorio el Número de Cuenta o CIE.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- AgregarCuentaBanco(TxtNombreBanco.Text.Trim, TxtNumeroSucursal.Text.Trim, TxtCLABECB.Text.Trim, TxtSWIFT.Text.Trim, TxtPlaza.Text.Trim, TxtNumeroCuenta.Text.Trim, TxtConvenioCIE.Text.Trim, TxtReferenciaCB.Text.Trim, DdlMoneda.SelectedValue.ToEntero, DdlMoneda.SelectedItem.Text, TxtBBVAAlias.Text)
- End Sub
- Private Sub CargaGridCuentasBancos(Orden As String)
- If CvePersonal > 0 Then
- If Orden <> String.Empty Then
- Dim DV As New DataView(DTCuentasBancos, "", Orden, DataViewRowState.CurrentRows)
- GvBancosCuentas.DataSource = DV.ToTable()
- DV.Dispose()
- Else
- GvBancosCuentas.DataSource = DTCuentasBancos
- End If
- Else
- If Orden <> String.Empty Then
- Dim DV As New DataView(TempDTCuentasBancos, "", Orden, DataViewRowState.CurrentRows)
- GvBancosCuentas.DataSource = DV.ToTable()
- DV.Dispose()
- Else
- GvBancosCuentas.DataSource = TempDTCuentasBancos
- End If
- End If
-
- GvBancosCuentas.DataBind()
- UpCuentasBancos.Update()
- End Sub
- Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String, CveMoneda As Integer, Moneda As String, BBVAAlias As String)
-
- Dim Row As DataRow
-
- If CvePersonal > 0 Then
- Dim ObjCuentasBancos As New ClsGenerales
- If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", UsuarioActual.CveUsuario, CveMoneda, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias) Then
- DTCuentasBancos.Clear()
- DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal)))
-
- Alert("Cuenta Bancaria agregada con éxito.", TipoMensaje.MsgInformacion)
-
- End If
- ObjCuentasBancos.Dispose()
-
- Else
- Row = TempDTCuentasBancos.NewRow
-
- Row("BancoNombre") = NombreBanco
- Row("Sucursal") = NumeroSucursal
- Row("CLABE") = CLABE
- Row("SWIFT") = SWIFT
- Row("Plaza") = Plaza
- Row("Cuenta") = NumeroCuenta
- Row("CIE") = ConvenioCIE
- Row("Referencia") = Referencia
- Row("CveMoneda") = CveMoneda
- Row("Moneda") = Moneda
- Row("EstatusPagoElectronico") = False
- TempDTCuentasBancos.Rows.Add(Row)
- End If
-
- LimpiaCuentasBancarias()
- CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
-
- If CvePersonal > 0 Then
- CargaGvBitacora()
- End If
-
- End Sub
- Private Sub LimpiaCuentasBancarias()
- TxtNombreBanco.Text = ""
- TxtNumeroSucursal.Text = ""
- TxtCLABECB.Text = ""
- TxtSWIFT.Text = ""
- TxtPlaza.Text = ""
- TxtNumeroCuenta.Text = ""
- TxtConvenioCIE.Text = ""
- TxtReferenciaCB.Text = ""
- End Sub
- Private Sub CargaCuentasBancarias()
- Dim ObjCuentasBancos As New ClsGenerales
- ViewState("OrdenCuentasBancos") = ""
- DTCuentasBancos = New DataTable
- TempDTCuentasBancos = New DataTable
-
- If ObjCuentasBancos.GetCuentasDepositos(CvePersonal:=CvePersonal) Then
- DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados)
- Else
- Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgError)
- End If
-
- If CvePersonal < 0 Then
- TempDTCuentasBancos = DTCuentasBancos.Clone
- End If
-
- ObjCuentasBancos.Dispose()
- CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
+ Protected Sub DdlProyectoAsistenciaA_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyectoAsistenciaA.SelectedIndexChanged
+ CargaSubProyectoAsistenciaA()
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
-
-
- If e.Row.RowState = DataControlRowState.Edit Then
- e.Row.FCDropDownList("DdlMoneda").DataSource = GlobalDTMonedas
- e.Row.FCDropDownList("DdlMoneda").DataBind()
- e.Row.FCDropDownList("DdlMoneda").Items.Insert(0, New ListItem("Seleccione", "-1"))
- e.Row.FCDropDownList("DdlMoneda").SelectedValue = e.Row.DBCampo("CveMoneda")
-
- 'SI TIENE PERMISO PUEDE EDITAR ESTATUS
- If UsuarioActual.TienePermisoProceso(155) Then
- 'Alert("usuario no tiene permiso", TipoMensaje.MsgInformacion)
- e.Row.FCCheckBox("ChkEstatus").Visible = True
- Else
- e.Row.FCCheckBox("ChkEstatus").Visible = False
- End If
-
- If CBool(e.Row.DBCampo("EstatusPagoElectronico")) Then
- e.Row.FCDropDownList("DdlMoneda").Enabled = False
- End If
-
- End If
-
- If CvePersonal < 0 Then
- For index = 1 To TempDTCuentasBancos.Rows.Count
- TempDTCuentasBancos.Rows(index - 1)("CveCuentaDeposito") = index
- Next
- TempDTCuentasBancos.AcceptChanges()
- End If
-
- End If
- End Sub
- Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing
- GvBancosCuentas.EditIndex = e.NewEditIndex
- CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
- End Sub
- Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit
- GvBancosCuentas.EditIndex = -1
- CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
- End Sub
- Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating
- Dim NombreBanco = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim
- Dim NumeroSucursal = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroSucursal").Text.Trim
- Dim CLABE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtCLABE").Text.Trim
- Dim SWIFT = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtSWIFT").Text.Trim
- Dim Plaza = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtPlaza").Text.Trim
- Dim NumeroCuenta = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim
- Dim ConvenioCIE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim
- 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 BBVAAlias As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtBBVAAlias").Text
-
- Dim RefCrediProveedor = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtRefCrediProveedor").Text.Trim
-
- Dim EsBancomer = False
-
- If NombreBanco.ToUpper.Contains("BBVA") Or NombreBanco.ToUpper.Contains("BANCOMER") Or (CLABE.Length = 18 AndAlso CLABE.Substring(0, 3) = "012") Then
- EsBancomer = True
- End If
-
- If EsBancomer AndAlso (CLABE.Length = 18 AndAlso Not CLABE.Substring(0, 3) = "012") Then
- Alert("La CLABE ingresada no pertenece a BANCOMER.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- ''CLABE SIEMPRE OBLIGATORIA CUANDO NO ES BANCOMER CON CIE
- 'If (CLABE.Trim.Length <> 18 And Not EsBancomer) Or (EsBancomer And ConvenioCIE.Trim.Length <> 6 And CLABE.Trim.Length <> 18) Then
- ' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- 'End If
-
- 'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER
- If CLABE.Trim.Length <> 18 And CLABE.Trim.Length = 0 And Not EsBancomer Then
- Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'SI CUENTA TIENE ALGO Y BANCO BANCOMER DEBE TENER UNA LOGITUD EXACTA DE 10
- If NumeroCuenta.Trim.Length <> 0 AndAlso NumeroCuenta.Trim.Length <> 10 AndAlso EsBancomer Then
- Alert("El número de cuenta debe tener una longitud de 10 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18
- If CLABE.Trim.Length <> 0 AndAlso CLABE.Trim.Length <> 18 Then
- Alert("La CLABE debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'SI CIE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 6 Y REFERENCIA OBLIGATORIA
- If (ConvenioCIE.Trim.Length <> 0 And ConvenioCIE.Trim.Length <> 6) Or (ConvenioCIE.Trim.Length = 6 And Referencia.Trim.Length < 3) Then
- Alert("El Convenio CIE debe tener una longitud de 6 dígitos y se debe especificar una referencia. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- 'CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA"
- If EsBancomer AndAlso Not (NumeroCuenta.Trim.Length = 10 Or ConvenioCIE.Trim.Length = 6) Then
- Alert("Para cuentas BBVA BANCOMER es obligatorio el Número de Cuenta o CIE.", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
- Dim ObjCuentasBancos As New ClsGenerales
- If CvePersonal > 0 Then
- If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias) Then
- DTCuentasBancos.Clear()
- DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal)))
- Alert("Cuenta actualizada con exito.", TipoMensaje.MsgInformacion)
-
- End If
- Else
- Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero - 1
- Dim Row As DataRow = TempDTCuentasBancos.Rows(index)
- Row("BancoNombre") = NombreBanco
- Row("Sucursal") = NumeroSucursal
- Row("CLABE") = CLABE
- Row("SWIFT") = SWIFT
- Row("Plaza") = Plaza
- Row("Cuenta") = NumeroCuenta
- Row("CIE") = ConvenioCIE
- Row("Referencia") = Referencia
- Row("CveMoneda") = CveMoneda
- Row("Moneda") = Moneda
- TempDTCuentasBancos.AcceptChanges()
- End If
- ObjCuentasBancos.Dispose()
-
- GvBancosCuentas.EditIndex = -1
- CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
- CargaGvBitacora()
- End Sub
- Protected Sub GvBancosCuentas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvBancosCuentas.RowDeleting
- Dim ObjCuentasBancos As New ClsGenerales
-
- If CvePersonal > 0 Then
- If ObjCuentasBancos.RemoveCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
- DTCuentasBancos.Clear()
- DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal)))
- Alert("Cuenta Bancaria borrada con exito.", TipoMensaje.MsgInformacion)
-
- End If
- Else
- Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero - 1
- TempDTCuentasBancos.Rows.RemoveAt(index)
- End If
-
- CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
- ObjCuentasBancos.Dispose()
- CargaGvBitacora()
- End Sub
-#End Region
-#End Region
+ Protected Sub LbContrato_Click(sender As Object, e As System.EventArgs) Handles LbContrato.Click
+ 'Dim oWordApp As Word.Application = Nothing
+ 'Dim oWordDoc As Word.Document = Nothing
+ 'Dim objSelection As Word.Selection = Nothing
+
+ 'Dim ArchivoPath As String = ""
+
+ 'Try
+ ' 'GuardaLog("Inicia Petición de Aplicación")
+ ' oWordApp = New Word.Application
+ ' oWordApp.Visible = True
+ ' 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")
+ ' oWordDoc.Activate()
+ ' objSelection = oWordApp.Selection
+
+ ' objSelection.WholeStory()
+ ' objSelection.Copy()
+ ' objSelection.Delete(Unit:=wdCharacter, Count:=1)
+ ' 'GuardaLog("Recorrer de reemplazo de variables")
+
+ ' objSelection.PasteAndFormat(Word.WdRecoveryType.wdPasteDefault)
+ ' 'ReemplazaTexto(objSelection, "{NOMBRE_PERSONAL}", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim))
+ ' 'ReemplazaTexto(objSelection, "{DIRECCION}", String.Format("{0} {1} {2}", TxtCalle.Text.Trim, TxtNumExt.Text.Trim, TxtNumInt.Text.Trim))
+ ' 'ReemplazaTexto(objSelection, "{CP}", TxtCP.Text.Trim)
+ ' 'ReemplazaTexto(objSelection, "{CIUDAD}", TxtCiudad.Text.Trim)
+ ' 'ReemplazaTexto(objSelection, "{ESTADO}", TxtEstado.Text.Trim)
+ ' 'ReemplazaTexto(objSelection, "{DIA_INICIA_CONTRATO}", TxtFechaInicioContrato.Text.ToDate.Day.ToString())
+ ' 'ReemplazaTexto(objSelection, "{MES_INICIA_CONTRATO}", MonthName(TxtFechaInicioContrato.Text.ToDate.Month).ToUpper)
+ ' 'ReemplazaTexto(objSelection, "{ANIO_INICIA_CONTRATO}", TxtFechaInicioContrato.Text.ToDate.Year.ToString())
+ ' 'ReemplazaTexto(objSelection, "{DIA_FIN_CONTRATO}", TxtFechaFinContrato.Text.ToDate.Day.ToString())
+ ' 'ReemplazaTexto(objSelection, "{MES_FIN_CONTRATO}", MonthName(TxtFechaFinContrato.Text.ToDate.Month).ToUpper)
+ ' 'ReemplazaTexto(objSelection, "{ANIO_FIN_CONTRATO}", TxtFechaFinContrato.Text.ToDate.Year.ToString())
+
+ ' 'objSelection.InsertBreak(Type:=wdPageBreak)
+ ' 'GuardaLog("Termina de reemplazo de variables")
+ ' objSelection.TypeBackspace()
+ ' objSelection.TypeBackspace()
+ ' 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 = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & UsuarioActual.CveUsuario & ".doc"
+
+ ' oWordDoc.SaveAs(ArchivoPath.ToString())
+ ' oWordDoc.Close()
+ ' Else
+ ' Alert("No se pudo generar el archivo", TipoMensaje.MsgError)
+ ' End If
+
+ 'Catch ex As Exception
+ ' Alert(ex.Message, TipoMensaje.MsgError)
+ ' OnError("", ex)
+ ' ArchivoPath = ""
+ 'Finally
+
+ ' If oWordDoc IsNot Nothing Then
+ ' 'GuardaLog("Documento Destruido")
+ ' While (Marshal.ReleaseComObject(oWordDoc) > 0)
+ ' End While
+ ' 'GuardaLog("Documento Destruido")
+ ' oWordDoc = Nothing
+ ' End If
+
+ ' If oWordApp IsNot Nothing Then
+ ' oWordApp.Quit(False)
+ ' While (Marshal.ReleaseComObject(oWordApp) > 0)
+ ' End While
+ ' 'GuardaLog("Aplicación Destruida")
+ ' oWordApp = Nothing
+ ' End If
+ ' System.GC.Collect()
+ ' objSelection = Nothing
+
+ 'End Try
-#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 gvi As Integer = 0
- 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)
- gvi = Arg(1).ToEntero
- Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
- Campo = Campo.Substring(0, Campo.Length - 1)
-
- If ViewState(String.Format("O{0}", Campo, gvi)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo, gvi)).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, gvi)) = String.Format("{0} DESC", Campo)
- Literal.Text = String.Format("")
- End If
- Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo, gvi)).ToString()
- ViewState("Orden") = Orden
- CargaGrid(Orden, gvi)
- End Sub
-
- Private Sub CargaGrid(Orden As String, gvi As Integer)
- If gvi = 0 Then
- ViewState("Orden") = Orden
- CargaGridCuentasBancos(Orden)
- ElseIf gvi = 1 Then
- ViewState("Orden1") = Orden
- CargaGvAsistencias()
- End If
+ 'If ArchivoPath <> "" Then
+
+ ' Dim Archivo As New System.IO.FileInfo(ArchivoPath)
+
+ ' 'If Archivo.Exists Then
+ ' 'HttpContext.Current.Response.Clear()
+ ' 'HttpContext.Current.Response.ClearContent()
+ ' ''HttpContext.Current.Response.ContentType = "application/msword"
+ ' 'HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
+ ' 'HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
+ ' 'HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
+ ' 'HttpContext.Current.Response.TransmitFile(ArchivoPath)
+ ' 'HttpContext.Current.Response.Flush()
+ ' 'HttpContext.Current.Response.End()
+ ' RegistraScript("AbrirVentana('/Ventas/PopUpImprimir.aspx?RH=True&Ext=" & Archivo.Extension & "', 700, 400, 'N', 'ImpRH')")
+ ' 'End If
+ ' Archivo = Nothing
+
+ 'End If
+
End Sub
-#End Region
+
+ 'Private Sub ReemplazaTexto(ByRef ObjSelection As Word.Selection, ByVal Texto As String, ByVal Reemplazar As String)
+ ' With ObjSelection.Find
+ ' .Text = Texto
+ ' .Replacement.Text = Reemplazar
+ ' .Forward = True
+ ' .Wrap = Word.WdFindWrap.wdFindContinue
+ ' .Format = False
+ ' .MatchCase = True
+ ' .MatchWholeWord = False
+ ' .MatchWildcards = False
+ ' .MatchSoundsLike = False
+ ' .MatchAllWordForms = False
+ ' End With
+ ' ObjSelection.Find.Execute(Replace:=Word.WdReplace.wdReplaceAll)
+ 'End Sub
+
+ Protected Sub BtnCargarClientes_Click(sender As Object, e As System.EventArgs) Handles BtnCargarClientes.Click
+ CargaClientes()
+ DdlClienteAsignado.Attributes.Remove("onclick")
+ DdlClienteAsistenciaC.Attributes.Remove("onclick")
+ DdlClienteAsistenciaA.Attributes.Remove("onclick")
+ End Sub
+
+#Region "Buzón de Calidad"
+
+
+ Private Sub CargaBuzonCalidad()
+
+ Dim ObjPersonal As New ClsRH
+ If ObjPersonal.GetBuzonCalidad(CvePersonal, UsuarioActual.CveEmpresa) Then
+ ViewState("DTBuzonCalidad") = ObjPersonal.DtResultados
+ GvBuzonCalidad.DataSource = ObjPersonal.DtResultados
+ Else
+ GvBuzonCalidad.DataSource = Nothing
+ ViewState("DTBuzonCalidad") = Nothing
+ End If
+ ObjPersonal.Dispose()
+ GvBuzonCalidad.DataBind()
+
+ UpBuzonCalidad.Update()
+
+ End Sub
+
+
+ Private Sub LnkBuzonDeCalidad_Click(sender As Object, e As EventArgs) Handles LnkBuzonDeCalidad.Click
+
+ ChkSeAtendio.Visible = False
+ DvSeguimiento.Visible = False
+ BuzonCalidadLimpiaModal(True)
+ RegistraScript("$('#ModalBuzonCalidad').modal({ backdrop: 'static', keyboard: false});")
+ End Sub
+ Private Sub LnkSaldoI_Click(sender As Object, e As EventArgs) Handles LnkSaldoI.Click
+ RegistraScript("$('#ModalSaldoInicial').modal({ backdrop: 'static', keyboard: false});")
+ End Sub
+
+
+ Private Sub BuzonCalidadLimpiaModal(ControlesActivos As Boolean)
+
+ DdlClienteBuzon.SelectedIndex = 0
+ DdlClienteBuzon.Enabled = ControlesActivos
+
+ DdlSucursalClienteBuzon.SelectedIndex = 0
+ DdlSucursalClienteBuzon.Enabled = ControlesActivos
+
+ DdlTipoBuzonCalidad.SelectedIndex = 0
+ DdlTipoBuzonCalidad.Enabled = ControlesActivos
+
+ TxtFechaBuzonCalidad.Text = ""
+ TxtFechaBuzonCalidad.Enabled = ControlesActivos
+
+ TxtBuzonDescriptcion.Text = ""
+ TxtBuzonDescriptcion.Enabled = ControlesActivos
+
+ TxtNombreClienteBuzonCalidad.Text = ""
+ TxtNombreClienteBuzonCalidad.Enabled = ControlesActivos
+
+ TxtTelefonoBuzonCalidad.Text = ""
+ TxtTelefonoBuzonCalidad.Enabled = ControlesActivos
+
+ TxtMailBuzonCalidad.Text = ""
+ TxtMailBuzonCalidad.Enabled = ControlesActivos
+
+ LnkFechaBuzonCalidad.Visible = ControlesActivos
+
+ BtnModalGuardarBuzonCalidad.Visible = ControlesActivos
+
+ TxtObservacionesBuzon.Text = ""
+ TxtObservacionesBuzon.Visible = ControlesActivos
+
+ UpModalBuzonCalidad.Update()
+ RegistraScript("$('#ModalBuzonCalidad').modal({ backdrop: 'static', keyboard: false});")
+
+ End Sub
+
+ Public Sub BuzonCalidadVerInfo_Click(sender As Object, e As EventArgs)
+
+ BuzonCalidadLimpiaModal(True)
+ DvSeguimiento.Visible = True
+
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ CvePersonalBuzon = GvRow.DataKey("CvePersonalBuzon").ToEntero
+ CargaBuzonCalidadSeguimiento()
+ DdlClienteBuzon.SelectedValueExist(GvRow.DataKey("CveCliente"))
+ ' DdlClienteBuzon.Enabled = False
+
+ If GvRow.DataKey("CveClienteSucursal").ToEntero > 0 Then
+ CargaClienteSucursal()
+ DdlSucursalClienteBuzon.SelectedValueExist(GvRow.DataKey("CveClienteSucursal"))
+ Else
+ DdlSucursalClienteBuzon.DataSource = Nothing
+ DdlSucursalClienteBuzon.DataBind()
+ DdlSucursalClienteBuzon.SelectedIndex = 0
+ ' DdlSucursalCliente.Enabled = False
+ End If
+
+ DdlTipoBuzonCalidad.SelectedValueExist(GvRow.DataKey("CveTipoBuzon"))
+ ChkSeAtendio.Visible = True
+
+ ChkSeAtendio.Checked = If(GvRow.DataKey("SeAtendioChk").ToString().ToEntero = 1, True, False)
+
+ TxtFechaBuzonCalidad.Text = GvRow.DataKey("FechaQueja").ToDate.ToString("dd/MM/yyyy")
+ TxtBuzonDescriptcion.Text = GvRow.DataKey("Descripcion")
+ TxtNombreClienteBuzonCalidad.Text = GvRow.DataKey("NombreReporto")
+ TxtTelefonoBuzonCalidad.Text = GvRow.DataKey("TelefonoReporto")
+ TxtMailBuzonCalidad.Text = GvRow.DataKey("MailReporto")
+ TxtObservacionesBuzon.Text = GvRow.DataKey("Observaciones")
+
+ UpModalBuzonCalidad.Update()
+ RegistraScript("$('#ModalBuzonCalidad').modal({ backdrop: 'static', keyboard: false});")
+
+
+ End Sub
+
+
+
+
+
+ Public Sub BuzonCalidadSeguimiento_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ 'CvePersonalBuzon,CveCliente,Cliente,TipoBuzon,FechaQueja,Descripcion,NombreReporto,TelefonoReporto,MailReporto,FechaIng,SeAtendio,Observaciones,SucursalCliente
+
+
+ End Sub
+
+ Public Sub BuzonCalidadFinalizar_Cllick(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ End Sub
+
+ Property CvePersonalBuzon As Integer
+ Get
+ If ViewState("CvePersonalBuzon") Is Nothing Then
+ Return -1
+ Else
+ Return ViewState("CvePersonalBuzon").ToString().ToEntero
+ End If
+ End Get
+ Set(value As Integer)
+ ViewState("CvePersonalBuzon") = value
+ End Set
+ End Property
+
+
+ Private Sub BtnModalGuardarBuzonCalidad_Click(sender As Object, e As EventArgs) Handles BtnModalGuardarBuzonCalidad.Click
+ Dim objRH As New ClsRH
+
+ If CvePersonalBuzon = -1 Then
+ objRH.AddBuzonCalidad(CvePersonal, DdlClienteBuzon.SelectedValue.ToEntero, DdlSucursalClienteBuzon.SelectedValue.ToEntero, DdlTipoBuzonCalidad.SelectedValue.ToEntero, TxtFechaBuzonCalidad.Text.ToDate, TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.Empresa.CveEmpresa, UsuarioActual.CveUsuario)
+
+ RegistraScript(" $('#ModalBuzonCalidad').modal('hide')", "HideModalCalidadAgregar")
+ Else
+ objRH.UpdateBuzonCalidad(CvePersonalBuzon, If(ChkSeAtendio.Checked, 1, 0), DdlClienteBuzon.SelectedValue.ToEntero, DdlSucursalClienteBuzon.SelectedValue.ToEntero, DdlTipoBuzonCalidad.SelectedValue.ToEntero, TxtBuzonDescriptcion.Text.Trim, TxtNombreClienteBuzonCalidad.Text.Trim, TxtTelefono.Text.Trim, TxtMailBuzonCalidad.Text.Trim, TxtObservacionesBuzon.Text, UsuarioActual.CveUsuario)
+ RegistraScript(" $('#ModalBuzonCalidad').modal('hide')", "HideModalCalidadAgregar")
+ End If
+ CargaBuzonCalidad()
+
+ CargaGridBC(ViewState("Orden").ToString())
+
+ objRH.Dispose()
+
+ End Sub
+
+
+
+ Private Sub BtnModalGuardarBuzonDetalleCalidad_Click(sender As Object, e As EventArgs) Handles BtnModalGuardarBuzonDetalleCalidad.Click
+ Dim objRH As New ClsRH
+
+ If objRH.AddBuzonCalidadDetalle(CvePersonalBuzon, TxtObserbacionBuzonDetalle.Text.Trim, If(chkBuzonDetalleNotiificar.Checked, 1, 0), TxtMailBuzonCalidad.Text.Trim, UsuarioActual.CveUsuario) Then
+
+
+ If chkBuzonDetalleNotiificar.Checked Then
+ Dim Correo As New ClsSisMail
+ Dim Asunto As String = $"{UsuarioActual.Empresa.Empresa} Seguimiento {DdlTipoBuzonCalidad.SelectedItem.Text} Empleado {NombreCompleto}"
+
+ Dim Cuerpo As New StringBuilder
+
+ Cuerpo.AppendLine($"Seguimiento {DdlTipoBuzonCalidad.SelectedItem.Text} ")
+ Cuerpo.AppendLine($" {UsuarioActual.Nombre} ")
+ Cuerpo.AppendLine($"Actualización: {TxtObserbacionBuzonDetalle.Text} ")
+ Cuerpo.AppendLine($" ")
+
+
+ Correo.SendMail(EmpresaNotificaciones, TxtMailBuzonCalidad.Text.Trim, Asunto, Body:=Cuerpo.ToString())
+
+ End If
+
+
+
+
+ TxtObserbacionBuzonDetalle.Text = ""
+ chkBuzonDetalleNotiificar.Checked = False
+
+ End If
+ objRH.Dispose()
+
+ CargaBuzonCalidadSeguimiento()
+
+ End Sub
+
+
+ Private Sub CargaBuzonCalidadSeguimiento()
+ If CvePersonalBuzon > 0 Then
+ Dim objRH As New ClsRH
+
+ If objRH.GetBuzonCalidadDetalle(CvePersonalBuzon) Then
+ GvBuzonDetalles.DataSource = objRH.DtResultados
+ Else
+ GvBuzonDetalles.DataSource = Nothing
+
+ End If
+
+
+
+ objRH.Dispose()
+ GvBuzonDetalles.DataBind()
+ UpModalBuzonCalidad.Update()
+
+ End If
+ End Sub
+
+
+
+
+ Private Sub CargaCombosBuzon()
+
+
+ Dim ObjClientes As New ClsClientes
+ If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
+ DdlClienteBuzon.DataSource = ObjClientes.DtResultados
+ DdlClienteBuzon.DataSource = ObjClientes.DtResultados
+ DdlClienteBuzon.DataSource = ObjClientes.DtResultados
+ Else
+ DdlClienteBuzon.DataSource = Nothing
+ DdlClienteBuzon.DataSource = Nothing
+ DdlClienteBuzon.DataSource = Nothing
+ End If
+ ObjClientes.Dispose()
+ DdlClienteBuzon.DataBind()
+
+
+ Dim objRH As New ClsRH
+
+ If objRH.GetBuzonCalidadTipo(1) Then
+ DdlTipoBuzonCalidad.DataSource = objRH.DtResultados
+
+ Else
+ DdlTipoBuzonCalidad.DataSource = Nothing
+ End If
+ objRH.Dispose()
+ DdlTipoBuzonCalidad.DataBind()
+
+ UpModalBuzonCalidad.Update()
+ End Sub
+
+
+ Private Sub DdlClienteBuzon_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClienteBuzon.SelectedIndexChanged
+ CargaClienteSucursal()
+ End Sub
+
+ Private Sub CargaClienteSucursal()
+
+ Dim ObjCliente As New ClsClientes()
+
+ If ObjCliente.GetSucursales(DdlClienteBuzon.SelectedValue.ToEntero) Then
+ DdlSucursalClienteBuzon.DataSource = ObjCliente.DtResultados
+ If ObjCliente.DtResultados.Rows.Count > 0 Then
+ Divsucursalciente.Visible = True
+ Else
+ Divsucursalciente.Visible = False
+ End If
+ Else
+ Divsucursalciente.Visible = False
+ DdlSucursalClienteBuzon.DataSource = Nothing
+ End If
+ DdlSucursalClienteBuzon.DataBind()
+ UpModalBuzonCalidad.Update()
+ End Sub
+
+ Protected Sub GvBuzonCalidad_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBuzonCalidad.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ e.Row.FCLiteral("LtlCliente").Text = "" & e.Row.DBCampo("Cliente") & ""
+ If e.Row.DBCampo("SeAtendio") = "Si" Then
+ e.Row.BackColor = Drawing.Color.LightBlue
+ End If
+ End If
+ End Sub
+
+ Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBuzonCalidad.RowCancelingEdit
+ GvBuzonCalidad.EditIndex = -1
+ If ViewState("Orden").ToString() <> String.Empty Then
+ CargaGridBC(ViewState("Orden").ToString())
+ Else
+ CargaGridBC("")
+ End If
+ End Sub
+
+ 'Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBuzonCalidad.RowUpdating
+ ' Dim ObjBuzonCalidad As New ClsRH
+
+ ' Dim Observaciones As String = DirectCast(GvBuzonCalidad.Rows(e.RowIndex).FindControl("TxtObs"), TextBox).Text.Trim
+ ' Dim SeAtendio As Boolean = GvBuzonCalidad.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
+ ' Dim CveBuzonCalidad As Integer = GvBuzonCalidad.DataKeys(e.RowIndex).Value.ToString().ToEntero
+
+ ' If ObjBuzonCalidad.UpdateBuzonCalidad(SeAtendio, Observaciones, CveBuzonCalidad, UsuarioActual.CveUsuario) Then
+ ' GvBuzonCalidad.EditIndex = -1
+ ' ViewState("DTBuzonCalidad") = ObjBuzonCalidad.DtResultados
+ ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
+ ' End If
+
+ ' ObjBuzonCalidad.Dispose()
+
+ ' If ViewState("Orden").ToString() <> String.Empty Then
+ ' CargaGridBC(ViewState("Orden").ToString())
+ ' Else
+ ' CargaGridBC("")
+ ' End If
+
+ 'End Sub
+
+ Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBuzonCalidad.RowEditing
+ GvBuzonCalidad.EditIndex = e.NewEditIndex
+
+ If ViewState("Orden").ToString() <> String.Empty Then
+ CargaGridBC(ViewState("Orden").ToString())
+ Else
+ CargaGridBC("")
+ End If
+ End Sub
+
+ Private Sub CargaGridBC(Orden As String)
+ If Orden <> String.Empty Then
+ Dim DV As New DataView(CType(ViewState("DTBuzonCalidad"), DataTable), "", Orden, DataViewRowState.CurrentRows)
+ GvBuzonCalidad.DataSource = DV.ToTable()
+ DV.Dispose()
+ Else
+ GvBuzonCalidad.DataSource = CType(ViewState("DTBuzonCalidad"), DataTable)
+ End If
+ GvBuzonCalidad.DataBind()
+ UpDatos.Update()
+ 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
+ If e.Row.RowIndex = 0 Then
+ e.Row.Cells(0).Width = Unit.Pixel(50) 'Código
+ e.Row.Cells(1).Width = Unit.Pixel(250) 'AF
+ e.Row.Cells(2).Width = Unit.Pixel(150) 'Tipo AF
+ e.Row.Cells(3).Width = Unit.Pixel(65) 'Inició
+ e.Row.Cells(4).Width = Unit.Pixel(65) 'Finalizó
+ e.Row.Cells(5).Width = Unit.Pixel(80) 'Estado
+ e.Row.Cells(6).Width = Unit.Pixel(280) 'Observaciones
+ End If
+
+ e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
+ e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
+ e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Left
+
+ Dim Liga As String = ""
+ e.Row.FCLiteral("LtlCodigo").Text = Liga & e.Row.FCLiteral("LtlCodigo").Text & ""
+ e.Row.FCLiteral("LtlAF").Text = Liga & e.Row.FCLiteral("LtlAF").Text & ""
+
+ End If
+ End Sub
+
+#End Region
+
+#Region "Nómina"
+
+
+ Private Sub CarcaConceptosNomina()
+ Dim ObjPersonal As New ClsRH
+ If ObjPersonal.GetPersonalConceptos(CvePersonal, UsuarioActual.CveEmpresa) Then
+ GVConceptos.DataSource = ObjPersonal.DtResultados.FiltraParametros("(CveSistema <>3 AND CveSistema <>4) OR CveSistema IS NULL")
+ Dim frow As DataRow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =3")
+ If Not IsNothing(frow) Then
+ TxtInfoValor.Text = String.Format("{0:###,###.##}", frow("Importe"))
+ DdlInfoTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString())
+
+ Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero
+ TxtInfoDescripcion.Text = String.Format("{0}", frow("Descripcion02"))
+ TxtInfoNumCredito.Text = String.Format("{0}", frow("Descripcion01"))
+ TxtInfoFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion"))
+ ChkInfo.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE")
+ End If
+
+
+ frow = ObjPersonal.DtResultados.FiltroPrimero("CveSistema =4")
+ TxtFonValor.Text = ""
+ DdlFonTipoAplicacion.SelectedValueExist("-1")
+ TxtFonDescripcion.Text = ""
+ TxtFonNumCredito.Text = ""
+ TxtFonFechaInicio.Text = ""
+ ChkFonacot.Checked = False
+ If Not IsNothing(frow) Then
+ TxtFonValor.Text = String.Format("{0:###,###.##}", frow("Importe"))
+ DdlFonTipoAplicacion.SelectedValueExist(frow("TipoAplicacion").ToString())
+
+ TxtFonDescripcion.Text = String.Format("{0}", frow("Descripcion02"))
+ TxtFonNumCredito.Text = String.Format("{0}", frow("Descripcion01"))
+ TxtFonFechaInicio.Text = String.Format("{0:dd/MM/yyyy}", frow("FInicioAplicacion"))
+ ChkFonacot.Checked = frow("estatus").ToString().ToUpper().Contiene("1", "TRUE")
+ End If
+ Else
+ GVConceptos.DataSource = Nothing
+ End If
+ ObjPersonal.Dispose()
+ GVConceptos.DataBind()
+
+ For Each Row As GridViewRow In GVConceptos.Rows
+ Dim Ddl As DropDownList = DirectCast(GVConceptos.Rows(Row.RowIndex).FCDropDownList("DdlTipoAplicacion"), DropDownList)
+ DdlTipoAplicacion_SelectedIndexChanged(Ddl, Nothing)
+ Next
+ End Sub
+
+ Protected Sub GVConceptos_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVConceptos.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
+
+ e.Row.Cells(0).Width = Unit.Pixel(50)
+ e.Row.Cells(1).Width = Unit.Pixel(50)
+ e.Row.Cells(3).Width = Unit.Pixel(70)
+ e.Row.Cells(4).Width = Unit.Pixel(70)
+ e.Row.Cells(5).Width = Unit.Pixel(160)
+
+
+ If e.Row.DBCampo("Aplica").ToEntero = 1 Then e.Row.FCCheckBox("ChkAplica").Checked = True
+
+ If e.Row.DBCampo("Formula") = "S" Then
+ e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(3).Text = "Calculado"
+ e.Row.FCDropDownList("DdlTipoAplicacion").Visible = False : e.Row.Cells(4).Text = "Permanente"
+ Else
+ 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
+
+ End If
+ End Sub
+
+ Protected Sub BtnGuardarInfornavit_Click(sender As Object, e As EventArgs)
+ Dim importe As Decimal = TxtInfoValor.Text.ToDecimal()
+ Dim TipoAplicacion As Integer = DdlInfoTipoAplicacion.SelectedValue.ToEntero
+ Dim NoPagos As Integer = 0
+ Dim SaldoIni As Decimal = 0
+ Dim descripcion02 As String = TxtInfoDescripcion.Text
+ Dim descripcion01 As String = TxtInfoNumCredito.Text
+ Dim fecha As String = TxtInfoFechaInicio.Text.Replace("_", "")
+ Dim estatus As Integer = If(ChkInfo.Checked, 1, 0)
+ If fecha.Length > 8 Then
+ fecha = fecha.ToDateTime().ToString("yyyy/MM/dd")
+ Else
+ fecha = ""
+ End If
+ Dim OcurrioError As Boolean = False
+ Using ObjPersonal As New ClsRH
+
+ If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 3, descripcion01, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then
+ OcurrioError = True
+ End If
+ End Using
+ If Not OcurrioError Then
+ Alert("Se actualizo el calculo de infonavit")
+ CarcaConceptosNomina()
+ End If
+ End Sub
+ Protected Sub BtnGuardarConceptos_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarConceptos.Click
+ If CvePersonal > 0 Then
+ Dim ObjPersonal As New ClsRH
+ ObjPersonal.IniciaTransacSQL()
+
+ Dim OcurrioError As Boolean = False
+ For Each Row As GridViewRow In GVConceptos.Rows
+ If Row.FCCheckBox("ChkAplica").Checked = True Then
+ Dim CveConcepto As Integer = Row.DataKey("CveConcepto").ToEntero
+ Dim Importe As Double = Row.FCTextBox("TxtImporte").Text.ToDouble
+ Dim TipoAplicacion As Integer = Row.FCDropDownList("DdlTipoAplicacion").SelectedValue.ToEntero
+ Dim NoPagos As Integer = If(Row.FCTextBox("TxtNoPagos").Text.ToEntero = 0, -1, Row.FCTextBox("TxtNoPagos").Text.ToEntero)
+ Dim SaldoIni As Double = If(Row.FCTextBox("TxtSaldoIni").Text.ToDouble = 0, -1, Row.FCTextBox("TxtSaldoIni").Text.ToDouble)
+
+ Select Case TipoAplicacion
+ Case 1
+ 'Saldo
+ NoPagos = -1
+ Case 2
+ 'Numero de Pagos
+ SaldoIni = -1
+ Case 2600
+ 'Permanente
+ NoPagos = -1
+ SaldoIni = -1
+ End Select
+
+ 'Insertarlo o Actualizarlo
+ If Not ObjPersonal.AddConcepto(CvePersonal, CveConcepto, Importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario) Then
+ OcurrioError = True
+ ObjPersonal.RollBack()
+ Exit For
+ End If
+ Else
+ 'Borrarlo
+ If Row.DataKey("CvePersonalConcepto") <> "" Then
+ If Not ObjPersonal.RemoveConcepto(Row.DataKey("CvePersonalConcepto").ToEntero) Then
+ OcurrioError = True
+ ObjPersonal.RollBack()
+ Exit For
+ End If
+ End If
+ End If
+ Next
+
+ If Not OcurrioError Then
+ ObjPersonal.Commit()
+ Alert("La información se guardó correctamente.", TipoMensaje.MsgInformacion)
+ Else
+ Alert("Ocurrió un error al guardar la información.", TipoMensaje.MsgError)
+ End If
+
+ ObjPersonal.Dispose()
+ End If
+ End Sub
+#End Region
+
+ Protected Sub DdlTipoAplicacion_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Dim Ddl As DropDownList = DirectCast(sender, DropDownList)
+
+ Dim gvr As GridViewRow = DirectCast(Ddl.NamingContainer, GridViewRow)
+
+ Select Case Ddl.SelectedValue.ToEntero
+ Case 1
+ 'Descontar hasta pagar el saldo prestado
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = True
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = False
+ Case 2
+ 'Descontar el numero de pagos
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = False
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = True
+ Case 2600
+ 'Permanente
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = False
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = False
+ Case -1
+ 'Seleccione
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtSaldoIni").Visible = False
+ GVConceptos.Rows(gvr.RowIndex).FCTextBox("TxtNoPagos").Visible = False
+ End Select
+ End Sub
+
+ Protected Sub DdlEstatusPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstatusPersonal.SelectedIndexChanged
+
+ MostrarOcultarFechasEstatus()
+ End Sub
+
+ Private Sub MostrarOcultarFechasEstatus()
+
+
+ If DdlEstatusPersonal.SelectedValue.ToEntero.Contiene(1, 2, 5) Then
+ DivFechaActivo.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 1, True, False)
+ DivFechaBaja.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 2, True, False)
+ DivFechaReingreso.Visible = If(DdlEstatusPersonal.SelectedValue.ToEntero = 5, True, False)
+ Else
+ DivFechaActivo.Visible = False
+ DivFechaBaja.Visible = False
+ DivFechaReingreso.Visible = False
+ End If
+
+ End Sub
+
+ Protected Sub GvNominas_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvNominas.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.RowIndex = 0 Then
+
+ e.Row.Cells(0).Width = Unit.Pixel(35)
+ e.Row.Cells(1).Width = Unit.Pixel(75)
+ e.Row.Cells(2).Width = Unit.Pixel(75)
+ e.Row.Cells(3).Width = Unit.Pixel(95)
+ e.Row.Cells(4).Width = Unit.Pixel(95)
+ e.Row.Cells(5).Width = Unit.Pixel(95)
+ e.Row.Cells(6).Width = Unit.Pixel(95)
+
+ End If
+
+
+
+ e.Row.FCLinkButton("LBCancelar").Visible = True
+ e.Row.FCLinkButton("LBCancelar").CommandArgument = e.Row.DBCampo("FolioFiscal")
+
+ If e.Row.DBCampo("SeTimbro") = "True" Then
+
+ e.Row.FCLinkButton("LbMail").CommandArgument = e.Row.DBCampo("FolioFiscal")
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LbMail"))
+ e.Row.FCLinkButton("LbMail").Visible = True
+
+ e.Row.FCLinkButton("LbPDF").CommandArgument = e.Row.DataKey("CvePeriodo")
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LbPDF")) ' registro el evento postback
+ 'e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Empresas/{0}/PDF/Nomina/{1}.pdf", e.Row.DBCampo("CveEmpresa"), e.Row.DBCampo("SerieFolio"))
+ 'e.Row.FCHyperLink("HplSeTimbro").NavigateUrl = String.Format("/Empresas/{0}/XML/Nomina/{1}.xml", e.Row.DBCampo("CveEmpresa"), e.Row.DBCampo("SerieFolio"))
+ e.Row.FCLinkButton("LbPDF").Visible = True
+
+ e.Row.FCLinkButton("LBCancelar").Visible = True
+ e.Row.FCLinkButton("LBCancelar").CommandArgument = e.Row.DBCampo("FolioFiscal")
+ End If
+
+ End If
+ 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
+ PnlGastoGeneral.Visible = True
+ PnlGastoCheque.Visible = False
+ Else
+ PnlGastoGeneral.Visible = False
+ PnlGastoCheque.Visible = True
+ End If
+
+ End Sub
+
+ Private Sub CargaCastosSinComprobar()
+ 'Dim objGXC As New ClsMovimientos
+
+ 'If objGXC.GetEgresosSinComprobar("-1", "-1", -1, CvePersonal, -1, -1, -1, -1, 0, UsuarioActual.CveEmpresa) Then
+ ' GvGxC.DataSource = objGXC.DtResultados.FiltraParametros("Saldo > 0")
+
+ ' GvGxCHistorial.DataSource = objGXC.DtResultados.FiltraParametros("Saldo = 0")
+
+ 'End If
+
+ 'objGXC.Dispose()
+ 'GvGxC.DataBind()
+ 'GvGxCHistorial.DataBind()
+
+ Dim Conta As New ClsContabilidad
+ If Conta.GetPersonalAuxiliar(CvePersonal, UsuarioActual.CveEmpresa) Then
+ DTGastosSinComp = Conta.DtResultados
+ GvGxC.DataSource = DTGastosSinComp
+ LblSaldoGxC.Text = (Conta.DtResultados.SUM("Cargo", "CveMovimiento Is NULL") - Conta.DtResultados.SUM("Abono", "CveMovimiento Is NULL")).FormatoNumero()
+ End If
+ Conta.Dispose()
+ GvGxC.DataBind()
+
+ Dim ObjBancos As New ClsBancos
+ If ObjBancos.GetPersonalPrestamoAuxiliar(CvePersonal, "-1", "-1", UsuarioActual.CveEmpresa) Then
+ GvAuxiliar.DataSource = ObjBancos.DtResultados
+ End If
+ ObjBancos.Dispose()
+ GvAuxiliar.DataBind()
+
+ End Sub
+
+ Private Sub CargaGastosPorCheque()
+ Dim RH As New ClsRH
+
+ If RH.GetRepPersonalBancos(CvePersonal, "-1", "-1", -1) Then
+ DTGastosPorCheque = RH.DtResultados
+ GvGastosCheque.DataSource = DTGastosPorCheque
+ Else
+ GvGastosCheque.DataSource = Nothing
+ Alert("Ocurrió un error al consultar los Gastos X Comprobar agrupados por cheque.", TipoMensaje.MsgError)
+ End If
+
+ RH.Dispose()
+
+ GvGastosCheque.DataBind()
+ End Sub
+
+ Protected Sub GvGastosCheque_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvGastosCheque.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ If e.Row.RowIndex = 0 Then
+ e.Row.Cells(0).Width = Unit.Pixel(120)
+ e.Row.Cells(1).Width = Unit.Pixel(70)
+ e.Row.Cells(2).Width = Unit.Pixel(80)
+ e.Row.Cells(3).Width = Unit.Pixel(80)
+ e.Row.Cells(4).Width = Unit.Pixel(90)
+ e.Row.Cells(5).Width = Unit.Pixel(90)
+ e.Row.Cells(6).Width = Unit.Pixel(105)
+ e.Row.Cells(7).Width = Unit.Pixel(90)
+
+ End If
+
+ If e.Row.DBCampo("CveCompra") = "" Then
+ If e.Row.DBCampo("CveIE") <> "" Then
+ e.Row.Cells(0).Text = String.Format("{0} - {1} - {2}", e.Row.DBCampo("Banco"), e.Row.DBCampo("NumCuenta"), e.Row.DBCampo("Moneda"))
+
+ e.Row.FCLiteral("LtlFechaVenci").Text = e.Row.DBCampo("FechaDocumento").ToDate.ToShortDateString
+ e.Row.FCHyperLink("HplCheque").Visible = True
+ End If
+ e.Row.BackColor = Drawing.Color.LightGray
+
+ End If
+
+ End If
+
+ 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
+ If e.Row.RowIndex = 0 Then
+ e.Row.Cells(0).Width = Unit.Pixel(200)
+ e.Row.Cells(1).Width = Unit.Pixel(200)
+ e.Row.Cells(2).Width = Unit.Pixel(100)
+ e.Row.Cells(3).Width = Unit.Pixel(500)
+ End If
+
+ If e.Row.DBCampo("Archivo").ToString() <> "" Then
+ e.Row.FCLinkButton("LinkArchivo").Visible = True
+ e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString())
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
+ End If
+
+ e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
+ End If
+ End Sub
+ Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
+
+ Dim ObjEventoBitacora As New ClsOIEventos
+
+ Dim FileExtension As String = "-1"
+ Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
+ Dim filemove As String = ""
+
+ For Each fileItem As Archivo In filesgral
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ filemove = fileItem.filename
+ Next
+
+ If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
+ If filemove <> "" Then
+ filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa))
+ End If
+
+ GvEB.DataSource = ObjEventoBitacora.DtResultados
+ TxtEventoDescripcion.Text = ""
+ Anexo.Text = "[]"
+ Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
+ RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
+ End If
+ ObjEventoBitacora.Dispose()
+ GvEB.DataBind()
+
+ UPEventoBitacora.Update()
+ CargaEventoBitacora()
+ UPAddEventoBitacora.Update()
+ End Sub
+ Private Sub CargaEventoBitacora()
+
+ Dim ObjEventoBitacora As New ClsOIEventos()
+ If ObjEventoBitacora.GetAgendaBitacora(-1, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
+ GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento = 6 OR CveTipoEvento = 2")
+ Else
+ GvEB.DataSource = Nothing
+ End If
+ GvEB.DataBind()
+ End Sub
+
+ Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
+ Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
+ Dim Archivo As New System.IO.FileInfo(filePath)
+
+ HttpContext.Current.Response.Clear()
+ HttpContext.Current.Response.ClearContent()
+ HttpContext.Current.Response.ContentType = "application/octet-stream"
+ HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + 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 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
+ e.Row.Cells(0).Width = Unit.Pixel(100)
+ e.Row.Cells(1).Width = Unit.Pixel(200)
+ e.Row.Cells(2).Width = Unit.Pixel(350)
+ e.Row.Cells(3).Width = Unit.Pixel(100)
+ e.Row.Cells(4).Width = Unit.Pixel(100)
+ 'e.Row.Cells(5).Width = Unit.Pixel(100)
+ 'e.Row.Cells(6).Width = Unit.Pixel(80)
+ 'e.Row.Cells(7).Width = Unit.Pixel(100)
+ End If
+
+ If e.Row.DBCampo("FechaDocumento") = "" Then e.Row.BackColor = Drawing.Color.LightGray
+
+ If e.Row.DBCampo("CveIE").ToEntero > 0 Then
+ e.Row.FCHyperLink("HplRef").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
+ e.Row.FCLabel("LtlC").CssClass = "label label-sm label-success"
+ e.Row.FCLabel("LtlC").ForeColor = Drawing.Color.White
+ End If
+ If e.Row.DBCampo("CveCompra").ToEntero > 0 Then
+ e.Row.FCHyperLink("HplRef").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
+ e.Row.FCLabel("LtlC").CssClass = "label label-sm label-warning"
+ e.Row.FCLabel("LtlC").ForeColor = Drawing.Color.White
+ End If
+
+ End If
+
+ End Sub
+
+ Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
+ If DtCuentasContables Is Nothing Then
+ CargaCuentasContables()
+ End If
+ Dim SeleccionadoContViaticos As String
+ Dim SeleccionadoContPrestamos As String
+ Select Case HdnCuenta.Value
+ Case "1"
+ SeleccionadoContViaticos = DdlViaticos.SelectedValue
+ DdlViaticos.Items.Clear() : DdlViaticos.Items.Add(New ListItem("Seleccione", "0"))
+ DdlViaticos.DataSource = DtCuentasContables : DdlViaticos.DataBind() : DdlViaticos.SelectedValueExist(SeleccionadoContViaticos)
+ DdlViaticos.AutoPostBack = False : DdlViaticos.Attributes.Remove("onclick") : DdlViaticos.CssClass &= " select2me"
+ Case "2"
+ SeleccionadoContPrestamos = DdlPrestamos.SelectedValue
+ DdlPrestamos.Items.Clear() : DdlPrestamos.Items.Add(New ListItem("Seleccione", "0"))
+ DdlPrestamos.DataSource = DtCuentasContables : DdlPrestamos.DataBind() : DdlPrestamos.SelectedValueExist(SeleccionadoContPrestamos)
+ DdlPrestamos.AutoPostBack = False : DdlPrestamos.Attributes.Remove("onclick") : DdlPrestamos.CssClass &= " select2me"
+ End Select
+
+
+
+
+ End Sub
+#Region "TAB BANCOS"
+ Private Sub CargaMonedas()
+ DdlMoneda.DataSource = GlobalDTMonedas
+ DdlMoneda.DataBind()
+ DdlMoneda.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End Sub
+
+ Protected Sub LbAgregarCuentaBanco_Click(sender As Object, e As EventArgs)
+ Dim EsBancomer = False
+
+ If TxtNombreBanco.Text.ToUpper.Contains("BBVA") Or TxtNombreBanco.Text.ToUpper.Contains("BANCOMER") Or (TxtCLABECB.Text.Length = 18 AndAlso TxtCLABECB.Text.Substring(0, 3) = "012") Then
+ EsBancomer = True
+ End If
+
+ If EsBancomer AndAlso (TxtCLABECB.Text.Length = 18 AndAlso Not TxtCLABECB.Text.Substring(0, 3) = "012") Then
+ Alert("La CLABE ingresada no pertenece a BANCOMER.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ ''CLABE SIEMPRE OBLIGATORIA CUANDO NO ES BANCOMER CON CIE
+ 'If (TxtCLABECB.Text.Trim.Length <> 18 And Not EsBancomer) Or (EsBancomer And TxtConvenioCIE.Text.Trim.Length <> 6 And TxtCLABECB.Text.Trim.Length <> 18) Then
+ ' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
+
+ 'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER
+ If TxtCLABECB.Text.Trim.Length <> 18 And TxtCLABECB.Text.Trim.Length = 0 And Not EsBancomer Then
+ Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'SI CUENTA TIENE ALGO Y BANCO BANCOMER DEBE TENER UNA LOGITUD EXACTA DE 10
+ If TxtNumeroCuenta.Text.Trim.Length <> 0 AndAlso TxtNumeroCuenta.Text.Trim.Length <> 10 AndAlso EsBancomer Then
+ Alert("El número de cuenta debe tener una longitud de 10 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18
+ If TxtCLABECB.Text.Trim.Length <> 0 AndAlso TxtCLABECB.Text.Trim.Length <> 18 Then
+ Alert("La CLABE debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'SI CIE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 6 Y REFERENCIA OBLIGATORIA
+ If (TxtConvenioCIE.Text.Trim.Length <> 0 And TxtConvenioCIE.Text.Trim.Length <> 6) Or (TxtConvenioCIE.Text.Trim.Length = 6 And TxtReferenciaCB.Text.Trim.Length < 3) Then
+ Alert("El Convenio CIE debe tener una longitud de 6 dígitos y se debe especificar una referencia. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA"
+ If EsBancomer AndAlso Not (TxtNumeroCuenta.Text.Trim.Length = 10 Or TxtConvenioCIE.Text.Trim.Length = 6) Then
+ Alert("Para cuentas BBVA BANCOMER es obligatorio el Número de Cuenta o CIE.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ AgregarCuentaBanco(TxtNombreBanco.Text.Trim, TxtNumeroSucursal.Text.Trim, TxtCLABECB.Text.Trim, TxtSWIFT.Text.Trim, TxtPlaza.Text.Trim, TxtNumeroCuenta.Text.Trim, TxtConvenioCIE.Text.Trim, TxtReferenciaCB.Text.Trim, DdlMoneda.SelectedValue.ToEntero, DdlMoneda.SelectedItem.Text, TxtBBVAAlias.Text)
+ End Sub
+ Private Sub CargaGridCuentasBancos(Orden As String)
+ If CvePersonal > 0 Then
+ If Orden <> String.Empty Then
+ Dim DV As New DataView(DTCuentasBancos, "", Orden, DataViewRowState.CurrentRows)
+ GvBancosCuentas.DataSource = DV.ToTable()
+ DV.Dispose()
+ Else
+ GvBancosCuentas.DataSource = DTCuentasBancos
+ End If
+ Else
+ If Orden <> String.Empty Then
+ Dim DV As New DataView(TempDTCuentasBancos, "", Orden, DataViewRowState.CurrentRows)
+ GvBancosCuentas.DataSource = DV.ToTable()
+ DV.Dispose()
+ Else
+ GvBancosCuentas.DataSource = TempDTCuentasBancos
+ End If
+ End If
+
+ GvBancosCuentas.DataBind()
+ UpCuentasBancos.Update()
+ End Sub
+ Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String, CveMoneda As Integer, Moneda As String, BBVAAlias As String)
+
+ Dim Row As DataRow
+
+ If CvePersonal > 0 Then
+ Dim ObjCuentasBancos As New ClsGenerales
+ If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", UsuarioActual.CveUsuario, CveMoneda, CvePersonal:=CvePersonal, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias) Then
+ DTCuentasBancos.Clear()
+ DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal)))
+
+ Alert("Cuenta Bancaria agregada con éxito.", TipoMensaje.MsgInformacion)
+
+ End If
+ ObjCuentasBancos.Dispose()
+
+ Else
+ Row = TempDTCuentasBancos.NewRow
+
+ Row("BancoNombre") = NombreBanco
+ Row("Sucursal") = NumeroSucursal
+ Row("CLABE") = CLABE
+ Row("SWIFT") = SWIFT
+ Row("Plaza") = Plaza
+ Row("Cuenta") = NumeroCuenta
+ Row("CIE") = ConvenioCIE
+ Row("Referencia") = Referencia
+ Row("CveMoneda") = CveMoneda
+ Row("Moneda") = Moneda
+ Row("EstatusPagoElectronico") = False
+ TempDTCuentasBancos.Rows.Add(Row)
+ End If
+
+ LimpiaCuentasBancarias()
+ CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
+
+ If CvePersonal > 0 Then
+ CargaGvBitacora()
+ End If
+
+ End Sub
+ Private Sub LimpiaCuentasBancarias()
+ TxtNombreBanco.Text = ""
+ TxtNumeroSucursal.Text = ""
+ TxtCLABECB.Text = ""
+ TxtSWIFT.Text = ""
+ TxtPlaza.Text = ""
+ TxtNumeroCuenta.Text = ""
+ TxtConvenioCIE.Text = ""
+ TxtReferenciaCB.Text = ""
+ End Sub
+ Private Sub CargaCuentasBancarias()
+ Dim ObjCuentasBancos As New ClsGenerales
+ ViewState("OrdenCuentasBancos") = ""
+ DTCuentasBancos = New DataTable
+ TempDTCuentasBancos = New DataTable
+
+ If ObjCuentasBancos.GetCuentasDepositos(CvePersonal:=CvePersonal) Then
+ DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados)
+ Else
+ Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgError)
+ End If
+
+ If CvePersonal < 0 Then
+ TempDTCuentasBancos = DTCuentasBancos.Clone
+ End If
+
+ ObjCuentasBancos.Dispose()
+ CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
+ 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
+
+
+ If e.Row.RowState = DataControlRowState.Edit Then
+ e.Row.FCDropDownList("DdlMoneda").DataSource = GlobalDTMonedas
+ e.Row.FCDropDownList("DdlMoneda").DataBind()
+ e.Row.FCDropDownList("DdlMoneda").Items.Insert(0, New ListItem("Seleccione", "-1"))
+ e.Row.FCDropDownList("DdlMoneda").SelectedValue = e.Row.DBCampo("CveMoneda")
+
+ 'SI TIENE PERMISO PUEDE EDITAR ESTATUS
+ If UsuarioActual.TienePermisoProceso(155) Then
+ 'Alert("usuario no tiene permiso", TipoMensaje.MsgInformacion)
+ e.Row.FCCheckBox("ChkEstatus").Visible = True
+ Else
+ e.Row.FCCheckBox("ChkEstatus").Visible = False
+ End If
+
+ If CBool(e.Row.DBCampo("EstatusPagoElectronico")) Then
+ e.Row.FCDropDownList("DdlMoneda").Enabled = False
+ End If
+
+ End If
+
+ If CvePersonal < 0 Then
+ For index = 1 To TempDTCuentasBancos.Rows.Count
+ TempDTCuentasBancos.Rows(index - 1)("CveCuentaDeposito") = index
+ Next
+ TempDTCuentasBancos.AcceptChanges()
+ End If
+
+ End If
+ End Sub
+ Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing
+ GvBancosCuentas.EditIndex = e.NewEditIndex
+ CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
+ End Sub
+ Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit
+ GvBancosCuentas.EditIndex = -1
+ CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
+ End Sub
+ Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating
+ Dim NombreBanco = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim
+ Dim NumeroSucursal = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroSucursal").Text.Trim
+ Dim CLABE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtCLABE").Text.Trim
+ Dim SWIFT = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtSWIFT").Text.Trim
+ Dim Plaza = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtPlaza").Text.Trim
+ Dim NumeroCuenta = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim
+ Dim ConvenioCIE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim
+ 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 BBVAAlias As String = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtBBVAAlias").Text
+
+ Dim RefCrediProveedor = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtRefCrediProveedor").Text.Trim
+
+ Dim EsBancomer = False
+
+ If NombreBanco.ToUpper.Contains("BBVA") Or NombreBanco.ToUpper.Contains("BANCOMER") Or (CLABE.Length = 18 AndAlso CLABE.Substring(0, 3) = "012") Then
+ EsBancomer = True
+ End If
+
+ If EsBancomer AndAlso (CLABE.Length = 18 AndAlso Not CLABE.Substring(0, 3) = "012") Then
+ Alert("La CLABE ingresada no pertenece a BANCOMER.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ ''CLABE SIEMPRE OBLIGATORIA CUANDO NO ES BANCOMER CON CIE
+ 'If (CLABE.Trim.Length <> 18 And Not EsBancomer) Or (EsBancomer And ConvenioCIE.Trim.Length <> 6 And CLABE.Trim.Length <> 18) Then
+ ' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ ' Exit Sub
+ 'End If
+
+ 'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER
+ If CLABE.Trim.Length <> 18 And CLABE.Trim.Length = 0 And Not EsBancomer Then
+ Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'SI CUENTA TIENE ALGO Y BANCO BANCOMER DEBE TENER UNA LOGITUD EXACTA DE 10
+ If NumeroCuenta.Trim.Length <> 0 AndAlso NumeroCuenta.Trim.Length <> 10 AndAlso EsBancomer Then
+ Alert("El número de cuenta debe tener una longitud de 10 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18
+ If CLABE.Trim.Length <> 0 AndAlso CLABE.Trim.Length <> 18 Then
+ Alert("La CLABE debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'SI CIE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 6 Y REFERENCIA OBLIGATORIA
+ If (ConvenioCIE.Trim.Length <> 0 And ConvenioCIE.Trim.Length <> 6) Or (ConvenioCIE.Trim.Length = 6 And Referencia.Trim.Length < 3) Then
+ Alert("El Convenio CIE debe tener una longitud de 6 dígitos y se debe especificar una referencia. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA"
+ If EsBancomer AndAlso Not (NumeroCuenta.Trim.Length = 10 Or ConvenioCIE.Trim.Length = 6) Then
+ Alert("Para cuentas BBVA BANCOMER es obligatorio el Número de Cuenta o CIE.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ Dim ObjCuentasBancos As New ClsGenerales
+ If CvePersonal > 0 Then
+ If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda, CveUsuarioModifico:=UsuarioActual.CveUsuario, BBVAAlias:=BBVAAlias) Then
+ DTCuentasBancos.Clear()
+ DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal)))
+ Alert("Cuenta actualizada con exito.", TipoMensaje.MsgInformacion)
+
+ End If
+ Else
+ Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero - 1
+ Dim Row As DataRow = TempDTCuentasBancos.Rows(index)
+ Row("BancoNombre") = NombreBanco
+ Row("Sucursal") = NumeroSucursal
+ Row("CLABE") = CLABE
+ Row("SWIFT") = SWIFT
+ Row("Plaza") = Plaza
+ Row("Cuenta") = NumeroCuenta
+ Row("CIE") = ConvenioCIE
+ Row("Referencia") = Referencia
+ Row("CveMoneda") = CveMoneda
+ Row("Moneda") = Moneda
+ TempDTCuentasBancos.AcceptChanges()
+ End If
+ ObjCuentasBancos.Dispose()
+
+ GvBancosCuentas.EditIndex = -1
+ CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
+ CargaGvBitacora()
+ End Sub
+ Protected Sub GvBancosCuentas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvBancosCuentas.RowDeleting
+ Dim ObjCuentasBancos As New ClsGenerales
+
+ If CvePersonal > 0 Then
+ If ObjCuentasBancos.RemoveCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString().ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
+ DTCuentasBancos.Clear()
+ DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CvePersonal = {0}", CvePersonal)))
+ Alert("Cuenta Bancaria borrada con exito.", TipoMensaje.MsgInformacion)
+
+ End If
+ Else
+ Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString().ToEntero - 1
+ TempDTCuentasBancos.Rows.RemoveAt(index)
+ End If
+
+ CargaGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString())
+ ObjCuentasBancos.Dispose()
+ CargaGvBitacora()
+ 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 = ""
+ Dim Campo As String = ""
+ Dim gvi As Integer = 0
+ 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)
+ gvi = Arg(1).ToEntero
+ Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
+ Campo = Campo.Substring(0, Campo.Length - 1)
+
+ If ViewState(String.Format("O{0}", Campo, gvi)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo, gvi)).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, gvi)) = String.Format("{0} DESC", Campo)
+ Literal.Text = String.Format("")
+ End If
+ Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo, gvi)).ToString()
+ ViewState("Orden") = Orden
+ CargaGrid(Orden, gvi)
+ End Sub
+
+ Private Sub CargaGrid(Orden As String, gvi As Integer)
+ If gvi = 0 Then
+ ViewState("Orden") = Orden
+ CargaGridCuentasBancos(Orden)
+ ElseIf gvi = 1 Then
+ ViewState("Orden1") = Orden
+ CargaGvAsistencias()
+ End If
+ 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)
-
+ Protected Sub LbPDF_Click(sender As Object, e As EventArgs)
+
Dim LB = CType(sender, LinkButton)
ImprimirbytesPDF(GeneraPDFNomina(CvePersonal, LB.CommandArgument.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta), "recibo")
ImprimirbytesPDF(GeneraPDFNomina(CvePersonal, LB.CommandArgument.ToEntero, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta), "recibo")
End Sub
-#End Region
+#End Region
+
+
+#Region " ORGANIGRAMA "
+ Private Sub CargaSuperioresOrganigrama()
+ Dim ObjRH As New ClsRH
+
+ If ObjRH.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
+ DdlSupervisorOrganigrama.DataSource = ObjRH.DtResultados
+ Else
+ DdlSupervisorOrganigrama.DataSource = Nothing
+ Alert("Ocurrió un error al cargar el catálogo de Jefes Inmediatos")
+ End If
+ ObjRH.Dispose()
+
+ If DdlSupervisorOrganigrama.DataSource IsNot Nothing Then
+ DdlSupervisorOrganigrama.DataBind()
+ End If
+
+
+
-#Region " ORGANIGRAMA "
- Private Sub CargaSuperioresOrganigrama()
- Dim ObjRH As New ClsRH
-
- If ObjRH.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
- DdlSupervisorOrganigrama.DataSource = ObjRH.DtResultados
- Else
- DdlSupervisorOrganigrama.DataSource = Nothing
- Alert("Ocurrió un error al cargar el catálogo de Jefes Inmediatos")
- End If
- ObjRH.Dispose()
-
- If DdlSupervisorOrganigrama.DataSource IsNot Nothing Then
- DdlSupervisorOrganigrama.DataBind()
- End If
-
-
-
-
-
End Sub
-#End Region
+#End Region
+
+
+#Region "I M P R I M I R "
+ Private Sub GenerarPDF(Optional Formato As String = "PDF")
+
+ Dim ObjPersonal As New ClsRH()
+ If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
+ If ObjPersonal.DtResultados.Rows.Count > 0 Then
+
+ Dim params As New List(Of ReportParameter)
+ params.Add(New ReportParameter("ApellidoP", ObjPersonal.APaterno))
+ params.Add(New ReportParameter("ApellidoM", ObjPersonal.AMaterno))
+ params.Add(New ReportParameter("Nombres", ObjPersonal.Nombres))
+ params.Add(New ReportParameter("Codigo", ObjPersonal.Codigo))
+ params.Add(New ReportParameter("Escolaridad", If(DdlEscolaridad.SelectedValue = "-1", "", DdlEscolaridad.SelectedItem.Text)))
+ params.Add(New ReportParameter("EstadoCivil", If(DdlEstadoCivil.SelectedValue = "-1", "", DdlEstadoCivil.SelectedItem.Text)))
+ params.Add(New ReportParameter("Genero", If(DdlGenero.SelectedValue = "-1", "", DdlGenero.SelectedItem.Text)))
+ params.Add(New ReportParameter("FechaNacimiento", ObjPersonal.FechaNacimiento.ToShortDateString))
+ params.Add(New ReportParameter("RFC", ObjPersonal.RFC))
+ params.Add(New ReportParameter("CURP", ObjPersonal.CURP))
+ params.Add(New ReportParameter("Calle", ObjPersonal.Calle))
+ params.Add(New ReportParameter("Numero", ObjPersonal.NumExt))
+ params.Add(New ReportParameter("Interior", ObjPersonal.NumInt))
+ params.Add(New ReportParameter("Colonia", ObjPersonal.Colonia))
+ params.Add(New ReportParameter("CP", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("Ciudad", ObjPersonal.CP))
+ params.Add(New ReportParameter("Estado", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("Telefono", ObjPersonal.Telefono))
+ params.Add(New ReportParameter("Celular", ObjPersonal.Celular))
+ params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
+ params.Add(New ReportParameter("LugarNacimiento", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("NombrePadre", ObjPersonal.NombrePadre))
+ params.Add(New ReportParameter("NombreMadre", ObjPersonal.NombreMadre))
+ params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
+ params.Add(New ReportParameter("FechaIContrato", ObjPersonal.FechaInicioContrato.ToShortDateString))
+ params.Add(New ReportParameter("FechaFContrato", ObjPersonal.FechaFinContrato.ToShortDateString))
+ params.Add(New ReportParameter("TipoContrato", If(DdlTipoContrato.SelectedValue = "-1", "", DdlTipoContrato.SelectedItem.Text)))
+ params.Add(New ReportParameter("Turno", If(DdlTurno.SelectedValue = "-1", "", DdlTurno.SelectedItem.Text)))
+ params.Add(New ReportParameter("Jornada", If(DdlJornada.SelectedValue = "-1", "", DdlJornada.SelectedItem.Text)))
+ params.Add(New ReportParameter("Ruta", If(DdlRuta.SelectedValue = "-1", "", DdlRuta.SelectedItem.Text)))
+ params.Add(New ReportParameter("Departamento", If(DdlDepartamento.SelectedValue = "-1", "", DdlDepartamento.SelectedItem.Text)))
+ params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue = "-1", "", DdlPuesto.SelectedItem.Text)))
+ params.Add(New ReportParameter("SupervisorRH", If(DdlSupervisor.SelectedValue = "-1", "", DdlSupervisor.SelectedItem.Text)))
+ params.Add(New ReportParameter("SupervisorInmediato", If(DdlSupervisorOrganigrama.SelectedValue = "-1", "", DdlSupervisorOrganigrama.SelectedItem.Text)))
+ params.Add(New ReportParameter("Cliente", DdlClienteAsignado.SelectedItem.Text))
+ params.Add(New ReportParameter("Proyecto", DdlProyectoAsignado.SelectedItem.Text))
+ params.Add(New ReportParameter("SubProyecto", DdlSubProyectoAsignado.SelectedItem.Text))
+ params.Add(New ReportParameter("Estatus", If(DdlEstatusPersonal.SelectedValue = "-1", "", DdlEstatusPersonal.SelectedItem.Text)))
+ params.Add(New ReportParameter("MotivoBaja", If(DdlMotivoBaja.SelectedValue = "-1", "", DdlMotivoBaja.SelectedItem.Text)))
+ params.Add(New ReportParameter("FechaInicio", ObjPersonal.FechaIng.ToShortDateString))
+ params.Add(New ReportParameter("FechaFin", If(ObjPersonal.FechaBaja.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaBaja.ToShortDateString)))
+ params.Add(New ReportParameter("CuentaContable", DdlViaticos.SelectedItem.Text))
+ params.Add(New ReportParameter("FechaIngreso", ObjPersonal.FechaIngreso.ToShortDateString))
+ params.Add(New ReportParameter("TipoPeriodo", ObjPersonal.CveTipoPeriodo.ToString()))
+ params.Add(New ReportParameter("RegimenContratacion", ObjPersonal.RegimenContratacion))
+ params.Add(New ReportParameter("RiesgoPuesto", DdlRiesgoPuesto.SelectedItem.Text))
+ params.Add(New ReportParameter("NoSeguroSocial", ObjPersonal.NumeroSS))
+ params.Add(New ReportParameter("InscribioSeguro", If(ObjPersonal.SeInscribioSS, "Si", "No")))
+ params.Add(New ReportParameter("SDD", ObjPersonal.SalarioDiario.ToString()))
+ params.Add(New ReportParameter("SDI", ObjPersonal.SDI.ToString()))
+ params.Add(New ReportParameter("SalarioIMSS", ObjPersonal.SalarioDiarioSS.ToString()))
+ params.Add(New ReportParameter("Bono", ObjPersonal.Bono.ToString()))
+ params.Add(New ReportParameter("DiasAguinaldo", ObjPersonal.NumDiasAguinaldo.ToString()))
+ params.Add(New ReportParameter("PrimaVacacional", ObjPersonal.PorPrimaVacacional.ToString()))
+ params.Add(New ReportParameter("MetodoPago", If(DdlMetodoPago.SelectedValue = "-1", "", DdlMetodoPago.SelectedItem.Text)))
+ params.Add(New ReportParameter("Banco", If(DdlBanco.SelectedValue = "-1", "", DdlBanco.SelectedItem.Text)))
+ params.Add(New ReportParameter("NoCuenta", ObjPersonal.BancoNumCuenta))
+ params.Add(New ReportParameter("CLABE", ObjPersonal.CLABE))
+
+
+
+ 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", ""))
+ End If
+
+ 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)
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("LogoPath", logouri))
+ Else
+ params.Add(New ReportParameter("LogoPath", ""))
+ End If
+
+ ImprimirPDF("Empresas/Grales/Formatos/Personal.rdlc", New DataTable, params, "ReportePersonal", Formato)
+ Else
+ Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
+
+ End If
+ End If
+ ObjPersonal.Dispose()
+ End Sub
+ 'Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
+ ' GenerarPDF("PDF")
+ 'End Sub
+ Protected Sub ImgImprimirExpediente_Click(sender As Object, e As EventArgs) Handles ImgImprimirExpediente.Click
+ Dim ObjPersonal As New ClsRH()
+ If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
+ If ObjPersonal.DtResultados.Rows.Count > 0 Then
+
+ Dim params As New List(Of ReportParameter)
+ params.Add(New ReportParameter("ApellidoP", ObjPersonal.APaterno))
+ params.Add(New ReportParameter("ApellidoM", ObjPersonal.AMaterno))
+ params.Add(New ReportParameter("Nombres", ObjPersonal.Nombres))
+ params.Add(New ReportParameter("Codigo", ObjPersonal.Codigo))
+ params.Add(New ReportParameter("Escolaridad", If(DdlEscolaridad.SelectedValue = "-1", "", DdlEscolaridad.SelectedItem.Text)))
+ params.Add(New ReportParameter("EstadoCivil", If(DdlEstadoCivil.SelectedValue = "-1", "", DdlEstadoCivil.SelectedItem.Text)))
+ params.Add(New ReportParameter("Genero", If(DdlGenero.SelectedValue = "-1", "", DdlGenero.SelectedItem.Text)))
+ params.Add(New ReportParameter("FechaNacimiento", ObjPersonal.FechaNacimiento.ToShortDateString))
+ params.Add(New ReportParameter("RFC", ObjPersonal.RFC))
+ params.Add(New ReportParameter("CURP", ObjPersonal.CURP))
+ params.Add(New ReportParameter("Calle", ObjPersonal.Calle))
+ params.Add(New ReportParameter("Numero", ObjPersonal.NumExt))
+ params.Add(New ReportParameter("Interior", ObjPersonal.NumInt))
+ params.Add(New ReportParameter("Colonia", ObjPersonal.Colonia))
+ params.Add(New ReportParameter("CP", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("Ciudad", ObjPersonal.CP))
+ params.Add(New ReportParameter("Estado", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("Telefono", ObjPersonal.Telefono))
+ params.Add(New ReportParameter("Celular", ObjPersonal.Celular))
+ params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
+ params.Add(New ReportParameter("LugarNacimiento", Now.ToDateTime.ToShortDateString))
+ params.Add(New ReportParameter("NombrePadre", ObjPersonal.NombrePadre))
+ params.Add(New ReportParameter("NombreMadre", ObjPersonal.NombreMadre))
+ params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
+ params.Add(New ReportParameter("FechaIContrato", ObjPersonal.FechaInicioContrato.ToShortDateString))
+ params.Add(New ReportParameter("FechaFContrato", ObjPersonal.FechaFinContrato.ToShortDateString))
+ params.Add(New ReportParameter("TipoContrato", If(DdlTipoContrato.SelectedValue = "-1", "", DdlTipoContrato.SelectedItem.Text)))
+ params.Add(New ReportParameter("Turno", If(DdlTurno.SelectedValue = "-1", "", DdlTurno.SelectedItem.Text)))
+ params.Add(New ReportParameter("Jornada", If(DdlJornada.SelectedValue = "-1", "", DdlJornada.SelectedItem.Text)))
+ params.Add(New ReportParameter("Ruta", If(DdlRuta.SelectedValue = "-1", "", DdlRuta.SelectedItem.Text)))
+ params.Add(New ReportParameter("Departamento", If(DdlDepartamento.SelectedValue = "-1", "", DdlDepartamento.SelectedItem.Text)))
+ params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue = "-1", "", DdlPuesto.SelectedItem.Text)))
+ params.Add(New ReportParameter("SupervisorRH", If(DdlSupervisor.SelectedValue = "-1", "", DdlSupervisor.SelectedItem.Text)))
+ params.Add(New ReportParameter("SupervisorInmediato", If(DdlSupervisorOrganigrama.SelectedValue = "-1", "", DdlSupervisorOrganigrama.SelectedItem.Text)))
+ params.Add(New ReportParameter("Cliente", DdlClienteAsignado.SelectedItem.Text))
+ params.Add(New ReportParameter("Proyecto", DdlProyectoAsignado.SelectedItem.Text))
+ params.Add(New ReportParameter("SubProyecto", DdlSubProyectoAsignado.SelectedItem.Text))
+ params.Add(New ReportParameter("Estatus", If(DdlEstatusPersonal.SelectedValue = "-1", "", DdlEstatusPersonal.SelectedItem.Text)))
+ params.Add(New ReportParameter("MotivoBaja", If(DdlMotivoBaja.SelectedValue = "-1", "", DdlMotivoBaja.SelectedItem.Text)))
+ params.Add(New ReportParameter("FechaInicio", ObjPersonal.FechaIng.ToShortDateString))
+ params.Add(New ReportParameter("FechaFin", If(ObjPersonal.FechaBaja.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaBaja.ToShortDateString)))
+ params.Add(New ReportParameter("CuentaContable", DdlViaticos.SelectedItem.Text))
+ params.Add(New ReportParameter("FechaIngreso", ObjPersonal.FechaIngreso.ToShortDateString))
+ params.Add(New ReportParameter("TipoPeriodo", ObjPersonal.CveTipoPeriodo.ToString()))
+ params.Add(New ReportParameter("RegimenContratacion", ObjPersonal.RegimenContratacion))
+ params.Add(New ReportParameter("RiesgoPuesto", DdlRiesgoPuesto.SelectedItem.Text))
+ params.Add(New ReportParameter("NoSeguroSocial", ObjPersonal.NumeroSS))
+ params.Add(New ReportParameter("InscribioSeguro", If(ObjPersonal.SeInscribioSS, "Si", "No")))
+ params.Add(New ReportParameter("SDD", ObjPersonal.SalarioDiario.ToString()))
+ params.Add(New ReportParameter("SDI", ObjPersonal.SDI.ToString()))
+ params.Add(New ReportParameter("SalarioIMSS", ObjPersonal.SalarioDiarioSS.ToString()))
+ params.Add(New ReportParameter("Bono", ObjPersonal.Bono.ToString()))
+ params.Add(New ReportParameter("DiasAguinaldo", ObjPersonal.NumDiasAguinaldo.ToString()))
+ params.Add(New ReportParameter("PrimaVacacional", ObjPersonal.PorPrimaVacacional.ToString()))
+ params.Add(New ReportParameter("MetodoPago", If(DdlMetodoPago.SelectedValue = "-1", "", DdlMetodoPago.SelectedItem.Text)))
+ params.Add(New ReportParameter("Banco", If(DdlBanco.SelectedValue = "-1", "", DdlBanco.SelectedItem.Text)))
+ params.Add(New ReportParameter("NoCuenta", ObjPersonal.BancoNumCuenta))
+ params.Add(New ReportParameter("CLABE", ObjPersonal.CLABE))
+ params.Add(New ReportParameter("Fecha", DateTime.Now.ToShortDateString))
+ Dim edad As Integer
+ edad = Now.Year - ObjPersonal.FechaNacimiento.Year
+ If Now.Month < ObjPersonal.FechaNacimiento.Month OrElse (Now.Month = ObjPersonal.FechaNacimiento.Month AndAlso Now.Day < ObjPersonal.FechaNacimiento.Day) Then
+ edad = edad - 1
+ End If
+
+ params.Add(New ReportParameter("Edad", edad.ToString()))
+
+
+
+ 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", ""))
+ End If
+
+ 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)
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("LogoPath", logouri))
+ Else
+ params.Add(New ReportParameter("LogoPath", ""))
+ End If
+
+ ImprimirPDF("Empresas/Grales/Formatos/ExpedientePersonal.rdlc", New DataTable, params, "ExpedientePersonal")
+ Else
+ Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
+
+ End If
+ End If
+ ObjPersonal.Dispose()
+ End Sub
+ Private Sub LbGafete_Click(sender As Object, e As EventArgs) Handles LbGafete.Click
+ Dim params As New List(Of ReportParameter)
+ Dim ObjPersonal As New ClsRH()
+
+ If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
+ If ObjPersonal.DtResultados.Rows.Count > 0 Then
+
+ params.Add(New ReportParameter("Nombre", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim)))
+ params.Add(New ReportParameter("Vigencia", TxtFechaFinContrato.Text))
+ params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero > 0, DdlPuesto.SelectedItem.Text, "")))
+ params.Add(New ReportParameter("CURP", TxtCURP.Text))
+ params.Add(New ReportParameter("NoRegistro", ""))
+ params.Add(New ReportParameter("RegIMSS", TxtNumeroSS.Text))
+ params.Add(New ReportParameter("FechaIngreso", TxtFechaIngreso.Text))
+ params.Add(New ReportParameter("DomPart", String.Format("{0} NoExt:{1} NoInt:{2} {3}", TxtCalle.Text, TxtNumExt.Text, TxtNumInt.Text, TxtColonia.Text)))
+ params.Add(New ReportParameter("Emergencia", ""))
+ params.Add(New ReportParameter("CUIP", ""))
+ params.Add(New ReportParameter("TipoSangre", ""))
+ params.Add(New ReportParameter("RFC", TxtRFC.Text))
+ params.Add(New ReportParameter("Denominacion", TxtRFC.Text))
+
+
+
+ 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", ""))
+ End If
+
+ ImprimirPDF("Empresas/Grales/Formatos/RHGafete.rdlc", New DataTable, params, String.Format("Gafete_{0}", ObjPersonal.CvePersonal), "PDF")
+ End If
+ End If
+ ObjPersonal.Dispose()
+ End Sub
+ Private Sub GenerarPDFGastosXComp(Optional Formato As String = "PDF")
+
+ If RBLTipoGastos.SelectedValue = "1" Then
+
+ If DTGastosSinComp.Rows.Count > 0 Then
+
+ Dim params As New List(Of ReportParameter)
+ params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("Empleado", LtlPersonal.Text.ToString()))
+ params.Add(New ReportParameter("Saldo", LblSaldoGxC.Text.ToString()))
+ params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
+
+ 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)
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("pImg", logouri))
+ Else
+ params.Add(New ReportParameter("pImg", ""))
+ End If
+
+ ImprimirPDF("Empresas/Grales/Formatos/GastosXComprobarGral.rdlc", DTGastosSinComp, params, "GastosSinComprobarGral", Formato)
+ Else
+ Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
+ End If
+
+ ElseIf RBLTipoGastos.SelectedValue = "2" Then
+
+ If DTGastosPorCheque.Rows.Count > 0 Then
+
+ For Each Row As DataRow In DTGastosPorCheque.Rows
+ Dim FolioPago As String = Row("FolioPago").ToString()
+ Row("FolioPago") = ""
+ If Row("CveCompra").ToString() = "" And Row("CveIE").ToString() <> "" Then
+ Row("FechaVencimiento") = Row("FechaDocumento")
+ Row("FolioPago") = FolioPago
+ End If
+
+ If Row("FolioPago").ToString() <> "" Then
+ Row("SerieFolio") = ""
+ End If
+ Next
+
+ Dim params As New List(Of ReportParameter)
+ params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("Empleado", LtlPersonal.Text.ToString()))
+ params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
+
+ 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)
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("pImg", logouri))
+ Else
+ params.Add(New ReportParameter("pImg", ""))
+ End If
+
+ ImprimirPDF("Empresas/Grales/Formatos/GastosXComprobarCheque.rdlc", DTGastosPorCheque, params, "GastosPorCheque", Formato)
+ Else
+ Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
+ End If
+ End If
-#Region "I M P R I M I R "
- Private Sub GenerarPDF(Optional Formato As String = "PDF")
-
- Dim ObjPersonal As New ClsRH()
- If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
- If ObjPersonal.DtResultados.Rows.Count > 0 Then
-
- Dim params As New List(Of ReportParameter)
- params.Add(New ReportParameter("ApellidoP", ObjPersonal.APaterno))
- params.Add(New ReportParameter("ApellidoM", ObjPersonal.AMaterno))
- params.Add(New ReportParameter("Nombres", ObjPersonal.Nombres))
- params.Add(New ReportParameter("Codigo", ObjPersonal.Codigo))
- params.Add(New ReportParameter("Escolaridad", If(DdlEscolaridad.SelectedValue = "-1", "", DdlEscolaridad.SelectedItem.Text)))
- params.Add(New ReportParameter("EstadoCivil", If(DdlEstadoCivil.SelectedValue = "-1", "", DdlEstadoCivil.SelectedItem.Text)))
- params.Add(New ReportParameter("Genero", If(DdlGenero.SelectedValue = "-1", "", DdlGenero.SelectedItem.Text)))
- params.Add(New ReportParameter("FechaNacimiento", ObjPersonal.FechaNacimiento.ToShortDateString))
- params.Add(New ReportParameter("RFC", ObjPersonal.RFC))
- params.Add(New ReportParameter("CURP", ObjPersonal.CURP))
- params.Add(New ReportParameter("Calle", ObjPersonal.Calle))
- params.Add(New ReportParameter("Numero", ObjPersonal.NumExt))
- params.Add(New ReportParameter("Interior", ObjPersonal.NumInt))
- params.Add(New ReportParameter("Colonia", ObjPersonal.Colonia))
- params.Add(New ReportParameter("CP", Now.ToDateTime.ToShortDateString))
- params.Add(New ReportParameter("Ciudad", ObjPersonal.CP))
- params.Add(New ReportParameter("Estado", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("Telefono", ObjPersonal.Telefono))
- params.Add(New ReportParameter("Celular", ObjPersonal.Celular))
- params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
- params.Add(New ReportParameter("LugarNacimiento", Now.ToDateTime.ToShortDateString))
- params.Add(New ReportParameter("NombrePadre", ObjPersonal.NombrePadre))
- params.Add(New ReportParameter("NombreMadre", ObjPersonal.NombreMadre))
- params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
- params.Add(New ReportParameter("FechaIContrato", ObjPersonal.FechaInicioContrato.ToShortDateString))
- params.Add(New ReportParameter("FechaFContrato", ObjPersonal.FechaFinContrato.ToShortDateString))
- params.Add(New ReportParameter("TipoContrato", If(DdlTipoContrato.SelectedValue = "-1", "", DdlTipoContrato.SelectedItem.Text)))
- params.Add(New ReportParameter("Turno", If(DdlTurno.SelectedValue = "-1", "", DdlTurno.SelectedItem.Text)))
- params.Add(New ReportParameter("Jornada", If(DdlJornada.SelectedValue = "-1", "", DdlJornada.SelectedItem.Text)))
- params.Add(New ReportParameter("Ruta", If(DdlRuta.SelectedValue = "-1", "", DdlRuta.SelectedItem.Text)))
- params.Add(New ReportParameter("Departamento", If(DdlDepartamento.SelectedValue = "-1", "", DdlDepartamento.SelectedItem.Text)))
- params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue = "-1", "", DdlPuesto.SelectedItem.Text)))
- params.Add(New ReportParameter("SupervisorRH", If(DdlSupervisor.SelectedValue = "-1", "", DdlSupervisor.SelectedItem.Text)))
- params.Add(New ReportParameter("SupervisorInmediato", If(DdlSupervisorOrganigrama.SelectedValue = "-1", "", DdlSupervisorOrganigrama.SelectedItem.Text)))
- params.Add(New ReportParameter("Cliente", DdlClienteAsignado.SelectedItem.Text))
- params.Add(New ReportParameter("Proyecto", DdlProyectoAsignado.SelectedItem.Text))
- params.Add(New ReportParameter("SubProyecto", DdlSubProyectoAsignado.SelectedItem.Text))
- params.Add(New ReportParameter("Estatus", If(DdlEstatusPersonal.SelectedValue = "-1", "", DdlEstatusPersonal.SelectedItem.Text)))
- params.Add(New ReportParameter("MotivoBaja", If(DdlMotivoBaja.SelectedValue = "-1", "", DdlMotivoBaja.SelectedItem.Text)))
- params.Add(New ReportParameter("FechaInicio", ObjPersonal.FechaIng.ToShortDateString))
- params.Add(New ReportParameter("FechaFin", If(ObjPersonal.FechaBaja.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaBaja.ToShortDateString)))
- params.Add(New ReportParameter("CuentaContable", DdlViaticos.SelectedItem.Text))
- params.Add(New ReportParameter("FechaIngreso", ObjPersonal.FechaIngreso.ToShortDateString))
- params.Add(New ReportParameter("TipoPeriodo", ObjPersonal.CveTipoPeriodo.ToString()))
- params.Add(New ReportParameter("RegimenContratacion", ObjPersonal.RegimenContratacion))
- params.Add(New ReportParameter("RiesgoPuesto", DdlRiesgoPuesto.SelectedItem.Text))
- params.Add(New ReportParameter("NoSeguroSocial", ObjPersonal.NumeroSS))
- params.Add(New ReportParameter("InscribioSeguro", If(ObjPersonal.SeInscribioSS, "Si", "No")))
- params.Add(New ReportParameter("SDD", ObjPersonal.SalarioDiario.ToString()))
- params.Add(New ReportParameter("SDI", ObjPersonal.SDI.ToString()))
- params.Add(New ReportParameter("SalarioIMSS", ObjPersonal.SalarioDiarioSS.ToString()))
- params.Add(New ReportParameter("Bono", ObjPersonal.Bono.ToString()))
- params.Add(New ReportParameter("DiasAguinaldo", ObjPersonal.NumDiasAguinaldo.ToString()))
- params.Add(New ReportParameter("PrimaVacacional", ObjPersonal.PorPrimaVacacional.ToString()))
- params.Add(New ReportParameter("MetodoPago", If(DdlMetodoPago.SelectedValue = "-1", "", DdlMetodoPago.SelectedItem.Text)))
- params.Add(New ReportParameter("Banco", If(DdlBanco.SelectedValue = "-1", "", DdlBanco.SelectedItem.Text)))
- params.Add(New ReportParameter("NoCuenta", ObjPersonal.BancoNumCuenta))
- params.Add(New ReportParameter("CLABE", ObjPersonal.CLABE))
-
-
-
- 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", ""))
- End If
-
- 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)
-
- If Imagen.Exists Then
- params.Add(New ReportParameter("LogoPath", logouri))
- Else
- params.Add(New ReportParameter("LogoPath", ""))
- End If
-
- ImprimirPDF("Empresas/Grales/Formatos/Personal.rdlc", New DataTable, params, "ReportePersonal", Formato)
- Else
- Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
-
- End If
- End If
- ObjPersonal.Dispose()
- End Sub
- 'Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
- ' GenerarPDF("PDF")
- 'End Sub
- Protected Sub ImgImprimirExpediente_Click(sender As Object, e As EventArgs) Handles ImgImprimirExpediente.Click
- Dim ObjPersonal As New ClsRH()
- If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
- If ObjPersonal.DtResultados.Rows.Count > 0 Then
-
- Dim params As New List(Of ReportParameter)
- params.Add(New ReportParameter("ApellidoP", ObjPersonal.APaterno))
- params.Add(New ReportParameter("ApellidoM", ObjPersonal.AMaterno))
- params.Add(New ReportParameter("Nombres", ObjPersonal.Nombres))
- params.Add(New ReportParameter("Codigo", ObjPersonal.Codigo))
- params.Add(New ReportParameter("Escolaridad", If(DdlEscolaridad.SelectedValue = "-1", "", DdlEscolaridad.SelectedItem.Text)))
- params.Add(New ReportParameter("EstadoCivil", If(DdlEstadoCivil.SelectedValue = "-1", "", DdlEstadoCivil.SelectedItem.Text)))
- params.Add(New ReportParameter("Genero", If(DdlGenero.SelectedValue = "-1", "", DdlGenero.SelectedItem.Text)))
- params.Add(New ReportParameter("FechaNacimiento", ObjPersonal.FechaNacimiento.ToShortDateString))
- params.Add(New ReportParameter("RFC", ObjPersonal.RFC))
- params.Add(New ReportParameter("CURP", ObjPersonal.CURP))
- params.Add(New ReportParameter("Calle", ObjPersonal.Calle))
- params.Add(New ReportParameter("Numero", ObjPersonal.NumExt))
- params.Add(New ReportParameter("Interior", ObjPersonal.NumInt))
- params.Add(New ReportParameter("Colonia", ObjPersonal.Colonia))
- params.Add(New ReportParameter("CP", Now.ToDateTime.ToShortDateString))
- params.Add(New ReportParameter("Ciudad", ObjPersonal.CP))
- params.Add(New ReportParameter("Estado", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("Telefono", ObjPersonal.Telefono))
- params.Add(New ReportParameter("Celular", ObjPersonal.Celular))
- params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
- params.Add(New ReportParameter("LugarNacimiento", Now.ToDateTime.ToShortDateString))
- params.Add(New ReportParameter("NombrePadre", ObjPersonal.NombrePadre))
- params.Add(New ReportParameter("NombreMadre", ObjPersonal.NombreMadre))
- params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
- params.Add(New ReportParameter("FechaIContrato", ObjPersonal.FechaInicioContrato.ToShortDateString))
- params.Add(New ReportParameter("FechaFContrato", ObjPersonal.FechaFinContrato.ToShortDateString))
- params.Add(New ReportParameter("TipoContrato", If(DdlTipoContrato.SelectedValue = "-1", "", DdlTipoContrato.SelectedItem.Text)))
- params.Add(New ReportParameter("Turno", If(DdlTurno.SelectedValue = "-1", "", DdlTurno.SelectedItem.Text)))
- params.Add(New ReportParameter("Jornada", If(DdlJornada.SelectedValue = "-1", "", DdlJornada.SelectedItem.Text)))
- params.Add(New ReportParameter("Ruta", If(DdlRuta.SelectedValue = "-1", "", DdlRuta.SelectedItem.Text)))
- params.Add(New ReportParameter("Departamento", If(DdlDepartamento.SelectedValue = "-1", "", DdlDepartamento.SelectedItem.Text)))
- params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue = "-1", "", DdlPuesto.SelectedItem.Text)))
- params.Add(New ReportParameter("SupervisorRH", If(DdlSupervisor.SelectedValue = "-1", "", DdlSupervisor.SelectedItem.Text)))
- params.Add(New ReportParameter("SupervisorInmediato", If(DdlSupervisorOrganigrama.SelectedValue = "-1", "", DdlSupervisorOrganigrama.SelectedItem.Text)))
- params.Add(New ReportParameter("Cliente", DdlClienteAsignado.SelectedItem.Text))
- params.Add(New ReportParameter("Proyecto", DdlProyectoAsignado.SelectedItem.Text))
- params.Add(New ReportParameter("SubProyecto", DdlSubProyectoAsignado.SelectedItem.Text))
- params.Add(New ReportParameter("Estatus", If(DdlEstatusPersonal.SelectedValue = "-1", "", DdlEstatusPersonal.SelectedItem.Text)))
- params.Add(New ReportParameter("MotivoBaja", If(DdlMotivoBaja.SelectedValue = "-1", "", DdlMotivoBaja.SelectedItem.Text)))
- params.Add(New ReportParameter("FechaInicio", ObjPersonal.FechaIng.ToShortDateString))
- params.Add(New ReportParameter("FechaFin", If(ObjPersonal.FechaBaja.ToShortDateString = "01/01/0001", "", ObjPersonal.FechaBaja.ToShortDateString)))
- params.Add(New ReportParameter("CuentaContable", DdlViaticos.SelectedItem.Text))
- params.Add(New ReportParameter("FechaIngreso", ObjPersonal.FechaIngreso.ToShortDateString))
- params.Add(New ReportParameter("TipoPeriodo", ObjPersonal.CveTipoPeriodo.ToString()))
- params.Add(New ReportParameter("RegimenContratacion", ObjPersonal.RegimenContratacion))
- params.Add(New ReportParameter("RiesgoPuesto", DdlRiesgoPuesto.SelectedItem.Text))
- params.Add(New ReportParameter("NoSeguroSocial", ObjPersonal.NumeroSS))
- params.Add(New ReportParameter("InscribioSeguro", If(ObjPersonal.SeInscribioSS, "Si", "No")))
- params.Add(New ReportParameter("SDD", ObjPersonal.SalarioDiario.ToString()))
- params.Add(New ReportParameter("SDI", ObjPersonal.SDI.ToString()))
- params.Add(New ReportParameter("SalarioIMSS", ObjPersonal.SalarioDiarioSS.ToString()))
- params.Add(New ReportParameter("Bono", ObjPersonal.Bono.ToString()))
- params.Add(New ReportParameter("DiasAguinaldo", ObjPersonal.NumDiasAguinaldo.ToString()))
- params.Add(New ReportParameter("PrimaVacacional", ObjPersonal.PorPrimaVacacional.ToString()))
- params.Add(New ReportParameter("MetodoPago", If(DdlMetodoPago.SelectedValue = "-1", "", DdlMetodoPago.SelectedItem.Text)))
- params.Add(New ReportParameter("Banco", If(DdlBanco.SelectedValue = "-1", "", DdlBanco.SelectedItem.Text)))
- params.Add(New ReportParameter("NoCuenta", ObjPersonal.BancoNumCuenta))
- params.Add(New ReportParameter("CLABE", ObjPersonal.CLABE))
- params.Add(New ReportParameter("Fecha", DateTime.Now.ToShortDateString))
- Dim edad As Integer
- edad = Now.Year - ObjPersonal.FechaNacimiento.Year
- If Now.Month < ObjPersonal.FechaNacimiento.Month OrElse (Now.Month = ObjPersonal.FechaNacimiento.Month AndAlso Now.Day < ObjPersonal.FechaNacimiento.Day) Then
- edad = edad - 1
- End If
-
- params.Add(New ReportParameter("Edad", edad.ToString()))
-
-
-
- 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", ""))
- End If
-
- 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)
-
- If Imagen.Exists Then
- params.Add(New ReportParameter("LogoPath", logouri))
- Else
- params.Add(New ReportParameter("LogoPath", ""))
- End If
-
- ImprimirPDF("Empresas/Grales/Formatos/ExpedientePersonal.rdlc", New DataTable, params, "ExpedientePersonal")
- Else
- Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
-
- End If
- End If
- ObjPersonal.Dispose()
- End Sub
- Private Sub LbGafete_Click(sender As Object, e As EventArgs) Handles LbGafete.Click
- Dim params As New List(Of ReportParameter)
- Dim ObjPersonal As New ClsRH()
-
- If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
- If ObjPersonal.DtResultados.Rows.Count > 0 Then
-
- params.Add(New ReportParameter("Nombre", String.Format("{0} {1} {2}", TxtAPaterno.Text.Trim, TxtAMaterno.Text.Trim, TxtNombres.Text.Trim)))
- params.Add(New ReportParameter("Vigencia", TxtFechaFinContrato.Text))
- params.Add(New ReportParameter("Puesto", If(DdlPuesto.SelectedValue.ToEntero > 0, DdlPuesto.SelectedItem.Text, "")))
- params.Add(New ReportParameter("CURP", TxtCURP.Text))
- params.Add(New ReportParameter("NoRegistro", ""))
- params.Add(New ReportParameter("RegIMSS", TxtNumeroSS.Text))
- params.Add(New ReportParameter("FechaIngreso", TxtFechaIngreso.Text))
- params.Add(New ReportParameter("DomPart", String.Format("{0} NoExt:{1} NoInt:{2} {3}", TxtCalle.Text, TxtNumExt.Text, TxtNumInt.Text, TxtColonia.Text)))
- params.Add(New ReportParameter("Emergencia", ""))
- params.Add(New ReportParameter("CUIP", ""))
- params.Add(New ReportParameter("TipoSangre", ""))
- params.Add(New ReportParameter("RFC", TxtRFC.Text))
- params.Add(New ReportParameter("Denominacion", TxtRFC.Text))
-
-
-
- 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", ""))
- End If
-
- ImprimirPDF("Empresas/Grales/Formatos/RHGafete.rdlc", New DataTable, params, String.Format("Gafete_{0}", ObjPersonal.CvePersonal), "PDF")
- End If
- End If
- ObjPersonal.Dispose()
- End Sub
- Private Sub GenerarPDFGastosXComp(Optional Formato As String = "PDF")
-
- If RBLTipoGastos.SelectedValue = "1" Then
-
- If DTGastosSinComp.Rows.Count > 0 Then
-
- Dim params As New List(Of ReportParameter)
- params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("Empleado", LtlPersonal.Text.ToString()))
- params.Add(New ReportParameter("Saldo", LblSaldoGxC.Text.ToString()))
- params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
-
- 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)
-
- If Imagen.Exists Then
- params.Add(New ReportParameter("pImg", logouri))
- Else
- params.Add(New ReportParameter("pImg", ""))
- End If
-
- ImprimirPDF("Empresas/Grales/Formatos/GastosXComprobarGral.rdlc", DTGastosSinComp, params, "GastosSinComprobarGral", Formato)
- Else
- Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
- End If
-
- ElseIf RBLTipoGastos.SelectedValue = "2" Then
-
- If DTGastosPorCheque.Rows.Count > 0 Then
-
- For Each Row As DataRow In DTGastosPorCheque.Rows
- Dim FolioPago As String = Row("FolioPago").ToString()
- Row("FolioPago") = ""
- If Row("CveCompra").ToString() = "" And Row("CveIE").ToString() <> "" Then
- Row("FechaVencimiento") = Row("FechaDocumento")
- Row("FolioPago") = FolioPago
- End If
-
- If Row("FolioPago").ToString() <> "" Then
- Row("SerieFolio") = ""
- End If
- Next
-
- Dim params As New List(Of ReportParameter)
- params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("Empleado", LtlPersonal.Text.ToString()))
- params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
-
- 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)
-
- If Imagen.Exists Then
- params.Add(New ReportParameter("pImg", logouri))
- Else
- params.Add(New ReportParameter("pImg", ""))
- End If
-
- ImprimirPDF("Empresas/Grales/Formatos/GastosXComprobarCheque.rdlc", DTGastosPorCheque, params, "GastosPorCheque", Formato)
- Else
- Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
- End If
- End If
-
-
- End Sub
-
-
- Protected Sub BtnPDFHistorial_Click(sender As Object, e As EventArgs)
- GenerarPDFGastosXComp("PDF")
- End Sub
- Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
- GenerarPDFGastosXComp("Excel")
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"
+ Protected Sub BtnPDFHistorial_Click(sender As Object, e As EventArgs)
+ GenerarPDFGastosXComp("PDF")
+ End Sub
+ Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
+ GenerarPDFGastosXComp("Excel")
+ End Sub
- Private Sub CargaDocumentacionFirmaDecontratos()
-
- If CvePersonal > 0 Then
- Dim objRH As New ClsEdocumentacion()
-
- If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then
- DTDocumentacion = objRH.DtResultados
- End If
-
- If DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ").Rows.Count > 0 Then
- GvDocumentosFirma.DataSource = DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ")
- Else
- GvDocumentosFirma.DataSource = Nothing
- End If
- GvDocumentosFirma.DataBind()
-
- UPGvDocumentosFirma.Update()
- UpGvDocumentosFirma2.Update()
- End If
-
- End Sub
- Public Sub UploadModal_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- Dim chkEstatus As CheckBox
- CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero
- CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString().ToEntero
- Documentacion = GvRow.DataKey("Documentacion")
- AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString()
-
- chkEstatus = GvRow.FCCheckBox("chkEstatus")
-
-
-
- ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
- FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
-
- AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
-
- LtlTitulofirmaContrato.Text = "Subir " & Documentacion
-
- UpTituloFirma.Update()
-
- RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal({ backdrop: 'static', keyboard: false});")
- End Sub
- Private Sub GuardarDocumentosFirmaContrato(Optional _CveDocumentacionExcluir As Integer = -1)
-
- Dim hasError As Boolean = True
- Dim objDocumentos As New ClsEdocumentacion
-
- For Each dRow As GridViewRow In GvDocumentosFirma.Rows
-
-
- Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString().ToEntero
- Dim _Adjunto As String = dRow.DataKey("Adjunto")
- 'Dim _Documentacion As String = dRow.DataKey("Documentacion")
- Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero
- Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones")
- Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite")
- Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia")
- Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus")
- Dim _estatus As Integer
-
- _estatus = If(dRow.DataKey("Estatus").ToString().ToUpper = "TRUE", 1, 0)
-
- Dim _FechaVigencia As Date
- Dim _FechaLimite As Date
-
- Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString().ToEntero
- Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString() = "1", True, False)
- Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False)
-
- If _TxtFechaVigencia.Text.Length = 10 Then
- _FechaVigencia = _TxtFechaVigencia.Text.ToDate
- Else
- _FechaVigencia = Nothing
- End If
-
- If Not AplicaDiasLimite Then
- _FechaLimite = MinFecha
- Else
- _FechaLimite = _TxtFechaLimite.Text.ToDate
- End If
-
- If Not AplicaFechaVencimiento Then
- _FechaVigencia = MinFecha
- End If
-
-
- If Not _CveDocumentacionExcluir = _CveDocumentacion Then
- Try
- If _CveDocumentacionElectronica = -1 Then
-
- If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then
- Else
- hasError = True
- Exit For
- End If
-
- Else
- If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then
- Else
- hasError = True
- Exit For
- End If
- End If
-
-
- hasError = False
- Catch ex As Exception
- hasError = True
- Exit For
- End Try
- End If
- Next
-
- 'refrescar grid datos investigacion
- CargaDocumentacionFirmaDecontratos()
- End Sub
- Protected Sub BtnModalFirmaContratoDocumentoUpload_Click(sender As Object, e As EventArgs) Handles BtnModalFirmaContratoDocumentoUpload.Click
-
- Dim FileExtension As String = "-1"
- Dim Filesgral As List(Of Archivo) = TxtFileFirmaContrato.getfiles().Archivos
- Dim Filename As String = ""
-
-
- For Each fileItem As Archivo In Filesgral
- Try
-
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
- Dim tempArray() As String
- tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
-
- Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & Documentacion & "." & FileExtension
- Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & AdjuntoDocumentacion
-
- If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\") Then
- System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\")
- End If
-
- If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
- File.Delete(rutaAdjuntoAnterior)
- End If
-
- If System.IO.File.Exists(rutaDestino) Then
- System.IO.File.Delete(rutaDestino)
- End If
-
- System.IO.File.Move(fileItem.FileUrl, rutaDestino)
-
- Dim objRH As New ClsEdocumentacion
-
-
- If CveDocumentacionElectronica = -1 Then
- If objRH.DocumentacionElectronicaAdd(CveDocumentacion, CvePersonal, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite) > 0 Then
-
- End If
- Else
- If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, CvePersonal, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite) Then
-
- End If
- End If
-
- objRH.Dispose()
-
- GuardarDocumentosFirmaContrato(CveDocumentacion)
- CargaDocumentacionFirmaDecontratos()
-
-
- TxtFileFirmaContrato.Text = ""
- UpModalFirmaContratoDocumento.Update()
-
- Catch ex As Exception
- OnError("Error al cargar archivo", ex)
- End Try
-
- Next
- RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal('hide')", "hidemodal7")
-
- End Sub
-
- Public Sub Update_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim activo As Boolean = False
-
- Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero
- Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero
- Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString()
- Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
-
- Dim obserbaciones As String = DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
- 'Dim DDLEstatus As DropDownList = DirectCast(GvRow.FindControl("DDLEstatus"), DropDownList)
- Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
-
- If chkCompleto.Checked Then
- Estatus = 1
- Else
- Estatus = 0
- End If
-
- Dim objRH As New ClsEdocumentacion
-
- If Not _CveDocumentacionElectronica = -1 Then
- If objRH.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, 1, obserbaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) Then
- Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
- End If
- Else
- If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, 1, obserbaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) > 0 Then
- Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
- End If
- End If
-
- CargaDocumentacionFirmaDecontratos()
- objRH.Dispose()
-
- End Sub
- Protected Sub GvDocumentosFirma_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentosFirma.RowDataBound
-
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString()
- Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato")
- Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
- Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
- Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
- Dim requerido As Boolean = If(e.Row.DBCampo("Requerido").ToUpper = "TRUE", True, False)
- Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
- Dim documentacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString()
- Dim Documentacion As String = e.Row.DBCampo("Documentacion").ToString()
- Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString().ToEntero
- Dim separado As Char() = ".".ToString().ToCharArray
- Dim array() As String = Adjunto.Split(separado)
- Dim extencion As String = ""
- Dim existeAdjunto As Boolean = False
- Dim TxtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
- ' FechaVigencia
-
- Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString().ToEntero
- Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString() = "1", True, False)
- Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False)
-
- txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
- TxtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
-
-
-
- Dim scripMascara = " $('#" & TxtFechaVigencia.ClientID & "').mask('00/00/0000');"
- RegistraScript(scripMascara)
- If array.Length > 0 Then
- extencion = array(array.Length - 1)
- End If
-
- If e.Row.DBCampo("Estatus").ToString().ToEntero = 1 Then
- chkEstatus.Checked = True
- Else
- chkEstatus.Checked = False
- End If
-
- If documentacionFormato = "" Then
- ImgDownLoadFormato.Visible = False
- Else
- Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & CveDocumentacion & "" & documentacionFormato
- ImgDownLoadFormato.Visible = True
- End If
-
- txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString().ToDate.ToString("dd/MM/yyyy")
-
- If Adjunto.Trim.Length > 0 Then
-
- Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Personal/" & CvePersonal & "/" & Adjunto
- Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Personal/" & CvePersonal & "/" & Adjunto
-
- If File.Exists(linkDescargaArchivo) Then
-
- ImgDownLoad.Visible = True
- If extencion.Length > 0 Then
- ImgDownLoad.Text = String.Format(" ", linkDescarga, CvePersonal & Documentacion & "." & extencion)
- Else
- ImgDownLoad.Text = String.Format(" ", linkDescarga, CvePersonal & Documentacion)
- End If
- Else
- ImgDownLoad.Visible = False
- End If
- Else
- ImgDownLoad.Visible = False
- End If
-
- If requerido Then
- ImgRequired.Text = " "
- Else
- ' ImgRequired.Text = " "
- End If
-
- End If
-
- End Sub
- Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero
+#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
+ Dim objRH As New ClsEdocumentacion()
+
+ If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then
+ DTDocumentacion = objRH.DtResultados
+ End If
+
+ If DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ").Rows.Count > 0 Then
+ GvDocumentosFirma.DataSource = DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ")
+ Else
+ GvDocumentosFirma.DataSource = Nothing
+ End If
+ GvDocumentosFirma.DataBind()
+
+ UPGvDocumentosFirma.Update()
+ UpGvDocumentosFirma2.Update()
+ End If
+
+ End Sub
+ Public Sub UploadModal_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ Dim chkEstatus As CheckBox
+ CveDocumentacionElectronica = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero
+ CveDocumentacion = GvRow.DataKey("CveDocumentacion").ToString().ToEntero
+ Documentacion = GvRow.DataKey("Documentacion")
+ AdjuntoDocumentacion = GvRow.DataKey("Adjunto").ToString()
+
+ chkEstatus = GvRow.FCCheckBox("chkEstatus")
+
+
+
+ ObservacionDocumentacion = GvRow.FCTextBox("TxtObservaciones").Text.Trim.ToUpper
+ FechaLimite = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
+
+ AdjuntoDocumentacion = GvRow.DataKey("Adjunto")
+
+ LtlTitulofirmaContrato.Text = "Subir " & Documentacion
+
+ UpTituloFirma.Update()
+
+ RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal({ backdrop: 'static', keyboard: false});")
+ End Sub
+ Private Sub GuardarDocumentosFirmaContrato(Optional _CveDocumentacionExcluir As Integer = -1)
+
+ Dim hasError As Boolean = True
+ Dim objDocumentos As New ClsEdocumentacion
+
+ For Each dRow As GridViewRow In GvDocumentosFirma.Rows
+
+
+ Dim _CveDocumentacion As Integer = dRow.DataKey("CveDocumentacion").ToString().ToEntero
+ Dim _Adjunto As String = dRow.DataKey("Adjunto")
+ 'Dim _Documentacion As String = dRow.DataKey("Documentacion")
+ Dim _CveDocumentacionElectronica As Integer = dRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero
+ Dim _txtObservaciones As TextBox = dRow.FCTextBox("TxtObservaciones")
+ Dim _TxtFechaLimite As TextBox = dRow.FCTextBox("TxtFechaLimite")
+ Dim _TxtFechaVigencia As TextBox = dRow.FCTextBox("TxtFechaVigencia")
+ Dim chkEstatus As CheckBox = dRow.FCCheckBox("chkEstatus")
+ Dim _estatus As Integer
+
+ _estatus = If(dRow.DataKey("Estatus").ToString().ToUpper = "TRUE", 1, 0)
+
+ Dim _FechaVigencia As Date
+ Dim _FechaLimite As Date
+
+ Dim DiasLimite As Integer = dRow.DataKey("DiasLimite").ToString().ToEntero
+ Dim AplicaDiasLimite As Boolean = If(dRow.DataKey("AplicaDiasLimite").ToString() = "1", True, False)
+ Dim AplicaFechaVencimiento As Boolean = If(dRow.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False)
+
+ If _TxtFechaVigencia.Text.Length = 10 Then
+ _FechaVigencia = _TxtFechaVigencia.Text.ToDate
+ Else
+ _FechaVigencia = Nothing
+ End If
+
+ If Not AplicaDiasLimite Then
+ _FechaLimite = MinFecha
+ Else
+ _FechaLimite = _TxtFechaLimite.Text.ToDate
+ End If
+
+ If Not AplicaFechaVencimiento Then
+ _FechaVigencia = MinFecha
+ End If
+
+
+ If Not _CveDocumentacionExcluir = _CveDocumentacion Then
+ Try
+ If _CveDocumentacionElectronica = -1 Then
+
+ If objDocumentos.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) > 0 Then
+ Else
+ hasError = True
+ Exit For
+ End If
+
+ Else
+ If objDocumentos.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, _estatus, _txtObservaciones.Text.Trim, _Adjunto, UsuarioActual.CveUsuario, _FechaLimite, _FechaVigencia) Then
+ Else
+ hasError = True
+ Exit For
+ End If
+ End If
+
+
+ hasError = False
+ Catch ex As Exception
+ hasError = True
+ Exit For
+ End Try
+ End If
+ Next
+
+ 'refrescar grid datos investigacion
+ CargaDocumentacionFirmaDecontratos()
+ End Sub
+ Protected Sub BtnModalFirmaContratoDocumentoUpload_Click(sender As Object, e As EventArgs) Handles BtnModalFirmaContratoDocumentoUpload.Click
+
+ Dim FileExtension As String = "-1"
+ Dim Filesgral As List(Of Archivo) = TxtFileFirmaContrato.getfiles().Archivos
+ Dim Filename As String = ""
+
+
+ For Each fileItem As Archivo In Filesgral
+ Try
+
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ Dim tempArray() As String
+ tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
+
+ Dim rutaDestino As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & Documentacion & "." & FileExtension
+ Dim rutaAdjuntoAnterior As String = UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\" & AdjuntoDocumentacion
+
+ If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\") Then
+ System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\")
+ End If
+
+ If File.Exists(rutaAdjuntoAnterior) And AdjuntoDocumentacion.Trim.Length > 0 Then
+ File.Delete(rutaAdjuntoAnterior)
+ End If
+
+ If System.IO.File.Exists(rutaDestino) Then
+ System.IO.File.Delete(rutaDestino)
+ End If
+
+ System.IO.File.Move(fileItem.FileUrl, rutaDestino)
+
+ Dim objRH As New ClsEdocumentacion
+
+
+ If CveDocumentacionElectronica = -1 Then
+ If objRH.DocumentacionElectronicaAdd(CveDocumentacion, CvePersonal, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite) > 0 Then
+
+ End If
+ Else
+ If objRH.DocumentacionElectronicaUpdate(CveDocumentacionElectronica, CveDocumentacion, CvePersonal, -1, -1, 1, ObservacionDocumentacion, Documentacion & "." & FileExtension, UsuarioActual.CveUsuario, FechaLimite) Then
+
+ End If
+ End If
+
+ objRH.Dispose()
+
+ GuardarDocumentosFirmaContrato(CveDocumentacion)
+ CargaDocumentacionFirmaDecontratos()
+
+
+ TxtFileFirmaContrato.Text = ""
+ UpModalFirmaContratoDocumento.Update()
+
+ Catch ex As Exception
+ OnError("Error al cargar archivo", ex)
+ End Try
+
+ Next
+ RegistraScript("$('#ModalUploadFirmaContratoDocumento').modal('hide')", "hidemodal7")
+
+ End Sub
+
+ Public Sub Update_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim activo As Boolean = False
+
+ Dim _CveDocumentacionElectronica As Integer = GvRow.DataKey("CveDocumentacionElectronica").ToString().ToEntero
+ Dim _CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero
+ Dim _Adjunto As String = GvRow.DataKey("Adjunto").ToString()
+ Dim _fechaLimite As Date = GvRow.FCTextBox("TxtFechaLimite").Text.ToDate
+
+ Dim obserbaciones As String = DirectCast(GvRow.FindControl("TxtObservaciones"), TextBox).Text
+ 'Dim DDLEstatus As DropDownList = DirectCast(GvRow.FindControl("DDLEstatus"), DropDownList)
+ Dim chkCompleto As CheckBox = DirectCast(GvRow.FindControl("chkEstatus"), CheckBox)
+
+ If chkCompleto.Checked Then
+ Estatus = 1
+ Else
+ Estatus = 0
+ End If
+
+ Dim objRH As New ClsEdocumentacion
+
+ If Not _CveDocumentacionElectronica = -1 Then
+ If objRH.DocumentacionElectronicaUpdate(_CveDocumentacionElectronica, _CveDocumentacion, CvePersonal, -1, -1, 1, obserbaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) Then
+ Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
+ End If
+ Else
+ If objRH.DocumentacionElectronicaAdd(_CveDocumentacion, CvePersonal, -1, -1, 1, obserbaciones, _Adjunto, UsuarioActual.CveUsuario, _fechaLimite) > 0 Then
+ Alert("Documento actualizado correctamente.", TipoMensaje.MsgInformacion)
+ End If
+ End If
+
+ CargaDocumentacionFirmaDecontratos()
+ objRH.Dispose()
+
+ End Sub
+ Protected Sub GvDocumentosFirma_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDocumentosFirma.RowDataBound
+
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ Dim Adjunto As String = e.Row.DBCampo("Adjunto").ToString()
+ Dim ImgDownLoadFormato As LinkButton = e.Row.FCLinkButton("ImgDownLoadFormato")
+ Dim ImgDownLoad As Literal = e.Row.FCLiteral("ImgDownLoad")
+ Dim ImgRequired As Literal = e.Row.FCLiteral("ImgRequired")
+ Dim txtFechaLimite As TextBox = e.Row.FCTextBox("TxtFechaLimite")
+ Dim requerido As Boolean = If(e.Row.DBCampo("Requerido").ToUpper = "TRUE", True, False)
+ Dim chkEstatus As CheckBox = e.Row.FCCheckBox("chkEstatus")
+ Dim documentacionFormato As String = e.Row.DBCampo("DocumentacionFormato").ToString()
+ Dim Documentacion As String = e.Row.DBCampo("Documentacion").ToString()
+ Dim _CveDocumentacion As Integer = e.Row.DBCampo("CveDocumentacion").ToString().ToEntero
+ Dim separado As Char() = ".".ToString().ToCharArray
+ Dim array() As String = Adjunto.Split(separado)
+ Dim extencion As String = ""
+ Dim existeAdjunto As Boolean = False
+ Dim TxtFechaVigencia As TextBox = e.Row.FCTextBox("TxtFechaVigencia")
+ ' FechaVigencia
+
+ Dim DiasLimite As Integer = e.Row.DataKey("DiasLimite").ToString().ToEntero
+ Dim AplicaDiasLimite As Boolean = If(e.Row.DataKey("AplicaDiasLimite").ToString() = "1", True, False)
+ Dim AplicaFechaVencimiento As Boolean = If(e.Row.DataKey("AplicaFechaVencimiento").ToString() = "1", True, False)
+
+ txtFechaLimite.Visible = If(AplicaDiasLimite, True, False)
+ TxtFechaVigencia.Visible = If(AplicaFechaVencimiento, True, False)
+
+
+
+ Dim scripMascara = " $('#" & TxtFechaVigencia.ClientID & "').mask('00/00/0000');"
+ RegistraScript(scripMascara)
+ If array.Length > 0 Then
+ extencion = array(array.Length - 1)
+ End If
+
+ If e.Row.DBCampo("Estatus").ToString().ToEntero = 1 Then
+ chkEstatus.Checked = True
+ Else
+ chkEstatus.Checked = False
+ End If
+
+ If documentacionFormato = "" Then
+ ImgDownLoadFormato.Visible = False
+ Else
+ Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Formatos/" & CveDocumentacion & "" & documentacionFormato
+ ImgDownLoadFormato.Visible = True
+ End If
+
+ txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString().ToDate.ToString("dd/MM/yyyy")
+
+ If Adjunto.Trim.Length > 0 Then
+
+ Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/Personal/" & CvePersonal & "/" & Adjunto
+ Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "Personal/" & CvePersonal & "/" & Adjunto
+
+ If File.Exists(linkDescargaArchivo) Then
+
+ ImgDownLoad.Visible = True
+ If extencion.Length > 0 Then
+ ImgDownLoad.Text = String.Format(" ", linkDescarga, CvePersonal & Documentacion & "." & extencion)
+ Else
+ ImgDownLoad.Text = String.Format(" ", linkDescarga, CvePersonal & Documentacion)
+ End If
+ Else
+ ImgDownLoad.Visible = False
+ End If
+ Else
+ ImgDownLoad.Visible = False
+ End If
+
+ If requerido Then
+ ImgRequired.Text = " "
+ Else
+ ' ImgRequired.Text = " "
+ End If
+
+ End If
+
+ End Sub
+ Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero
Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato")
@@ -3863,1311 +3863,1311 @@ Partial Class RH_Personal
- End Sub
- Public Sub DescarFormato(documento As String)
-
- Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
- Dim PathSource As String
- Dim pathDesti As String
-
- PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
- pathDesti = PathRoot & "Temp\" & CvePersonal & documento
-
- If File.Exists(pathDesti) Then
- File.Delete(pathDesti)
- End If
-
- File.Copy(PathSource, pathDesti)
-
- Dim objDoc As New clsGemBoxDocument(pathDesti)
- Dim objRH As New ClsRH
- Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
-
-
- objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
- objRH.Dispose()
-
-
-
- objDoc.Guardar(pathDesti)
-
- Dim fileinfo As New FileInfo(pathDesti)
-
- Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
- baseUrl = baseUrl & "/temp/" & fileinfo.Name
-
- RegistraDescargaJavaScript(baseUrl)
-
- End Sub
-
-
-
- Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos)
- Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
-
- If CvePersonal <> -1 Then
- Dim objRH As New ClsRH
-
-
-
- If objRH.PersonalReclutamientoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Nombres}", objRH.DtResultados(0)("Nombres").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{APaterno}", objRH.DtResultados(0)("APaterno").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{AMaterno}", objRH.DtResultados(0)("AMaterno").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{RFC}", objRH.DtResultados(0)("RFC").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", NombreCompleto))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Estatura}", objRH.DtResultados(0)("Estatura").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Peso}", objRH.DtResultados(0)("Peso").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{LugarNacimiento}", objRH.DtResultados(0)("LugarNacimiento").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", objRH.DtResultados(0)("Edad").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{NombreTelEmergencia}", objRH.DtResultados(0)("NombreTelEmergencia").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{TipoSangre}", objRH.DtResultados(0)("TipoSangre").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Vivienda}", objRH.DtResultados(0)("Vivienda").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{ViviendaDueno}", objRH.DtResultados(0)("ViviendaDueno").ToString()))
-
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{CreditoInfonavit}", objRH.DtResultados(0)("CreditoInfonavit").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{RentaMensual}", objRH.DtResultados(0)("RentaMensual").ToString().ToDecimal.ToString("###,###,###.00")))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{TransportePublico}", objRH.DtResultados(0)("TransportePublico").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormente}", objRH.DtResultados(0)("TrabajadoAnteriormente").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormenteObservaciones}", objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{ParientesEmpresa}", objRH.DtResultados(0)("ParientesEmpresa").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelito}", objRH.DtResultados(0)("AcusadoDelito").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelitoObservaciones}", objRH.DtResultados(0)("AcusadoDelitoObservaciones").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Calle}", objRH.DtResultados(0)("Calle").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Colonia}", objRH.DtResultados(0)("Colonia").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{CP}", objRH.DtResultados(0)("CP").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Telefono}", objRH.DtResultados(0)("Telefono").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Celular}", objRH.DtResultados(0)("Celular").ToString()))
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Correo}", objRH.DtResultados(0)("Correo").ToString()))
-
-
- 'If Not IsDBNull(objRH.DtResultados(0)("CveSucursal")) Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{CveSucursal}", DDLSucursal4.Text))
- 'End If
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{NumeroSS}", objRH.DtResultados(0)("NumeroSS").ToString()))
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Licencia}", objRH.DtResultados(0)("Licencia").ToString()))
-
-
-
-
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{CartillaMilitar}", objRH.DtResultados(0)("CartillaMilitar").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{CURP}", objRH.DtResultados(0)("CURP").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{AutorizaAntidoping}", objRH.DtResultados(0)("AutorizaAntidoping").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Observaciones}", objRH.DtResultados(0)("Observaciones").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{FechaIngreso}", objRH.DtResultados(0)("FechaIngreso").ToString().ToDate.ToShortDateString))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString().ToDate.ToShortDateString))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{Puesto}", objRH.DtResultados(0)("Puesto").ToString()))
-
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{CUIP}", ""))
- ListaTagsDocumentost.Add(New TagsDocumentos("{Denominacion}", ""))
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{FechaNacimiento}", objRH.DtResultados(0)("FechaNacimiento").ToString().ToDate.ToString("dd/MM/yyyy")))
-
-
- Dim fechaActual As String = " " & Now.Day & " del mes " & Now.Month & " del año " & Now.Year
-
- Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
-
- ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
- ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
- End If
-
-
- objRH.Dispose()
- End If
-
- Return ListaTagsDocumentost
- End Function
-
-
-
-
-
-
-
- 'Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos)
- ' Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
-
- ' If CvePersonal <> -1 Then
- ' Dim objRH As New ClsRH
-
-
-
- ' If objRH.PersonalReclutamientoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Nombres")) Then
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Nombres}", objRH.DtResultados(0)("Nombres").ToString()))
- ' End If
-
- ' If Not objRH.DtResultados(0)("APaterno") Is Nothing Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{APaterno}", objRH.DtResultados(0)("APaterno").ToString()))
- ' End If
-
- ' If Not objRH.DtResultados(0)("AMaterno") Is Nothing Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{AMaterno}", objRH.DtResultados(0)("AMaterno").ToString()))
- ' End If
-
- ' If Not objRH.DtResultados(0)("NombreCompleto") Is Nothing Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", objRH.DtResultados(0)("NombreCompleto").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Estatura")) Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Estatura}", objRH.DtResultados(0)("Estatura").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Peso")) Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Peso}", objRH.DtResultados(0)("Peso").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("LugarNacimiento")) Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{LugarNacimiento}", objRH.DtResultados(0)("LugarNacimiento").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Edad")) Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", objRH.DtResultados(0)("Edad").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("NombreTelEmergencia")) Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreTelEmergencia}", objRH.DtResultados(0)("NombreTelEmergencia").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("TipoSangre")) Then
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{TipoSangre}", objRH.DtResultados(0)("TipoSangre").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Vivienda")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Vivienda}", objRH.DtResultados(0)("Vivienda").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("ViviendaDueno")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{ViviendaDueno}", objRH.DtResultados(0)("ViviendaDueno").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("CreditoInfonavit")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CreditoInfonavit}", objRH.DtResultados(0)("CreditoInfonavit").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("RentaMensual")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{RentaMensual}", objRH.DtResultados(0)("RentaMensual").ToString().ToDecimal.ToString("###,###,###.00")))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("TransportePublico")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TransportePublico}", objRH.DtResultados(0)("TransportePublico").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormente")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormente}", objRH.DtResultados(0)("TrabajadoAnteriormente").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormenteObservaciones}", objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("ParientesEmpresa")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{ParientesEmpresa}", objRH.DtResultados(0)("ParientesEmpresa").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelito")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelito}", objRH.DtResultados(0)("AcusadoDelito").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelitoObservaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelitoObservaciones}", objRH.DtResultados(0)("AcusadoDelitoObservaciones").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Direccion")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Calle")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Calle}", objRH.DtResultados(0)("Calle").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Colonia")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Colonia}", objRH.DtResultados(0)("Colonia").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("CP")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CP}", objRH.DtResultados(0)("CP").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Telefono")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Telefono}", objRH.DtResultados(0)("Telefono").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Celular")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Celular}", objRH.DtResultados(0)("Celular").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Correo")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Correo}", objRH.DtResultados(0)("Correo").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("CveSucursal")) Then
-
- ' ' ListaTagsDocumentost.Add(New TagsDocumentos("{CveSucursal}", DDLSucursal4.Text))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("NumeroSS")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{NumeroSS}", objRH.DtResultados(0)("NumeroSS").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Licencia")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Licencia}", objRH.DtResultados(0)("Licencia").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("CartillaMilitar")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CartillaMilitar}", objRH.DtResultados(0)("CartillaMilitar").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("CURP")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CURP}", objRH.DtResultados(0)("CURP").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("AutorizaAntidoping")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AutorizaAntidoping}", objRH.DtResultados(0)("AutorizaAntidoping").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Observaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Observaciones}", objRH.DtResultados(0)("Observaciones").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("CredencialElector")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CredencialElector}", objRH.DtResultados(0)("CredencialElector").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Sucursal")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Sucursal}", objRH.DtResultados(0)("Sucursal").ToString()))
-
- ' If Not IsDBNull(objRH.DtResultados(0)("Puesto")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Puesto}", objRH.DtResultados(0)("Puesto").ToString()))
-
- ' 'If Not IsDBNull(objRH.DtResultados(0)("InformacionFidedigno")) Then chkFidedigna4.Checked = objRH.DtResultados(0)("InformacionFidedigno")
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{InformacionFidedigno}", objRH.DtResultados(0)("InformacionFidedigno").ToString()))
- ' End If
-
- ' If Not IsDBNull(objRH.DtResultados(0)("FechaNacimiento")) Then
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{InformacionFidedigno}", objRH.DtResultados(0)("FechaNacimiento").ToString().ToDate.ToString("dd/MM/yyyy")))
- ' End If
-
-
- ' Dim fechaActual As String = " " & Now.Day & " del mes " & Now.Month & " del año " & Now.Year
- ' Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
-
-
- ' objRH.Dispose()
- ' End If
-
- ' Return ListaTagsDocumentost
- 'End Function
- Private Sub RegistraDescargaJavaScript(baseUrl As String)
-
- RegistraScript("Download('" & baseUrl & "')")
-
+ End Sub
+ Public Sub DescarFormato(documento As String)
+
+ Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
+ Dim PathSource As String
+ Dim pathDesti As String
+
+ PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento
+ pathDesti = PathRoot & "Temp\" & CvePersonal & documento
+
+ If File.Exists(pathDesti) Then
+ File.Delete(pathDesti)
+ End If
+
+ File.Copy(PathSource, pathDesti)
+
+ Dim objDoc As New clsGemBoxDocument(pathDesti)
+ Dim objRH As New ClsRH
+ Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
+
+
+ objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(CvePersonal, UsuarioActual.CveEmpresa))
+ objRH.Dispose()
+
+
+
+ objDoc.Guardar(pathDesti)
+
+ Dim fileinfo As New FileInfo(pathDesti)
+
+ Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
+ baseUrl = baseUrl & "/temp/" & fileinfo.Name
+
+ RegistraDescargaJavaScript(baseUrl)
+
End Sub
-#End Region
- Protected Sub LBCancelar_Click(sender As Object, e As EventArgs)
-
- Dim FolioFiscal = CType(sender, LinkButton).CommandArgument.ToString()
- Dim gvr As GridViewRow = CType(CType(sender, LinkButton).BindingContainer, GridViewRow)
- Dim CveNomina As Integer = gvr.DataKey("CveNomina").ToString().ToEntero
- Dim Total As Decimal = gvr.DataKey("Total").ToString().ToDecimal
- Dim RFCReceptor As String = gvr.DataKey("RFC").ToString()
-
- Dim Obj As New Timbrado
-
- If Obj.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC) Then
- Dim ObjNomina As New ClsNominas()
- ObjNomina.UpdateEstatusNomNominas(2, -1, "", "", Now, CveNomina)
- ObjNomina.Dispose()
- Alert("La nómina se canceló correctamente.", TipoMensaje.MsgInformacion)
- End If
-
- Obj = Nothing
-
-
+
+ Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos)
+ Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
+
+ If CvePersonal <> -1 Then
+ Dim objRH As New ClsRH
+
+
+
+ If objRH.PersonalReclutamientoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Nombres}", objRH.DtResultados(0)("Nombres").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{APaterno}", objRH.DtResultados(0)("APaterno").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{AMaterno}", objRH.DtResultados(0)("AMaterno").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{RFC}", objRH.DtResultados(0)("RFC").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", NombreCompleto))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Estatura}", objRH.DtResultados(0)("Estatura").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Peso}", objRH.DtResultados(0)("Peso").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{LugarNacimiento}", objRH.DtResultados(0)("LugarNacimiento").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", objRH.DtResultados(0)("Edad").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{NombreTelEmergencia}", objRH.DtResultados(0)("NombreTelEmergencia").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{TipoSangre}", objRH.DtResultados(0)("TipoSangre").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Vivienda}", objRH.DtResultados(0)("Vivienda").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{ViviendaDueno}", objRH.DtResultados(0)("ViviendaDueno").ToString()))
+
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{CreditoInfonavit}", objRH.DtResultados(0)("CreditoInfonavit").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{RentaMensual}", objRH.DtResultados(0)("RentaMensual").ToString().ToDecimal.ToString("###,###,###.00")))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{TransportePublico}", objRH.DtResultados(0)("TransportePublico").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormente}", objRH.DtResultados(0)("TrabajadoAnteriormente").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormenteObservaciones}", objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{ParientesEmpresa}", objRH.DtResultados(0)("ParientesEmpresa").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelito}", objRH.DtResultados(0)("AcusadoDelito").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelitoObservaciones}", objRH.DtResultados(0)("AcusadoDelitoObservaciones").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Calle}", objRH.DtResultados(0)("Calle").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Colonia}", objRH.DtResultados(0)("Colonia").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{CP}", objRH.DtResultados(0)("CP").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Telefono}", objRH.DtResultados(0)("Telefono").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Celular}", objRH.DtResultados(0)("Celular").ToString()))
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Correo}", objRH.DtResultados(0)("Correo").ToString()))
+
+
+ 'If Not IsDBNull(objRH.DtResultados(0)("CveSucursal")) Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{CveSucursal}", DDLSucursal4.Text))
+ 'End If
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{NumeroSS}", objRH.DtResultados(0)("NumeroSS").ToString()))
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Licencia}", objRH.DtResultados(0)("Licencia").ToString()))
+
+
+
+
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{CartillaMilitar}", objRH.DtResultados(0)("CartillaMilitar").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{CURP}", objRH.DtResultados(0)("CURP").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{AutorizaAntidoping}", objRH.DtResultados(0)("AutorizaAntidoping").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Observaciones}", objRH.DtResultados(0)("Observaciones").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{FechaIngreso}", objRH.DtResultados(0)("FechaIngreso").ToString().ToDate.ToShortDateString))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString().ToDate.ToShortDateString))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Puesto}", objRH.DtResultados(0)("Puesto").ToString()))
+
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{CUIP}", ""))
+ ListaTagsDocumentost.Add(New TagsDocumentos("{Denominacion}", ""))
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{FechaNacimiento}", objRH.DtResultados(0)("FechaNacimiento").ToString().ToDate.ToString("dd/MM/yyyy")))
+
+
+ Dim fechaActual As String = " " & Now.Day & " del mes " & Now.Month & " del año " & Now.Year
+
+ Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
+
+ ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
+ ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
+ End If
+
+
+ objRH.Dispose()
+ End If
+
+ Return ListaTagsDocumentost
+ End Function
+
+
+
+
+
+
+
+ 'Private Function GetDatosTagsDocumentos() As List(Of TagsDocumentos)
+ ' Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
+
+ ' If CvePersonal <> -1 Then
+ ' Dim objRH As New ClsRH
+
+
+
+ ' If objRH.PersonalReclutamientoGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Nombres")) Then
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Nombres}", objRH.DtResultados(0)("Nombres").ToString()))
+ ' End If
+
+ ' If Not objRH.DtResultados(0)("APaterno") Is Nothing Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{APaterno}", objRH.DtResultados(0)("APaterno").ToString()))
+ ' End If
+
+ ' If Not objRH.DtResultados(0)("AMaterno") Is Nothing Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{AMaterno}", objRH.DtResultados(0)("AMaterno").ToString()))
+ ' End If
+
+ ' If Not objRH.DtResultados(0)("NombreCompleto") Is Nothing Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", objRH.DtResultados(0)("NombreCompleto").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Estatura")) Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Estatura}", objRH.DtResultados(0)("Estatura").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Peso")) Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Peso}", objRH.DtResultados(0)("Peso").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("LugarNacimiento")) Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{LugarNacimiento}", objRH.DtResultados(0)("LugarNacimiento").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Edad")) Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Edad}", objRH.DtResultados(0)("Edad").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("NombreTelEmergencia")) Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreTelEmergencia}", objRH.DtResultados(0)("NombreTelEmergencia").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("TipoSangre")) Then
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{TipoSangre}", objRH.DtResultados(0)("TipoSangre").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Vivienda")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Vivienda}", objRH.DtResultados(0)("Vivienda").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("ViviendaDueno")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{ViviendaDueno}", objRH.DtResultados(0)("ViviendaDueno").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("CreditoInfonavit")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CreditoInfonavit}", objRH.DtResultados(0)("CreditoInfonavit").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("RentaMensual")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{RentaMensual}", objRH.DtResultados(0)("RentaMensual").ToString().ToDecimal.ToString("###,###,###.00")))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("TransportePublico")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TransportePublico}", objRH.DtResultados(0)("TransportePublico").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormente")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormente}", objRH.DtResultados(0)("TrabajadoAnteriormente").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{TrabajadoAnteriormenteObservaciones}", objRH.DtResultados(0)("TrabajadoAnteriormenteObservaciones").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("ParientesEmpresa")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{ParientesEmpresa}", objRH.DtResultados(0)("ParientesEmpresa").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelito")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelito}", objRH.DtResultados(0)("AcusadoDelito").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("AcusadoDelitoObservaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AcusadoDelitoObservaciones}", objRH.DtResultados(0)("AcusadoDelitoObservaciones").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Direccion")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Direccion}", objRH.DtResultados(0)("Direccion").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Calle")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Calle}", objRH.DtResultados(0)("Calle").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Colonia")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Colonia}", objRH.DtResultados(0)("Colonia").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("CP")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CP}", objRH.DtResultados(0)("CP").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Telefono")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Telefono}", objRH.DtResultados(0)("Telefono").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Celular")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Celular}", objRH.DtResultados(0)("Celular").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Correo")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Correo}", objRH.DtResultados(0)("Correo").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("CveSucursal")) Then
+
+ ' ' ListaTagsDocumentost.Add(New TagsDocumentos("{CveSucursal}", DDLSucursal4.Text))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("NumeroSS")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{NumeroSS}", objRH.DtResultados(0)("NumeroSS").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Licencia")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Licencia}", objRH.DtResultados(0)("Licencia").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("CartillaMilitar")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CartillaMilitar}", objRH.DtResultados(0)("CartillaMilitar").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("CURP")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CURP}", objRH.DtResultados(0)("CURP").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("AutorizaAntidoping")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{AutorizaAntidoping}", objRH.DtResultados(0)("AutorizaAntidoping").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Observaciones")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Observaciones}", objRH.DtResultados(0)("Observaciones").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("CredencialElector")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{CredencialElector}", objRH.DtResultados(0)("CredencialElector").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Sucursal")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Sucursal}", objRH.DtResultados(0)("Sucursal").ToString()))
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("Puesto")) Then ListaTagsDocumentost.Add(New TagsDocumentos("{Puesto}", objRH.DtResultados(0)("Puesto").ToString()))
+
+ ' 'If Not IsDBNull(objRH.DtResultados(0)("InformacionFidedigno")) Then chkFidedigna4.Checked = objRH.DtResultados(0)("InformacionFidedigno")
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{InformacionFidedigno}", objRH.DtResultados(0)("InformacionFidedigno").ToString()))
+ ' End If
+
+ ' If Not IsDBNull(objRH.DtResultados(0)("FechaNacimiento")) Then
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{InformacionFidedigno}", objRH.DtResultados(0)("FechaNacimiento").ToString().ToDate.ToString("dd/MM/yyyy")))
+ ' End If
+
+
+ ' Dim fechaActual As String = " " & Now.Day & " del mes " & Now.Month & " del año " & Now.Year
+ ' Dim FechaActualDF As String = Now.ToString("dd/MM/yyyy")
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActual}", fechaActual))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaActualDF}", FechaActualDF))
+
+
+ ' objRH.Dispose()
+ ' End If
+
+ ' Return ListaTagsDocumentost
+ 'End Function
+ Private Sub RegistraDescargaJavaScript(baseUrl As String)
+
+ RegistraScript("Download('" & baseUrl & "')")
+
End Sub
-#Region "VACACIONES"
+#End Region
- Private Sub CargaVacaciones()
-
- Dim objRH As New ClsRH
-
- If objRH.VacacionesGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
- GvVacaciones.DataSource = objRH.DtResultados
-
- If objRH.DtResultados.Rows.Count > 0 Then
- VacFolioActual = objRH.DtResultados.Compute("Max(Folio)", String.Empty).ToString().ToEntero
- Else
- VacFolioActual = 0
- End If
-
- Else
- GvVacaciones.DataSource = Nothing
- End If
-
- objRH.Dispose()
- GvVacaciones.DataBind()
- UpGvVacaciones.Update()
-
- End Sub
-
- Protected Sub GvVacaciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVacaciones.RowDataBound
-
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- Dim _Estatus As Boolean = Boolean.Parse(e.Row.DBCampo("Estatus").ToString())
- Dim _Documento As String = e.Row.DataKey("Documento")
- Dim _CveAutoriza As Integer = e.Row.DataKey("CveAutoriza").ToEntero()
- Dim RutaDocuemntoAutorizacion As String = String.Format("{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento)
- Dim lnkDescargaFormato As LinkButton = e.Row.FCLinkButton("ImgDescargaFormato")
- Dim lnkDescargaAutorizacion As LinkButton = e.Row.FCLinkButton("ImgDescargaAutorizacion")
- Dim lnkEditar As LinkButton = e.Row.FCLinkButton("ImgEditar")
- If _CveAutoriza > 0 Or Not _Estatus Then
- lnkEditar.Visible = False
- End If
- lnkDescargaFormato.Visible = True
- 'ScriptManager.GetCurrent(Me).RegisterAsyncPostBackControl(lnkDescargaFormato)
- If File.Exists(RutaDocuemntoAutorizacion) And _Estatus Then
- lnkDescargaAutorizacion.Visible = True
- 'ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaAutorizacion)
- Else
- lnkDescargaAutorizacion.Visible = False
- End If
-
- 'If _Estatus Then
- ' lnkDescargaFormato.Visible = True
- ' ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaFormato)
- 'Else
- ' lnkDescargaFormato.Visible = False
- 'End If
-
- End If
-
-
- End Sub
-
- 'cada vez que se hace un postback que relacione al gridview de vacaio es se tienen que generar los eventos de postback para la descarga de archivos
- Private Sub AgregarEventosAsincronosGvVacaciones()
-
-
-
- For Each GvRow As GridViewRow In GvPermisos.Rows
- Dim lnkDescargaFormato As LinkButton = GvRow.FCLinkButton("ImgDescargaFormato")
- If lnkDescargaFormato.Visible Then
-
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaFormato)
- End If
- Next
- For Each GvRow As GridViewRow In GvVacaciones.Rows
- 'Dim _Estatus As Boolean = Boolean.Parse(GvRow.DataKey("Estatus").ToString())
- 'Dim _Documento As String = GvRow.DataKey("Documento")
- 'Dim _CveAutoriza As Integer = GvRow.DataKey("CveAutoriza").ToEntero
- 'Dim RutaDocuemntoAutorizacion As String = String.Format("{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento)
- Dim lnkDescargaFormato As LinkButton = GvRow.FCLinkButton("ImgDescargaFormato")
- Dim lnkDescargaAutorizacion As LinkButton = GvRow.FCLinkButton("ImgDescargaAutorizacion")
- 'Dim lnkEditar As LinkButton = GvRow.FCLinkButton("ImgEditar")
- 'If _CveAutoriza > 0 Or Not _Estatus Then
- ' lnkEditar.Visible = False
- 'End If
- 'lnkDescargaFormato.Visible = True
- If lnkDescargaFormato.Visible Then
-
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaFormato)
- End If
- If lnkDescargaAutorizacion.Visible Then
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaAutorizacion)
- End If
- 'If File.Exists(RutaDocuemntoAutorizacion) And _Estatus Then
- ' lnkDescargaAutorizacion.Visible = True
- 'Else
- ' lnkDescargaAutorizacion.Visible = False
- 'End If
- Next
- End Sub
-
-
- Private Sub CargaVacacionesResumenPeriodoActual()
- Dim objRH As New ClsRH
-
- If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
- If objRH.DtResultados.Rows.Count > 0 Then
-
- VacInicioPeriodo = objRH.DtResultados(0)("InicioPeriodo").ToString().ToDate
- VacFinPeriodo = objRH.DtResultados(0)("FinPeriodo").ToString().ToDate
- VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero
- VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero
- VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero
- VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero
- VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero
- GvVacacionesResumen.DataSource = objRH.DtResultados
- VacSupervisorNombre = objRH.DtResultados(0)("SupervisorNombre").ToString()
- VacSupervisorCorreo = objRH.DtResultados(0)("SupervisorCorreo").ToString()
- VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero
-
- Else
- VacInicioPeriodo = Now
- VacFinPeriodo = Now
- VacAnios = 0
- VacDias = 0
- VacDiasUsados = 0
- VacDiasCancelados = 0
- VacDiasDisponibles = 0
- End If
- End If
-
- objRH.Dispose()
- GvVacacionesResumen.DataBind()
-
- UpGvVacacionesResumen.Update()
-
- End Sub
-
- Protected Sub BtnSolicitarVacaciones_Click(sender As Object, e As EventArgs) Handles BtnSolicitarVacaciones.Click
- Dim fInicio As Date = TxtFechaInicioVac.Text.ToDate
- Dim fFin As Date = TxtFechaFinVac.Text.ToDate
- 'Dim motivoVacaciones As String = TxtMotivoVacaciones.Text
- If fInicio <= fFin Then
-
- VacFolioActual = VacFolioActual + 1
- Dim objRH As New ClsRH
- 'Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones)
- Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual)
- If objRH.DtResultados.Rows.Count > 0 Then
- Dim ShowError As String = objRH.DtResultados.Rows(0)("ShowError").ToString()
- If ShowError.Length > 0 Then
- Alert(ShowError, TipoMensaje.MsgAdvertencia)
- continuar = False
- End If
- End If
- objRH.Dispose()
- If continuar Then
- CargaVacaciones()
- CargaVacacionesResumenPeriodoActual()
- VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " & NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin)
- RegistraScript("$('#ModalAddVacaciones').modal('hide');")
- End If
- Else
-
- Alert("La fecha Inicial debe ser inferior a la fecha final.", TipoMensaje.MsgAdvertencia)
- End If
- 'If UsuarioActual.CveEmpresa <> 72 Then
- ' CargaVacaciones()
- ' CargaVacacionesResumenPeriodoActual()
-
-
- ' Dim objRH As New ClsRH
- ' If VacDiasDisponibles > 0 Then
-
- ' Dim fInicio As Date = TxtFechaInicioVac.Text.ToDate
- ' Dim fFin As Date = TxtFechaFinVac.Text.ToDate
- ' Dim ErrorSolicitud As Boolean = True
- ' Dim DiasSolicitados As Integer = (fFin - fInicio).TotalDays.ToString().ToEntero
-
- ' If fInicio < fFin Or fInicio = fFin Then
-
- ' VacFolioActual = VacFolioActual + 1
-
- ' If fInicio = fFin Then
-
-
-
- ' If fInicio < VacFinPeriodo Then
- ' If objRH.VacacionesAddUpdate(-1, CvePersonal, fInicio, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual) Then
- ' ErrorSolicitud = False
- ' CargaVacaciones()
- ' CargaVacacionesResumenPeriodoActual()
- ' VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " & NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin)
- ' 'DescarSolicitudVacaciones(VacFolioActual)
- ' End If
- ' End If
-
- ' Else
- ' If ((DiasSolicitados + 1) > VacDiasDisponibles) Then
- ' Alert("Los dias solicitados son mayores a los dias disponibles.", TipoMensaje.MsgAdvertencia)
- ' objRH.Dispose()
- ' Exit Sub
- ' End If
-
- ' Dim fVacacion As Date = fInicio
-
- ' For x As Integer = 0 To DiasSolicitados
-
- ' If fVacacion < VacFinPeriodo Then
- ' If objRH.VacacionesAddUpdate(-1, CvePersonal, fVacacion, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual) Then
- ' ErrorSolicitud = False
- ' Else
- ' ErrorSolicitud = True
- ' Exit For
- ' End If
- ' Else
- ' ErrorSolicitud = True
- ' Exit For
- ' End If
-
- ' fVacacion = fVacacion.AddDays(1)
- ' Next
-
- ' CargaVacaciones()
- ' CargaVacacionesResumenPeriodoActual()
- ' VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " & NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin)
-
- ' If Not ErrorSolicitud Then
- ' 'DescarSolicitudVacaciones(VacFolioActual)
- ' End If
-
- ' End If
-
- ' Else
- ' Alert("La fecha Inicial debe ser inferior a la fecha final")
- ' End If
- ' Else
- ' Alert("No se tienen dias disponibles.")
- ' End If
-
- ' objRH.Dispose()
- 'ElseIf UsuarioActual.CveEmpresa = 72 Then
-
-
- ' 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} "
-
-
- ' Dim pathDesti As String = ""
-
- ' If Not File.Exists(RutaFormato) Then
- ' RutaFormato = $"{PathRoot}\Empresas\Grales\Formatos\{FormatoNombre} "
- ' End If
-
-
-
- ' pathDesti = PathRoot & "Temp\" & CvePersonal & "_" & FormatoNombre
-
-
-
- ' If File.Exists(pathDesti) Then
- ' File.Delete(pathDesti)
- ' End If
-
- ' File.Copy(RutaFormato, pathDesti)
-
-
-
- ' Dim objDoc As New clsGemBoxDocument(pathDesti)
-
- ' Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
-
-
-
- ' Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", $"{TxtNombres.Text} {TxtAPaterno.Text} {TxtAMaterno.Text}"))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Codigo}", TxtCodigo.Text))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Departamento}", DdlDepartamento.SelectedItem.Text))
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{JefeInmediato}", DdlSupervisorOrganigrama.SelectedItem.Text))
-
-
-
- ' For x As Integer = 1 To 8
-
- ' If DdlPermisoTipo.SelectedValue.ToEntero = x Then
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op" & x & "}", "X"))
- ' Else
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op" & x & "}", ""))
- ' End If
- ' Next
-
-
- ' If RblPermisoDocNecesario.SelectedValue = "1" Then
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op9}", "X"))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op10}", ""))
- ' Else
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op9}", ""))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op10}", "X"))
- ' End If
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Dias}", TxtPermisosDias.Text))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Horas}", TxtPermisosHoras.Text))
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaI}", TxtFechaInicioVac.Text))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaF}", TxtFechaFinVac.Text))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Fecha}", Now.ToString("dd/MM/yyyy")))
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Reemplazo}", DdlPermisosReemplazo.SelectedItem.Text))
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op11}", " "))
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{op12}", " "))
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Motivo}", TxtPermisoMotivo.Text))
-
- ' ListaTagsDocumentost.Add(New TagsDocumentos("{Comentarios}", TxtPermisoComentarios.Text))
-
- ' objDoc.SustituirTags(ListaTagsDocumentost)
- ' objDoc.GuardarStreamPDF()
-
-
- ' Dim DocByte As Byte() = objDoc.GetBytesDocumento()
-
-
- ' Response.ClearHeaders()
- ' Response.Clear()
- ' Response.AddHeader("Content-Type", "application/pdf")
- ' Response.AddHeader("Content-Length", DocByte.Length.ToString())
- ' Response.AddHeader("Content-Disposition", "attachment; filename=sample.pdf")
- ' Response.BinaryWrite(DocByte)
- ' Response.Flush()
- ' Response.End()
-
-
- 'End If
-
-
- End Sub
-
- Private Sub VacacionesMandaCorreoSupervisor(Asunto As String, CorreoSupervisor As String, NombreSupervisor As String, NombreSolicitante As String, _FechaInicio As Date, _FechaFin As Date)
-
- If CorreoSupervisor.Trim.Length > 0 Then
-
- Dim a As String = String.Format("{0} -- {1} --- {2}", Asunto, CorreoSupervisor, "")
- Dim Cuerpo As String
- a.GuardaLog()
-
- If _FechaInicio = _FechaFin Then
- Cuerpo = "El empleado " & NombreCompleto & " a hecho una solicitud de vacaiones programada para el día " & _FechaInicio.ToString("dd/MM/yyyy") & " en las proximas horas se le presentara la solicitud para que se a aprovada o declinada por usted."
- Else
- Cuerpo = "El empleado " & NombreCompleto & " a hecho una solicitud de vacaiones programada de " & _FechaInicio.ToString("dd/MM/yyyy") & " a " & _FechaFin.ToString("dd/MM/yyyy") & " en las proximas horas se le presentara la solicitud para que se a aprovada o declinada por usted."
- End If
-
- Dim Mail As New ClsSisMail()
- Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
-
- ' CorreoSupervisor = "rakcsle.rakcsle@gmail.com"
-
- Mail.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoSupervisor, Asunto, Cuerpo, "", LSRutasMail)
- Mail = Nothing
- Alert("Se ha enviado un correo al supervisor informandole de la solicitud.")
- Else
- Alert("La solicitud se a realizado correctamente.")
- End If
-
- End Sub
-
- Protected Sub LnkEliminarSolicitud_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero()
-
- Dim objRH As New ClsRH()
- If objRH.RemoverSolicitudVacaciones(CvePersonalVacaciones) Then
- CargaVacaciones()
- CargaVacacionesResumenPeriodoActual()
- Alert("Las vacaciones se ha eliminado")
- End If
- objRH.Dispose()
- End Sub
- Public Sub Edit_ClickVacacionDia(sender As Object, e As EventArgs)
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero
- 'ChkEstatusDiaVacacion.Checked = Boolean.Parse(GvRow.DataKey("Estatus"))
- VacFolio = GvRow.DataKey("Folio").ToString().ToEntero
-
- TxtFechaDiaVacacion.Text = GvRow.DataKey("FechaInicio").ToString().ToDate.ToString("dd/MM/yyyy")
- TxtFechaDiaVacacionFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate.ToString("dd/MM/yyyy")
-
- UpModalEditarDiaVacacion.Update()
- RegistraScript("$('#divEditarDiaVacacion').modal({ backdrop: 'static', keyboard: false});")
-
- End Sub
-
-
- Protected Sub BtnEditarDiaVacacionModal_Click(sender As Object, e As EventArgs) Handles BtnEditarDiaVacacionModal.Click
-
- Dim objRH As New ClsRH()
-
-
-
-
- Dim FileExtension As String = "-1"
- Dim Filesgral As List(Of Archivo) = TxtFileFormatoVacaciones.getfiles().Archivos
- Dim Filename As String = ""
- Dim Documento As String = ""
-
- For Each fileItem As Archivo In Filesgral
- Try
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
- Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}"
- Dim tempArray() As String
- tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
-
- Dim rutaDestino As String = $"{UsuarioActual.Empresa.Ruta}Personal\{CvePersonal}\Vacaciones\{Documento}"
-
- If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\") Then
- System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\")
- End If
-
-
- If System.IO.File.Exists(rutaDestino) Then
- System.IO.File.Delete(rutaDestino)
- End If
-
- System.IO.File.Move(fileItem.FileUrl, rutaDestino)
-
- TxtFileFormatoVacaciones.Text = ""
-
- Catch ex As Exception
- OnError("Error al cargar Formato vacaciones", ex)
- End Try
-
- Next
- If Documento.Length > 0 Then
-
- If objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, CvePersonal, UsuarioActual.CveUsuario, Documento) Then
- Alert("La fecha se actualizo correctamente")
- End If
- UpModalEditarDiaVacacion.Update()
-
- objRH.Dispose()
-
- CargaVacaciones()
- CargaVacacionesResumenPeriodoActual()
- RegistraScript("$('#divEditarDiaVacacion').modal('hide');")
- Else
- Alert("debe ingresar un documento para poder autorizar la solicitud", TipoMensaje.MsgAdvertencia)
- End If
- End Sub
-
- Public Sub DownLoad_ClickSolicitudVacaciones(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\SolicitudVacaciones.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 fechaIngreso As Date = TxtFechaIngreso.Text.ToDate()
- Dim Periodoingreso As Integer = fechaIngreso.ToString("MMdd").ToEntero()
- Dim PeriodoInicio As Integer = GvRow.DataKey("FechaInicio").ToDate().ToString("MMdd").ToEntero()
- 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("Dias")
- Dim MotivoPermiso As String = GvRow.DataKey("Motivo")
- Dim Puesto As String = DdlPuesto.SelectedItem.Value
- Dim Fecha As String = DateTime.Now.ToString("dd/MM/yyyy")
- Dim Solicitante As String = UsuarioActual.Nombre
- Dim anio As Integer = GvRow.DataKey("FechaInicio").ToDate().Year
+ Protected Sub LBCancelar_Click(sender As Object, e As EventArgs)
+
+ Dim FolioFiscal = CType(sender, LinkButton).CommandArgument.ToString()
+ Dim gvr As GridViewRow = CType(CType(sender, LinkButton).BindingContainer, GridViewRow)
+ Dim CveNomina As Integer = gvr.DataKey("CveNomina").ToString().ToEntero
+ Dim Total As Decimal = gvr.DataKey("Total").ToString().ToDecimal
+ Dim RFCReceptor As String = gvr.DataKey("RFC").ToString()
+
+ Dim Obj As New Timbrado
+
+ If Obj.CFDICancelar(UsuarioActual.Empresa, FolioFiscal, Total, RFCReceptor, UsuarioActual.Empresa.RFC) Then
+ Dim ObjNomina As New ClsNominas()
+ ObjNomina.UpdateEstatusNomNominas(2, -1, "", "", Now, CveNomina)
+ ObjNomina.Dispose()
+ Alert("La nómina se canceló correctamente.", TipoMensaje.MsgInformacion)
+ End If
+
+ Obj = Nothing
+
+
+ End Sub
+
+#Region "VACACIONES"
+
+ Private Sub CargaVacaciones()
+
+ Dim objRH As New ClsRH
+
+ If objRH.VacacionesGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
+ GvVacaciones.DataSource = objRH.DtResultados
+
+ If objRH.DtResultados.Rows.Count > 0 Then
+ VacFolioActual = objRH.DtResultados.Compute("Max(Folio)", String.Empty).ToString().ToEntero
+ Else
+ VacFolioActual = 0
+ End If
+
+ Else
+ GvVacaciones.DataSource = Nothing
+ End If
+
+ objRH.Dispose()
+ GvVacaciones.DataBind()
+ UpGvVacaciones.Update()
+
+ End Sub
+
+ Protected Sub GvVacaciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvVacaciones.RowDataBound
+
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ Dim _Estatus As Boolean = Boolean.Parse(e.Row.DBCampo("Estatus").ToString())
+ Dim _Documento As String = e.Row.DataKey("Documento")
+ Dim _CveAutoriza As Integer = e.Row.DataKey("CveAutoriza").ToEntero()
+ Dim RutaDocuemntoAutorizacion As String = String.Format("{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento)
+ Dim lnkDescargaFormato As LinkButton = e.Row.FCLinkButton("ImgDescargaFormato")
+ Dim lnkDescargaAutorizacion As LinkButton = e.Row.FCLinkButton("ImgDescargaAutorizacion")
+ Dim lnkEditar As LinkButton = e.Row.FCLinkButton("ImgEditar")
+ If _CveAutoriza > 0 Or Not _Estatus Then
+ lnkEditar.Visible = False
+ End If
+ lnkDescargaFormato.Visible = True
+ 'ScriptManager.GetCurrent(Me).RegisterAsyncPostBackControl(lnkDescargaFormato)
+ If File.Exists(RutaDocuemntoAutorizacion) And _Estatus Then
+ lnkDescargaAutorizacion.Visible = True
+ 'ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaAutorizacion)
+ Else
+ lnkDescargaAutorizacion.Visible = False
+ End If
+
+ 'If _Estatus Then
+ ' lnkDescargaFormato.Visible = True
+ ' ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaFormato)
+ 'Else
+ ' lnkDescargaFormato.Visible = False
+ 'End If
+
+ End If
+
+
+ End Sub
+
+ 'cada vez que se hace un postback que relacione al gridview de vacaio es se tienen que generar los eventos de postback para la descarga de archivos
+ Private Sub AgregarEventosAsincronosGvVacaciones()
+
+
+
+ For Each GvRow As GridViewRow In GvPermisos.Rows
+ Dim lnkDescargaFormato As LinkButton = GvRow.FCLinkButton("ImgDescargaFormato")
+ If lnkDescargaFormato.Visible Then
+
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaFormato)
+ End If
+ Next
+ For Each GvRow As GridViewRow In GvVacaciones.Rows
+ 'Dim _Estatus As Boolean = Boolean.Parse(GvRow.DataKey("Estatus").ToString())
+ 'Dim _Documento As String = GvRow.DataKey("Documento")
+ 'Dim _CveAutoriza As Integer = GvRow.DataKey("CveAutoriza").ToEntero
+ 'Dim RutaDocuemntoAutorizacion As String = String.Format("{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento)
+ Dim lnkDescargaFormato As LinkButton = GvRow.FCLinkButton("ImgDescargaFormato")
+ Dim lnkDescargaAutorizacion As LinkButton = GvRow.FCLinkButton("ImgDescargaAutorizacion")
+ 'Dim lnkEditar As LinkButton = GvRow.FCLinkButton("ImgEditar")
+ 'If _CveAutoriza > 0 Or Not _Estatus Then
+ ' lnkEditar.Visible = False
+ 'End If
+ 'lnkDescargaFormato.Visible = True
+ If lnkDescargaFormato.Visible Then
+
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaFormato)
+ End If
+ If lnkDescargaAutorizacion.Visible Then
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkDescargaAutorizacion)
+ End If
+ 'If File.Exists(RutaDocuemntoAutorizacion) And _Estatus Then
+ ' lnkDescargaAutorizacion.Visible = True
+ 'Else
+ ' lnkDescargaAutorizacion.Visible = False
+ 'End If
+ Next
+ End Sub
+
+
+ Private Sub CargaVacacionesResumenPeriodoActual()
+ Dim objRH As New ClsRH
+
+ If objRH.VacacionesResumenGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
+ If objRH.DtResultados.Rows.Count > 0 Then
+
+ VacInicioPeriodo = objRH.DtResultados(0)("InicioPeriodo").ToString().ToDate
+ VacFinPeriodo = objRH.DtResultados(0)("FinPeriodo").ToString().ToDate
+ VacAnios = objRH.DtResultados(0)("Anios").ToString().ToEntero
+ VacDias = objRH.DtResultados(0)("Dias").ToString().ToEntero
+ VacDiasUsados = objRH.DtResultados(0)("DiasUsados").ToString().ToEntero
+ VacDiasCancelados = objRH.DtResultados(0)("DiasCancelados").ToString().ToEntero
+ VacDiasDisponibles = objRH.DtResultados(0)("DiasDisponibles").ToString().ToEntero
+ GvVacacionesResumen.DataSource = objRH.DtResultados
+ VacSupervisorNombre = objRH.DtResultados(0)("SupervisorNombre").ToString()
+ VacSupervisorCorreo = objRH.DtResultados(0)("SupervisorCorreo").ToString()
+ VacCveSupervisor = objRH.DtResultados(0)("SupervisorCorreo").ToString().ToEntero
+
+ Else
+ VacInicioPeriodo = Now
+ VacFinPeriodo = Now
+ VacAnios = 0
+ VacDias = 0
+ VacDiasUsados = 0
+ VacDiasCancelados = 0
+ VacDiasDisponibles = 0
+ End If
+ End If
+
+ objRH.Dispose()
+ GvVacacionesResumen.DataBind()
+
+ UpGvVacacionesResumen.Update()
+
+ End Sub
+
+ Protected Sub BtnSolicitarVacaciones_Click(sender As Object, e As EventArgs) Handles BtnSolicitarVacaciones.Click
+ Dim fInicio As Date = TxtFechaInicioVac.Text.ToDate
+ Dim fFin As Date = TxtFechaFinVac.Text.ToDate
+ 'Dim motivoVacaciones As String = TxtMotivoVacaciones.Text
+ If fInicio <= fFin Then
+
+ VacFolioActual = VacFolioActual + 1
+ Dim objRH As New ClsRH
+ 'Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual, motivoVacaciones)
+ Dim continuar As Boolean = objRH.SolicitudVacacionesAdd(CvePersonal, fInicio, fFin, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual)
+ If objRH.DtResultados.Rows.Count > 0 Then
+ Dim ShowError As String = objRH.DtResultados.Rows(0)("ShowError").ToString()
+ If ShowError.Length > 0 Then
+ Alert(ShowError, TipoMensaje.MsgAdvertencia)
+ continuar = False
+ End If
+ End If
+ objRH.Dispose()
+ If continuar Then
+ CargaVacaciones()
+ CargaVacacionesResumenPeriodoActual()
+ VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " & NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin)
+ RegistraScript("$('#ModalAddVacaciones').modal('hide');")
+ End If
+ Else
+
+ Alert("La fecha Inicial debe ser inferior a la fecha final.", TipoMensaje.MsgAdvertencia)
+ End If
+ 'If UsuarioActual.CveEmpresa <> 72 Then
+ ' CargaVacaciones()
+ ' CargaVacacionesResumenPeriodoActual()
+
+
+ ' Dim objRH As New ClsRH
+ ' If VacDiasDisponibles > 0 Then
+
+ ' Dim fInicio As Date = TxtFechaInicioVac.Text.ToDate
+ ' Dim fFin As Date = TxtFechaFinVac.Text.ToDate
+ ' Dim ErrorSolicitud As Boolean = True
+ ' Dim DiasSolicitados As Integer = (fFin - fInicio).TotalDays.ToString().ToEntero
+
+ ' If fInicio < fFin Or fInicio = fFin Then
+
+ ' VacFolioActual = VacFolioActual + 1
+
+ ' If fInicio = fFin Then
+
+
+
+ ' If fInicio < VacFinPeriodo Then
+ ' If objRH.VacacionesAddUpdate(-1, CvePersonal, fInicio, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual) Then
+ ' ErrorSolicitud = False
+ ' CargaVacaciones()
+ ' CargaVacacionesResumenPeriodoActual()
+ ' VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " & NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin)
+ ' 'DescarSolicitudVacaciones(VacFolioActual)
+ ' End If
+ ' End If
+
+ ' Else
+ ' If ((DiasSolicitados + 1) > VacDiasDisponibles) Then
+ ' Alert("Los dias solicitados son mayores a los dias disponibles.", TipoMensaje.MsgAdvertencia)
+ ' objRH.Dispose()
+ ' Exit Sub
+ ' End If
+
+ ' Dim fVacacion As Date = fInicio
+
+ ' For x As Integer = 0 To DiasSolicitados
+
+ ' If fVacacion < VacFinPeriodo Then
+ ' If objRH.VacacionesAddUpdate(-1, CvePersonal, fVacacion, 0, UsuarioActual.CveUsuario, VacCveSupervisor, VacFolioActual) Then
+ ' ErrorSolicitud = False
+ ' Else
+ ' ErrorSolicitud = True
+ ' Exit For
+ ' End If
+ ' Else
+ ' ErrorSolicitud = True
+ ' Exit For
+ ' End If
+
+ ' fVacacion = fVacacion.AddDays(1)
+ ' Next
+
+ ' CargaVacaciones()
+ ' CargaVacacionesResumenPeriodoActual()
+ ' VacacionesMandaCorreoSupervisor("Solicitud Vacaciones " & NombreCompleto, VacSupervisorCorreo, VacSupervisorNombre, NombreCompleto, fInicio, fFin)
+
+ ' If Not ErrorSolicitud Then
+ ' 'DescarSolicitudVacaciones(VacFolioActual)
+ ' End If
+
+ ' End If
+
+ ' Else
+ ' Alert("La fecha Inicial debe ser inferior a la fecha final")
+ ' End If
+ ' Else
+ ' Alert("No se tienen dias disponibles.")
+ ' End If
+
+ ' objRH.Dispose()
+ 'ElseIf UsuarioActual.CveEmpresa = 72 Then
+
+
+ ' 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} "
+
+
+ ' Dim pathDesti As String = ""
+
+ ' If Not File.Exists(RutaFormato) Then
+ ' RutaFormato = $"{PathRoot}\Empresas\Grales\Formatos\{FormatoNombre} "
+ ' End If
+
+
+
+ ' pathDesti = PathRoot & "Temp\" & CvePersonal & "_" & FormatoNombre
+
+
+
+ ' If File.Exists(pathDesti) Then
+ ' File.Delete(pathDesti)
+ ' End If
+
+ ' File.Copy(RutaFormato, pathDesti)
+
+
+
+ ' Dim objDoc As New clsGemBoxDocument(pathDesti)
+
+ ' Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
+
+
+
+ ' Dim ListaTagsDocumentost = New List(Of TagsDocumentos)
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{NombreCompleto}", $"{TxtNombres.Text} {TxtAPaterno.Text} {TxtAMaterno.Text}"))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Codigo}", TxtCodigo.Text))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Departamento}", DdlDepartamento.SelectedItem.Text))
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{JefeInmediato}", DdlSupervisorOrganigrama.SelectedItem.Text))
+
+
+
+ ' For x As Integer = 1 To 8
+
+ ' If DdlPermisoTipo.SelectedValue.ToEntero = x Then
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op" & x & "}", "X"))
+ ' Else
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op" & x & "}", ""))
+ ' End If
+ ' Next
+
+
+ ' If RblPermisoDocNecesario.SelectedValue = "1" Then
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op9}", "X"))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op10}", ""))
+ ' Else
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op9}", ""))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op10}", "X"))
+ ' End If
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Dias}", TxtPermisosDias.Text))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Horas}", TxtPermisosHoras.Text))
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaI}", TxtFechaInicioVac.Text))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{FechaF}", TxtFechaFinVac.Text))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Fecha}", Now.ToString("dd/MM/yyyy")))
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Reemplazo}", DdlPermisosReemplazo.SelectedItem.Text))
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op11}", " "))
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{op12}", " "))
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Motivo}", TxtPermisoMotivo.Text))
+
+ ' ListaTagsDocumentost.Add(New TagsDocumentos("{Comentarios}", TxtPermisoComentarios.Text))
+
+ ' objDoc.SustituirTags(ListaTagsDocumentost)
+ ' objDoc.GuardarStreamPDF()
+
+
+ ' Dim DocByte As Byte() = objDoc.GetBytesDocumento()
+
+
+ ' Response.ClearHeaders()
+ ' Response.Clear()
+ ' Response.AddHeader("Content-Type", "application/pdf")
+ ' Response.AddHeader("Content-Length", DocByte.Length.ToString())
+ ' Response.AddHeader("Content-Disposition", "attachment; filename=sample.pdf")
+ ' Response.BinaryWrite(DocByte)
+ ' Response.Flush()
+ ' Response.End()
+
+
+ 'End If
+
+
+ End Sub
+
+ Private Sub VacacionesMandaCorreoSupervisor(Asunto As String, CorreoSupervisor As String, NombreSupervisor As String, NombreSolicitante As String, _FechaInicio As Date, _FechaFin As Date)
+
+ If CorreoSupervisor.Trim.Length > 0 Then
+
+ Dim a As String = String.Format("{0} -- {1} --- {2}", Asunto, CorreoSupervisor, "")
+ Dim Cuerpo As String
+ a.GuardaLog()
+
+ If _FechaInicio = _FechaFin Then
+ Cuerpo = "El empleado " & NombreCompleto & " a hecho una solicitud de vacaiones programada para el día " & _FechaInicio.ToString("dd/MM/yyyy") & " en las proximas horas se le presentara la solicitud para que se a aprovada o declinada por usted."
+ Else
+ Cuerpo = "El empleado " & NombreCompleto & " a hecho una solicitud de vacaiones programada de " & _FechaInicio.ToString("dd/MM/yyyy") & " a " & _FechaFin.ToString("dd/MM/yyyy") & " en las proximas horas se le presentara la solicitud para que se a aprovada o declinada por usted."
+ End If
+
+ Dim Mail As New ClsSisMail()
+ Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
+
+ ' CorreoSupervisor = "rakcsle.rakcsle@gmail.com"
+
+ Mail.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoSupervisor, Asunto, Cuerpo, "", LSRutasMail)
+ Mail = Nothing
+ Alert("Se ha enviado un correo al supervisor informandole de la solicitud.")
+ Else
+ Alert("La solicitud se a realizado correctamente.")
+ End If
+
+ End Sub
+
+ Protected Sub LnkEliminarSolicitud_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero()
+
+ Dim objRH As New ClsRH()
+ If objRH.RemoverSolicitudVacaciones(CvePersonalVacaciones) Then
+ CargaVacaciones()
+ CargaVacacionesResumenPeriodoActual()
+ Alert("Las vacaciones se ha eliminado")
+ End If
+ objRH.Dispose()
+ End Sub
+ Public Sub Edit_ClickVacacionDia(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ CvePersonalVacaciones = GvRow.DataKey("CvePersonalVacaciones").ToEntero
+ 'ChkEstatusDiaVacacion.Checked = Boolean.Parse(GvRow.DataKey("Estatus"))
+ VacFolio = GvRow.DataKey("Folio").ToString().ToEntero
+
+ TxtFechaDiaVacacion.Text = GvRow.DataKey("FechaInicio").ToString().ToDate.ToString("dd/MM/yyyy")
+ TxtFechaDiaVacacionFin.Text = GvRow.DataKey("FechaFin").ToString().ToDate.ToString("dd/MM/yyyy")
+
+ UpModalEditarDiaVacacion.Update()
+ RegistraScript("$('#divEditarDiaVacacion').modal({ backdrop: 'static', keyboard: false});")
+
+ End Sub
+
+
+ Protected Sub BtnEditarDiaVacacionModal_Click(sender As Object, e As EventArgs) Handles BtnEditarDiaVacacionModal.Click
+
+ Dim objRH As New ClsRH()
+
+
+
+
+ Dim FileExtension As String = "-1"
+ Dim Filesgral As List(Of Archivo) = TxtFileFormatoVacaciones.getfiles().Archivos
+ Dim Filename As String = ""
+ Dim Documento As String = ""
+
+ For Each fileItem As Archivo In Filesgral
+ Try
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ Documento = $"Vacaciones_{CvePersonalVacaciones}.{FileExtension}"
+ Dim tempArray() As String
+ tempArray = fileItem.filename.ToString().Split("-".ToCharArray())
+
+ Dim rutaDestino As String = $"{UsuarioActual.Empresa.Ruta}Personal\{CvePersonal}\Vacaciones\{Documento}"
+
+ If Not System.IO.Directory.Exists(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\") Then
+ System.IO.Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Personal\" & CvePersonal & "\Vacaciones\")
+ End If
+
+
+ If System.IO.File.Exists(rutaDestino) Then
+ System.IO.File.Delete(rutaDestino)
+ End If
+
+ System.IO.File.Move(fileItem.FileUrl, rutaDestino)
+
+ TxtFileFormatoVacaciones.Text = ""
+
+ Catch ex As Exception
+ OnError("Error al cargar Formato vacaciones", ex)
+ End Try
+
+ Next
+ If Documento.Length > 0 Then
+
+ If objRH.SolicitudVacacionesAddUpdate(CvePersonalVacaciones, CvePersonal, UsuarioActual.CveUsuario, Documento) Then
+ Alert("La fecha se actualizo correctamente")
+ End If
+ UpModalEditarDiaVacacion.Update()
+
+ objRH.Dispose()
+
+ CargaVacaciones()
+ CargaVacacionesResumenPeriodoActual()
+ RegistraScript("$('#divEditarDiaVacacion').modal('hide');")
+ Else
+ Alert("debe ingresar un documento para poder autorizar la solicitud", TipoMensaje.MsgAdvertencia)
+ End If
+ End Sub
+
+ Public Sub DownLoad_ClickSolicitudVacaciones(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\SolicitudVacaciones.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 fechaIngreso As Date = TxtFechaIngreso.Text.ToDate()
+ Dim Periodoingreso As Integer = fechaIngreso.ToString("MMdd").ToEntero()
+ Dim PeriodoInicio As Integer = GvRow.DataKey("FechaInicio").ToDate().ToString("MMdd").ToEntero()
+ 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("Dias")
+ Dim MotivoPermiso As String = GvRow.DataKey("Motivo")
+ Dim Puesto As String = DdlPuesto.SelectedItem.Value
+ Dim Fecha As String = DateTime.Now.ToString("dd/MM/yyyy")
+ Dim Solicitante As String = UsuarioActual.Nombre
+ Dim anio As Integer = GvRow.DataKey("FechaInicio").ToDate().Year
Dim FechaPeriodo As String = GvRow.DataKey("Periodo")
- If Periodoingreso > PeriodoInicio Then
- anio = anio - 1
+ If Periodoingreso > PeriodoInicio Then
+ anio = anio - 1
End If
- If File.Exists(RutaFormato) Then
-
- Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
- Dim ListaTags As New List(Of TagsDocumentos)
-
- ListaTags = GetDatosTagsDocumentos()
-
- ListaTags.Add(New TagsDocumentos("{Solicitante}", Solicitante))
- ListaTags.Add(New TagsDocumentos("{Fecha}", Fecha))
- 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("{MotivoPermiso}", MotivoPermiso))
- ListaTags.Add(New TagsDocumentos("{Puesto}", Puesto))
- ListaTags.Add(New TagsDocumentos("{anio}", anio.ToString()))
- ListaTags.Add(New TagsDocumentos("{FechaPeriodo}", FechaPeriodo))
-
- 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 & "_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)
- 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)
- End If
- End Sub
-
- Public Sub DownLoad_ClickSolicitudAutorizacion(sender As Object, e As EventArgs)
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim _Documento As String = GvRow.DataKey("Documento")
- Dim RutaDocuemntoAutorizacion As String = String.Format("{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento)
-
- If File.Exists(RutaDocuemntoAutorizacion) Then
- Dim bytesInStream As Byte() = File.ReadAllBytes(RutaDocuemntoAutorizacion)
- Response.Clear()
- Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & _Documento)
- Response.BinaryWrite(bytesInStream)
- Response.End()
- Else
- Alert("No se encontro el documento que intenta descargar.")
- End If
-
- End Sub
-
- Private Sub DescarSolicitudVacaciones(_Folio As Integer)
-
- Dim objEdoc As New ClsEdocumentacion
- Dim objRH As New ClsRH
- Dim DTVacaciones As DataTable
- Dim _CveDocumentacion As Integer = -1
- Dim _DocumentacionFormato As String = ""
- Dim _PathDocumento As String
- Dim DtVacacionesFolio As New DataTable
- Dim FechasVacaciones As String = ""
-
- If objEdoc.DocumentacionGet(-1, 10, -1, UsuarioActual.Empresa.CveEmpresa) Then '10 Tipo de oducmentacion hoja de vacacaciones
-
- DTVacaciones = objEdoc.DtResultados
-
- If objRH.VacacionesGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
- DtVacacionesFolio = objRH.DtResultados.FiltraParametros("Folio=" & _Folio)
- End If
-
- objRH.Dispose()
- objEdoc.Dispose()
-
- _CveDocumentacion = DTVacaciones(0)("CveDocumentacion").ToString().ToEntero
- _DocumentacionFormato = DTVacaciones(0)("DocumentacionFormato").ToString()
- _PathDocumento = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & _DocumentacionFormato
-
- If File.Exists(_PathDocumento) Then
-
- Dim objGemDocument As New clsGemBoxDocument(_PathDocumento)
- Dim ListaTags As New List(Of TagsDocumentos)
-
- ListaTags = GetDatosTagsDocumentos()
- ListaTags.AddRange(GetDatosTagsVacaciones(_Folio).ToArray)
-
- For Each dRow As DataRow In DtVacacionesFolio.Rows
- FechasVacaciones = FechasVacaciones & dRow("Fecha").ToString().ToDate.ToString("dd/MM/yyyy") & vbLf
- Next
-
- ListaTags.Add(New TagsDocumentos("{FechasVacaciones}", FechasVacaciones))
- ListaTags.Add(New TagsDocumentos("{Folio}", _Folio.ToString()))
-
- objGemDocument.SustituirTags(ListaTags)
-
- objGemDocument.GuardarStream()
-
- Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
- objGemDocument.Dispose()
-
- Response.Clear()
- Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicitud_Vacaciones_" & _Folio & "_" & Now.ToString("yyyyMMddhhmmss") & ".docx")
- Response.BinaryWrite(bytesInStream)
- Response.End()
-
- End If
-
- Else
- objRH.Dispose()
- End If
-
- End Sub
-
- Private Function GetDatosTagsVacaciones(_VacFolio As Integer) As List(Of TagsDocumentos)
-
- Dim ListaTags = New List(Of TagsDocumentos)
- Dim objRH As New ClsRH
-
- If objRH.VacacionesFolioGet(CvePersonal, _VacFolio) Then
-
- If objRH.DtResultados.Rows.Count > 0 Then
-
- ListaTags.Add(New TagsDocumentos("{Anios}", VacAnios.ToString()))
- ListaTags.Add(New TagsDocumentos("{DiasUsados}", VacDiasUsados.ToString()))
- ListaTags.Add(New TagsDocumentos("{DiasDisponibles}", VacDiasDisponibles.ToString()))
-
- If Not IsDBNull(objRH.DtResultados(0)("InicioVac")) Then
- ListaTags.Add(New TagsDocumentos("{InicioVac}", objRH.DtResultados(0)("InicioVac").ToString().ToDate.ToString("dd/MM/yyyy")))
- End If
-
- If Not IsDBNull(objRH.DtResultados(0)("FinVac")) Then
- ListaTags.Add(New TagsDocumentos("{FinVac}", objRH.DtResultados(0)("FinVac").ToString().ToDate.ToString("dd/MM/yyyy")))
- End If
-
- If Not IsDBNull(objRH.DtResultados(0)("RegresoVac")) Then
- ListaTags.Add(New TagsDocumentos("{RegresoVac}", objRH.DtResultados(0)("RegresoVac").ToString().ToDate.ToString("dd/MM/yyyy")))
- End If
-
- If Not IsDBNull(objRH.DtResultados(0)("DiasSolicitados")) Then
- ListaTags.Add(New TagsDocumentos("{DiasTomados}", objRH.DtResultados(0)("DiasSolicitados").ToString()))
- End If
-
- End If
- End If
-
- objRH.Dispose()
- Return ListaTags
+ If File.Exists(RutaFormato) Then
+
+ Dim objGemDocument As New clsGemBoxDocument(RutaFormato)
+ Dim ListaTags As New List(Of TagsDocumentos)
+
+ ListaTags = GetDatosTagsDocumentos()
+
+ ListaTags.Add(New TagsDocumentos("{Solicitante}", Solicitante))
+ ListaTags.Add(New TagsDocumentos("{Fecha}", Fecha))
+ 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("{MotivoPermiso}", MotivoPermiso))
+ ListaTags.Add(New TagsDocumentos("{Puesto}", Puesto))
+ ListaTags.Add(New TagsDocumentos("{anio}", anio.ToString()))
+ ListaTags.Add(New TagsDocumentos("{FechaPeriodo}", FechaPeriodo))
+
+ 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 & "_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)
+ 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)
+ End If
+ End Sub
+
+ Public Sub DownLoad_ClickSolicitudAutorizacion(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim _Documento As String = GvRow.DataKey("Documento")
+ Dim RutaDocuemntoAutorizacion As String = String.Format("{0}Personal\{1}\Vacaciones\{2}", UsuarioActual.Empresa.Ruta, CvePersonal, _Documento)
+
+ If File.Exists(RutaDocuemntoAutorizacion) Then
+ Dim bytesInStream As Byte() = File.ReadAllBytes(RutaDocuemntoAutorizacion)
+ Response.Clear()
+ Response.ContentType = "application/force-download"
+ Response.AddHeader("content-disposition", "attachment; filename=" & _Documento)
+ Response.BinaryWrite(bytesInStream)
+ Response.End()
+ Else
+ Alert("No se encontro el documento que intenta descargar.")
+ End If
+
+ End Sub
+
+ Private Sub DescarSolicitudVacaciones(_Folio As Integer)
+
+ Dim objEdoc As New ClsEdocumentacion
+ Dim objRH As New ClsRH
+ Dim DTVacaciones As DataTable
+ Dim _CveDocumentacion As Integer = -1
+ Dim _DocumentacionFormato As String = ""
+ Dim _PathDocumento As String
+ Dim DtVacacionesFolio As New DataTable
+ Dim FechasVacaciones As String = ""
+
+ If objEdoc.DocumentacionGet(-1, 10, -1, UsuarioActual.Empresa.CveEmpresa) Then '10 Tipo de oducmentacion hoja de vacacaciones
+
+ DTVacaciones = objEdoc.DtResultados
+
+ If objRH.VacacionesGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
+ DtVacacionesFolio = objRH.DtResultados.FiltraParametros("Folio=" & _Folio)
+ End If
+
+ objRH.Dispose()
+ objEdoc.Dispose()
+
+ _CveDocumentacion = DTVacaciones(0)("CveDocumentacion").ToString().ToEntero
+ _DocumentacionFormato = DTVacaciones(0)("DocumentacionFormato").ToString()
+ _PathDocumento = UsuarioActual.Empresa.Ruta & "Formatos\" & _CveDocumentacion & "_" & _DocumentacionFormato
+
+ If File.Exists(_PathDocumento) Then
+
+ Dim objGemDocument As New clsGemBoxDocument(_PathDocumento)
+ Dim ListaTags As New List(Of TagsDocumentos)
+
+ ListaTags = GetDatosTagsDocumentos()
+ ListaTags.AddRange(GetDatosTagsVacaciones(_Folio).ToArray)
+
+ For Each dRow As DataRow In DtVacacionesFolio.Rows
+ FechasVacaciones = FechasVacaciones & dRow("Fecha").ToString().ToDate.ToString("dd/MM/yyyy") & vbLf
+ Next
+
+ ListaTags.Add(New TagsDocumentos("{FechasVacaciones}", FechasVacaciones))
+ ListaTags.Add(New TagsDocumentos("{Folio}", _Folio.ToString()))
+
+ objGemDocument.SustituirTags(ListaTags)
+
+ objGemDocument.GuardarStream()
+
+ Dim bytesInStream As Byte() = objGemDocument.memoryStream.ToArray
+ objGemDocument.Dispose()
+
+ Response.Clear()
+ Response.ContentType = "application/force-download"
+ Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Solicitud_Vacaciones_" & _Folio & "_" & Now.ToString("yyyyMMddhhmmss") & ".docx")
+ Response.BinaryWrite(bytesInStream)
+ Response.End()
+
+ End If
+
+ Else
+ objRH.Dispose()
+ End If
+
+ End Sub
+
+ Private Function GetDatosTagsVacaciones(_VacFolio As Integer) As List(Of TagsDocumentos)
+
+ Dim ListaTags = New List(Of TagsDocumentos)
+ Dim objRH As New ClsRH
+
+ If objRH.VacacionesFolioGet(CvePersonal, _VacFolio) Then
+
+ If objRH.DtResultados.Rows.Count > 0 Then
+
+ ListaTags.Add(New TagsDocumentos("{Anios}", VacAnios.ToString()))
+ ListaTags.Add(New TagsDocumentos("{DiasUsados}", VacDiasUsados.ToString()))
+ ListaTags.Add(New TagsDocumentos("{DiasDisponibles}", VacDiasDisponibles.ToString()))
+
+ If Not IsDBNull(objRH.DtResultados(0)("InicioVac")) Then
+ ListaTags.Add(New TagsDocumentos("{InicioVac}", objRH.DtResultados(0)("InicioVac").ToString().ToDate.ToString("dd/MM/yyyy")))
+ End If
+
+ If Not IsDBNull(objRH.DtResultados(0)("FinVac")) Then
+ ListaTags.Add(New TagsDocumentos("{FinVac}", objRH.DtResultados(0)("FinVac").ToString().ToDate.ToString("dd/MM/yyyy")))
+ End If
+
+ If Not IsDBNull(objRH.DtResultados(0)("RegresoVac")) Then
+ ListaTags.Add(New TagsDocumentos("{RegresoVac}", objRH.DtResultados(0)("RegresoVac").ToString().ToDate.ToString("dd/MM/yyyy")))
+ End If
+
+ If Not IsDBNull(objRH.DtResultados(0)("DiasSolicitados")) Then
+ ListaTags.Add(New TagsDocumentos("{DiasTomados}", objRH.DtResultados(0)("DiasSolicitados").ToString()))
+ End If
+
+ End If
+ End If
+
+ objRH.Dispose()
+ Return ListaTags
End Function
-#End Region
+#End Region
-#Region "CURSOS"
+#Region "CURSOS"
- Private Sub CargaCursos()
-
- Dim objRH As New ClsRH
-
- If objRH.PersonalCursosGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
- GvCursos.DataSource = objRH.DtResultados
- Else
- GvCursos.DataSource = Nothing
- End If
- objRH.Dispose()
- GvCursos.DataBind()
-
- End Sub
-
- Private Sub GvCursosCreaEventoDescarga()
-
- For Each dRow As GridViewRow In GvCursos.Rows
-
- Dim CurAsistencia As Boolean = Boolean.Parse(dRow.DataKey("Asistencia"))
- Dim lnkCursoConstancia As LinkButton = dRow.FCLinkButton("lnkCursoConstancia")
- Dim ConstanciaDC3 As Boolean = Boolean.Parse(dRow.DataKey("ConstanciaDC3"))
-
-
- If ConstanciaDC3 Then
- If CurAsistencia And TxtRFC.Text.Trim.Length > 11 And TxtRFC.Text.Length < 14 Then
-
- lnkCursoConstancia.Visible = True
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
-
- Else
- lnkCursoConstancia.Visible = False
- End If
- Else
- lnkCursoConstancia.Visible = True
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
- End If
-
-
- Next
- End Sub
-
-
- Protected Sub GvCursos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCursos.RowDataBound
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- Dim CurAsistencia As Boolean = Boolean.Parse(e.Row.DBCampo("Asistencia"))
- Dim lnkCursoConstancia As LinkButton = e.Row.FCLinkButton("lnkCursoConstancia")
- Dim ConstanciaDC3 As Boolean = Boolean.Parse(e.Row.DataKey("ConstanciaDC3"))
-
- If ConstanciaDC3 Then
- If CurAsistencia And TxtRFC.Text.Trim.Length > 11 And TxtRFC.Text.Length < 14 Then
-
- lnkCursoConstancia.Visible = True
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
-
- Else
- lnkCursoConstancia.Visible = False
- End If
- Else
- lnkCursoConstancia.Visible = True
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
- End If
-
- End If
- End Sub
-
-
- Public Sub ImprimirConstancia_Click(sender As Object, e As EventArgs)
-
- Dim objConstancias As New ClsConstancias
- Dim DocumenBitArray As Byte() = Nothing
- Dim RutaDocumento As String = Server.MapPath("~")
- 'RutaDocumento = Path.Combine(RutaDocumento, "Empresas\Grales\FormatoDC3.docx")
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim _CveCurso As Integer = GvRow.DataKey("CveCurso").ToEntero
-
-
-
- DocumenBitArray = objConstancias.PersonalConstanciaGenera(CvePersonal, _CveCurso, UsuarioActual.CveEmpresa, RutaDocumento, UsuarioActual.Empresa)
-
- GvCursosCreaEventoDescarga()
- If Not DocumenBitArray Is Nothing Then
-
- Response.Clear()
- Response.ContentType = "application/force-download"
- Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Constancia_Curso_" & _CveCurso & "_" & Now.ToString("yyyyMMddhhmmss") & ".docx")
- Response.BinaryWrite(DocumenBitArray)
- Response.End()
-
- End If
-
-
-
-
-
+ Private Sub CargaCursos()
+
+ Dim objRH As New ClsRH
+
+ If objRH.PersonalCursosGet(CvePersonal, UsuarioActual.Empresa.CveEmpresa) Then
+ GvCursos.DataSource = objRH.DtResultados
+ Else
+ GvCursos.DataSource = Nothing
+ End If
+ objRH.Dispose()
+ GvCursos.DataBind()
+
+ End Sub
+
+ Private Sub GvCursosCreaEventoDescarga()
+
+ For Each dRow As GridViewRow In GvCursos.Rows
+
+ Dim CurAsistencia As Boolean = Boolean.Parse(dRow.DataKey("Asistencia"))
+ Dim lnkCursoConstancia As LinkButton = dRow.FCLinkButton("lnkCursoConstancia")
+ Dim ConstanciaDC3 As Boolean = Boolean.Parse(dRow.DataKey("ConstanciaDC3"))
+
+
+ If ConstanciaDC3 Then
+ If CurAsistencia And TxtRFC.Text.Trim.Length > 11 And TxtRFC.Text.Length < 14 Then
+
+ lnkCursoConstancia.Visible = True
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
+
+ Else
+ lnkCursoConstancia.Visible = False
+ End If
+ Else
+ lnkCursoConstancia.Visible = True
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
+ End If
+
+
+ Next
End Sub
-#End Region
+ Protected Sub GvCursos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCursos.RowDataBound
-#Region "UNIFORMES"
- Private Sub CargaComboUniformes()
-
- Dim objRH As New ClsRH
-
- If objRH.UniformeGet(-1, 1, UsuarioActual.CveEmpresa) Then
-
- DdlUniforme.DataSource = objRH.DtResultados
- Else
- DdlUniforme.DataSource = Nothing
- End If
-
- DdlUniforme.DataBind()
- DdlUniforme.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
- objRH.Dispose()
- 'UpGvUniformes.Update()
-
- End Sub
-
- Private Sub CargaUniformesPersonal()
-
- If Not UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
-
- GvUniforme.Visible = True
- GvUniformesResguardo.Visible = False
- If DdlUniforme.SelectedIndex > 0 Then
- Dim objRH As New ClsRH
-
- If objRH.UniformeDetallePersonalGet(CvePersonal, DdlUniforme.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
- GvUniforme.DataSource = objRH.DtResultados
-
- If objRH.DtResultados.Rows.Count > 0 Then
- LnkSurtir.Visible = True
- Else
- LnkSurtir.Visible = False
- End If
-
- UpBtnUniformes.Update()
- Else
- GvUniforme.DataSource = Nothing
- LnkSurtir.Visible = False
- UpBtnUniformes.Update()
- End If
- objRH.Dispose()
- Else
- GvUniforme.DataSource = Nothing
- LnkSurtir.Visible = False
- UpBtnUniformes.Update()
- End If
-
- Else
- GvUniforme.Visible = False
- GvUniformesResguardo.Visible = True
-
- Dim ObjInv As New ClsInventarios
-
- If ObjInv.GetResguardoUniformesRep(UsuarioActual.CveEmpresa, CvePersonal, -1, -1, Todo:=False) Then
- GvUniformesResguardo.DataSource = ObjInv.DtResultados
- UniformesInfo = ObjInv.DtResultados
- Else
- GvUniformesResguardo.DataSource = Nothing
- 'LnkSurtir.Visible = False
- UpBtnUniformes.Update()
- End If
-
-
-
- ObjInv.Dispose()
- GvUniformesResguardo.DataBind()
- UpGvUniformes.Update()
-
- End If
-
- GvUniforme.DataBind()
- GvUniformesResguardo.DataBind()
-
- UpGvUniformes.Update()
- UpUniformesResguardo.Update()
-
- End Sub
-
- Protected Sub LbLiberarUniforme(sender As Object, e As System.EventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ Dim CurAsistencia As Boolean = Boolean.Parse(e.Row.DBCampo("Asistencia"))
+ Dim lnkCursoConstancia As LinkButton = e.Row.FCLinkButton("lnkCursoConstancia")
+ Dim ConstanciaDC3 As Boolean = Boolean.Parse(e.Row.DataKey("ConstanciaDC3"))
+
+ If ConstanciaDC3 Then
+ If CurAsistencia And TxtRFC.Text.Trim.Length > 11 And TxtRFC.Text.Length < 14 Then
+
+ lnkCursoConstancia.Visible = True
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
+
+ Else
+ lnkCursoConstancia.Visible = False
+ End If
+ Else
+ lnkCursoConstancia.Visible = True
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(lnkCursoConstancia)
+ End If
+
+ End If
+ End Sub
+
+
+ Public Sub ImprimirConstancia_Click(sender As Object, e As EventArgs)
+
+ Dim objConstancias As New ClsConstancias
+ Dim DocumenBitArray As Byte() = Nothing
+ Dim RutaDocumento As String = Server.MapPath("~")
+ 'RutaDocumento = Path.Combine(RutaDocumento, "Empresas\Grales\FormatoDC3.docx")
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim _CveCurso As Integer = GvRow.DataKey("CveCurso").ToEntero
+
+
+
+ DocumenBitArray = objConstancias.PersonalConstanciaGenera(CvePersonal, _CveCurso, UsuarioActual.CveEmpresa, RutaDocumento, UsuarioActual.Empresa)
+
+ GvCursosCreaEventoDescarga()
+ If Not DocumenBitArray Is Nothing Then
+
+ Response.Clear()
+ Response.ContentType = "application/force-download"
+ Response.AddHeader("content-disposition", "attachment; filename=" & CvePersonal & "_Constancia_Curso_" & _CveCurso & "_" & Now.ToString("yyyyMMddhhmmss") & ".docx")
+ Response.BinaryWrite(DocumenBitArray)
+ Response.End()
+
+ End If
+
+
+
+
+
+ End Sub
+
+
+#End Region
+
+#Region "UNIFORMES"
+ Private Sub CargaComboUniformes()
+
+ Dim objRH As New ClsRH
+
+ If objRH.UniformeGet(-1, 1, UsuarioActual.CveEmpresa) Then
+
+ DdlUniforme.DataSource = objRH.DtResultados
+ Else
+ DdlUniforme.DataSource = Nothing
+ End If
+
+ DdlUniforme.DataBind()
+ DdlUniforme.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+ objRH.Dispose()
+ 'UpGvUniformes.Update()
+
+ End Sub
+
+ Private Sub CargaUniformesPersonal()
+
+ If Not UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then
+
+ GvUniforme.Visible = True
+ GvUniformesResguardo.Visible = False
+ If DdlUniforme.SelectedIndex > 0 Then
+ Dim objRH As New ClsRH
+
+ If objRH.UniformeDetallePersonalGet(CvePersonal, DdlUniforme.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
+ GvUniforme.DataSource = objRH.DtResultados
+
+ If objRH.DtResultados.Rows.Count > 0 Then
+ LnkSurtir.Visible = True
+ Else
+ LnkSurtir.Visible = False
+ End If
+
+ UpBtnUniformes.Update()
+ Else
+ GvUniforme.DataSource = Nothing
+ LnkSurtir.Visible = False
+ UpBtnUniformes.Update()
+ End If
+ objRH.Dispose()
+ Else
+ GvUniforme.DataSource = Nothing
+ LnkSurtir.Visible = False
+ UpBtnUniformes.Update()
+ End If
+
+ Else
+ GvUniforme.Visible = False
+ GvUniformesResguardo.Visible = True
+
+ Dim ObjInv As New ClsInventarios
+
+ If ObjInv.GetResguardoUniformesRep(UsuarioActual.CveEmpresa, CvePersonal, -1, -1, Todo:=False) Then
+ GvUniformesResguardo.DataSource = ObjInv.DtResultados
+ UniformesInfo = ObjInv.DtResultados
+ Else
+ GvUniformesResguardo.DataSource = Nothing
+ 'LnkSurtir.Visible = False
+ UpBtnUniformes.Update()
+ End If
+
+
+
+ ObjInv.Dispose()
+ GvUniformesResguardo.DataBind()
+ UpGvUniformes.Update()
+
+ End If
+
+ GvUniforme.DataBind()
+ GvUniformesResguardo.DataBind()
+
+ UpGvUniformes.Update()
+ UpUniformesResguardo.Update()
+
+ End Sub
+
+ Protected Sub LbLiberarUniforme(sender As Object, e As System.EventArgs)
Dim lb As LinkButton = CType(sender, LinkButton)
Dim row As GridViewRow = CType(lb.NamingContainer, GridViewRow)
- CveAlmacenUniforme = row.DataKey("CveAlmacen").ToString().ToEntero
+ CveAlmacenUniforme = row.DataKey("CveAlmacen").ToString().ToEntero
DescripcionUniforme = row.DataKey("CodigoPS")
- PU = row.DataKey("PU").ToString().ToDecimal
+ PU = row.DataKey("PU").ToString().ToDecimal
CveSeccionAlmacenUniforme = row.DataKey("CveSeccionAlmacen").ToString().ToEntero
- CveUM = row.DataKey("CveUM").ToString().ToEntero
- CvePS = row.DataKey("CvePS").ToString().ToEntero
- CveMovimientoUniforme = row.DataKey("CveMovimiento").ToString().ToEntero
+ CveUM = row.DataKey("CveUM").ToString().ToEntero
+ CvePS = row.DataKey("CvePS").ToString().ToEntero
+ CveMovimientoUniforme = row.DataKey("CveMovimiento").ToString().ToEntero
CveMovimientoDetalleUniforme = row.DataKey("CveMovimientoDetalle").ToString().ToEntero
Dim Cantidad As Integer = row.DataKey("Cantidad").ToString().ToEntero
TxtCantidadResguardo.Text = Cantidad.ToString
@@ -5178,228 +5178,234 @@ Partial Class RH_Personal
CargaSeccionesAlmacen(DdlSeccionAlmacen, DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePS, UsuarioActual.CveEmpresa)
DdlSeccionAlmacen.DataSource = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePS)
DdlSeccionAlmacen.DataBind()
- End If
-
-
- UPPLiberarUniforme.Update()
-
- RegistraScript(String.Format("$('#{0}').modal();", "ModalUniforme"))
- End Sub
-
- Private Sub DdlUniforme_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlUniforme.SelectedIndexChanged
-
- CargaUniformesPersonal()
-
- End Sub
-
- Sub LiberarUniforme(sender As Object, e As EventArgs)
-
- Dim ObjInventario As New ClsInventarios
- ObjInventario.IniciaTransacSQL()
-
- Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble()
-
+ End If
+ TxtLiberarSerie.Text = ""
+
+ If row.DataKey("AplicaSerie").ToString = "True" Then
+ divSerie.Visible = True
+ End If
+
+
+ UPPLiberarUniforme.Update()
+
+ RegistraScript(String.Format("$('#{0}').modal();", "ModalUniforme"))
+ End Sub
+
+ Private Sub DdlUniforme_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlUniforme.SelectedIndexChanged
+
+ CargaUniformesPersonal()
+
+ End Sub
+
+ Sub LiberarUniforme(sender As Object, e As EventArgs)
+
+ Dim ObjInventario As New ClsInventarios
+ ObjInventario.IniciaTransacSQL()
+
+ Dim Cantidad As Double = TxtCantidadResguardo.Text.ToDouble()
+ Dim Serie As String = TxtLiberarSerie.Text.Trim
+
Dim CveResultadoSalida As Integer = ObjInventario.AddMovimiento(CveAlmacenUniforme, 3, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveAlmacenDestino:=DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme)
- Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme)
+ Dim ResultadoDetalleSalida As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoSalida, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacenUniforme, Serie:=Serie, CveMovimientoDetalleEntrada:=CveMovimientoDetalleUniforme)
Dim CveSeccionAlmacen As Integer = DdlSeccionAlmacen.SelectedValue.ToEntero
Dim CveResultadoEntrada As Integer = ObjInventario.AddMovimiento(DdlAlmacenDestinoLiberarUniforme.SelectedValue.ToEntero, 2, 1, Date.Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CvePersonal:=CvePersonal, Observaciones:=DescripcionUniforme, CveMovimientoRelacionado:=CveMovimientoUniforme)
- Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen)
-
- If ResultadoDetalleSalida And ResultadoDetalleEntrada Then
- ObjInventario.Commit()
- Alert("El resguardo se liberó correctamente")
- RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalUniforme"))
+ Dim ResultadoDetalleEntrada As Boolean = ObjInventario.AddMovimientoDetalle(CveResultadoEntrada, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie)
+
+ If ResultadoDetalleSalida And ResultadoDetalleEntrada Then
+ ObjInventario.Commit()
+ Alert("El resguardo se liberó correctamente")
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalUniforme"))
CargaUniformesPersonal()
- Else
- Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError)
- ObjInventario.RollBack()
- End If
- ObjInventario.Dispose()
+ Else
+ Alert("No se pudo registrar la liberación.", TipoMensaje.MsgError)
+ ObjInventario.RollBack()
+ End If
+ ObjInventario.Dispose()
End Sub
-#End Region
+#End Region
-#Region "CARGAR IMAGEN"
- Private Sub LnkSubirFacturas_Click(sender As Object, e As EventArgs) Handles LnkSubirFacturas.Click
- RegistraScript(String.Format("$('#{0}').modal();", "ModalArchivo"))
- End Sub
-
- Private Sub BtnGuardarArchivo_Click(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click
- Dim FileExtension As String = "-1"
- Dim filesgral As List(Of Archivo) = TxtCargaImg.getfiles().Archivos
- Dim filemove As String = ""
-
-
- For Each fileItem As Archivo In filesgral
- FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
- filemove = fileItem.filename
-
- Dim yaExistente As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.jpg", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal)
- Dim yaExistentePNG As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.png", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal)
- Dim yaExistenteBMP As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.bmp", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal)
-
- If File.Exists(yaExistente) Then
- File.Delete(yaExistente)
- ElseIf File.Exists(yaExistentePNG) Then
- File.Delete(yaExistentePNG)
- ElseIf File.Exists(yaExistenteBMP) Then
- File.Delete(yaExistenteBMP)
- 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(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & "." & FileExtension) Then
- Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.{2}", UsuarioActual.CveEmpresa, CvePersonal, FileExtension)
- Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}&version={4}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica), Now)
- ImgPersonal.ImageUrl = logouri
- End If
- UpImage.Update()
- TxtCargaImg.Text = "[]"
- UpAddArchivo.Update()
- RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalArchivo"))
+#Region "CARGAR IMAGEN"
+ Private Sub LnkSubirFacturas_Click(sender As Object, e As EventArgs) Handles LnkSubirFacturas.Click
+ RegistraScript(String.Format("$('#{0}').modal();", "ModalArchivo"))
End Sub
-#Region "PERMISOS"
+ Private Sub BtnGuardarArchivo_Click(sender As Object, e As EventArgs) Handles BtnGuardarArchivo.Click
+ Dim FileExtension As String = "-1"
+ Dim filesgral As List(Of Archivo) = TxtCargaImg.getfiles().Archivos
+ Dim filemove As String = ""
- Public Sub CargaPermisos()
-
- Dim ObjRH As New ClsRH
- Dim CvePersonal As Integer = If(IsNumeric(Request("CvePersonal")), Request("CvePersonal").ToString().ToEntero, -1)
- If ObjRH.ChecadorPermisosGet(-1, "-1", CvePersonal, Now.AddMonths(-3), Now.AddMonths(2), -1, -1, UsuarioActual.CveEmpresa) Then
- GvPermisos.DataSource = ObjRH.DtResultados
- Else
- GvPermisos.DataSource = Nothing
- End If
-
- ObjRH.Dispose()
- GvPermisos.DataBind()
- UpGvPermisos.Update()
-
- End Sub
- Private Sub BtnPermiso_Click(sender As Object, e As EventArgs) Handles BtnPermiso.Click
-
- Dim ObjRH As New ClsRH
-
- Dim HoraEntrada As TimeSpan
- Dim HoraSalida As TimeSpan
- Dim GoceSueldo As Integer = If(ChkGoceSueldo.Checked, 1, 0)
- Dim EstatusPermiso As Integer = If(ChkEstatusPermiso.Checked, 1, 0)
-
- If TxtHoraEntrada.Text.Trim.Length > 0 Then
- Try
- HoraEntrada = TimeSpan.Parse(TxtHoraEntrada.Text)
- Catch ex As Exception
- HoraEntrada = Nothing
- End Try
- Else
- HoraEntrada = Nothing
-
- End If
-
- If TxtHoraSalida.Text.Trim.Length > 0 Then
- Try
- HoraSalida = TimeSpan.Parse(TxtHoraSalida.Text)
- Catch ex As Exception
-
- End Try
- Else
- HoraSalida = Nothing
- End If
-
-
- If ObjRH.ChecadorPermisosAddUpdate(CvePermiso, TxtPermisoDescripcion.Text.Trim, CvePersonal, TxtFechaInicioPer.Text.ToDate, TxtFechaFinPer.Text.Trim.ToDate, HoraEntrada, HoraSalida,
- GoceSueldo, EstatusPermiso, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
- If CvePermiso = -1 Then
- Alert("Permiso agregado correctamente")
- Else
- Alert("Permiso agregado Actualizado correctamente")
- End If
-
- RegistraScript("$('#DvPermisos').modal('hide');")
-
- End If
-
- ObjRH.Dispose()
- CargaPermisos()
-
- End Sub
-
- Private Sub LnkAgregarPermiso_Click(sender As Object, e As EventArgs) Handles LnkAgregarPermiso.Click
- BtnPermiso.Text = "Agregar"
- ChkEstatusPermiso.Checked = True
- CvePermiso = -1
- RegistraScript("$('#DvPermisos').modal({ backdrop: 'static', keyboard: false});")
- End Sub
-
-
- Public Sub Edit_ClickPermiso(sender As Object, e As EventArgs)
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- CvePermiso = GvRow.DataKey("CvePermiso").ToString().ToEntero
- TxtPermisoDescripcion.Text = GvRow.DataKey("Descripcion").ToString()
- TxtFechaInicioPer.Text = GvRow.DataKey("FechaInicio").ToString()
- TxtFechaFinPer.Text = GvRow.DataKey("FechaFin").ToString()
-
- If GvRow.DataKey("HoraEntrada").ToString().Length > 0 Then
- Try
- TxtHoraEntrada.Text = TimeSpan.Parse(GvRow.DataKey("HoraEntrada").ToString()).ToString("hh:mm:ss")
- Catch ex As Exception
- TxtHoraEntrada.Text = ""
- End Try
- Else
- TxtHoraEntrada.Text = ""
- End If
-
-
- If GvRow.DataKey("HoraSalida").ToString().Length > 0 Then
- Try
- TxtHoraSalida.Text = TimeSpan.Parse(GvRow.DataKey("HoraSalida").ToString()).ToString("hh:mm:ss")
- Catch ex As Exception
- TxtHoraSalida.Text = ""
- End Try
- Else
- TxtHoraSalida.Text = ""
- End If
-
- BtnPermiso.Text = "Actualizar"
-
- ChkGoceSueldo.Checked = Boolean.Parse(GvRow.DataKey("GoceSueldo").ToString())
- ChkEstatusPermiso.Checked = Boolean.Parse(GvRow.DataKey("Estatus").ToString())
- UpModalPermisos.Update()
- RegistraScript("$('#DvPermisos').modal({ backdrop: 'static', keyboard: false});")
-
-
-
- End Sub
-
-
- Public Sub Remove_ClickPermiso(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- Dim ObjRH As New ClsRH
- Dim CvePermisoInterno As Integer = GvRow.DataKey("CvePermiso").ToEntero
- If ObjRH.ChecadorPermisosRemove(CvePermisoInterno, UsuarioActual.CveEmpresa) Then
-
- End If
-
- ObjRH.Dispose()
-
- CargaPermisos()
+
+ For Each fileItem As Archivo In filesgral
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ filemove = fileItem.filename
+
+ Dim yaExistente As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.jpg", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal)
+ Dim yaExistentePNG As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.png", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal)
+ Dim yaExistenteBMP As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.bmp", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal)
+
+ If File.Exists(yaExistente) Then
+ File.Delete(yaExistente)
+ ElseIf File.Exists(yaExistentePNG) Then
+ File.Delete(yaExistentePNG)
+ ElseIf File.Exists(yaExistenteBMP) Then
+ File.Delete(yaExistenteBMP)
+ 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(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & "." & FileExtension) Then
+ Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.{2}", UsuarioActual.CveEmpresa, CvePersonal, FileExtension)
+ Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}&version={4}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica), Now)
+ ImgPersonal.ImageUrl = logouri
+ End If
+ UpImage.Update()
+ TxtCargaImg.Text = "[]"
+ UpAddArchivo.Update()
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalArchivo"))
+ End Sub
+
+#Region "PERMISOS"
+
+ Public Sub CargaPermisos()
+
+ Dim ObjRH As New ClsRH
+ Dim CvePersonal As Integer = If(IsNumeric(Request("CvePersonal")), Request("CvePersonal").ToString().ToEntero, -1)
+ If ObjRH.ChecadorPermisosGet(-1, "-1", CvePersonal, Now.AddMonths(-3), Now.AddMonths(2), -1, -1, UsuarioActual.CveEmpresa) Then
+ GvPermisos.DataSource = ObjRH.DtResultados
+ Else
+ GvPermisos.DataSource = Nothing
+ End If
+
+ ObjRH.Dispose()
+ GvPermisos.DataBind()
+ UpGvPermisos.Update()
+
+ End Sub
+ Private Sub BtnPermiso_Click(sender As Object, e As EventArgs) Handles BtnPermiso.Click
+
+ Dim ObjRH As New ClsRH
+
+ Dim HoraEntrada As TimeSpan
+ Dim HoraSalida As TimeSpan
+ Dim GoceSueldo As Integer = If(ChkGoceSueldo.Checked, 1, 0)
+ Dim EstatusPermiso As Integer = If(ChkEstatusPermiso.Checked, 1, 0)
+
+ If TxtHoraEntrada.Text.Trim.Length > 0 Then
+ Try
+ HoraEntrada = TimeSpan.Parse(TxtHoraEntrada.Text)
+ Catch ex As Exception
+ HoraEntrada = Nothing
+ End Try
+ Else
+ HoraEntrada = Nothing
+
+ End If
+
+ If TxtHoraSalida.Text.Trim.Length > 0 Then
+ Try
+ HoraSalida = TimeSpan.Parse(TxtHoraSalida.Text)
+ Catch ex As Exception
+
+ End Try
+ Else
+ HoraSalida = Nothing
+ End If
+
+
+ If ObjRH.ChecadorPermisosAddUpdate(CvePermiso, TxtPermisoDescripcion.Text.Trim, CvePersonal, TxtFechaInicioPer.Text.ToDate, TxtFechaFinPer.Text.Trim.ToDate, HoraEntrada, HoraSalida,
+ GoceSueldo, EstatusPermiso, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ If CvePermiso = -1 Then
+ Alert("Permiso agregado correctamente")
+ Else
+ Alert("Permiso agregado Actualizado correctamente")
+ End If
+
+ RegistraScript("$('#DvPermisos').modal('hide');")
+
+ End If
+
+ ObjRH.Dispose()
+ CargaPermisos()
+
+ End Sub
+
+ Private Sub LnkAgregarPermiso_Click(sender As Object, e As EventArgs) Handles LnkAgregarPermiso.Click
+ BtnPermiso.Text = "Agregar"
+ ChkEstatusPermiso.Checked = True
+ CvePermiso = -1
+ RegistraScript("$('#DvPermisos').modal({ backdrop: 'static', keyboard: false});")
+ End Sub
+
+
+ Public Sub Edit_ClickPermiso(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ CvePermiso = GvRow.DataKey("CvePermiso").ToString().ToEntero
+ TxtPermisoDescripcion.Text = GvRow.DataKey("Descripcion").ToString()
+ TxtFechaInicioPer.Text = GvRow.DataKey("FechaInicio").ToString()
+ TxtFechaFinPer.Text = GvRow.DataKey("FechaFin").ToString()
+
+ If GvRow.DataKey("HoraEntrada").ToString().Length > 0 Then
+ Try
+ TxtHoraEntrada.Text = TimeSpan.Parse(GvRow.DataKey("HoraEntrada").ToString()).ToString("hh:mm:ss")
+ Catch ex As Exception
+ TxtHoraEntrada.Text = ""
+ End Try
+ Else
+ TxtHoraEntrada.Text = ""
+ End If
+
+
+ If GvRow.DataKey("HoraSalida").ToString().Length > 0 Then
+ Try
+ TxtHoraSalida.Text = TimeSpan.Parse(GvRow.DataKey("HoraSalida").ToString()).ToString("hh:mm:ss")
+ Catch ex As Exception
+ TxtHoraSalida.Text = ""
+ End Try
+ Else
+ TxtHoraSalida.Text = ""
+ End If
+
+ BtnPermiso.Text = "Actualizar"
+
+ ChkGoceSueldo.Checked = Boolean.Parse(GvRow.DataKey("GoceSueldo").ToString())
+ ChkEstatusPermiso.Checked = Boolean.Parse(GvRow.DataKey("Estatus").ToString())
+ UpModalPermisos.Update()
+ RegistraScript("$('#DvPermisos').modal({ backdrop: 'static', keyboard: false});")
+
+
+
+ End Sub
+
+
+ Public Sub Remove_ClickPermiso(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ Dim ObjRH As New ClsRH
+ Dim CvePermisoInterno As Integer = GvRow.DataKey("CvePermiso").ToEntero
+ If ObjRH.ChecadorPermisosRemove(CvePermisoInterno, UsuarioActual.CveEmpresa) Then
+
+ End If
+
+ ObjRH.Dispose()
+
+ CargaPermisos()
End Sub
-#End Region
+#End Region
-#End Region
+#End Region
'Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click
@@ -5440,798 +5446,798 @@ Partial Class RH_Personal
' End If
'End Sub
-#Region "Consumos"
+#Region "Consumos"
- Private Sub Consumos()
-
- Dim ObjCompras As New ClsCompras
-
- If ObjCompras.GetRepComprasPersonalDetalle("-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1, CvePersonal, -1, -1, -1, "-1", UsuarioActual.CveUsuario) Then
- DTConsumos = ObjCompras.DtResultados
- GvConsumos.DataSource = DTConsumos
- Else
- GvConsumos.DataSource = Nothing
- End If
- ObjCompras.Dispose()
-
- GvConsumos.DataBind()
-
- UpConsumos.Update()
- End Sub
-
- Protected Sub GvConsumos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvConsumos.RowDataBound
-
- If e.Row.RowType = DataControlRowType.Header Then
- 'Cambiar Header
- End If
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- Dim FechaI, FechaF As String
- FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
- FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
-
- Dim Liga As String = $"/Compras/Compras.aspx?CveCompra={e.Row.DBCampo("CveCompra")}"
-
- If e.Row.DBCampo("Orden") = "1" Then
- e.Row.Cells(0).Text = String.Format("{2}", "Texto", Liga, e.Row.DBCampo("SerieFolio").ToString())
- Else
- e.Row.BackColor = Drawing.Color.LightGray
- End If
-
- End If
- End Sub
- 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}/", 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"
- End If
-
- Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
- Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
- Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
-
- params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
- 'params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
-
- Dim ObjPersonal As New ClsRH()
- If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
- If ObjPersonal.DtResultados.Rows.Count > 0 Then
- CodigoP = ObjPersonal.Codigo
- NombreCompletoP = ObjPersonal.NombreCompleto
- params.Add(New ReportParameter("NombrePersonal", ObjPersonal.NombreCompleto))
- params.Add(New ReportParameter("CodigoPersonal", ObjPersonal.Codigo))
- End If
- End If
- ObjPersonal.Dispose()
-
- params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
- params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()))
-
- If Imagen.Exists Then
- params.Add(New ReportParameter("pImg", logouri))
- Else
- params.Add(New ReportParameter("pImg", ""))
- End If
- ImprimirPDF(RutaPDF, DTConsumos, params, $"RepConsumoPersonal - {CodigoP} {NombreCompletoP}", Formato)
- End Sub
- Protected Sub LnkImprimirPDFConsumo_Click(sender As Object, e As EventArgs)
- GenerarPDFConsumo()
+ Private Sub Consumos()
+
+ Dim ObjCompras As New ClsCompras
+
+ If ObjCompras.GetRepComprasPersonalDetalle("-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1, CvePersonal, -1, -1, -1, "-1", UsuarioActual.CveUsuario) Then
+ DTConsumos = ObjCompras.DtResultados
+ GvConsumos.DataSource = DTConsumos
+ Else
+ GvConsumos.DataSource = Nothing
+ End If
+ ObjCompras.Dispose()
+
+ GvConsumos.DataBind()
+
+ UpConsumos.Update()
End Sub
-#End Region
+ Protected Sub GvConsumos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvConsumos.RowDataBound
-#Region ""
- Protected Sub LbMail_Click(sender As Object, e As EventArgs)
-
- Dim gvr As GridViewRow = CType(CType(sender, LinkButton).BindingContainer, GridViewRow)
-
- If gvr.DataKey("SeTimbro") = "True" Then
-
- Dim NombreComercial = UsuarioActual.Empresa.Empresa
- Dim SerieFolio = gvr.DataKey("SerieFolio").ToString()
- Dim Destinatario = gvr.DataKey("Correo").ToString()
- Dim Personal = gvr.DataKey("Nombre").ToString()
- Dim fechai = gvr.DataKey("FechaInicio").ToString().ToDate.ToShortDateString
- Dim fechaf = gvr.DataKey("FechaFin").ToString().ToDate.ToShortDateString
- Dim cvePeriodo = gvr.DataKey("CvePeriodo").ToString().ToEntero
-
- If UsuarioActual.CveRol = 1 Then
- Alert("Parametros:" + NombreComercial + " " + SerieFolio + " " + Destinatario + " " + Personal + " " + fechai + " " + fechaf)
- End If
- MandaCorreo(NombreComercial, SerieFolio, Destinatario, Personal, fechai, fechaf, cvePeriodo)
- End If
-
-
-
- End Sub
-
- Private Sub MandaCorreo(NombreComercial As String, SerieFolio As String, Destinatario As String, Optional Personal As String = "", Optional FechaI As String = "", Optional FechaF As String = "", Optional CvePeriodo As Integer = -1)
-
- Dim RutaXml As String = String.Format("{0}XML\Nomina\{1}.xml", UsuarioActual.Empresa.Ruta, SerieFolio)
- Dim RutaPdf As String = String.Format("{0}PDF\Nomina\{1}.pdf", UsuarioActual.Empresa.Ruta, SerieFolio)
-
- If Destinatario.Length > 0 Then
-
- Dim Correo As New ClsSisMail()
- Dim Asunto As String = "Comprobante de Nómina"
- Dim Cuerpo As New StringBuilder
-
- Cuerpo.AppendFormat("Estimado {0} Por este medio le hacemos llegar los comprobantes fiscales de su nomina, correspondiente al periodo del {1} al {2}
", Personal, FechaI, FechaF)
- Cuerpo.AppendFormat(" {0}", NombreComercial)
-
- Dim Xml As New ClsSisMail.ArchivoMail
- Dim Pdf As New ClsSisMail.ArchivoMail
- Dim ListaAdjuntos As New List(Of ClsSisMail.ArchivoMail)
-
- If File.Exists(RutaXml) Then
- 'Xml.ArchivoBinario() = File.ReadAllBytes(RutaXml)
- Xml.Ruta = RutaXml
-
- Xml.NombreArchivo = New FileInfo(SerieFolio + ".Xml").Name
-
- ListaAdjuntos.Add(Xml)
- End If
-
- If Not File.Exists(RutaPdf) Then
- GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)
- End If
-
- If File.Exists(RutaPdf) Then
- 'Pdf.ArchivoBinario() = File.ReadAllBytes(RutaPdf)
- Pdf.Ruta = RutaPdf
-
- Pdf.NombreArchivo = New FileInfo(SerieFolio + ".Pdf").Name
-
- ListaAdjuntos.Add(Pdf)
- End If
-
-
- If ListaAdjuntos.Count > 0 Then
- If Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString(), Archivos:=ListaAdjuntos) Then
- Alert("Correo enviado existosamente a " & Destinatario)
- Else
- Alert("Se presento un error al enviar el correo a " & Destinatario)
- End If
- Else
- If Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString()) Then
- Alert("Correo enviado existosamente a " & Destinatario)
- Else
- Alert("Se presento un error al adjuntar comprobantes")
- End If
- End If
- Else
-
- End If
-
- End Sub
-#End Region
-
-#Region "VIATICOS"
- Protected Sub CargaViaticosPersonal()
- Dim ObjBancos As ClsBancos = New ClsBancos
-
- If ObjBancos.GetSolicitudesViaticos(-1, UsuarioActual.CveEmpresa, -1, CvePersonal) Then
- GVViaticos.DataSource = ObjBancos.DtResultados
- GVViaticos.DataBind()
- End If
-
- ObjBancos.Dispose()
- End Sub
-
- Protected Sub LnkViaticoDetalle_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim CveSolicitudViatico As Integer = GvRow.DataKey("CveSolicitudViatico").ToEntero
- CargaViaticosDetalle(CveSolicitudViatico)
- RegistraScript("$('#DivViaticoDetalle').modal({ backdrop: 'static', keyboard: false});")
- End Sub
-
- Protected Sub CargaViaticosDetalle(CveSolicitudViativo As Integer)
- Dim ObjBancos As ClsBancos = New ClsBancos
- If ObjBancos.GetSolicitudesViaticosDetalle(CveSolicitudViativo, -1) Then
- DTViaticosDetalle = ObjBancos.DtResultados
- GVViaticoDetalle.DataSource = DTViaticosDetalle
- GVViaticoDetalle.DataBind()
- End If
- ObjBancos.Dispose()
- UpViaticoDetalle.Update()
- End Sub
-
- Protected Sub GVViaticoDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs)
- If (e.Row.RowType = DataControlRowType.Footer) Then
- e.Row.FCLiteral("LtTotalImporte").Text = DTViaticosDetalle.SUM("Importe").FormatoNumero()
- End If
- End Sub
-#End Region
-
-#Region "BITACORA"
-
- Private Sub CargaGvBitacora()
-
- If CvePersonal > 0 Then
- Dim ObjGral As New ClsGenerales()
- If ObjGral.GetHistorialBitacora(-1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
- GvBitacora.DataSource = ObjGral.DtResultados
- End If
- ObjGral.Dispose()
- GvBitacora.DataBind()
- UpHistorialModificacion.Update()
- End If
-
- End Sub
-
-#End Region
-
-#Region "PAGO DE FACTURAS"
-
- Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
- CargaPagoFactura()
- UpnHistorial.Update()
- End Sub
-
- Private Sub CargaPagoFactura()
- Dim ObjRH As New ClsRH
- If ObjRH.GetPersonalPagoFactura(CvePersonal, TxtFechaICredito.Text.ToDate, TxtFechaFCredito.Text.ToDate, UsuarioActual.CveEmpresa) Then
- GVPagoFactura.DataSource = ObjRH.DtResultados
- End If
- ObjRH.Dispose()
- GVPagoFactura.DataBind()
- 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()
-
- Dim ObjMov As New ClsContabilidad()
- If AgregarSaldoInicial(SaldoInicial, Fecha, 1, ObjMov) > 0 Then
- Alert("Se agregó el saldo inicial al personal.")
- Else
- Alert("Ocurrió un error al agregar el saldo inicial.", TipoMensaje.MsgError)
- End If
- ObjMov.Dispose()
- RegistraScript("$('#ModalSaldoInicial').modal('hide');")
- 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
-
-#Region "L I C E N C I A S"
- Public Sub CargaLicencias()
- If CvePersonal > 0 Then
- Dim ObjAF As New ClsAF()
- If ObjAF.GetLicencias(-1, -1, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
- GvLicencias.DataSource = ObjAF.DtResultados
- GvLicencias.DataBind()
- End If
- ObjAF.Dispose()
- UpLicencias.Update()
- Else
- DTLicencias = New DataTable()
- Dim PK As New DataColumn("CveLicencia", GetType(Integer))
- PK.AutoIncrement = True
- PK.AutoIncrementSeed = 1
- PK.AutoIncrementStep = 1
-
- DTLicencias.Columns.Add(PK)
- DTLicencias.Columns.Add("Licencia", GetType(String))
- DTLicencias.Columns.Add("FechaExpedicion", GetType(DateTime))
- DTLicencias.Columns.Add("FechaVencimiento", GetType(DateTime))
- DTLicencias.Columns.Add("Estatus", GetType(Boolean))
- DTLicencias.Columns.Add("EstatusSTR", GetType(String))
-
- GvLicencias.DataSource = DTLicencias
- GvLicencias.DataBind()
- End If
- End Sub
-
- Public Sub EditLicencia_Click(sender As Object, e As EventArgs)
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
-
- HdnModalidadLicencia.Value = "U"
- HdnIDLicencia.Value = GvRow.DataKey("CveLicencia")
- BtnAgregarLicencia.Text = "Actualizar"
- LabelLicencia.InnerText = "Actualizar Licencia"
- TxtLicencia.Text = GvRow.DataKey("Licencia")
- TxtFechaExpLicencia.Text = GvRow.DataKey("FechaExpedicion")
- TxtFechaVencLicencia.Text = GvRow.DataKey("FechaVencimiento")
-
- ChkModalLicenciaEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus").ToString())
-
- UpAddLicencias.Update()
- UpLicencias.Update()
-
- RegistraScript("$('#DivAddLicencias').modal('show');")
- End Sub
-
- Public Sub DeleteLicencia_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- HdnIDLicencia.Value = GvRow.DataKey("CveLicencia")
-
- If CvePersonal > 0 Then
- Dim ObjAF As New ClsAF()
- If ObjAF.RemoveLicencia(HdnIDLicencia.Value.ToEntero) Then
- CargaLicencias()
- Alert("La licencia se eliminó correctamente.", TipoMensaje.MsgInformacion)
- End If
- ObjAF.Dispose()
- Else
- If DTLicencias IsNot Nothing Then
- Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero}")(0)
- DTLicencias.Rows.Remove(Row)
- GvLicencias.DataSource = DTLicencias
- GvLicencias.DataBind()
- Alert("La licencia se eliminó correctamente.", TipoMensaje.MsgInformacion)
- End If
- End If
-
- UpLicencias.Update()
-
- End Sub
-
- Private Sub LnkAddLicencias_Click(sender As Object, e As EventArgs) Handles LnkAddLicencias.Click
- HdnModalidadLicencia.Value = "A"
- BtnAgregarLicencia.Text = "Agregar"
- LabelLicencia.InnerText = "Agregar Licencia"
-
- TxtLicencia.Text = ""
- TxtFechaExpLicencia.Text = ""
- TxtFechaVencLicencia.Text = ""
- ChkModalLicenciaEstatus.Checked = False
-
-
- UpLicencias.Update()
- UpAddLicencias.Update()
- RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddLicencias"))
- End Sub
-
- Private Sub BtnAgregarLicencia_Click(sender As Object, e As EventArgs) Handles BtnAgregarLicencia.Click
- If CvePersonal > 0 Then
- Dim ObjAF As New ClsAF
- If HdnModalidadLicencia.Value = "A" Then
- If ObjAF.AddLicencia(-1, TxtLicencia.Text.Trim, TxtFechaExpLicencia.Text.ToDateTime, TxtFechaVencLicencia.Text.ToDateTime, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal, Estatus:=ChkModalLicenciaEstatus.Checked) Then
- Alert("La licencia se agregó correctamente.", TipoMensaje.MsgInformacion)
- End If
- ElseIf HdnModalidadLicencia.Value = "U" Then
- If ObjAF.UpdateLicencia(HdnIDLicencia.Value.ToEntero, TxtLicencia.Text.Trim, TxtFechaExpLicencia.Text.ToDateTime, TxtFechaVencLicencia.Text.ToDateTime, Estatus:=ChkModalLicenciaEstatus.Checked) Then
- Alert("La licencia se actualizó correctamente.", TipoMensaje.MsgInformacion)
- End If
- End If
- ObjAF.Dispose()
- CargaLicencias()
- Else
- If DTLicencias IsNot Nothing Then
- If HdnModalidadLicencia.Value = "A" Then
- Dim Row = DTLicencias.NewRow()
-
- Row("Licencia") = TxtLicencia.Text.Trim()
- Row("FechaExpedicion") = TxtFechaExpLicencia.Text.ToDateTime()
- Row("FechaVencimiento") = TxtFechaVencLicencia.Text.ToDateTime()
- Row("Estatus") = ChkModalLicenciaEstatus.Checked
-
- Row("EstatusSTR") = If(ChkModalLicenciaEstatus.Checked, "Si", "No")
-
- DTLicencias.Rows.Add(Row)
-
- GvLicencias.DataSource = DTLicencias
- GvLicencias.DataBind()
- UpLicencias.Update()
- Alert("La licencia se agregó correctamente.", TipoMensaje.MsgInformacion)
- ElseIf HdnModalidadLicencia.Value = "U" Then
- Try
- Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero}")(0)
-
- Row("Licencia") = TxtLicencia.Text.Trim()
- Row("FechaExpedicion") = TxtFechaExpLicencia.Text.ToDateTime()
- Row("FechaVencimiento") = TxtFechaVencLicencia.Text.ToDateTime()
- Row("Estatus") = ChkModalLicenciaEstatus.Checked
- Row("EstatusSTR") = If(ChkModalLicenciaEstatus.Checked, "Si", "No")
-
- GvLicencias.DataSource = DTLicencias
- GvLicencias.DataBind()
- UpLicencias.Update()
- Alert("La licencia se actualizó correctamente.", TipoMensaje.MsgInformacion)
- Catch ex As Exception
- Alert("Ocurrió el error al actualizar la licencia.", TipoMensaje.MsgError)
- End Try
-
- End If
-
- End If
- End If
- RegistraScript("$('#DivAddLicencias').modal('hide');")
-
- End Sub
-#End Region
- Protected Sub BtnPDFResguardo_Click(sender As Object, e As EventArgs)
- GenerarPDFResguardosAF()
- End Sub
- Protected Sub BtnExcelResguardo_Click(sender As Object, e As EventArgs)
- GenerarPDFResguardosAF("Excel")
- End Sub
- Protected Sub GenerarPDFResguardosAF(Optional Formato As String = "PDF")
-
- Dim ObjAF As New ClsAF
-
- Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\RepResguardosAF.rdlc", UsuarioActual.Empresa.Ruta))
- Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
- Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
-
- Dim dtVC As DataTable = Nothing
- Dim params As New List(Of ReportParameter)
- Dim dr As DataRow = Nothing
-
- If ObjAF.GetActivosFijosResguardos(-1, -1, CvePersonal, -1, UsuarioImprimio:=UsuarioActual.CveUsuario) Then
- dtVC = ObjAF.DtResultados
- End If
-
- ObjAF.Dispose()
-
- If dtVC.Rows.Count > 0 Then
- dr = dtVC.Rows(0)
-
- 'If UsuarioActual.CveEmpresa.Contiene(72, 119) Then
- 'End If
-
- Dim SBDomicilioSucursal As New StringBuilder()
- Dim DRSucursal = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, CveSubProyecto:=dr("CveSubProyecto").ToString().ToEntero, Estatus:=1).FiltroPrimero("")
-
- If DRSucursal IsNot Nothing Then
- Dim CiudadSucursal As String = String.Format("{0},{1}", DRSucursal("Municipio"), DRSucursal("Estado"))
- Dim DomicilioSucursal As String = ""
-
- SBDomicilioSucursal.AppendFormat("{0}", DRSucursal("Calle"))
- If DRSucursal("NoExt").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", DRSucursal("NoExt").ToString().ToEntero)
- If DRSucursal("NoInt").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", DRSucursal("NoInt").ToString().ToEntero)
- If DRSucursal("Colonia").ToString().Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", DRSucursal("Colonia").ToString())
- If DRSucursal("CP").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", DRSucursal("CP").ToString())
- If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal)
- If DRSucursal("Pais").ToString().Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", DRSucursal("Pais").ToString())
- End If
-
- params.Add(New ReportParameter("NombreResponsable", dr("NombreCompleto").ToString()))
- params.Add(New ReportParameter("RFC", dr("RFC").ToString()))
- params.Add(New ReportParameter("Puesto", dr("Puesto").ToString()))
- params.Add(New ReportParameter("Departamento", dr("Departamento").ToString()))
- params.Add(New ReportParameter("Sucursal", dr("SubProyecto").ToString()))
- params.Add(New ReportParameter("Telefono", dr("Celular").ToString()))
- params.Add(New ReportParameter("DireccionSucursal", SBDomicilioSucursal.ToString()))
- params.Add(New ReportParameter("PuestoUsuarioActual", dr("PuestoUsuarioImprimio").ToString()))
-
- params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
-
- If Imagen.Exists Then
- params.Add(New ReportParameter("LogoPath", logouri))
- Else
- params.Add(New ReportParameter("LogoPath", ""))
- End If
-
-
- If Archivo.Exists Then
- ImprimirPDF(String.Format("{0}Formatos\RepResguardosAF.rdlc", UsuarioActual.Empresa.Ruta), dtVC, params, "PersonalResguardosAF", Formato)
- Else
- ImprimirPDF("Empresas/Grales/Formatos/RepResguardosAF.rdlc", dtVC, params, "PersonalResguardosAF", Formato)
- End If
-
- Else
- Alert("No se encontraron registros .", TipoMensaje.MsgAdvertencia)
- End If
-
- End Sub
-
-
-#Region "FAMILIARES"
-
-
- Private Sub CargaFamiliares()
-
- If CvePersonal <> -1 Then
- Dim objRH As New ClsRH
-
- If objRH.PersonalFamiliaresGet(-1, CvePersonal) Then
-
- If objRH.DtResultados.Rows.Count > 0 Then
- DTFamiliares = objRH.DtResultados
- DTFamiliares.Columns.Add("Accion", Type.GetType("System.String"))
- DTFamiliares.AcceptChanges()
- GvFamiliares.DataSource = DTFamiliares
- Else
- DTFamiliares.Rows.Clear()
- GvFamiliares.DataSource = DTFamiliares
- End If
-
- Else
- GvFamiliares.DataSource = Nothing
- End If
-
- objRH.Dispose()
- GvFamiliares.DataBind()
- UPTabFamiliares.Update()
-
- End If
- 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"))
- Familiares.Columns.Add("Parentesco", Type.GetType("System.String"))
- Familiares.Columns.Add("Nombre", Type.GetType("System.String"))
- Familiares.Columns.Add("Domicilio", Type.GetType("System.String"))
- Familiares.Columns.Add("Edad", Type.GetType("System.Int32"))
- Familiares.Columns.Add("Ocupacion", Type.GetType("System.String"))
- Familiares.Columns.Add("Fecha", Type.GetType("System.DateTime"))
- Familiares.Columns.Add("Usuario", Type.GetType("System.String"))
- Familiares.Columns.Add("Telefono", Type.GetType("System.String"))
- Familiares.Columns.Add("Accion", Type.GetType("System.String"))
- Familiares.Columns.Add("Observaciones", Type.GetType("System.String"))
- Familiares.Columns.Add("Beneficiario", Type.GetType("System.Boolean"))
-
- 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()
-
- ActualizarFamiliar = False
- CveFamiliar = -1
-
- LtlTituloModalFamiliar.Text = "Agregar Familiar"
- BtnAgregarFamiliarModal.Text = "Agregar Familiar"
- TxtNombreFamiliar4.Text = ""
- TxtDomicilioFamiliar4.Text = ""
- TxtEdadFamiliar4.Text = ""
- TxtOcupacionFamiliar4.Text = ""
- TxtTelefonoFamiliar.Text = ""
- TxtObservacionesFamiliar.Text = ""
- DDLParentescoFamiliar4.SelectedIndex = 0
- ChkBeneficiario.Checked = False
-
- UpModalFamiliar.Update()
-
- End Sub
-
- Protected Sub BtnAgregarFamiliarModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliarModal.Click
-
- If ActualizarFamiliar Then
-
- 'DtRowFamiliar("CveFamiliar") = -1
- DTFamiliares(IndexActual)("CvePersonal") = -1
- DTFamiliares(IndexActual)("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text
- DTFamiliares(IndexActual)("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero
- DTFamiliares(IndexActual)("Nombre") = TxtNombreFamiliar4.Text.Trim
- DTFamiliares(IndexActual)("Domicilio") = TxtDomicilioFamiliar4.Text.Trim
- DTFamiliares(IndexActual)("Edad") = TxtEdadFamiliar4.Text.ToEntero
- DTFamiliares(IndexActual)("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim
- DTFamiliares(IndexActual)("Telefono") = TxtTelefonoFamiliar.Text.Trim
- DTFamiliares(IndexActual)("Observaciones") = TxtObservacionesFamiliar.Text.Trim
- DTFamiliares(IndexActual)("Beneficiario") = ChkBeneficiario.Checked
-
- If DTFamiliares(IndexActual)("CveFamiliar").ToString() = "-1" Then
- DTFamiliares(IndexActual)("Accion") = "2"
- Else
- DTFamiliares(IndexActual)("Accion") = "1"
- End If
-
- DTFamiliares.AcceptChanges()
-
- Else
-
- Dim DtRowFamiliar As DataRow
- DtRowFamiliar = DTFamiliares.NewRow
-
- DtRowFamiliar("CveFamiliar") = -1
- DtRowFamiliar("CvePersonal") = -1
- DtRowFamiliar("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text
- DtRowFamiliar("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero
- DtRowFamiliar("Nombre") = TxtNombreFamiliar4.Text.Trim
- DtRowFamiliar("Domicilio") = TxtDomicilioFamiliar4.Text.Trim
- DtRowFamiliar("Edad") = TxtEdadFamiliar4.Text.ToEntero
- DtRowFamiliar("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim
- DtRowFamiliar("Telefono") = TxtTelefonoFamiliar.Text.Trim
- DtRowFamiliar("Observaciones") = TxtObservacionesFamiliar.Text.Trim
- DtRowFamiliar("Beneficiario") = ChkBeneficiario.Checked
-
- DtRowFamiliar("Accion") = "2"
-
- DTFamiliares.Rows.Add(DtRowFamiliar)
- DTFamiliares.AcceptChanges()
-
- End If
-
- IndexActual = -1
-
-
- RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarFamiliar"))
- 'CargaFamiliares()
-
- GvFamiliares.DataSource = DTFamiliares
- GvFamiliares.DataBind()
- UPTabFamiliares.Update()
-
- CveFamiliar = -1
- ActualizarFamiliar = False
-
- 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
-
- CveFamiliar = GvRow.DataKey("CveFamiliar").ToString().ToEntero
- ActualizarFamiliar = True
- IndexActual = GvRow.RowIndex
-
- LtlTituloModalFamiliar.Text = "Editar Familiar"
- BtnAgregarFamiliarModal.Text = "Actualizar"
-
- TxtNombreFamiliar4.Text = GvRow.DataKey("Nombre")
- DDLParentescoFamiliar4.SelectedValueExist(GvRow.DataKey("CveParentesco"))
- TxtDomicilioFamiliar4.Text = GvRow.DataKey("Domicilio")
- TxtEdadFamiliar4.Text = GvRow.DataKey("Edad")
- TxtOcupacionFamiliar4.Text = GvRow.DataKey("Ocupacion")
- TxtTelefonoFamiliar.Text = GvRow.DataKey("Telefono")
- TxtObservacionesFamiliar.Text = GvRow.DataKey("Observaciones")
- ChkBeneficiario.Checked = Boolean.Parse(GvRow.DataKey("Beneficiario").ToString())
-
- UpModalFamiliar.Update()
- RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
-
- End Sub
-
-
- Public Sub Remove_ClickFamiliar(sender As Object, e As EventArgs)
-
-
-
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- IndexActual = GvRow.RowIndex
- Dim activo As Boolean = False
- Dim CveFamiliar As Integer = GvRow.DataKey("CveFamiliar").ToString().ToEntero
-
- If CveFamiliar > 0 Then
-
- DTFamiliares.Rows(IndexActual)("Accion") = "3"
- Dim objRH As New ClsRH
- ProcesaDTFamiliares(objRH)
- objRH.Dispose()
-
- CargaFamiliares()
-
-
-
- Else
- DTFamiliares.Rows(IndexActual).Delete()
- DTFamiliares.AcceptChanges()
- GvFamiliares.DataSource = DTFamiliares
- GvFamiliares.DataBind()
- UPTabFamiliares.Update()
- End If
- IndexActual = -1
-
- 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
-
-
- 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())
-
-
-
- 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
-
- If dRow("CveParentesco").ToString().ToEntero = 1 Then
- ValPadre = True
- End If
-
- If dRow("CveParentesco").ToString().ToEntero = 2 Then
- ValMadre = True
- End If
-
- If dRow("Accion").ToString() = "3" Then 'Borra
- objRH.PersonalFamiliaresRemove(dRow("CveFamiliar").ToString().ToEntero, -1)
- End If
-
- Next
-
- '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
- Protected Sub LnkGuardarFonacot_Click(sender As Object, e As EventArgs)
- Dim importe As Double = TxtFonValor.Text.ToDouble()
- Dim TipoAplicacion As Integer = DdlFonTipoAplicacion.SelectedValue.ToEntero()
- Dim NoPagos As Integer = 0
- Dim SaldoIni As Double = 0
- Dim descripcion02 As String = TxtFonDescripcion.Text
- Dim descripcion01 As String = TxtFonNumCredito.Text
- Dim fecha As String = TxtFonFechaInicio.Text.Replace("_", "")
- Dim estatus As Integer = If(ChkFonacot.Checked, 1, 0)
-
- If fecha.Length > 8 Then
- fecha = fecha.ToDateTime().ToString("yyyy/MM/dd")
- Else
- fecha = ""
- End If
-
- Dim continuar As Boolean = True
-
- Using ObjPersonal As ClsRH = New ClsRH()
- If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 4, descripcion01, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then continuar = False
- End Using
-
- If continuar Then
- Alert("Se actualizo el calculo de fonacot")
- End If
- End Sub
- Protected Sub LnkCalcularFactor_Click(sender As Object, e As EventArgs)
- getdatosFI()
- RegistraScript("$('#DmodalFactordeIntegraccion').modal()")
- End Sub
- Private Sub getdatosFI()
-
- If TxtFIAguinaldo.Text = "0" Or TxtFIAguinaldo.Text = "" Or TxtFIAguinaldo.Text = "-1" Then
- TxtFIAguinaldo.Text = "15"
- End If
- If TxtFIPrimaVacacional.Text = "0" Or TxtFIPrimaVacacional.Text = "" Or TxtFIAguinaldo.Text = "-1" Then
- TxtFIPrimaVacacional.Text = "25"
+ If e.Row.RowType = DataControlRowType.Header Then
+ 'Cambiar Header
End If
- TxtFISalariodiario.Text = TxtSalarioDiario.Text
- TxtFactordeIntegracion.Text = ""
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ Dim FechaI, FechaF As String
+ FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), "-1")
+ FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), "-1")
+
+ Dim Liga As String = $"/Compras/Compras.aspx?CveCompra={e.Row.DBCampo("CveCompra")}"
+
+ If e.Row.DBCampo("Orden") = "1" Then
+ e.Row.Cells(0).Text = String.Format("{2}", "Texto", Liga, e.Row.DBCampo("SerieFolio").ToString())
+ Else
+ e.Row.BackColor = Drawing.Color.LightGray
+ End If
+
+ End If
+ End Sub
+ 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}/", 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"
+ End If
+
+ Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+ Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
+ Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
+
+ params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
+ 'params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
+
+ Dim ObjPersonal As New ClsRH()
+ If ObjPersonal.GetPersonal(CvePersonal, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
+ If ObjPersonal.DtResultados.Rows.Count > 0 Then
+ CodigoP = ObjPersonal.Codigo
+ NombreCompletoP = ObjPersonal.NombreCompleto
+ params.Add(New ReportParameter("NombrePersonal", ObjPersonal.NombreCompleto))
+ params.Add(New ReportParameter("CodigoPersonal", ObjPersonal.Codigo))
+ End If
+ End If
+ ObjPersonal.Dispose()
+
+ params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
+ params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()))
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("pImg", logouri))
+ Else
+ params.Add(New ReportParameter("pImg", ""))
+ End If
+ ImprimirPDF(RutaPDF, DTConsumos, params, $"RepConsumoPersonal - {CodigoP} {NombreCompletoP}", Formato)
+ End Sub
+ Protected Sub LnkImprimirPDFConsumo_Click(sender As Object, e As EventArgs)
+ GenerarPDFConsumo()
+ End Sub
+
+#End Region
+
+#Region ""
+ Protected Sub LbMail_Click(sender As Object, e As EventArgs)
+
+ Dim gvr As GridViewRow = CType(CType(sender, LinkButton).BindingContainer, GridViewRow)
+
+ If gvr.DataKey("SeTimbro") = "True" Then
+
+ Dim NombreComercial = UsuarioActual.Empresa.Empresa
+ Dim SerieFolio = gvr.DataKey("SerieFolio").ToString()
+ Dim Destinatario = gvr.DataKey("Correo").ToString()
+ Dim Personal = gvr.DataKey("Nombre").ToString()
+ Dim fechai = gvr.DataKey("FechaInicio").ToString().ToDate.ToShortDateString
+ Dim fechaf = gvr.DataKey("FechaFin").ToString().ToDate.ToShortDateString
+ Dim cvePeriodo = gvr.DataKey("CvePeriodo").ToString().ToEntero
+
+ If UsuarioActual.CveRol = 1 Then
+ Alert("Parametros:" + NombreComercial + " " + SerieFolio + " " + Destinatario + " " + Personal + " " + fechai + " " + fechaf)
+ End If
+ MandaCorreo(NombreComercial, SerieFolio, Destinatario, Personal, fechai, fechaf, cvePeriodo)
+ End If
+
+
+
+ End Sub
+
+ Private Sub MandaCorreo(NombreComercial As String, SerieFolio As String, Destinatario As String, Optional Personal As String = "", Optional FechaI As String = "", Optional FechaF As String = "", Optional CvePeriodo As Integer = -1)
+
+ Dim RutaXml As String = String.Format("{0}XML\Nomina\{1}.xml", UsuarioActual.Empresa.Ruta, SerieFolio)
+ Dim RutaPdf As String = String.Format("{0}PDF\Nomina\{1}.pdf", UsuarioActual.Empresa.Ruta, SerieFolio)
+
+ If Destinatario.Length > 0 Then
+
+ Dim Correo As New ClsSisMail()
+ Dim Asunto As String = "Comprobante de Nómina"
+ Dim Cuerpo As New StringBuilder
+
+ Cuerpo.AppendFormat("Estimado {0} Por este medio le hacemos llegar los comprobantes fiscales de su nomina, correspondiente al periodo del {1} al {2}
", Personal, FechaI, FechaF)
+ Cuerpo.AppendFormat(" {0}", NombreComercial)
+
+ Dim Xml As New ClsSisMail.ArchivoMail
+ Dim Pdf As New ClsSisMail.ArchivoMail
+ Dim ListaAdjuntos As New List(Of ClsSisMail.ArchivoMail)
+
+ If File.Exists(RutaXml) Then
+ 'Xml.ArchivoBinario() = File.ReadAllBytes(RutaXml)
+ Xml.Ruta = RutaXml
+
+ Xml.NombreArchivo = New FileInfo(SerieFolio + ".Xml").Name
+
+ ListaAdjuntos.Add(Xml)
+ End If
+
+ If Not File.Exists(RutaPdf) Then
+ GeneraPDFNomina(CvePersonal, CvePeriodo, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)
+ End If
+
+ If File.Exists(RutaPdf) Then
+ 'Pdf.ArchivoBinario() = File.ReadAllBytes(RutaPdf)
+ Pdf.Ruta = RutaPdf
+
+ Pdf.NombreArchivo = New FileInfo(SerieFolio + ".Pdf").Name
+
+ ListaAdjuntos.Add(Pdf)
+ End If
+
+
+ If ListaAdjuntos.Count > 0 Then
+ If Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString(), Archivos:=ListaAdjuntos) Then
+ Alert("Correo enviado existosamente a " & Destinatario)
+ Else
+ Alert("Se presento un error al enviar el correo a " & Destinatario)
+ End If
+ Else
+ If Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString()) Then
+ Alert("Correo enviado existosamente a " & Destinatario)
+ Else
+ Alert("Se presento un error al adjuntar comprobantes")
+ End If
+ End If
+ Else
+
+ End If
+
+ End Sub
+#End Region
+
+#Region "VIATICOS"
+ Protected Sub CargaViaticosPersonal()
+ Dim ObjBancos As ClsBancos = New ClsBancos
+
+ If ObjBancos.GetSolicitudesViaticos(-1, UsuarioActual.CveEmpresa, -1, CvePersonal) Then
+ GVViaticos.DataSource = ObjBancos.DtResultados
+ GVViaticos.DataBind()
+ End If
+
+ ObjBancos.Dispose()
+ End Sub
+
+ Protected Sub LnkViaticoDetalle_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim CveSolicitudViatico As Integer = GvRow.DataKey("CveSolicitudViatico").ToEntero
+ CargaViaticosDetalle(CveSolicitudViatico)
+ RegistraScript("$('#DivViaticoDetalle').modal({ backdrop: 'static', keyboard: false});")
+ End Sub
+
+ Protected Sub CargaViaticosDetalle(CveSolicitudViativo As Integer)
+ Dim ObjBancos As ClsBancos = New ClsBancos
+ If ObjBancos.GetSolicitudesViaticosDetalle(CveSolicitudViativo, -1) Then
+ DTViaticosDetalle = ObjBancos.DtResultados
+ GVViaticoDetalle.DataSource = DTViaticosDetalle
+ GVViaticoDetalle.DataBind()
+ End If
+ ObjBancos.Dispose()
+ UpViaticoDetalle.Update()
+ End Sub
+
+ Protected Sub GVViaticoDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If (e.Row.RowType = DataControlRowType.Footer) Then
+ e.Row.FCLiteral("LtTotalImporte").Text = DTViaticosDetalle.SUM("Importe").FormatoNumero()
+ End If
+ End Sub
+#End Region
+
+#Region "BITACORA"
+
+ Private Sub CargaGvBitacora()
+
+ If CvePersonal > 0 Then
+ Dim ObjGral As New ClsGenerales()
+ If ObjGral.GetHistorialBitacora(-1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
+ GvBitacora.DataSource = ObjGral.DtResultados
+ End If
+ ObjGral.Dispose()
+ GvBitacora.DataBind()
+ UpHistorialModificacion.Update()
+ End If
+
+ End Sub
+
+#End Region
+
+#Region "PAGO DE FACTURAS"
+
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+ CargaPagoFactura()
+ UpnHistorial.Update()
+ End Sub
+
+ Private Sub CargaPagoFactura()
+ Dim ObjRH As New ClsRH
+ If ObjRH.GetPersonalPagoFactura(CvePersonal, TxtFechaICredito.Text.ToDate, TxtFechaFCredito.Text.ToDate, UsuarioActual.CveEmpresa) Then
+ GVPagoFactura.DataSource = ObjRH.DtResultados
+ End If
+ ObjRH.Dispose()
+ GVPagoFactura.DataBind()
+ 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()
+
+ Dim ObjMov As New ClsContabilidad()
+ If AgregarSaldoInicial(SaldoInicial, Fecha, 1, ObjMov) > 0 Then
+ Alert("Se agregó el saldo inicial al personal.")
+ Else
+ Alert("Ocurrió un error al agregar el saldo inicial.", TipoMensaje.MsgError)
+ End If
+ ObjMov.Dispose()
+ RegistraScript("$('#ModalSaldoInicial').modal('hide');")
+ 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
+
+#Region "L I C E N C I A S"
+ Public Sub CargaLicencias()
+ If CvePersonal > 0 Then
+ Dim ObjAF As New ClsAF()
+ If ObjAF.GetLicencias(-1, -1, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) Then
+ GvLicencias.DataSource = ObjAF.DtResultados
+ GvLicencias.DataBind()
+ End If
+ ObjAF.Dispose()
+ UpLicencias.Update()
+ Else
+ DTLicencias = New DataTable()
+ Dim PK As New DataColumn("CveLicencia", GetType(Integer))
+ PK.AutoIncrement = True
+ PK.AutoIncrementSeed = 1
+ PK.AutoIncrementStep = 1
+
+ DTLicencias.Columns.Add(PK)
+ DTLicencias.Columns.Add("Licencia", GetType(String))
+ DTLicencias.Columns.Add("FechaExpedicion", GetType(DateTime))
+ DTLicencias.Columns.Add("FechaVencimiento", GetType(DateTime))
+ DTLicencias.Columns.Add("Estatus", GetType(Boolean))
+ DTLicencias.Columns.Add("EstatusSTR", GetType(String))
+
+ GvLicencias.DataSource = DTLicencias
+ GvLicencias.DataBind()
+ End If
+ End Sub
+
+ Public Sub EditLicencia_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ HdnModalidadLicencia.Value = "U"
+ HdnIDLicencia.Value = GvRow.DataKey("CveLicencia")
+ BtnAgregarLicencia.Text = "Actualizar"
+ LabelLicencia.InnerText = "Actualizar Licencia"
+ TxtLicencia.Text = GvRow.DataKey("Licencia")
+ TxtFechaExpLicencia.Text = GvRow.DataKey("FechaExpedicion")
+ TxtFechaVencLicencia.Text = GvRow.DataKey("FechaVencimiento")
+
+ ChkModalLicenciaEstatus.Checked = Boolean.Parse(GvRow.DataKey("Estatus").ToString())
+
+ UpAddLicencias.Update()
+ UpLicencias.Update()
+
+ RegistraScript("$('#DivAddLicencias').modal('show');")
+ End Sub
+
+ Public Sub DeleteLicencia_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ HdnIDLicencia.Value = GvRow.DataKey("CveLicencia")
+
+ If CvePersonal > 0 Then
+ Dim ObjAF As New ClsAF()
+ If ObjAF.RemoveLicencia(HdnIDLicencia.Value.ToEntero) Then
+ CargaLicencias()
+ Alert("La licencia se eliminó correctamente.", TipoMensaje.MsgInformacion)
+ End If
+ ObjAF.Dispose()
+ Else
+ If DTLicencias IsNot Nothing Then
+ Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero}")(0)
+ DTLicencias.Rows.Remove(Row)
+ GvLicencias.DataSource = DTLicencias
+ GvLicencias.DataBind()
+ Alert("La licencia se eliminó correctamente.", TipoMensaje.MsgInformacion)
+ End If
+ End If
+
+ UpLicencias.Update()
+
+ End Sub
+
+ Private Sub LnkAddLicencias_Click(sender As Object, e As EventArgs) Handles LnkAddLicencias.Click
+ HdnModalidadLicencia.Value = "A"
+ BtnAgregarLicencia.Text = "Agregar"
+ LabelLicencia.InnerText = "Agregar Licencia"
+
+ TxtLicencia.Text = ""
+ TxtFechaExpLicencia.Text = ""
+ TxtFechaVencLicencia.Text = ""
+ ChkModalLicenciaEstatus.Checked = False
+
+
+ UpLicencias.Update()
+ UpAddLicencias.Update()
+ RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddLicencias"))
+ End Sub
+
+ Private Sub BtnAgregarLicencia_Click(sender As Object, e As EventArgs) Handles BtnAgregarLicencia.Click
+ If CvePersonal > 0 Then
+ Dim ObjAF As New ClsAF
+ If HdnModalidadLicencia.Value = "A" Then
+ If ObjAF.AddLicencia(-1, TxtLicencia.Text.Trim, TxtFechaExpLicencia.Text.ToDateTime, TxtFechaVencLicencia.Text.ToDateTime, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal, Estatus:=ChkModalLicenciaEstatus.Checked) Then
+ Alert("La licencia se agregó correctamente.", TipoMensaje.MsgInformacion)
+ End If
+ ElseIf HdnModalidadLicencia.Value = "U" Then
+ If ObjAF.UpdateLicencia(HdnIDLicencia.Value.ToEntero, TxtLicencia.Text.Trim, TxtFechaExpLicencia.Text.ToDateTime, TxtFechaVencLicencia.Text.ToDateTime, Estatus:=ChkModalLicenciaEstatus.Checked) Then
+ Alert("La licencia se actualizó correctamente.", TipoMensaje.MsgInformacion)
+ End If
+ End If
+ ObjAF.Dispose()
+ CargaLicencias()
+ Else
+ If DTLicencias IsNot Nothing Then
+ If HdnModalidadLicencia.Value = "A" Then
+ Dim Row = DTLicencias.NewRow()
+
+ Row("Licencia") = TxtLicencia.Text.Trim()
+ Row("FechaExpedicion") = TxtFechaExpLicencia.Text.ToDateTime()
+ Row("FechaVencimiento") = TxtFechaVencLicencia.Text.ToDateTime()
+ Row("Estatus") = ChkModalLicenciaEstatus.Checked
+
+ Row("EstatusSTR") = If(ChkModalLicenciaEstatus.Checked, "Si", "No")
+
+ DTLicencias.Rows.Add(Row)
+
+ GvLicencias.DataSource = DTLicencias
+ GvLicencias.DataBind()
+ UpLicencias.Update()
+ Alert("La licencia se agregó correctamente.", TipoMensaje.MsgInformacion)
+ ElseIf HdnModalidadLicencia.Value = "U" Then
+ Try
+ Dim Row = DTLicencias.Select($"CveLicencia = {HdnIDLicencia.Value.ToEntero}")(0)
+
+ Row("Licencia") = TxtLicencia.Text.Trim()
+ Row("FechaExpedicion") = TxtFechaExpLicencia.Text.ToDateTime()
+ Row("FechaVencimiento") = TxtFechaVencLicencia.Text.ToDateTime()
+ Row("Estatus") = ChkModalLicenciaEstatus.Checked
+ Row("EstatusSTR") = If(ChkModalLicenciaEstatus.Checked, "Si", "No")
+
+ GvLicencias.DataSource = DTLicencias
+ GvLicencias.DataBind()
+ UpLicencias.Update()
+ Alert("La licencia se actualizó correctamente.", TipoMensaje.MsgInformacion)
+ Catch ex As Exception
+ Alert("Ocurrió el error al actualizar la licencia.", TipoMensaje.MsgError)
+ End Try
+
+ End If
+
+ End If
+ End If
+ RegistraScript("$('#DivAddLicencias').modal('hide');")
+
+ End Sub
+#End Region
+ Protected Sub BtnPDFResguardo_Click(sender As Object, e As EventArgs)
+ GenerarPDFResguardosAF()
+ End Sub
+ Protected Sub BtnExcelResguardo_Click(sender As Object, e As EventArgs)
+ GenerarPDFResguardosAF("Excel")
+ End Sub
+ Protected Sub GenerarPDFResguardosAF(Optional Formato As String = "PDF")
+
+ Dim ObjAF As New ClsAF
+
+ Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\RepResguardosAF.rdlc", UsuarioActual.Empresa.Ruta))
+ Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
+ Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
+
+ Dim dtVC As DataTable = Nothing
+ Dim params As New List(Of ReportParameter)
+ Dim dr As DataRow = Nothing
+
+ If ObjAF.GetActivosFijosResguardos(-1, -1, CvePersonal, -1, UsuarioImprimio:=UsuarioActual.CveUsuario) Then
+ dtVC = ObjAF.DtResultados
+ End If
+
+ ObjAF.Dispose()
+
+ If dtVC.Rows.Count > 0 Then
+ dr = dtVC.Rows(0)
+
+ 'If UsuarioActual.CveEmpresa.Contiene(72, 119) Then
+ 'End If
+
+ Dim SBDomicilioSucursal As New StringBuilder()
+ Dim DRSucursal = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa, CveSubProyecto:=dr("CveSubProyecto").ToString().ToEntero, Estatus:=1).FiltroPrimero("")
+
+ If DRSucursal IsNot Nothing Then
+ Dim CiudadSucursal As String = String.Format("{0},{1}", DRSucursal("Municipio"), DRSucursal("Estado"))
+ Dim DomicilioSucursal As String = ""
+
+ SBDomicilioSucursal.AppendFormat("{0}", DRSucursal("Calle"))
+ If DRSucursal("NoExt").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", DRSucursal("NoExt").ToString().ToEntero)
+ If DRSucursal("NoInt").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", DRSucursal("NoInt").ToString().ToEntero)
+ If DRSucursal("Colonia").ToString().Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", DRSucursal("Colonia").ToString())
+ If DRSucursal("CP").ToString().ToEntero > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", DRSucursal("CP").ToString())
+ If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal)
+ If DRSucursal("Pais").ToString().Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", DRSucursal("Pais").ToString())
+ End If
+
+ params.Add(New ReportParameter("NombreResponsable", dr("NombreCompleto").ToString()))
+ params.Add(New ReportParameter("RFC", dr("RFC").ToString()))
+ params.Add(New ReportParameter("Puesto", dr("Puesto").ToString()))
+ params.Add(New ReportParameter("Departamento", dr("Departamento").ToString()))
+ params.Add(New ReportParameter("Sucursal", dr("SubProyecto").ToString()))
+ params.Add(New ReportParameter("Telefono", dr("Celular").ToString()))
+ params.Add(New ReportParameter("DireccionSucursal", SBDomicilioSucursal.ToString()))
+ params.Add(New ReportParameter("PuestoUsuarioActual", dr("PuestoUsuarioImprimio").ToString()))
+
+ params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
+ params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("LogoPath", logouri))
+ Else
+ params.Add(New ReportParameter("LogoPath", ""))
+ End If
+
+
+ If Archivo.Exists Then
+ ImprimirPDF(String.Format("{0}Formatos\RepResguardosAF.rdlc", UsuarioActual.Empresa.Ruta), dtVC, params, "PersonalResguardosAF", Formato)
+ Else
+ ImprimirPDF("Empresas/Grales/Formatos/RepResguardosAF.rdlc", dtVC, params, "PersonalResguardosAF", Formato)
+ End If
+
+ Else
+ Alert("No se encontraron registros .", TipoMensaje.MsgAdvertencia)
+ End If
+
+ End Sub
+
+
+#Region "FAMILIARES"
+
+
+ Private Sub CargaFamiliares()
+
+ If CvePersonal <> -1 Then
+ Dim objRH As New ClsRH
+
+ If objRH.PersonalFamiliaresGet(-1, CvePersonal) Then
+
+ If objRH.DtResultados.Rows.Count > 0 Then
+ DTFamiliares = objRH.DtResultados
+ DTFamiliares.Columns.Add("Accion", Type.GetType("System.String"))
+ DTFamiliares.AcceptChanges()
+ GvFamiliares.DataSource = DTFamiliares
+ Else
+ DTFamiliares.Rows.Clear()
+ GvFamiliares.DataSource = DTFamiliares
+ End If
+
+ Else
+ GvFamiliares.DataSource = Nothing
+ End If
+
+ objRH.Dispose()
+ GvFamiliares.DataBind()
+ UPTabFamiliares.Update()
+
+ End If
+ 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"))
+ Familiares.Columns.Add("Parentesco", Type.GetType("System.String"))
+ Familiares.Columns.Add("Nombre", Type.GetType("System.String"))
+ Familiares.Columns.Add("Domicilio", Type.GetType("System.String"))
+ Familiares.Columns.Add("Edad", Type.GetType("System.Int32"))
+ Familiares.Columns.Add("Ocupacion", Type.GetType("System.String"))
+ Familiares.Columns.Add("Fecha", Type.GetType("System.DateTime"))
+ Familiares.Columns.Add("Usuario", Type.GetType("System.String"))
+ Familiares.Columns.Add("Telefono", Type.GetType("System.String"))
+ Familiares.Columns.Add("Accion", Type.GetType("System.String"))
+ Familiares.Columns.Add("Observaciones", Type.GetType("System.String"))
+ Familiares.Columns.Add("Beneficiario", Type.GetType("System.Boolean"))
+
+ 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()
+
+ ActualizarFamiliar = False
+ CveFamiliar = -1
+
+ LtlTituloModalFamiliar.Text = "Agregar Familiar"
+ BtnAgregarFamiliarModal.Text = "Agregar Familiar"
+ TxtNombreFamiliar4.Text = ""
+ TxtDomicilioFamiliar4.Text = ""
+ TxtEdadFamiliar4.Text = ""
+ TxtOcupacionFamiliar4.Text = ""
+ TxtTelefonoFamiliar.Text = ""
+ TxtObservacionesFamiliar.Text = ""
+ DDLParentescoFamiliar4.SelectedIndex = 0
+ ChkBeneficiario.Checked = False
+
+ UpModalFamiliar.Update()
+
+ End Sub
+
+ Protected Sub BtnAgregarFamiliarModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFamiliarModal.Click
+
+ If ActualizarFamiliar Then
+
+ 'DtRowFamiliar("CveFamiliar") = -1
+ DTFamiliares(IndexActual)("CvePersonal") = -1
+ DTFamiliares(IndexActual)("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text
+ DTFamiliares(IndexActual)("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero
+ DTFamiliares(IndexActual)("Nombre") = TxtNombreFamiliar4.Text.Trim
+ DTFamiliares(IndexActual)("Domicilio") = TxtDomicilioFamiliar4.Text.Trim
+ DTFamiliares(IndexActual)("Edad") = TxtEdadFamiliar4.Text.ToEntero
+ DTFamiliares(IndexActual)("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim
+ DTFamiliares(IndexActual)("Telefono") = TxtTelefonoFamiliar.Text.Trim
+ DTFamiliares(IndexActual)("Observaciones") = TxtObservacionesFamiliar.Text.Trim
+ DTFamiliares(IndexActual)("Beneficiario") = ChkBeneficiario.Checked
+
+ If DTFamiliares(IndexActual)("CveFamiliar").ToString() = "-1" Then
+ DTFamiliares(IndexActual)("Accion") = "2"
+ Else
+ DTFamiliares(IndexActual)("Accion") = "1"
+ End If
+
+ DTFamiliares.AcceptChanges()
+
+ Else
+
+ Dim DtRowFamiliar As DataRow
+ DtRowFamiliar = DTFamiliares.NewRow
+
+ DtRowFamiliar("CveFamiliar") = -1
+ DtRowFamiliar("CvePersonal") = -1
+ DtRowFamiliar("Parentesco") = DDLParentescoFamiliar4.SelectedItem.Text
+ DtRowFamiliar("CveParentesco") = DDLParentescoFamiliar4.SelectedValue.ToEntero
+ DtRowFamiliar("Nombre") = TxtNombreFamiliar4.Text.Trim
+ DtRowFamiliar("Domicilio") = TxtDomicilioFamiliar4.Text.Trim
+ DtRowFamiliar("Edad") = TxtEdadFamiliar4.Text.ToEntero
+ DtRowFamiliar("Ocupacion") = TxtOcupacionFamiliar4.Text.Trim
+ DtRowFamiliar("Telefono") = TxtTelefonoFamiliar.Text.Trim
+ DtRowFamiliar("Observaciones") = TxtObservacionesFamiliar.Text.Trim
+ DtRowFamiliar("Beneficiario") = ChkBeneficiario.Checked
+
+ DtRowFamiliar("Accion") = "2"
+
+ DTFamiliares.Rows.Add(DtRowFamiliar)
+ DTFamiliares.AcceptChanges()
+
+ End If
+
+ IndexActual = -1
+
+
+ RegistraScript(String.Format("$('#{0}').modal('hide');", "divAgregarFamiliar"))
+ 'CargaFamiliares()
+
+ GvFamiliares.DataSource = DTFamiliares
+ GvFamiliares.DataBind()
+ UPTabFamiliares.Update()
+
+ CveFamiliar = -1
+ ActualizarFamiliar = False
+
+ 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
+
+ CveFamiliar = GvRow.DataKey("CveFamiliar").ToString().ToEntero
+ ActualizarFamiliar = True
+ IndexActual = GvRow.RowIndex
+
+ LtlTituloModalFamiliar.Text = "Editar Familiar"
+ BtnAgregarFamiliarModal.Text = "Actualizar"
+
+ TxtNombreFamiliar4.Text = GvRow.DataKey("Nombre")
+ DDLParentescoFamiliar4.SelectedValueExist(GvRow.DataKey("CveParentesco"))
+ TxtDomicilioFamiliar4.Text = GvRow.DataKey("Domicilio")
+ TxtEdadFamiliar4.Text = GvRow.DataKey("Edad")
+ TxtOcupacionFamiliar4.Text = GvRow.DataKey("Ocupacion")
+ TxtTelefonoFamiliar.Text = GvRow.DataKey("Telefono")
+ TxtObservacionesFamiliar.Text = GvRow.DataKey("Observaciones")
+ ChkBeneficiario.Checked = Boolean.Parse(GvRow.DataKey("Beneficiario").ToString())
+
+ UpModalFamiliar.Update()
+ RegistraScript("$('#divAgregarFamiliar').modal({ backdrop: 'static', keyboard: false});")
+
+ End Sub
+
+
+ Public Sub Remove_ClickFamiliar(sender As Object, e As EventArgs)
+
+
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ IndexActual = GvRow.RowIndex
+ Dim activo As Boolean = False
+ Dim CveFamiliar As Integer = GvRow.DataKey("CveFamiliar").ToString().ToEntero
+
+ If CveFamiliar > 0 Then
+
+ DTFamiliares.Rows(IndexActual)("Accion") = "3"
+ Dim objRH As New ClsRH
+ ProcesaDTFamiliares(objRH)
+ objRH.Dispose()
+
+ CargaFamiliares()
+
+
+
+ Else
+ DTFamiliares.Rows(IndexActual).Delete()
+ DTFamiliares.AcceptChanges()
+ GvFamiliares.DataSource = DTFamiliares
+ GvFamiliares.DataBind()
+ UPTabFamiliares.Update()
+ End If
+ IndexActual = -1
+
+ 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
+
+
+ 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())
+
+
+
+ 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
+
+ If dRow("CveParentesco").ToString().ToEntero = 1 Then
+ ValPadre = True
+ End If
+
+ If dRow("CveParentesco").ToString().ToEntero = 2 Then
+ ValMadre = True
+ End If
+
+ If dRow("Accion").ToString() = "3" Then 'Borra
+ objRH.PersonalFamiliaresRemove(dRow("CveFamiliar").ToString().ToEntero, -1)
+ End If
+
+ Next
+
+ '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
+ Protected Sub LnkGuardarFonacot_Click(sender As Object, e As EventArgs)
+ Dim importe As Double = TxtFonValor.Text.ToDouble()
+ Dim TipoAplicacion As Integer = DdlFonTipoAplicacion.SelectedValue.ToEntero()
+ Dim NoPagos As Integer = 0
+ Dim SaldoIni As Double = 0
+ Dim descripcion02 As String = TxtFonDescripcion.Text
+ Dim descripcion01 As String = TxtFonNumCredito.Text
+ Dim fecha As String = TxtFonFechaInicio.Text.Replace("_", "")
+ Dim estatus As Integer = If(ChkFonacot.Checked, 1, 0)
+
+ If fecha.Length > 8 Then
+ fecha = fecha.ToDateTime().ToString("yyyy/MM/dd")
+ Else
+ fecha = ""
+ End If
+
+ Dim continuar As Boolean = True
+
+ Using ObjPersonal As ClsRH = New ClsRH()
+ If Not ObjPersonal.AddConcepto(CvePersonal, -1, importe, TipoAplicacion, NoPagos, SaldoIni, UsuarioActual.CveUsuario, 4, descripcion01, descripcion02, fecha, "", estatus, UsuarioActual.CveEmpresa) Then continuar = False
+ End Using
+
+ If continuar Then
+ Alert("Se actualizo el calculo de fonacot")
+ End If
+ End Sub
+ Protected Sub LnkCalcularFactor_Click(sender As Object, e As EventArgs)
+ getdatosFI()
+ RegistraScript("$('#DmodalFactordeIntegraccion').modal()")
+ End Sub
+ Private Sub getdatosFI()
+
+ If TxtFIAguinaldo.Text = "0" Or TxtFIAguinaldo.Text = "" Or TxtFIAguinaldo.Text = "-1" Then
+ TxtFIAguinaldo.Text = "15"
+ End If
+ If TxtFIPrimaVacacional.Text = "0" Or TxtFIPrimaVacacional.Text = "" Or TxtFIAguinaldo.Text = "-1" Then
+ TxtFIPrimaVacacional.Text = "25"
+ End If
+
+ TxtFISalariodiario.Text = TxtSalarioDiario.Text
+ TxtFactordeIntegracion.Text = ""
TxtFISalarioDiarioIntegrado.Text = ""
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
TxtFIDiasVacaciones.Text = "6"
@@ -6251,49 +6257,49 @@ Partial Class RH_Personal
End If
End If
End Using
- End If
+ End If
UpFactordeintegracion.Update()
- End Sub
+ End Sub
Private Sub calcularSDI()
- Dim SD As Decimal = TxtFISalariodiario.Text.ToDecimal()
- Dim primav As Decimal = TxtFIPrimaVacacional.Text.ToDecimal()
- Dim DiasVacaciones As Decimal = TxtFIDiasVacaciones.Text.ToDecimal()
- Dim diasaguinaldo As Decimal = TxtFIAguinaldo.Text.ToDecimal()
- Dim FI As Decimal = (365 + diasaguinaldo + (DiasVacaciones * (primav / 100))) / 365
- Dim SDI As Decimal = (SD * FI)
- TxtFactordeIntegracion.Text = FI.ToString()
- TxtFISalarioDiarioIntegrado.Text = String.Format("{0:###0.########}", SDI)
+ Dim SD As Decimal = TxtFISalariodiario.Text.ToDecimal()
+ Dim primav As Decimal = TxtFIPrimaVacacional.Text.ToDecimal()
+ Dim DiasVacaciones As Decimal = TxtFIDiasVacaciones.Text.ToDecimal()
+ Dim diasaguinaldo As Decimal = TxtFIAguinaldo.Text.ToDecimal()
+ Dim FI As Decimal = (365 + diasaguinaldo + (DiasVacaciones * (primav / 100))) / 365
+ Dim SDI As Decimal = (SD * FI)
+ TxtFactordeIntegracion.Text = FI.ToString()
+ TxtFISalarioDiarioIntegrado.Text = String.Format("{0:###0.########}", SDI)
UpFactordeintegracion.Update()
- End Sub
+ End Sub
Protected Sub LnkCalcularFactordeintegracion_Click(sender As Object, e As EventArgs)
calcularSDI()
- Alert(String.Format(" salario diario integreado {0}", TxtFISalarioDiarioIntegrado.Text))
- End Sub
- Protected Sub LnkCalcularFactordeintegracionyguardar_Click(sender As Object, e As EventArgs)
- calcularSDI()
-
- Using ObjPersonal As ClsRH = New ClsRH()
- If ObjPersonal.UpdateSalariointegrado(CvePersonal, UsuarioActual.CveEmpresa, TxtFISalarioDiarioIntegrado.Text.ToDouble(), TxtFISalariodiario.Text.ToDouble) Then
- TxtSalarioDiario.Text = TxtFISalariodiario.Text
- TxtSalarioDiarioM.Text = TxtFISalariodiario.Text
- 'TxtSalarioCotizado.Text = TxtFISalarioDiarioIntegrado.Text
- 'TxtSalarioDiarioImSS.Text = TxtFISalarioDiarioIntegrado.Text
- TxtSalarioDiarioIntegrado.Text = TxtFISalarioDiarioIntegrado.Text
- TxtSDI.Text = TxtFISalarioDiarioIntegrado.Text
- UpDatos.Update()
+ Alert(String.Format(" salario diario integreado {0}", TxtFISalarioDiarioIntegrado.Text))
+ End Sub
+ Protected Sub LnkCalcularFactordeintegracionyguardar_Click(sender As Object, e As EventArgs)
+ calcularSDI()
+
+ Using ObjPersonal As ClsRH = New ClsRH()
+ If ObjPersonal.UpdateSalariointegrado(CvePersonal, UsuarioActual.CveEmpresa, TxtFISalarioDiarioIntegrado.Text.ToDouble(), TxtFISalariodiario.Text.ToDouble) Then
+ TxtSalarioDiario.Text = TxtFISalariodiario.Text
+ TxtSalarioDiarioM.Text = TxtFISalariodiario.Text
+ 'TxtSalarioCotizado.Text = TxtFISalarioDiarioIntegrado.Text
+ 'TxtSalarioDiarioImSS.Text = TxtFISalarioDiarioIntegrado.Text
+ TxtSalarioDiarioIntegrado.Text = TxtFISalarioDiarioIntegrado.Text
+ TxtSDI.Text = TxtFISalarioDiarioIntegrado.Text
+ UpDatos.Update()
Alert("Se ha actualizado el salario diario integreado")
- RegistraScript("$('#DmodalFactordeIntegraccion').modal('hide')")
- End If
- End Using
- End Sub
- Protected Sub ChkEstemporal_CheckedChanged(sender As Object, e As EventArgs)
-
- Using ObjPersonal As ClsRH = New ClsRH()
- If ObjPersonal.Updateestemporal(CvePersonal, UsuarioActual.CveEmpresa, ChkEstemporal.Checked) Then
- Alert("Se ha actualizado el empleado", TipoMensaje.ToastInformacion)
- End If
- End Using
- End Sub
+ RegistraScript("$('#DmodalFactordeIntegraccion').modal('hide')")
+ End If
+ End Using
+ End Sub
+ Protected Sub ChkEstemporal_CheckedChanged(sender As Object, e As EventArgs)
+
+ Using ObjPersonal As ClsRH = New ClsRH()
+ If ObjPersonal.Updateestemporal(CvePersonal, UsuarioActual.CveEmpresa, ChkEstemporal.Checked) Then
+ Alert("Se ha actualizado el empleado", TipoMensaje.ToastInformacion)
+ End If
+ End Using
+ End Sub
Protected Sub LnkModificarSalarioGuardar_Click(sender As Object, e As EventArgs)
getdatosFI()
@@ -6301,32 +6307,32 @@ Partial Class RH_Personal
TxtFISalariodiario.Text = TxtSalarioDiarioM.Text
calcularSDI()
TxtSalarioDiarioImSS.Text = TxtFISalarioDiarioIntegrado.Text
- TxtSalarioDiarioIntegrado.Text = TxtFISalarioDiarioIntegrado.Text
- Using ObjPersonal As ClsRH = New ClsRH()
+ TxtSalarioDiarioIntegrado.Text = TxtFISalarioDiarioIntegrado.Text
+ Using ObjPersonal As ClsRH = New ClsRH()
If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveEmpresa, TxtSalarioDiarioM.Text.ToDecimal(), TxtFISalarioDiarioIntegrado.Text.ToDecimal(), TxtFISalarioDiarioIntegrado.Text.ToDecimal(), TxtSalarioDiarioM.Text.ToDecimal()) Then
-
-
- TxtSalarioDiario.Text = TxtSalarioDiarioM.Text
- TxtFISalariodiario.Text = TxtSalarioDiarioM.Text
- TxtSalarioCotizado.Text = TxtSalarioDiarioImSS.Text
- TxtSDI.Text = TxtSalarioDiarioIntegrado.Text
+
+
+ TxtSalarioDiario.Text = TxtSalarioDiarioM.Text
+ TxtFISalariodiario.Text = TxtSalarioDiarioM.Text
+ TxtSalarioCotizado.Text = TxtSalarioDiarioImSS.Text
+ TxtSDI.Text = TxtSalarioDiarioIntegrado.Text
TxtFISalarioDiarioIntegrado.Text = TxtSalarioDiarioIntegrado.Text
UpModSalario.Update()
- UpDatos.Update()
- Alert("Se ha actualizado el salario", TipoMensaje.ToastInformacion)
- End If
- End Using
-
- End Sub
- Protected Sub LnkModsalario_Click(sender As Object, e As EventArgs)
-
- TxtFechamodSalario.Text = DateTime.Now.ToString("dd/MM/yyyy")
- TxtSalarioDiarioM.Text = TxtSalarioDiario.Text
- TxtSalarioDiarioImSS.Text = TxtSalarioCotizado.Text
- TxtSalarioDiarioIntegrado.Text = TxtSDI.Text
- RegistraScript("$('#Dmodamodificarsalario').modal()")
- UpModSalario.Update()
+ UpDatos.Update()
+ Alert("Se ha actualizado el salario", TipoMensaje.ToastInformacion)
+ End If
+ End Using
+
+ End Sub
+ Protected Sub LnkModsalario_Click(sender As Object, e As EventArgs)
+
+ TxtFechamodSalario.Text = DateTime.Now.ToString("dd/MM/yyyy")
+ TxtSalarioDiarioM.Text = TxtSalarioDiario.Text
+ TxtSalarioDiarioImSS.Text = TxtSalarioCotizado.Text
+ TxtSalarioDiarioIntegrado.Text = TxtSDI.Text
+ RegistraScript("$('#Dmodamodificarsalario').modal()")
+ UpModSalario.Update()
End Sub
Protected Sub LnkDescargaFormatoParametros_Click(sender As Object, e As EventArgs)
@@ -6344,26 +6350,26 @@ Partial Class RH_Personal
Next
- Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
- Dim PathSource As String
- Dim pathDesti As String
-
- PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & DocumentoParametros
- pathDesti = PathRoot & "Temp\" & CvePersonal & DocumentoParametros
-
- If File.Exists(pathDesti) Then
- File.Delete(pathDesti)
- End If
-
- File.Copy(PathSource, pathDesti)
-
+ Dim PathRoot As String = AppDomain.CurrentDomain.BaseDirectory
+ Dim PathSource As String
+ Dim pathDesti As String
+
+ PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & DocumentoParametros
+ pathDesti = PathRoot & "Temp\" & CvePersonal & DocumentoParametros
+
+ If File.Exists(pathDesti) Then
+ File.Delete(pathDesti)
+ End If
+
+ File.Copy(PathSource, pathDesti)
+
Dim objDoc As New clsGemBoxDocument(pathDesti)
objDoc.SustituirTags(ListaTagsDocumentost)
- objDoc.Guardar(pathDesti)
-
- Dim fileinfo As New FileInfo(pathDesti)
-
- Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
+ objDoc.Guardar(pathDesti)
+
+ Dim fileinfo As New FileInfo(pathDesti)
+
+ Dim baseUrl As String = Request.Url.GetLeftPart(UriPartial.Authority)
baseUrl = baseUrl & "/temp/" & fileinfo.Name
RegistraScript("$('#DVDescargaDocumentoParametrosModal').modal('hide')", "500")
@@ -6380,4 +6386,4 @@ Partial Class RH_Personal
End If
ObjBancos.Dispose()
End Sub
-End Class
+End Class
diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx
index d83ba7ada..a0a12b138 100644
--- a/Ventas/ProductosServicios.aspx
+++ b/Ventas/ProductosServicios.aspx
@@ -575,6 +575,10 @@
+
+
+
+
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index 4526e1692..d3e678596 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -901,6 +901,7 @@ Partial Class ProductosyServicios
LnkUnificar.Visible = True
ChkEsOutSourcing.Checked = ObjProductosServicios.EsOutSourcing
+ ChkPrecioLibre.Checked = ObjProductosServicios.PrecioLibre
Else
Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
@@ -1237,7 +1238,7 @@ Partial Class ProductosyServicios
CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero,
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
- ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero()) > 0 Then
+ ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked) > 0 Then
ViewState("CvePS") = ObjProductosServicios.CvePS
For Each GVR As GridViewRow In GvImpuestosLocales.Rows
If GVR.FCCheckBox("ChkDeduccion").Checked Then
@@ -1286,7 +1287,7 @@ Partial Class ProductosyServicios
CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(),
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
- AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero()) Then
+ AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked) Then
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True
diff --git a/vwd.webinfo b/vwd.webinfo
index 37b42e3cc..d553518ff 100644
--- a/vwd.webinfo
+++ b/vwd.webinfo
@@ -174,6 +174,8 @@
+
+