OrdenesTrabajo comit General

This commit is contained in:
Rakcsle Supertramp
2020-09-04 18:53:49 -07:00
parent 97ff4bff4d
commit 6234eb2ae8
4 changed files with 240 additions and 14 deletions

View File

@@ -231,7 +231,8 @@
<ContentTemplate>
<asp:GridView ID="GvMaterial" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveTipoServicioMaterial,CveTipoServicio,Cantidad,CveUM,CvePS,Tipo"
OnRowDataBound="GvMaterial_RowDataBound"
DataKeyNames="CveMaterial,Cantidad,CvePS,Importe"
GridLines="None">
<Columns>
@@ -243,6 +244,12 @@
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="45%" HeaderText="Importe">
<ItemTemplate>
<asp:TextBox ID="TxtImporte" runat="server" Text='<%# Eval("Importe") %>' Width="100px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
@@ -265,7 +272,8 @@
<ContentTemplate>
<asp:GridView ID="GvActividades" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveTipoServicioActividad,CveActividad,Duracion" GridLines="None">
OnRowDataBound="GvActividades_RowDataBound"
DataKeyNames="CveOrdenTrabajoActividad,CveActividad,Terminado" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="">
@@ -275,16 +283,18 @@
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Horas">
<ItemStyle Width="100px" />
<asp:BoundField DataField="Actividad" ItemStyle-Width="30%" HeaderText="Detalle" />
<asp:BoundField DataField="Duracion" ItemStyle-Width="30%" HeaderText="Duración (hrs)" />
<asp:TemplateField HeaderText="Observaciones">
<ItemStyle Width="300px" />
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtHoras" Width="100px"></asp:TextBox>
<ajax:FilteredTextBoxExtender runat="server" TargetControlID="TxtHoras" FilterType="Custom" ValidChars="1234567890." />
<asp:TextBox runat="server" ID="Observaciones" Text='<%# Eval("Observaciones") %>' Width="300px" MaxLength="200"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Nombre" ItemStyle-Width="30%" HeaderText="Actividad" />
<asp:BoundField DataField="Puesto" ItemStyle-Width="30%" HeaderText="Puesto" />
<%-- <asp:BoundField DataField="Nombre" ItemStyle-Width="30%" HeaderText="Actividad" />
<asp:BoundField DataField="Puesto" ItemStyle-Width="30%" HeaderText="Puesto" />--%>
</Columns>
</asp:GridView>
@@ -301,12 +311,13 @@
<ajax:TabPanel ID="TabCheckList" runat="server" HeaderText="Check List">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<div class="col-md-8">
<asp:UpdatePanel runat="server" ID="UpGvCheckList" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCheckList" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron datos" ToolTip="" CssClass="table table-smallpadding Widthall"
DataKeyNames="CveCheckListActividad,CheckListActividadGrupo,CveCheckList,CveTipoServicio"
OnRowDataBound="GvCheckList_RowDataBound"
DataKeyNames="CveOrdenTrabajoCheckList,CveCheckListActividad,CheckListActividadGrupo,Observaciones,Estatus,Terminado"
GridLines="None">
<Columns>
@@ -318,9 +329,9 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="No.">
<ItemStyle Width="100px" />
<ItemStyle Width="200px" />
<ItemTemplate>
<asp:Literal ID="LtlNROW" runat="server" Text='<%# Eval("NROW")%>'></asp:Literal>
<asp:Literal ID="LtlNROW" runat="server" Text='<%# Eval("NROWO")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
@@ -333,6 +344,41 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Condiciones operativas" ItemStyle-HorizontalAlign="Center">
<ItemStyle Width="180px" />
<HeaderTemplate>
<table style="width:180px">
<tr><td colspan="3">Condiciones Operativas</td></tr>
<tr>
<td style="width:60px">Si</td>
<td style="width:60px">No</td>
<td style="width:60px">ND</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<asp:RadioButtonList ID="RDLSINOND" runat="server" RepeatDirection="Horizontal" Width="180px" >
<asp:ListItem Value="1" ><label style="width:30px!important"></asp:ListItem>
<asp:ListItem Value="2"><label style="width:30px!important"></asp:ListItem>
<asp:ListItem Value="3"><label style="width:30px!important"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Observaciones">
<ItemStyle Width="300px" />
<ItemTemplate>
<asp:TextBox runat="server" ID="TxtObservaciones" Text='<%# Eval("Observaciones") %>' Width="300px" MaxLength="200"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

View File

@@ -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

View File

@@ -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

View File

@@ -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