Error al guardar por conexion cerrada

This commit is contained in:
2021-04-30 10:43:25 -07:00
parent 4e079f06e1
commit b6f772d0e8

View File

@@ -522,30 +522,13 @@ Partial Class Sistemas_PopUpAddUsuario
Alert("Ocurrió un error al agregar el usuario.", TipoMensaje.MsgInformacion) Alert("Ocurrió un error al agregar el usuario.", TipoMensaje.MsgInformacion)
End If End If
Catch ex As Exception Catch ex As Exception
HuboError = true
OnError("Ocurrió un error al agregar el usuario.", ex) OnError("Ocurrió un error al agregar el usuario.", ex)
End Try End Try
If Not HuboError Then If Not HuboError Then
ObjUsuarios.Commit() ObjUsuarios.Commit()
If UsuarioActual.Empresa.CvePlataforma = 3 Then
Using ObjNotificaciones As New ClsSisNotificaciones()
ObjNotificaciones.DeleteNotificacion(-1, CveUsuario)
For Each row As GridViewRow In GVNotificaciones.Rows
If row.FCCheckBox("chkCorreo").Checked OrElse row.FCCheckBox("chkVentana").Checked OrElse row.FCCheckBox("chkSMS").Checked OrElse
row.FCCheckBox("chkApp").Checked OrElse row.FCCheckBox("chkCampana").Checked Then
If Not ObjNotificaciones.AddUsuariosNotificacion(CveUsuario, row.DataKey("CveNotificacion"), row.FCCheckBox("chkCorreo").Checked, row.FCCheckBox("chkVentana").Checked, row.FCCheckBox("chkSMS").Checked,
row.FCCheckBox("chkApp").Checked, row.FCCheckBox("chkCampana").Checked) Then
HuboError = True
End If
End If
Next
End Using
End If
Dim JSBTN As String = "" Dim JSBTN As String = ""
If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso UsuarioActual.CveCliente > 0 Then If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso UsuarioActual.CveCliente > 0 Then
@@ -568,6 +551,23 @@ Partial Class Sistemas_PopUpAddUsuario
End If End If
ObjUsuarios.Dispose() ObjUsuarios.Dispose()
If Not HuboError AndAlso UsuarioActual.Empresa.CvePlataforma = 3 Then
Using ObjNotificaciones As New ClsSisNotificaciones()
ObjNotificaciones.DeleteNotificacion(-1, CveUsuario)
For Each row As GridViewRow In GVNotificaciones.Rows
If row.FCCheckBox("chkCorreo").Checked OrElse row.FCCheckBox("chkVentana").Checked OrElse row.FCCheckBox("chkSMS").Checked OrElse
row.FCCheckBox("chkApp").Checked OrElse row.FCCheckBox("chkCampana").Checked Then
If Not ObjNotificaciones.AddUsuariosNotificacion(CveUsuario, row.DataKey("CveNotificacion"), row.FCCheckBox("chkCorreo").Checked, row.FCCheckBox("chkVentana").Checked, row.FCCheckBox("chkSMS").Checked,
row.FCCheckBox("chkApp").Checked, row.FCCheckBox("chkCampana").Checked) Then
HuboError = True
End If
End If
Next
End Using
End If
RecargarGlobalUsuarios() RecargarGlobalUsuarios()
RecargarGlobal() RecargarGlobal()
End Sub End Sub