Apoyo logistico, ordenes de servicio
This commit is contained in:
@@ -1218,38 +1218,54 @@ Partial Class OS_OrdenesServicios
|
||||
Dim Especificaciones As String = Row("Especificaciones").ToString
|
||||
Dim ComentarioTecnico As String = Row("ComentarioTecnico").ToString
|
||||
Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero
|
||||
Dim Archivo As New System.IO.FileInfo(Row("Archivo").ToString)
|
||||
|
||||
|
||||
|
||||
Dim fname As String = ""
|
||||
|
||||
If File.Exists(Row("Archivo").ToString) Then
|
||||
Dim Archivo As New System.IO.FileInfo("")
|
||||
fname = Archivo.Name
|
||||
End If
|
||||
|
||||
|
||||
Dim CveUsuarioEntrego As Integer = If(Entregar = True, UsuarioActual.CveUsuario, -1)
|
||||
Dim FechaEntrega As String = If(Entregar = True, Now.ToString("dd/MM/yyy"), "-1")
|
||||
Dim Consecutivo As Integer = Row("Consecutivo").ToString.ToEntero
|
||||
CveConsecutivo = Consecutivo
|
||||
|
||||
If CveOSDetalle > 0 Then
|
||||
If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalle(CvePS, Cantidad, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, ComentarioTecnico, CveCuentaEquipo, Archivo.Name, "-1", FechaEntrega, CveOSDetalle, CveOS) Then
|
||||
If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalle(CvePS, Cantidad, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, ComentarioTecnico, CveCuentaEquipo, fname, "-1", FechaEntrega, CveOSDetalle, CveOS) Then
|
||||
Errores = True
|
||||
End If
|
||||
Else
|
||||
CveOSDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(CveOS, CvePS, Cantidad, -1, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, CveCuentaEquipo, "-1", "-1", FechaEntrega, ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=Archivo.Name)
|
||||
CveOSDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(CveOS, CvePS, Cantidad, -1, CveUsuarioEntrego, Observaciones, SeSuperviso, SeFacturara, Estatus, CveCuentaEquipo, "-1", "-1", FechaEntrega, ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=fname)
|
||||
If Not CveOSDetalle > 0 Then Errores = True
|
||||
|
||||
End If
|
||||
|
||||
If Archivo.Name <> "-1" Then
|
||||
'Cambiar el nombre del archivo de CveUsuario-Consecutivo.ext a CveOS-Consecutivo.ext
|
||||
Dim ArchivoFinal As New System.IO.FileInfo(String.Format("{0}OS\Archivos\OS{1}-{2}{3}", UsuarioActual.Empresa.Ruta, CveOS, Consecutivo, System.IO.Path.GetExtension(Archivo.Extension)))
|
||||
|
||||
If ArchivoFinal.Exists() Then
|
||||
ArchivoFinal.Delete()
|
||||
End If
|
||||
|
||||
'Mover el archivo de los temporales a OS
|
||||
System.IO.File.Move(UsuarioActual.Empresa.Ruta & "\OS\Temp\" & Archivo.Name, UsuarioActual.Empresa.Ruta & "\OS\Archivos\" & ArchivoFinal.Name)
|
||||
If File.Exists(Row("Archivo").ToString) Then
|
||||
Dim Archivo As New System.IO.FileInfo("")
|
||||
If Archivo.Name <> "-1" Then
|
||||
'Cambiar el nombre del archivo de CveUsuario-Consecutivo.ext a CveOS-Consecutivo.ext
|
||||
Dim ArchivoFinal As New System.IO.FileInfo(String.Format("{0}OS\Archivos\OS{1}-{2}{3}", UsuarioActual.Empresa.Ruta, CveOS, Consecutivo, System.IO.Path.GetExtension(Archivo.Extension)))
|
||||
|
||||
If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalleArchivo(ArchivoFinal.Name, ObjOrdenServicio.CveOSDetalle) Then
|
||||
Errores = True
|
||||
If ArchivoFinal.Exists() Then
|
||||
ArchivoFinal.Delete()
|
||||
End If
|
||||
|
||||
'Mover el archivo de los temporales a OS
|
||||
System.IO.File.Move(UsuarioActual.Empresa.Ruta & "\OS\Temp\" & Archivo.Name, UsuarioActual.Empresa.Ruta & "\OS\Archivos\" & ArchivoFinal.Name)
|
||||
|
||||
If Not ObjOrdenServicio.UpdateOrdenesServiciosDetalleArchivo(ArchivoFinal.Name, ObjOrdenServicio.CveOSDetalle) Then
|
||||
Errores = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If TmpDTCaracteristica.FiltraParametros(String.Format("CveConsecutivoDetalle = {0}", Consecutivo)).Rows.Count > 0 Then
|
||||
|
||||
For Each RowE As DataRow In TmpDTCaracteristica.FiltraParametros(String.Format("CveConsecutivoDetalle = {0}", Consecutivo)).Rows
|
||||
@@ -1279,6 +1295,7 @@ Partial Class OS_OrdenesServicios
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
Else
|
||||
Errores = True
|
||||
|
||||
Reference in New Issue
Block a user