CarataPorte
This commit is contained in:
@@ -51,11 +51,22 @@ Partial Class Inventarios_CatUnidades
|
||||
If ObjGral.GetCartaPorteTipoPermisoSCT() Then
|
||||
DdlTipoPermisoSCT.DataSource = ObjGral.DtResultados
|
||||
End If
|
||||
|
||||
If ObjGral.GetCartaPorteTiposRemolques() Then
|
||||
DdlTiposRemolque.DataSource = ObjGral.DtResultados
|
||||
End If
|
||||
|
||||
|
||||
End Using
|
||||
|
||||
DdlConfigAuto.DataBind()
|
||||
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione Uno ", "-1"))
|
||||
|
||||
DdlTipoPermisoSCT.DataBind()
|
||||
DdlTipoPermisoSCT.Items.Insert(0, New ListItem("Seleccione Uno ", "-1"))
|
||||
|
||||
DdlTiposRemolque.DataBind()
|
||||
DdlTiposRemolque.Items.Insert(0, New ListItem("Seleccione Uno ", "-1"))
|
||||
|
||||
UpModalUnidades.Update()
|
||||
|
||||
@@ -82,8 +93,15 @@ Partial Class Inventarios_CatUnidades
|
||||
TxtNumPolizaSeguroMedioAmbiente.Text = ""
|
||||
TxtNombreAseguradoraCarga.Text = ""
|
||||
TxtNumPolizaSeguroCarga.Text = ""
|
||||
|
||||
TxtLongitudCaja.Text = ""
|
||||
TxtLineaTransportacion.Text = ""
|
||||
TxtSCAC.Text = ""
|
||||
TxtCAAT.Text = ""
|
||||
ChkesRemolque.Checked = False
|
||||
LtlTituloModal.Text = "Agregar Unidad"
|
||||
DdlTiposRemolque.SelectedValueExist(-1)
|
||||
|
||||
ChkesRemolque_CheckedChanged(Nothing, Nothing)
|
||||
|
||||
UpModalUnidades.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarUnidad"))
|
||||
@@ -95,7 +113,7 @@ Partial Class Inventarios_CatUnidades
|
||||
Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
|
||||
|
||||
CveCamion = GvRow.DataKey("CveCamion").ToEntero()
|
||||
|
||||
Dim CveTipoRemolque As Integer = GvRow.DataKey("CveTipoRemolque").ToEntero
|
||||
|
||||
TxtPlacaNuevo.Text = GvRow.DataKey("Placa")
|
||||
TxtEspecificacionNuevo.Text = GvRow.DataKey("Especificacion")
|
||||
@@ -113,8 +131,20 @@ Partial Class Inventarios_CatUnidades
|
||||
TxtNombreAseguradoraCarga.Text = GvRow.DataKey("NombreAseguradoraCarga")
|
||||
TxtNumPolizaSeguroCarga.Text = GvRow.DataKey("NumPolizaSeguroCarga")
|
||||
|
||||
DdlTiposRemolque.SelectedValueExist(CveTipoRemolque)
|
||||
|
||||
TxtLongitudCaja.Text = GvRow.DataKey("LongitudCaja")
|
||||
TxtLineaTransportacion.Text = GvRow.DataKey("LineaTransportacion")
|
||||
TxtSCAC.Text = GvRow.DataKey("SCAC")
|
||||
TxtCAAT.Text = GvRow.DataKey("CAAT")
|
||||
|
||||
ChkesRemolque.Checked = (GvRow.DataKey("CveTipoCamion") = "2")
|
||||
|
||||
LtlTituloModal.Text = "Actualizar Unidad"
|
||||
|
||||
ChkesRemolque_CheckedChanged(Nothing, Nothing)
|
||||
|
||||
|
||||
UpModalUnidades.Update()
|
||||
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarUnidad"))
|
||||
@@ -128,18 +158,19 @@ Partial Class Inventarios_CatUnidades
|
||||
|
||||
Dim CveCamionEliminar = GvRow.DataKey("CveCamion").ToEntero()
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Using ObjInventarios As New ClsInventarios
|
||||
|
||||
If (ObjInventarios.RemoveCamiones(CveCamionEliminar, UsuarioActual.CveEmpresa)) Then
|
||||
|
||||
UpDatos.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarUnidad"))
|
||||
Alert("Unidad Eliminada Correctamente")
|
||||
Else
|
||||
ErrorAlElimiar = True
|
||||
End If
|
||||
If (ObjInventarios.RemoveCamiones(CveCamionEliminar, UsuarioActual.CveEmpresa)) Then
|
||||
|
||||
UpDatos.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarUnidad"))
|
||||
Alert("Unidad Eliminada Correctamente")
|
||||
Else
|
||||
ErrorAlElimiar = True
|
||||
End If
|
||||
End Using
|
||||
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
If Not ErrorAlElimiar Then
|
||||
GlobalDTInvCamiones(UsuarioActual.CveEmpresa) = Nothing
|
||||
@@ -152,23 +183,25 @@ Partial Class Inventarios_CatUnidades
|
||||
|
||||
Dim ErrorPrceso As Boolean = False
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
Dim CveTipoCamion As Integer = If(ChkesRemolque.Checked, 2, 1)
|
||||
Using ObjInventarios As New ClsInventarios
|
||||
|
||||
If CveCamion <= 0 Then
|
||||
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario,
|
||||
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text) Then
|
||||
Alert("Unidad agregada correctamente")
|
||||
If CveCamion <= 0 Then
|
||||
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario,
|
||||
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero) Then
|
||||
Alert("Unidad agregada correctamente")
|
||||
Else
|
||||
ErrorPrceso = True
|
||||
End If
|
||||
Else
|
||||
ErrorPrceso = True
|
||||
If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero) Then
|
||||
Alert("Unidad actualizada correctamente")
|
||||
Else
|
||||
ErrorPrceso = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero, TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text) Then
|
||||
Alert("Unidad actualizada correctamente")
|
||||
Else
|
||||
ErrorPrceso = True
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
|
||||
|
||||
If Not ErrorPrceso Then
|
||||
@@ -183,4 +216,34 @@ Partial Class Inventarios_CatUnidades
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub ChkesRemolque_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If Not ChkesRemolque.Checked Then
|
||||
|
||||
DVAnio.Visible = True
|
||||
DVConfigAuto.Visible = True
|
||||
DVTipoPermisoSCT.Visible = True
|
||||
DVNumermisoSCT.Visible = True
|
||||
DVNombreAseguradora.Visible = True
|
||||
DVNombreAseguradoraMedioAmbiente.Visible = True
|
||||
DVNumPolizaSeguroMedioAmbient.Visible = True
|
||||
|
||||
DVTiposRemolque.Visible = False
|
||||
Else
|
||||
DVAnio.Visible = False
|
||||
DVConfigAuto.Visible = False
|
||||
DVTipoPermisoSCT.Visible = False
|
||||
DVNumermisoSCT.Visible = False
|
||||
DVNombreAseguradora.Visible = False
|
||||
DVNombreAseguradoraMedioAmbiente.Visible = False
|
||||
DVNumPolizaSeguroMedioAmbient.Visible = False
|
||||
|
||||
DVTiposRemolque.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
DVTiposRemolque.Visible = ChkesRemolque.Checked
|
||||
UpModalUnidades.Update
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user