-- mejora en carga imagen AF
This commit is contained in:
@@ -2394,10 +2394,10 @@ Partial Class AF_AF
|
||||
End If
|
||||
NewName = String.Format("{0}{1}", NewName, IO.Path.GetExtension(DirectorioOld.ToString()))
|
||||
DirectorioNew.Append(NewName)
|
||||
If ObjActivosFijos.AddActivosFijosImagenes(CveActivoFijo, String.Format("AF/{0}", NewName), UsuarioActual.CveUsuario) Then
|
||||
If ObjActivosFijos.AddActivosFijosImagenes(CveActivoFijo, String.Format("AF/{0}", NewName), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then
|
||||
CargarArchivo()
|
||||
My.Computer.FileSystem.MoveFile(DirectorioOld.ToString, DirectorioNew.ToString)
|
||||
Else
|
||||
My.Computer.FileSystem.MoveFile(DirectorioOld.ToString, DirectorioNew.ToString)
|
||||
|
||||
End If
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
@@ -2409,8 +2409,6 @@ Partial Class AF_AF
|
||||
UpUpFotos.Update()
|
||||
Next
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnEliminarFoto_Click(sender As Object, e As System.EventArgs)
|
||||
|
||||
@@ -698,20 +698,21 @@ Public Class ClsAF
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Public Function AddActivosFijosImagenes(CveActivoFijo As Integer, URL As String, CveUsuario As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Public Function AddActivosFijosImagenes(CveActivoFijo As Integer, URL As String, CveUsuario As Integer, CveEmpresa As Integer) As Integer
|
||||
Dim Retorno As Integer = 0
|
||||
|
||||
DataAdapter("PA_AF_ActivosFijosImagenesAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
|
||||
.Add("@URL", SqlDbType.VarChar).Value = URL
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveImagenActivoFijo", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Retorno = SqlAdapter.SelectCommand.Parameters("@CveImagenActivoFijo").Value.ToString().ToEntero()
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 2627;") Then
|
||||
Alert("Ya existe una Imagen en Fijo Imagenes con el mismo nombre: " & Descripcion & ".", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user