diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index c716f91b6..2f6dc4b60 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -1415,6 +1415,33 @@ Public Class ClsContratos + + Public Function UpdateContratosEstimacion(CveEstimacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveEstimacionEstatus As Integer) As Boolean + + Dim Retorno = False + + DataAdapter("PA_Con_ContratosEstimacionUpdate") + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEstimacionEstatus", SqlDbType.Int).Value = CveEstimacionEstatus + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la estimacion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function RemoveContratosAvance(CveContratoAvance As Integer, CveEmpresa As Integer) As Boolean Dim Retorno = False diff --git a/Contratos/ContratoObraAutorizacion.aspx b/Contratos/ContratoObraAutorizacion.aspx index f22ccaceb..39a0117da 100644 --- a/Contratos/ContratoObraAutorizacion.aspx +++ b/Contratos/ContratoObraAutorizacion.aspx @@ -85,7 +85,7 @@
@@ -149,7 +149,7 @@
- + diff --git a/Contratos/ContratoObraAutorizacion.aspx.vb b/Contratos/ContratoObraAutorizacion.aspx.vb index bec497e3b..312288238 100644 --- a/Contratos/ContratoObraAutorizacion.aspx.vb +++ b/Contratos/ContratoObraAutorizacion.aspx.vb @@ -216,6 +216,9 @@ Partial Class Contratos_ContratoObraAutorizacion DTEstimaciones = ObjContratos.DtResultados CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero + If DTEstimaciones.Rows.Count > 0 Then + CveEstimacionActual = DTEstimaciones.FiltroPrimeroValor("CveEstimacion", "CveEstimacion > 0").ToString.ToEntero + End If End If @@ -652,6 +655,34 @@ Partial Class Contratos_ContratoObraAutorizacion + End Sub + Protected Sub BtnAutoriza_Click(sender As Object, e As EventArgs) + + + + Dim ErrorProceso As Boolean = True + + + + Dim ObjContrato As New ClsContratos + + If ObjContrato.UpdateContratosEstimacion(CveEstimacionActual, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3) Then + ErrorProceso = False + End If + + ObjContrato.Dispose() + + If Not ErrorProceso Then + + CveEstimacionActual = -1 + CargaAvancesParaEstimar() + Alert("Avance autorizado correctamente.") + + End If + + + + End Sub End Class