-- parametro de empresa en eliminar chofer

This commit is contained in:
2022-02-10 07:30:21 -07:00
parent 9bb1d9431a
commit c6bd70ad5d
2 changed files with 13 additions and 10 deletions

View File

@@ -212,9 +212,11 @@ Partial Class Acarreos_CatChoferes
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnID.Value = GvRow.DataKey("CveChofer")
UpDatos.Update()
If ObjAcar.RemoveChofer(HdnID.Value) Then
If ObjAcar.RemoveChofer(HdnID.Value, UsuarioActual.CveEmpresa) Then
CargaDatos()
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
Else
Alert("No se puede eliminar el chofer. verifique que no tenga movimientos registrados.", TipoMensaje.MsgError)
End If
ObjAcar.Dispose()
UpDatos.Update()
@@ -312,7 +314,7 @@ Partial Class Acarreos_CatChoferes
If CPTxt > 0 And CveColonia > 0 Then
Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
If CPTxt <> CP Then
Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
Alert("El código postal seleccionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
End If
End If
End Sub

View File

@@ -207,26 +207,27 @@ Public Class ClsAcarreos
Return Retorno
End Function
Public Function RemoveChofer(CveChofer As Integer) As Boolean
Public Function RemoveChofer(CveChofer As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Acar_ChoferesRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@vRetorno", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Retorno = SqlAdapter.SelectCommand.Parameters("@vRetorno").Value.ToString = "1"
Catch ex As Exception
OnError("Ocurrió un error al eliminar el chofer.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
End Function
#End Region
#Region "Transportistas"
Public Function AddTransportista(Transportista As String, CveUsuario As Integer, CveEmpresa As Integer, CveProveedor As Integer) As Boolean
Dim Retorno As Boolean = False