Asignar Estatus a los usuarios en ordenes de servicio
This commit is contained in:
@@ -1574,16 +1574,16 @@ Public Class ClsOS
|
||||
|
||||
Return Retorno
|
||||
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
|
||||
|
||||
DataAdapter("PA_OS_EstatusUsuariosRemove")
|
||||
|
||||
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
|
||||
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UPSuperior" UpdateMode="Conditional">
|
||||
<%--<asp:UpdatePanel runat="server" ID="UPSuperior" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField runat="server" ID="IDhdnCveEstatusUsuarios" ClientIDMode="Static" />
|
||||
<asp:HiddenField runat="server" ID="IDCellYellow" ClientIDMode="Static" />
|
||||
@@ -364,7 +364,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:UpdatePanel>--%>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
@@ -30,7 +30,7 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
Get
|
||||
Return CType(ViewState("DTEstatusUsuarios"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Set(value As Data.DataTable)
|
||||
ViewState("DTEstatusUsuarios") = value
|
||||
End Set
|
||||
End Property
|
||||
@@ -39,16 +39,13 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
CreaGrid("Req")
|
||||
CreaGrid("OC")
|
||||
CargaGridEstatusUsuarios()
|
||||
ViewState("Orden") = ""
|
||||
'ViewState("TipoSeleccionado") = DdlTipo.SelectedValue
|
||||
|
||||
CveEstatuOS = -1
|
||||
CargaDatos()
|
||||
|
||||
'CargaProyectos()
|
||||
CargaUsuarios()
|
||||
|
||||
End If
|
||||
@@ -66,6 +63,12 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
If ObjEstatusOrdenServicios.GetEstatusUsuarios(-1, -1) Then
|
||||
DTEstatusUsuarios = ObjEstatusOrdenServicios.DtResultados
|
||||
Dim PermisosDeUsuario As DataTable = DTEstatusUsuarios
|
||||
End If
|
||||
|
||||
OrdenaDatos()
|
||||
ObjEstatusOrdenServicios.Dispose()
|
||||
GvDatos.DataBind()
|
||||
@@ -148,16 +151,8 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
Dim Estado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstado").Checked
|
||||
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()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -234,9 +229,7 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
Dim HuboErrores As Boolean = False
|
||||
Dim CveSubProyecto = 59
|
||||
|
||||
|
||||
For Each Row As GridViewRow In GvEstatusUsuariosREQ.Rows
|
||||
Dim aux As String = Row.DataKey("CveUsuario").ToString
|
||||
Dim r As Integer = 1
|
||||
For i = 0 To Row.Cells.Count - 1
|
||||
|
||||
@@ -244,14 +237,13 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
|
||||
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
|
||||
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
|
||||
Exit For
|
||||
End If
|
||||
ElseIf Row.FCCheckBox("chkEstatus" + r.ToString).Checked = True Then
|
||||
'And Row.FCHiddenField("hdnCveEstatusUsuarios" + r.ToString).Value.ToEntero = -1
|
||||
'Guardado masivo cuando sea SubProyecto "Todos"
|
||||
If CveSubProyecto = -2 Then
|
||||
For Each dr As DataRow In GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).Rows
|
||||
@@ -292,7 +284,25 @@ Partial Class OS_CatEstatusOrdenServicio
|
||||
End If
|
||||
|
||||
objEstatusOC.Dispose()
|
||||
CargaDatos()
|
||||
CargaGridEstatusUsuarios()
|
||||
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 Class
|
||||
|
||||
Reference in New Issue
Block a user