Asignar Estatus a los usuarios en ordenes de servicio
This commit is contained in:
@@ -1574,16 +1574,16 @@ Public Class ClsOS
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function RemoveEstatusUsuarios(CveEstatusUsuarios As Integer) As Boolean
|
Public Function RemoveEstatusUsuarios(CveEstatus As Integer, CveUsuario As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_OS_EstatusUsuariosRemove")
|
DataAdapter("PA_OS_EstatusUsuariosRemove")
|
||||||
|
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
SqlAdapter.SelectCommand.Parameters.Add("@CveEstatusUsuario", SqlDbType.Int).Value = CveEstatusUsuarios
|
.Add("@CveEstatusOrdenServicio", SqlDbType.Int).Value = CveEstatus
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
End With
|
End With
|
||||||
|
|
||||||
|
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
Retorno = True
|
Retorno = True
|
||||||
|
|||||||
@@ -302,7 +302,7 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
<asp:UpdatePanel runat="server" ID="UPSuperior" UpdateMode="Conditional">
|
<%--<asp:UpdatePanel runat="server" ID="UPSuperior" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:HiddenField runat="server" ID="IDhdnCveEstatusUsuarios" ClientIDMode="Static" />
|
<asp:HiddenField runat="server" ID="IDhdnCveEstatusUsuarios" ClientIDMode="Static" />
|
||||||
<asp:HiddenField runat="server" ID="IDCellYellow" ClientIDMode="Static" />
|
<asp:HiddenField runat="server" ID="IDCellYellow" ClientIDMode="Static" />
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>--%>
|
||||||
|
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Partial Class OS_CatEstatusOrdenServicio
|
|||||||
Get
|
Get
|
||||||
Return CType(ViewState("DTEstatusUsuarios"), DataTable)
|
Return CType(ViewState("DTEstatusUsuarios"), DataTable)
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As Data.DataTable)
|
||||||
ViewState("DTEstatusUsuarios") = value
|
ViewState("DTEstatusUsuarios") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -39,16 +39,13 @@ Partial Class OS_CatEstatusOrdenServicio
|
|||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
|
CargaDatos()
|
||||||
CreaGrid("Req")
|
CreaGrid("Req")
|
||||||
CreaGrid("OC")
|
|
||||||
CargaGridEstatusUsuarios()
|
CargaGridEstatusUsuarios()
|
||||||
ViewState("Orden") = ""
|
ViewState("Orden") = ""
|
||||||
'ViewState("TipoSeleccionado") = DdlTipo.SelectedValue
|
|
||||||
|
|
||||||
CveEstatuOS = -1
|
CveEstatuOS = -1
|
||||||
CargaDatos()
|
|
||||||
|
|
||||||
'CargaProyectos()
|
|
||||||
CargaUsuarios()
|
CargaUsuarios()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -66,6 +63,12 @@ Partial Class OS_CatEstatusOrdenServicio
|
|||||||
Else
|
Else
|
||||||
Me.GvDatos.DataSource = Nothing
|
Me.GvDatos.DataSource = Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If ObjEstatusOrdenServicios.GetEstatusUsuarios(-1, -1) Then
|
||||||
|
DTEstatusUsuarios = ObjEstatusOrdenServicios.DtResultados
|
||||||
|
Dim PermisosDeUsuario As DataTable = DTEstatusUsuarios
|
||||||
|
End If
|
||||||
|
|
||||||
OrdenaDatos()
|
OrdenaDatos()
|
||||||
ObjEstatusOrdenServicios.Dispose()
|
ObjEstatusOrdenServicios.Dispose()
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
@@ -148,16 +151,8 @@ Partial Class OS_CatEstatusOrdenServicio
|
|||||||
Dim Estado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
Dim Estado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||||
Dim CveEstatusOrdenServicio As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
Dim CveEstatusOrdenServicio As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
|
||||||
|
|
||||||
'If ObjEstatusOrdenServicios.UpdateEstatusOrdenServicio(EstatusOrdenServicio, Estado, CveEstatusOrdenServicio) Then
|
|
||||||
' GvDatos.EditIndex = -1
|
|
||||||
' ViewState("DTEstatusOrdenServicios") = ObjEstatusOrdenServicios.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
|
||||||
' GlobalDTEstatusOrdenServicios = ObjEstatusOrdenServicios.DtResultados
|
|
||||||
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
|
||||||
'End If
|
|
||||||
|
|
||||||
ObjEstatusOrdenServicios.Dispose()
|
ObjEstatusOrdenServicios.Dispose()
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
@@ -234,9 +229,7 @@ Partial Class OS_CatEstatusOrdenServicio
|
|||||||
Dim HuboErrores As Boolean = False
|
Dim HuboErrores As Boolean = False
|
||||||
Dim CveSubProyecto = 59
|
Dim CveSubProyecto = 59
|
||||||
|
|
||||||
|
|
||||||
For Each Row As GridViewRow In GvEstatusUsuariosREQ.Rows
|
For Each Row As GridViewRow In GvEstatusUsuariosREQ.Rows
|
||||||
Dim aux As String = Row.DataKey("CveUsuario").ToString
|
|
||||||
Dim r As Integer = 1
|
Dim r As Integer = 1
|
||||||
For i = 0 To Row.Cells.Count - 1
|
For i = 0 To Row.Cells.Count - 1
|
||||||
|
|
||||||
@@ -244,14 +237,13 @@ Partial Class OS_CatEstatusOrdenServicio
|
|||||||
|
|
||||||
If CveEstatus > 0 Then
|
If CveEstatus > 0 Then
|
||||||
|
|
||||||
If Row.FCCheckBox("chkEstatus" + r.ToString).Checked = False And Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero > 0 Then
|
If Row.FCCheckBox("chkEstatus" + r.ToString).Checked = False Then
|
||||||
'Eliminar el registro existente
|
'Eliminar el registro existente
|
||||||
If Not objEstatusOC.RemoveEstatusUsuarios(Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero) Then
|
If Not objEstatusOC.RemoveEstatusUsuarios(CveEstatus, Row.DataKey("CveUsuario").ToString.ToEntero) Then
|
||||||
HuboErrores = True
|
HuboErrores = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
ElseIf Row.FCCheckBox("chkEstatus" + r.ToString).Checked = True Then
|
ElseIf Row.FCCheckBox("chkEstatus" + r.ToString).Checked = True Then
|
||||||
'And Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero = -1
|
|
||||||
'Guardado masivo cuando sea SubProyecto "Todos"
|
'Guardado masivo cuando sea SubProyecto "Todos"
|
||||||
If CveSubProyecto = -2 Then
|
If CveSubProyecto = -2 Then
|
||||||
For Each dr As DataRow In GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).Rows
|
For Each dr As DataRow In GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).Rows
|
||||||
@@ -292,7 +284,25 @@ Partial Class OS_CatEstatusOrdenServicio
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
objEstatusOC.Dispose()
|
objEstatusOC.Dispose()
|
||||||
|
CargaDatos()
|
||||||
CargaGridEstatusUsuarios()
|
CargaGridEstatusUsuarios()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub GvEstatusUsuariosREQ_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatusUsuariosREQ.RowDataBound
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
Dim PermisosDeUsuario As DataTable = DTEstatusUsuarios.FiltraParametros(String.Format("CveUsuario = {0}", e.Row.DBCampo("CveUsuario").ToString))
|
||||||
|
Dim CveUsuario As String = e.Row.DBCampo("CveUsuario").ToString
|
||||||
|
For i As Integer = 1 To 10
|
||||||
|
Dim CveEstatus As Integer = GvEstatusUsuariosREQ.Columns(i).FooterText.ToEntero
|
||||||
|
If CveEstatus > 0 Then
|
||||||
|
Dim auxiliarBandera As DataRow = PermisosDeUsuario.FiltroPrimero(String.Format("CveEstatusOrdenServicio = {0}", CveEstatus.ToString))
|
||||||
|
If auxiliarBandera IsNot Nothing Then
|
||||||
|
Dim chkEstatus As CheckBox = e.Row.FCCheckBox(String.Format("chkEstatus{0}", i))
|
||||||
|
chkEstatus.Checked = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user