diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index a0b88fb36..248704414 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -118,12 +118,14 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState context.Response.Write(sendMailLPM(context)) Case "getSATColomias" getSatColonias(context) - Case "GetFilesDirectory" + Case "GetFilesDirectory" GetFilesDirectory(context) Case "Getetiquetas" Getetiquetas(context) - Case "cancelarRemision" + Case "cancelarRemision" cancelarRemision(context) + Case "RemoveMovimiento" + RemoveMovimiento(context) End Select Catch ex As Exception ex.GuardaLog(ex.Message) @@ -1644,4 +1646,66 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Return retorno End Function #End Region + Private Function RemoveMovimiento(ByVal context As HttpContext) As String + Dim retorno As String = "" + + Dim Borrar As Boolean = False + Dim Inv As New ClsInventarios + Dim Conta As New ClsContabilidad(Inv.IniciaTransacSQL()) + Dim ObjGral As New ClsGenerales(Inv.IniciaTransacSQL()) + + Dim CveMovimiento As Integer = IfNull(context.Request("CveMovimiento"), "-1").ToString().ToEntero() + Dim CveEmpresa As Integer = IfNull(context.Request("CveEmpresa"), "-1").ToString().ToEntero() + + Dim TieneError = False + + CveMovimiento.ToString.GuardaLog + + 'Dim ObjConta As ClsContPAQi = Nothing + 'If UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC Then + ' ObjConta = New ClsContPAQi(UsuarioActual.Empresa) + ' ObjConta.IniciaTransacSQL() + 'End If + + 'If Not ObjGral.AddHistorialBitacora(Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, String.Format("{0}, Informacion = {1}", TxtDescripcion.Text, DescripcionDetalladaEliminar), "Inventarios", TxtFolio.Text + " / " + DdlConcepto.SelectedItem.Text) Then + ' TieneError = True + 'End If + + If Not Inv.MovimientoRemove(CveMovimiento, CveEmpresa) Then + + TieneError = True + End If + + 'If Not TieneError Then + ' If Not Conta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then + ' TieneError = True + ' End If + 'End If + + If Not TieneError Then + 'If ObjConta IsNot Nothing Then ObjConta.Commit() + Inv.Commit() + + + Else + Inv.RollBack() + + Alert("Ocurrió un error al eliminar el movimiento. Por favor vuelva a intentar.", TipoMensaje.MsgError) + End If + CveMovimiento = 0 + + Inv.Dispose() + ObjGral.Dispose() + Conta.Dispose() + If Not String.IsNullOrEmpty(retorno) Then + context.Response.Write(retorno) + Else + context.Response.Write("[]") + End If + + Return retorno + End Function + + + End Class \ No newline at end of file