Ordenes de servicio actualizado
This commit is contained in:
@@ -238,6 +238,15 @@ Partial Class OS_OrdenesServicios
|
|||||||
ViewState("MensajeAlert") = value
|
ViewState("MensajeAlert") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property CveTecnico As Integer
|
||||||
|
Get
|
||||||
|
Return ViewState("CveTecnico").ToString.ToEntero
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveTecnico") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
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 IsPostBack Then
|
If Not IsPostBack Then
|
||||||
@@ -270,18 +279,6 @@ Partial Class OS_OrdenesServicios
|
|||||||
CreaDtMaterialesDetalle()
|
CreaDtMaterialesDetalle()
|
||||||
CreaDtSolicitarMateriales()
|
CreaDtSolicitarMateriales()
|
||||||
CveSub = -1
|
CveSub = -1
|
||||||
'Carga estatus
|
|
||||||
Dim ObjEstatusPermisos As New ClsOS
|
|
||||||
If ObjEstatusPermisos.GetEstatusUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
|
||||||
EstatusOSDelUsuario = ObjEstatusPermisos.DtResultados
|
|
||||||
Dim PermisoEstatus As New DataTable
|
|
||||||
PermisoEstatus = ObjEstatusPermisos.DtResultados.FiltraParametros("TipoEstatus = 1")
|
|
||||||
If PermisoEstatus.Rows.Count = 0 Then
|
|
||||||
UpGuardar.Visible = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
ObjEstatusPermisos.Dispose()
|
|
||||||
CargaEstatusOS(2)
|
|
||||||
|
|
||||||
'Carga cliente
|
'Carga cliente
|
||||||
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
|
If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero > 0 Then
|
||||||
@@ -315,6 +312,8 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
'Carga OS
|
'Carga OS
|
||||||
If CveOS > 0 Then
|
If CveOS > 0 Then
|
||||||
|
|
||||||
|
CargaEstatusOS()
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
'PermisosSegunEstatus()
|
'PermisosSegunEstatus()
|
||||||
CargaDetalles()
|
CargaDetalles()
|
||||||
@@ -454,33 +453,45 @@ Partial Class OS_OrdenesServicios
|
|||||||
TxtFechaRecibido.Text = ObjOS.FechaRecepcion.ToString
|
TxtFechaRecibido.Text = ObjOS.FechaRecepcion.ToString
|
||||||
CveFolio = ObjOS.Folio
|
CveFolio = ObjOS.Folio
|
||||||
LblFolio.Text = ObjOS.Folio.ToString
|
LblFolio.Text = ObjOS.Folio.ToString
|
||||||
DdlEstatusOS.SelectedValue = ObjOS.CveEstatusOrdenServicio.ToString
|
|
||||||
DdlSubProyecto.SelectedValueExist(ObjOS.CveSubProyecto)
|
DdlSubProyecto.SelectedValueExist(ObjOS.CveSubProyecto)
|
||||||
DdlTipoOrdenOS.SelectedValueExist(ObjOS.CveOSTipo)
|
DdlTipoOrdenOS.SelectedValueExist(ObjOS.CveOSTipo)
|
||||||
DdlSucursalCliente.SelectedValueExist(ObjOS.CveClienteSucursal)
|
DdlSucursalCliente.SelectedValueExist(ObjOS.CveClienteSucursal)
|
||||||
|
|
||||||
TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio), "CveEstatusOrdenServicio ASC").ToEntero
|
TipoEstatus = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio), "CveEstatusOrdenServicio ASC").ToEntero
|
||||||
SeFacturara = GlobalDTTipoOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("SeFacturara", String.Format("CveOrdenServicioTipo = {0}", ObjOS.CveOSTipo))
|
SeFacturara = GlobalDTTipoOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("SeFacturara", String.Format("CveOrdenServicioTipo = {0}", ObjOS.CveOSTipo))
|
||||||
|
CveTecnico = ObjOS.CveUsuarioAtendio
|
||||||
If TipoEstatus = 2 Then
|
CargarEstatusDelUsuario()
|
||||||
LnkTecnico.Visible = True
|
Dim validacionTieneEstatus As Integer = EstatusOSDelUsuario.FiltraParametros(String.Format("CveEstatusOrdenServicio = {0}", ObjOS.CveEstatusOrdenServicio)).Rows.Count
|
||||||
End If
|
If validacionTieneEstatus > 0 Then
|
||||||
|
DdlEstatusOS.Items.Clear()
|
||||||
If TipoEstatus = 3 Then
|
DdlEstatusOS.DataSource = EstatusOSDelUsuario
|
||||||
DisableAll()
|
DdlEstatusOS.DataBind()
|
||||||
|
|
||||||
If SeFacturara = "True" Then
|
|
||||||
HplFacturar.Visible = True
|
|
||||||
If ObjOS.CveCotizacion > 0 Then
|
|
||||||
HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", ObjOS.CveCotizacion)
|
|
||||||
Else
|
Else
|
||||||
HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveOS={0}", CveOS)
|
CargaEstatusOS()
|
||||||
End If
|
DdlEstatusOS.Enabled = False
|
||||||
End If
|
End If
|
||||||
|
DdlEstatusOS.SelectedValue = ObjOS.CveEstatusOrdenServicio.ToString
|
||||||
|
|
||||||
ElseIf TipoEstatus = 4 Then
|
'If TipoEstatus = 2 Then
|
||||||
DisableAll()
|
' LnkTecnico.Visible = True
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
|
'If TipoEstatus = 3 Then
|
||||||
|
' DisableAll()
|
||||||
|
|
||||||
|
' If SeFacturara = "True" Then
|
||||||
|
' HplFacturar.Visible = True
|
||||||
|
' If ObjOS.CveCotizacion > 0 Then
|
||||||
|
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", ObjOS.CveCotizacion)
|
||||||
|
' Else
|
||||||
|
' HplFacturar.NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveOS={0}", CveOS)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
|
||||||
|
'ElseIf TipoEstatus = 4 Then
|
||||||
|
' DisableAll()
|
||||||
|
'End If
|
||||||
|
|
||||||
DivCliente.Attributes.Add("class", "col-md-8")
|
DivCliente.Attributes.Add("class", "col-md-8")
|
||||||
DivFolio.Visible = True
|
DivFolio.Visible = True
|
||||||
@@ -662,11 +673,11 @@ Partial Class OS_OrdenesServicios
|
|||||||
RegistraScript("OrdenarGVMateriales();")
|
RegistraScript("OrdenarGVMateriales();")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaEstatusOS(ValorSeleccionado As Integer)
|
Private Sub CargaEstatusOS()
|
||||||
DdlEstatusOS.Items.Clear()
|
DdlEstatusOS.Items.Clear()
|
||||||
DdlEstatusOS.DataSource = EstatusOSDelUsuario
|
DdlEstatusOS.DataSource = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa)
|
||||||
DdlEstatusOS.DataBind()
|
DdlEstatusOS.DataBind()
|
||||||
DdlEstatusOS.SelectedValue = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1", "Orden ASC")
|
'DdlEstatusOS.SelectedValue = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1", "Orden ASC")
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaPS(CveClasificacion As Integer, Objeto As DropDownList)
|
Private Sub CargaPS(CveClasificacion As Integer, Objeto As DropDownList)
|
||||||
Objeto.Items.Clear()
|
Objeto.Items.Clear()
|
||||||
@@ -876,6 +887,19 @@ Partial Class OS_OrdenesServicios
|
|||||||
GvPS.DataSource = TmpDT
|
GvPS.DataSource = TmpDT
|
||||||
GvPS.DataBind()
|
GvPS.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargarEstatusDelUsuario()
|
||||||
|
Dim ObjEstatusPermisos As New ClsOS
|
||||||
|
If ObjEstatusPermisos.GetEstatusUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||||
|
EstatusOSDelUsuario = ObjEstatusPermisos.DtResultados
|
||||||
|
Dim PermisoEstatus As New DataTable
|
||||||
|
PermisoEstatus = ObjEstatusPermisos.DtResultados.FiltraParametros("TipoEstatus = 1")
|
||||||
|
If PermisoEstatus.Rows.Count = 0 Then
|
||||||
|
UpGuardar.Visible = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjEstatusPermisos.Dispose()
|
||||||
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "BUSCAR CLIENTE "
|
#Region "BUSCAR CLIENTE "
|
||||||
@@ -1031,7 +1055,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
If CveTecnico = UsuarioActual.CveUsuario Then
|
||||||
If ObjOrdenServicio.UpdateOrdenesServicios(TxtSolicito.Text, TxtFechaRecibido.Text, TxtDescripcion.Text, UsuarioActual.CveUsuario, DdlEstatusOS.SelectedValue.ToEntero, CveOS, UsuarioActual.CveUsuario, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
|
If ObjOrdenServicio.UpdateOrdenesServicios(TxtSolicito.Text, TxtFechaRecibido.Text, TxtDescripcion.Text, UsuarioActual.CveUsuario, DdlEstatusOS.SelectedValue.ToEntero, CveOS, UsuarioActual.CveUsuario, DdlTipoOrdenOS.SelectedValue.ToEntero, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
|
||||||
For Each Row As DataRow In TmpDT.Rows
|
For Each Row As DataRow In TmpDT.Rows
|
||||||
If Not Errores Then
|
If Not Errores Then
|
||||||
@@ -1110,6 +1134,10 @@ Partial Class OS_OrdenesServicios
|
|||||||
Else
|
Else
|
||||||
Errores = True
|
Errores = True
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
Alert("No tienes permisos para modificar esta Orden de Servicio", TipoMensaje.MsgAdvertencia)
|
||||||
|
Errores = True
|
||||||
|
End If
|
||||||
|
|
||||||
If Not Errores Then
|
If Not Errores Then
|
||||||
ObjOrdenServicio.Commit()
|
ObjOrdenServicio.Commit()
|
||||||
@@ -1209,7 +1237,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
TxtSolicito.Text = ""
|
TxtSolicito.Text = ""
|
||||||
TxtFechaRecibido.Text = ""
|
TxtFechaRecibido.Text = ""
|
||||||
TxtDescripcion.Text = ""
|
TxtDescripcion.Text = ""
|
||||||
CargaEstatusOS(2)
|
CargaEstatusOS()
|
||||||
|
|
||||||
GvPS.DataSource = Nothing
|
GvPS.DataSource = Nothing
|
||||||
GvPS.DataBind()
|
GvPS.DataBind()
|
||||||
|
|||||||
Reference in New Issue
Block a user