134 lines
4.6 KiB
Plaintext
134 lines
4.6 KiB
Plaintext
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports Extensiones
|
|
Imports System.Data
|
|
|
|
Partial Class Nomina_RepPersonalAcumulados
|
|
Inherits ClsPaginas
|
|
|
|
#Region "Propiedades"
|
|
|
|
Private ReadOnly Property CvePersonal As Integer
|
|
Get
|
|
Return ViewState("CvePersonal").ToString.ToEntero
|
|
End Get
|
|
End Property
|
|
|
|
Private ReadOnly Property CveTipoPeriodo As Integer
|
|
Get
|
|
Return ViewState("CveTipoPeriodo").ToString.ToEntero
|
|
End Get
|
|
End Property
|
|
#End Region
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
CargaPersonal()
|
|
|
|
If Request("CvePersonal") IsNot Nothing AndAlso IsNumeric(Request("CvePersonal")) AndAlso Request("CvePersonal").ToEntero > 0 Then
|
|
ViewState("CvePersonal") = Request("CvePersonal")
|
|
CargaPersona()
|
|
CargarPeriodo()
|
|
CargaDatos()
|
|
DdlPersonal.SelectedValue = CvePersonal.ToString
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub CargaPersonal()
|
|
Dim ObjPersonal As New ClsRH
|
|
|
|
If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
|
|
DdlPersonal.DataSource = ObjPersonal.DtResultados
|
|
DdlPersonal.DataBind()
|
|
End If
|
|
|
|
ObjPersonal.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaPersona()
|
|
Dim ObjPersonal As New ClsRH
|
|
|
|
If CvePersonal > 0 AndAlso ObjPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) Then
|
|
ViewState("CveTipoPeriodo") = ObjPersonal.CveTipoPeriodo
|
|
LblNombre.Text = ObjPersonal.NombreCompleto
|
|
LblCodigo.Text = ObjPersonal.Codigo
|
|
|
|
Dim Departamento As DataRow = GlobalDTDepartamentos().FiltraParametros("CveDepartamento = " & ObjPersonal.CveDepartamento)(0)
|
|
LblDepartamento.Text = Departamento("Departamento").ToString
|
|
|
|
Dim Puesto As DataRow = GlobalDTRHPuestos(UsuarioActual.CveEmpresa).FiltraParametros("CvePuesto = " & ObjPersonal.CvePuesto)(0)
|
|
LblPuesto.Text = Puesto("Puesto").ToString
|
|
|
|
LblRFC.Text = ObjPersonal.RFC
|
|
LblCURP.Text = ObjPersonal.CURP
|
|
Else
|
|
ViewState("CveTipoPeriodo") = -1
|
|
LblNombre.Text = ""
|
|
LblCodigo.Text = ""
|
|
LblDepartamento.Text = ""
|
|
LblPuesto.Text = ""
|
|
LblRFC.Text = ""
|
|
LblCURP.Text = ""
|
|
End If
|
|
|
|
ObjPersonal.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargarPeriodo()
|
|
Dim objPeriodo As New ClsNominas
|
|
|
|
If objPeriodo.GetPeriodos(CveTipoPeriodo, UsuarioActual.CveEmpresa, -1, -1, -1) Then
|
|
LblTipoPeriodo.Text = objPeriodo.TipoPeriodo
|
|
LblNumero.Text = objPeriodo.Numero.ToString
|
|
LblFechaInicio.Text = objPeriodo.FechaInicio.ToShortDateString
|
|
LblFechaFin.Text = objPeriodo.FechaFin.ToShortDateString
|
|
End If
|
|
|
|
objPeriodo.Dispose()
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjNomina As New ClsNominas()
|
|
|
|
If ObjNomina.GetRepPersonalAcumulados(CvePersonal, UsuarioActual.Empresa.EjercicioActual) Then
|
|
GvDatos.DataSource = ObjNomina.DtResultados
|
|
Else
|
|
GvDatos.DataSource = Nothing
|
|
End If
|
|
ObjNomina.Dispose()
|
|
GvDatos.DataBind()
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
Dim Css As String = "Texto"
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
|
|
e.Row.Cells(0).Width = Unit.Pixel(100)
|
|
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
|
e.Row.Cells(1).Width = Unit.Pixel(200)
|
|
e.Row.Cells(2).Width = Unit.Pixel(100)
|
|
e.Row.Cells(3).Width = Unit.Pixel(100)
|
|
e.Row.Cells(4).Width = Unit.Pixel(100)
|
|
e.Row.CssClass = "Totales"
|
|
Css = "Totales"
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
|
|
GvDatos.ExportToExcel("ReportePersonalAcumulados" & Now.ToShortDateString)
|
|
End Sub
|
|
|
|
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonal.SelectedIndexChanged
|
|
ViewState("CvePersonal") = DdlPersonal.SelectedValue
|
|
CargaPersona()
|
|
CargaDatos()
|
|
CargarPeriodo()
|
|
UPEmpleado.Update()
|
|
UPDatos.Update()
|
|
End Sub
|
|
End Class
|