CellValidated cuando cierro formulario
Private Sub dgv4_CellValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv4.CellValidated
Try
If Not dgv4.CurrentCell.ColumnIndex = 5 Then
Exit Sub
End If
If cantidad_recepcionar = 0 And dvguias_transportista_bultos.Table.Rows(dr).IsNull("CANTIDAD_RECEPCIONAR") Then
Exit Sub
End If
If Not dvguias_transportista_bultos.Table.Rows(dr).IsNull("CANTIDAD_RECEPCIONAR") Then
If cantidad_recepcionar = Val(dvguias_transportista_bultos.Table.Rows(dr)("CANTIDAD_RECEPCIONAR")) Then Exit Sub
End If
Dim objGUIA_TRANSPORTISTA_DETALL As New ClsLb.dtoGUIA_TRANSPORTISTA_DETALL
Dim dv As New DataView
objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL = dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("IDGUIA_TRANSPORTISTA_DETALL")
If Not dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index).IsNull("CANTIDAD_RECEPCIONAR") Then
objGUIA_TRANSPORTISTA_DETALL.CANTIDAD_RECEPCIONAR = Val(dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR"))
dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR") = Val(dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR"))
If dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR") > dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD") Then
MsgBox("La cantidad a recepcionar no puede ser mayor que la de envio", MsgBoxStyle.Information, "Segurdidad del Sistema")
dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR") = cantidad_recepcionar
Exit Sub
End If
If dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR") < 0 Then
MsgBox("La cantidad a recepcionar no puede ser negativo", MsgBoxStyle.Information, "Segurdidad del Sistema")
dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR") = cantidad_recepcionar
Exit Sub
End If
Else
objGUIA_TRANSPORTISTA_DETALL.CANTIDAD_RECEPCIONAR = 0
End If
objGUIA_TRANSPORTISTA_DETALL.IDUNIDAD_AGENCIA = dtoUSUARIOS.m_idciudad
objGUIA_TRANSPORTISTA_DETALL.IDUSUARIO_PERSONAL = dtoUSUARIOS.IdLogin
dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR") = Val(dvguias_transportista_bultos.Table.Rows(dgv4.CurrentRow.Index)("CANTIDAD_RECEPCIONAR"))
'
'Mod.12/10/2009 -->Omendoza - Pasando al datahelper -
'dv = objGUIA_TRANSPORTISTA_DETALL.sp_RECEPCIONAR_BULTOSIII(VOCONTROLUSUARIO)
dv = objGUIA_TRANSPORTISTA_DETALL.sp_RECEPCIONAR_BULTOSIII()
'Dim aaa As Integer = id_guia_transportista
Dim obj_gui_transpor As New INTEGRACION_LN.Cls_Guias_LN
Dim dt_gui_transpor As DataTable
Dim id_age_destino As Integer
dt_gui_transpor = obj_gui_transpor.Retornar_Datos_Guia_Transportista(id_guia_transportista)
id_age_destino = dt_gui_transpor.Rows(0).Item(0).ToString
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim dvListar_ageVirtuales As New DataView
dvListar_ageVirtuales = obj_gui_transpor.Listar_agencias_virtuales()
'agencias virtuales
For i As Integer = 0 To dvListar_ageVirtuales.Table.Rows.Count - 1
Dim idagencia_virtual As Integer = dvListar_ageVirtuales.Table.Rows(i)("idagencias")
If id_age_destino = idagencia_virtual Then
Dim obj_grt_det As New INTEGRACION_LN.Cls_Guias_LN
obj_grt_det.Actualizar_Doc_GRT(objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL)
End If
Next
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'agencias virtuales
'If id_age_destino = 204 Then
' 'actualizar la guia o factura a 20 llegada
' Dim obj_grt_det As New INTEGRACION_LN.Cls_Guias_LN
' obj_grt_det.Actualizar_Doc_GRT(objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL)
'End If
If dv.Table.Rows(0)("retor_es_recepcionado") = 0 Then
dvguias_transportista.Table.Rows(DGV3.CurrentRow.Index)("es_recepcionado") = 0
dvguias_transportista.Table.Rows(DGV3.CurrentRow.Index)("Es_Recepcionado_decrip") = "DESP."
Try
ObjWebService.fnWebServiceLlegada(objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL.ToString())
Catch ex As Exception
End Try
ElseIf dv.Table.Rows(0)("retor_es_recepcionado") = 1 Then
dvguias_transportista.Table.Rows(DGV3.CurrentRow.Index)("es_recepcionado") = 1
dvguias_transportista.Table.Rows(DGV3.CurrentRow.Index)("Es_Recepcionado_decrip") = "RECEP."
Try
ObjWebService.fnWebServiceLlegada(objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL.ToString())
Catch ex As Exception
End Try
ElseIf dv.Table.Rows(0)("retor_es_recepcionado") = 2 Then
dvguias_transportista.Table.Rows(DGV3.CurrentRow.Index)("es_recepcionado") = 2
dvguias_transportista.Table.Rows(DGV3.CurrentRow.Index)("Es_Recepcionado_decrip") = "RECEP. PARCIAL"
Try
ObjWebService.fnWebServiceLlegada(objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL.ToString())
Catch ex As Exception
End Try
Else
MsgBox(dv.Table.Rows(0)(2), MsgBoxStyle.Information, "Seguridad del Sistema...")
dvguias_transportista_bultos.Table.Rows(dr)("CANTIDAD_RECEPCIONAR") = cantidad_recepcionar
End If
Recepcionar_valijas(objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL)
'nuevo itinerario pasajes
'********************************************************************************************
Dim obj_RecepcionarItinerario As New Cls_Ventas_LN
obj_RecepcionarItinerario.RecepcionarItinerarioDocumentos(objGUIA_TRANSPORTISTA_DETALL.IDGUIA_TRANSPORTISTA_DETALL, dvguias_transportista_bultos.Table.Rows(dr)("CANTIDAD_RECEPCIONAR"))
'********************************************************************************************
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Information, "Seguridad del Sistema...")
End Try
End Sub