diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx index b0d679f5a..13f18fd12 100644 --- a/Acumuladores/CatFoliosGarantia.aspx +++ b/Acumuladores/CatFoliosGarantia.aspx @@ -265,6 +265,7 @@ +
diff --git a/Acumuladores/CatFoliosGarantia.aspx.vb b/Acumuladores/CatFoliosGarantia.aspx.vb index e2b64d68d..ad11b7002 100644 --- a/Acumuladores/CatFoliosGarantia.aspx.vb +++ b/Acumuladores/CatFoliosGarantia.aspx.vb @@ -98,19 +98,20 @@ Partial Class Acumuladores_CatFoliosGarantia End Sub - Protected Sub BtnAgregarFolioGarantiaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantiaModal.Click - - Dim ObjAcum As New ClsAcumuladores - - 'Dim Cargo, Bonificacion, Compra, Puntos As Decimal - - 'Cargo = If(TxtCargo.Text.ToDecimal > 0, TxtCargo.Text.ToDecimal, -1) - 'Bonificacion = If(TxtBonificacion.Text.ToDecimal > 0, TxtBonificacion.Text.ToDecimal, -1) - 'Compra = If(TxtCompra.Text.ToDecimal > 0, TxtCompra.Text.ToDecimal, -1) - 'Puntos = If(TxtPuntos.Text.ToDecimal > 0, TxtPuntos.Text.ToDecimal, -1) - - - If Not Actualizar Then + Protected Sub BtnAgregarFolioGarantiaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarFolioGarantiaModal.Click + + + + 'Dim Cargo, Bonificacion, Compra, Puntos As Decimal + + 'Cargo = If(TxtCargo.Text.ToDecimal > 0, TxtCargo.Text.ToDecimal, -1) + 'Bonificacion = If(TxtBonificacion.Text.ToDecimal > 0, TxtBonificacion.Text.ToDecimal, -1) + 'Compra = If(TxtCompra.Text.ToDecimal > 0, TxtCompra.Text.ToDecimal, -1) + 'Puntos = If(TxtPuntos.Text.ToDecimal > 0, TxtPuntos.Text.ToDecimal, -1) + + + If Not Actualizar Then + Dim ObjAcum As New ClsAcumuladores If ObjAcum.FoliosGarantiaAdd(TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then TxtFolioGarantia.Text = "" @@ -128,8 +129,16 @@ Partial Class Acumuladores_CatFoliosGarantia Alert("Folio de Garantía Agregado Correctamente", TipoMensaje.MsgInformacion) Else Alert("Ocurrió un error al guardar el Folio de Garantía", TipoMensaje.MsgError) - End If - Else + End If + ObjAcum.Dispose() + Else + 'si se marca como enviado, debe de revisar que tenga el movto de traslado + If HdnCveMovimientoSalida.Value = "" AndAlso DdlEstatusEditar.SelectedValue = "2" Then + Alert("No se ha realizado la salida del almacen de garantía, al de 'devolución al proveedor'.
Favor de aplicar la salida y luego cambiar el estatus a enviado. ", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + Dim ObjAcum As New ClsAcumuladores If ObjAcum.FoliosGarantiaUpdate(CveFolioGarantia, TxtFolioGarantia.Text, DdlEstatusEditar.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlSubProyectos.SelectedValue.ToEntero, DdlTipoFolioModal.SelectedValue, TxtLimite.Text.ToEntero, DdlArea.SelectedValue.ToEntero) Then @@ -149,14 +158,15 @@ Partial Class Acumuladores_CatFoliosGarantia Alert("Folio de Garantía Actualizado Correctamente", TipoMensaje.MsgInformacion) Else Alert("Ocurrió un error al Actualizar el Folio de Garantía", TipoMensaje.MsgError) - End If + End If + ObjAcum.Dispose() End If CveFolioGarantia = -1 - Actualizar = False - - ObjAcum.Dispose() - + Actualizar = False + + + End Sub Public Sub Remove_ClickFolioGarantia(sender As Object, e As EventArgs) @@ -188,6 +198,7 @@ Partial Class Acumuladores_CatFoliosGarantia TxtLimite.Text = GvRow.DataKey("Limite") DdlTipoFolioModal.SelectedValue = GvRow.DataKey("tipoFolio") DdlArea.SelectedValue = GvRow.DataKey("Area") + HdnCveMovimientoSalida.Value = GvRow.DataKey("CveMovimiento") 'TxtCargo.Text = GvRow.DataKey("Cargo").ToDecimal.ToString("###,###,###.00") 'TxtBonificacion.Text = GvRow.DataKey("Bonificacion").ToDecimal.ToString("###,###,###.00") 'TxtCompra.Text = GvRow.DataKey("Compra").ToDecimal.ToString("###,###,###.00")