-- parametro de empresa en eliminar chofer
This commit is contained in:
@@ -212,9 +212,11 @@ Partial Class Acarreos_CatChoferes
|
|||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
HdnID.Value = GvRow.DataKey("CveChofer")
|
HdnID.Value = GvRow.DataKey("CveChofer")
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
If ObjAcar.RemoveChofer(HdnID.Value) Then
|
If ObjAcar.RemoveChofer(HdnID.Value, UsuarioActual.CveEmpresa) Then
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||||
|
Else
|
||||||
|
Alert("No se puede eliminar el chofer. verifique que no tenga movimientos registrados.", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
ObjAcar.Dispose()
|
ObjAcar.Dispose()
|
||||||
UpDatos.Update()
|
UpDatos.Update()
|
||||||
@@ -312,7 +314,7 @@ Partial Class Acarreos_CatChoferes
|
|||||||
If CPTxt > 0 And CveColonia > 0 Then
|
If CPTxt > 0 And CveColonia > 0 Then
|
||||||
Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
|
Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
|
||||||
If CPTxt <> CP Then
|
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 If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -207,26 +207,27 @@ Public Class ClsAcarreos
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
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
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Acar_ChoferesRemove")
|
DataAdapter("PA_Acar_ChoferesRemove")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
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
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = SqlAdapter.SelectCommand.Parameters("@vRetorno").Value.ToString = "1"
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
OnError("Ocurrió un error al eliminar el chofer.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
OnError("Ocurrió un error al eliminar el chofer.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Transportistas"
|
#Region "Transportistas"
|
||||||
Public Function AddTransportista(Transportista As String, CveUsuario As Integer, CveEmpresa As Integer, CveProveedor As Integer) As Boolean
|
Public Function AddTransportista(Transportista As String, CveUsuario As Integer, CveEmpresa As Integer, CveProveedor As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|||||||
Reference in New Issue
Block a user