From 6234eb2ae8aa0c8a968f373428c6ffcf338f48c2 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Fri, 4 Sep 2020 18:53:49 -0700 Subject: [PATCH] OrdenesTrabajo comit General --- AF/OrdenTrabajo.aspx | 70 +++++++++++++++++++----- AF/OrdenTrabajo.aspx.vb | 103 +++++++++++++++++++++++++++++++++++- AF/TipoOrdenTrabajo.aspx.vb | 5 +- App_Code/ClsAF.vb | 76 ++++++++++++++++++++++++++ 4 files changed, 240 insertions(+), 14 deletions(-) diff --git a/AF/OrdenTrabajo.aspx b/AF/OrdenTrabajo.aspx index 2725753e6..d11bfb317 100644 --- a/AF/OrdenTrabajo.aspx +++ b/AF/OrdenTrabajo.aspx @@ -231,7 +231,8 @@ @@ -243,6 +244,12 @@ + + + + + + @@ -265,7 +272,8 @@ + OnRowDataBound="GvActividades_RowDataBound" + DataKeyNames="CveOrdenTrabajoActividad,CveActividad,Terminado" GridLines="None"> @@ -275,16 +283,18 @@ - - + + + + + - - + - - + <%-- + --%> @@ -301,12 +311,13 @@
-
+
@@ -318,9 +329,9 @@ - + - + @@ -333,6 +344,41 @@ + + + + + + + + + + + +
Condiciones Operativas
SiNoND
+
+ + + + + + + + + + + + + +
+ + + + + + + +
diff --git a/AF/OrdenTrabajo.aspx.vb b/AF/OrdenTrabajo.aspx.vb index 7eb814f2b..17c74f7c4 100644 --- a/AF/OrdenTrabajo.aspx.vb +++ b/AF/OrdenTrabajo.aspx.vb @@ -37,6 +37,7 @@ Partial Class AF_OrdenTrabajo If Request("CveOrdenTrabajo") IsNot Nothing Then CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero Tab.Visible = True + CargaDatos() End If CargaCombos() @@ -106,7 +107,9 @@ Partial Class AF_OrdenTrabajo Private Sub CargaDatos() - + CargaMaterial() + CargaActividades() + CargaCheckList() End Sub @@ -369,4 +372,102 @@ Partial Class AF_OrdenTrabajo End Sub + + + Private Sub CargaMaterial() + + Dim ObjAF As New ClsAF + + If ObjAF.GetOrdenesTrabajoMateriales(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then + GvMaterial.DataSource = ObjAF.DtResultados + Else + GvMaterial.DataSource = Nothing + End If + + ObjAF.Dispose() + + GvMaterial.DataBind() + UpGvMaterial.Update() + + End Sub + + Private Sub CargaActividades() + + Dim ObjAF As New ClsAF + + + If ObjAF.GetOrdenesTrabajoActividades(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then + GvActividades.DataSource = ObjAF.DtResultados + Else + GvActividades.DataSource = Nothing + End If + + ObjAF.Dispose() + + GvActividades.DataBind() + UpGvActividades.Update() + + + End Sub + + Private Sub CargaCheckList() + + Dim ObjAF As New ClsAF + + + If ObjAF.GetOrdenesTrabajoCheckList(CveOrdenTrabajo, UsuarioActual.CveEmpresa) Then + + + GvCheckList.DataSource = ObjAF.DtResultados + Else + GvCheckList.DataSource = Nothing + End If + + ObjAF.Dispose() + + GvCheckList.DataBind() + UpGvCheckList.Update() + + End Sub + + Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + End Sub + Protected Sub GvActividades_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + End Sub + Protected Sub GvCheckList_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim Chk As CheckBox = e.Row.FCCheckBox("Chk") + Dim RDLSINOND As RadioButtonList = e.Row.FCRadioButtonList("RDLSINOND") + Dim TxtObservaciones As TextBox = e.Row.FCTextBox("TxtObservaciones") + + If e.Row.DataKey("CveOrdenTrabajoCheckList").ToEntero = 0 Then + + e.Row.FCLiteral("LtlNROW").Text = e.Row.DataKey("CheckListActividadGrupo").ToString + + e.Row.Attributes.Add("style", "background-color:#DDD") + + Chk.Visible = False + RDLSINOND.Visible = False + TxtObservaciones.Visible = False + Else + + If Boolean.Parse(e.Row.DataKey("Terminado")) Then + Chk.Checked = True + Else + Chk.Checked = False + End If + + End If + + + + + + End If + + End Sub End Class diff --git a/AF/TipoOrdenTrabajo.aspx.vb b/AF/TipoOrdenTrabajo.aspx.vb index cebcd7af4..ee6e23080 100644 --- a/AF/TipoOrdenTrabajo.aspx.vb +++ b/AF/TipoOrdenTrabajo.aspx.vb @@ -303,12 +303,15 @@ Partial Class AF_TipoOrdenTrabajo If e.Row.RowType = DataControlRowType.DataRow Then Dim Chk As CheckBox = e.Row.FCCheckBox("Chk") + If e.Row.DataKey("CveCheckListActividad").ToEntero = 0 Then e.Row.FCLiteral("LtlNROW").Text = e.Row.DataKey("CheckListActividadGrupo").ToString - Chk.Visible = False e.Row.Attributes.Add("style", "background-color:#DDD") + Chk.Visible = False + + End If diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index b9df20682..09c6e2dce 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -4279,6 +4279,82 @@ Public Class ClsAF + + Public Function GetOrdenesTrabajoMateriales(CveOrdenTrabajo As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoMaterialesGet") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los materiales", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + Public Function GetOrdenesTrabajoActividades(CveOrdenTrabajo As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoActividadesGet") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las actividades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + Public Function GetOrdenesTrabajoCheckList(CveOrdenTrabajo As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoCheckListGet") + + With SqlAdapter.SelectCommand.Parameters + + .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With + + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el check list", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + #End Region #End Region