diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index eeee4c853..3ac5ef12b 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -4157,12 +4157,22 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Try SqlAdapter.Fill(Data) Retorno = True - Catch exs As SqlException - If exs.ErrorCode = -2146232060 Then + Catch exs As SqlException + + + If exs.Message.Contains("Número: 547;") Then OnError("Ocurrió al Eliminar el Tema Existen registros relacionadados.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) Else OnError("Ocurrió al Eliminar el Tema TemasRemove.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End If + End If + + + 'If exs.ErrorCode = -2146232060 Then + ' OnError("Ocurrió al Eliminar el Tema Existen registros relacionadados.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + 'Else + ' OnError("Ocurrió al Eliminar el Tema TemasRemove.", exs, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + 'End If + Catch ex As Exception OnError("Ocurrió al Eliminar el Tema TemasRemove.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try @@ -6859,25 +6869,26 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al obtener los pagos de factura de personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function - + End Function + #End Region - - - Public msgsError As New StringBuilder() - Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") - GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - msgsError.AppendLine(Mensaje) - msgsError.Append("
") - 'Alert(Obj, Mensaje, TipoMensaje.MsgError) - 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - End Sub + + + 'Public msgsError As New StringBuilder() + 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") + ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + ' msgsError.AppendLine(Mensaje) + ' msgsError.Append("
") + ' 'Alert(Obj, Mensaje, TipoMensaje.MsgError) + ' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + 'End Sub + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) - If msgsError.ToString().Length > 0 Then - Alert(msgsError.ToString(), TipoMensaje.MsgError) - End If + 'If msgsError.ToString().Length > 0 Then + ' Alert(msgsError.ToString(), TipoMensaje.MsgError) + 'End If If Not disposedValue Then If disposing Then ' TODO: Liberar otro estado (objetos administrados). diff --git a/RH/CatCursosTemas.aspx.vb b/RH/CatCursosTemas.aspx.vb index 76b5f1b13..75996ce7d 100644 --- a/RH/CatCursosTemas.aspx.vb +++ b/RH/CatCursosTemas.aspx.vb @@ -101,9 +101,8 @@ Partial Class RH_CatCursosTemas If objRH.TemasRemove(CveTema) Then CargadatosGvTemas() LoadComboTemas() - Alert("Tema elimino correctamente ", TipoMensaje.MsgInformacion) - Else - Alert("Ocurrio un error al eliminar el tema", TipoMensaje.MsgError) + Alert("Tema elimino correctamente ", TipoMensaje.MsgInformacion) + End If End Sub @@ -179,9 +178,8 @@ Partial Class RH_CatCursosTemas If objRH.SubtemaRemove(CveTema) Then CargadatosGvTemas() - Alert("Subtema Elimino Correctamente.", TipoMensaje.MsgInformacion) - Else - Alert("Ocurrio un error al Eliminar el Subtema.", TipoMensaje.MsgError) + Alert("Subtema Elimino Correctamente.", TipoMensaje.MsgInformacion) + End If LoadComboTemas() CargadatosGvSubtemas()