Personal código siguiente
This commit is contained in:
@@ -8,6 +8,7 @@ Imports Microsoft.Reporting.WebForms
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
Imports System.Data.SqlTypes
|
Imports System.Data.SqlTypes
|
||||||
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||||
|
Imports Microsoft.AspNet.SignalR.Infrastructure
|
||||||
|
|
||||||
Partial Class RH_Personal
|
Partial Class RH_Personal
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -1058,11 +1059,42 @@ Partial Class RH_Personal
|
|||||||
DVDdlTipoSangre.Visible = True
|
DVDdlTipoSangre.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not CvePersonal > 0 Then
|
||||||
|
AsignaSiguienteCodigo()
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
AgregarEventosAsincronosGvVacaciones()
|
AgregarEventosAsincronosGvVacaciones()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub AsignaSiguienteCodigo()
|
||||||
|
Dim ObjPersonal As New ClsRH()
|
||||||
|
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
|
Dim MaxCodigo As Integer = 1
|
||||||
|
|
||||||
|
If ObjPersonal.DtResultados.Rows.Count > 0 Then
|
||||||
|
MaxCodigo = ObjPersonal.DtResultados.AsEnumerable() _
|
||||||
|
.Select(Function(row)
|
||||||
|
Dim codigoStr As String = row.Field(Of String)("Codigo")
|
||||||
|
If Not String.IsNullOrWhiteSpace(codigoStr) Then
|
||||||
|
Dim codigo As Integer
|
||||||
|
If Integer.TryParse(codigoStr, codigo) Then
|
||||||
|
Return codigo
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return 0
|
||||||
|
End Function) _
|
||||||
|
.DefaultIfEmpty(0) _
|
||||||
|
.Max()
|
||||||
|
End If
|
||||||
|
|
||||||
|
TxtCodigo.Text = (MaxCodigo + 1).ToString("000")
|
||||||
|
|
||||||
|
End If
|
||||||
|
ObjPersonal.Dispose()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadDefaultValues()
|
Private Sub LoadDefaultValues()
|
||||||
DdlDepartamento.SelectedIndex = 1
|
DdlDepartamento.SelectedIndex = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user