Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

View File

@@ -0,0 +1,137 @@
Option Strict On
Option Explicit On
Imports Extensiones
Imports System.Data
Partial Class Ventas_RepIndiceRotacionPersonal
Inherits ClsPaginas
Private Sub Ventas_RepIndiceRotacionPersonal_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
txtInicio.Text = Date.Now.AddDays(-30).ToString("dd/MM/yyyy")
txtFin.Text = Date.Now.ToString("dd/MM/yyyy")
CargaProyecto()
CargaTurnos()
CargaDatos()
loadData()
End If
End Sub
Private Sub CargaTurnos()
DdlTurno.DataSource = GlobalDTTurno.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlTurno.DataBind()
DdlTurno.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargaProyecto()
DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa)
DdlProyecto.DataBind()
DdlProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto()
End Sub
Private Sub CargaDatos()
End Sub
Private Sub loadData()
Dim rh As New ClsRH
Dim dTable As New DataTable
Dim CveProyecto As Integer = -1
Dim CveSubproyecto As Integer = -1
Dim CveTurno As Integer = -1
Dim FechaInicio As Date = Date.Now.AddDays(-30)
Dim FechaFin As Date = Date.Now
Try
FechaInicio = Date.Parse(txtInicio.Text)
FechaFin = Date.Parse(txtFin.Text)
If DdlProyecto.SelectedIndex <> 0 Then
CveProyecto = DdlProyecto.SelectedValue.ToEntero
End If
If DdlSubProyecto.SelectedIndex <> 0 Then
CveSubproyecto = DdlSubProyecto.SelectedValue.ToEntero
End If
If DdlTurno.SelectedIndex <> 0 Then
CveTurno = DdlTurno.SelectedValue.ToEntero
End If
If rh.GetReporteRotacionPersonal(FechaInicio, FechaFin, CveTurno, CveProyecto, CveSubproyecto, UsuarioActual.Empresa.CveEmpresa) Then
dTable = rh.DtResultados
End If
GVRegDatos.DataSource = dTable
GVRegDatos.DataBind()
Catch ex As Exception
Dim exe As String = ex.Message
End Try
rh.Dispose()
UpDatos.Update()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
loadData()
End Sub
Protected Sub GVRegDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVRegDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
Dim sPorcentaje As String = e.Row.DBCampo("IRP").Trim
Dim porcentaje As Double = Convert.ToDouble(sPorcentaje)
e.Row.FCLabel("LblIrp").CssClass = "label label-danger"
e.Row.FCLabel("LblIrp").Font.Bold = True
e.Row.FCLabel("lblIrp").Attributes.Add("dir", "rtl")
e.Row.FCLabel("LblIrp").Text = sPorcentaje & "%"
If porcentaje <= 15.0 Then
e.Row.FCLabel("LblIrp").CssClass = "label label-success"
ElseIf (porcentaje > 15.0 And porcentaje <= 30.0) Then
e.Row.FCLabel("LblIrp").CssClass = "label label-warning"
End If
End If
End If
End Sub
End Class