agregado procesos y bd clases
This commit is contained in:
50
guia/Extensiones/gestionesvarias.vb
Normal file
50
guia/Extensiones/gestionesvarias.vb
Normal file
@@ -0,0 +1,50 @@
|
||||
Partial Public Class gestionesvarias
|
||||
Public Shared Function CreaNuevoCambioContraseñaAgente(idAgente As Integer) As gestionesvarias
|
||||
Try
|
||||
Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContextoCN()
|
||||
Dim idTg = bd.enumeraciones.First(Function(x) x.Codigo = "TGV.CCAG").idEnumeracion
|
||||
Dim Ag = bd.agentes.First(Function(x) x.idAgente = idAgente).Codigo
|
||||
Static r As System.Random = New System.Random()
|
||||
Randomize()
|
||||
Dim iAleatorio = r.Next(100000000, 999999999).ToString
|
||||
Dim ng As New gestionesvarias
|
||||
With ng
|
||||
.idTipo = idTg
|
||||
.idAplicacion = idAgente
|
||||
.FechaCreacion = Now
|
||||
.Descripción = Ag
|
||||
.Parametros = tsl5.crypt.SHA1("M3Soft." & iAleatorio.ToString)
|
||||
End With
|
||||
bd.gestionesvarias.AddObject(ng)
|
||||
bd.SaveChanges()
|
||||
Return ng
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function CreaNuevoCambioContraseñaSubAgente(idSubAgente As Integer) As gestionesvarias
|
||||
Try
|
||||
Dim bd = bdGestionAsegasa.gestionasegasaEntities.NuevoContextoCN()
|
||||
Dim idTg = bd.enumeraciones.First(Function(x) x.Codigo = "TGV.CCSAG").idEnumeracion
|
||||
Dim Sag = bd.subagentes.First(Function(x) x.idSubagente = idSubAgente)
|
||||
Static r As System.Random = New System.Random()
|
||||
Randomize()
|
||||
Dim iAleatorio = r.Next(100000000, 999999999).ToString
|
||||
|
||||
Dim ng As New gestionesvarias
|
||||
With ng
|
||||
.idTipo = idTg
|
||||
.idAplicacion = idSubAgente
|
||||
.FechaCreacion = Now
|
||||
.Descripción = Sag.agentes.Codigo & "-" & Sag.Codigo
|
||||
.Parametros = tsl5.crypt.SHA1("M3Soft." & iAleatorio.ToString)
|
||||
End With
|
||||
bd.gestionesvarias.AddObject(ng)
|
||||
bd.SaveChanges()
|
||||
Return ng
|
||||
Catch ex As Exception
|
||||
Throw New Exception(ex.Message, ex)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user