CalculoSBC
This commit is contained in:
@@ -4,6 +4,7 @@ Option Explicit On
|
|||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports CrystalDecisions.[Shared].Json
|
Imports CrystalDecisions.[Shared].Json
|
||||||
|
Imports DocumentFormat.OpenXml.Presentation
|
||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports Microsoft.Ajax.Utilities
|
Imports Microsoft.Ajax.Utilities
|
||||||
Imports Profact.TimbraCFDI40
|
Imports Profact.TimbraCFDI40
|
||||||
@@ -2283,7 +2284,9 @@ Public Class ClsRH
|
|||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Public Function UpdateSalarios(CvePersonal As Integer, Fecha As String, CveUsuario As Integer, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double, SalarioDiarioSS As Double, SalarioDiarioPago As Double, Optional CalcularSDI As Boolean = False) As Boolean
|
Public Function UpdateSalarios(CvePersonal As Integer, Fecha As String, CveUsuario As Integer, CveEmpresa As Integer, SalarioDiario As Double, SDI As Double,
|
||||||
|
SalarioDiarioSS As Double, SalarioDiarioPago As Double, Optional CalcularSDI As Boolean = False, Optional ActualizaSalarioV As Boolean = False,
|
||||||
|
Optional OrigenU As String = "") As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
SqlDataAdapter("PA_RH_PersonalUpdateSalarios")
|
SqlDataAdapter("PA_RH_PersonalUpdateSalarios")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
@@ -2296,6 +2299,8 @@ Public Class ClsRH
|
|||||||
.Add("@SDI", SqlDbType.Money).Value = SDI
|
.Add("@SDI", SqlDbType.Money).Value = SDI
|
||||||
.Add("@SalarioDiarioSS", SqlDbType.Money).Value = SalarioDiarioSS
|
.Add("@SalarioDiarioSS", SqlDbType.Money).Value = SalarioDiarioSS
|
||||||
.Add("@CalcularSDI", SqlDbType.Bit).Value = CalcularSDI
|
.Add("@CalcularSDI", SqlDbType.Bit).Value = CalcularSDI
|
||||||
|
.Add("@ActualizaSalarioV", SqlDbType.Bit).Value = ActualizaSalarioV
|
||||||
|
.Add("@OrigenU", SqlDbType.Bit).Value = OrigenU
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -420,5 +420,24 @@ Public Class ClsTransportes
|
|||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function VIA_FormularioTrip(cveTrip As Int32, cveUsuario As Int32, cveEmpresa As Int32) As Boolean
|
||||||
|
Dim retorno As Boolean = False
|
||||||
|
DataAdapter("PA_VIA_FormularioTrip", CommandType.StoredProcedure)
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveTrip", SqlDbType.Int).Value = cveTrip
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = cveUsuario
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar el importe.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
BIN
Imagenes/autobus.png
Normal file
BIN
Imagenes/autobus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
Imagenes/sprinter.png
Normal file
BIN
Imagenes/sprinter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -555,7 +555,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
}
|
}
|
||||||
private void CargaTiposPeriodo()
|
private void CargaTiposPeriodo()
|
||||||
{
|
{
|
||||||
set_GlobalDTTipoPeriodos(UsuarioActual.CveEmpresa, null);
|
|
||||||
DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodos(UsuarioActual.CveEmpresa);
|
DdlTipoPeriodo.DataSource = get_GlobalDTTipoPeriodos(UsuarioActual.CveEmpresa);
|
||||||
DdlTipoPeriodoCM.DataSource = DdlTipoPeriodo.DataSource;
|
DdlTipoPeriodoCM.DataSource = DdlTipoPeriodo.DataSource;
|
||||||
DdlTipoPeriodoSim.DataSource = DdlTipoPeriodo.DataSource;
|
DdlTipoPeriodoSim.DataSource = DdlTipoPeriodo.DataSource;
|
||||||
|
|||||||
@@ -520,7 +520,8 @@ public partial class RH_CalculoSBC : ClsPaginas
|
|||||||
SDI = Salariodiario * factordeintegracion;
|
SDI = Salariodiario * factordeintegracion;
|
||||||
SalarioCotizacion = Salariovariable + SDI;
|
SalarioCotizacion = Salariovariable + SDI;
|
||||||
if (objpersonal.UpdateSalarios(CvePersonal, txtfechacargamasiva.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
if (objpersonal.UpdateSalarios(CvePersonal, txtfechacargamasiva.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||||
Salariodiario.ToString().ToDouble(), SDI.ToString().ToDouble(), SalarioCotizacion.ToString().ToDouble(), Salariodiario.ToString().ToDouble()))
|
Salariodiario.ToString().ToDouble(), SDI.ToString().ToDouble(), SalarioCotizacion.ToString().ToDouble(), Salariodiario.ToString().ToDouble(),
|
||||||
|
false,true,"C"))
|
||||||
{
|
{
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -753,7 +754,9 @@ public partial class RH_CalculoSBC : ClsPaginas
|
|||||||
double SalarioVariableNuevo = item.DataKey("SalarioVariableNuevo").ToDouble();
|
double SalarioVariableNuevo = item.DataKey("SalarioVariableNuevo").ToDouble();
|
||||||
double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2);
|
double SalarioDiarioSS = Math.Round(item.DataKey("SalarioDiarioSS").ToDouble(), 2);
|
||||||
if (continuar && (item.FCCheckBox("chkUpdate").Checked) &&//SalarioDiarioSSNuevo != SalarioDiarioSS &&
|
if (continuar && (item.FCCheckBox("chkUpdate").Checked) &&//SalarioDiarioSSNuevo != SalarioDiarioSS &&
|
||||||
(continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario)))
|
(continuar = objrh.UpdateSalarios(CvePersonal, fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, SalarioDiario, SDINuevo, SalarioDiarioSSNuevo, SalarioDiario,
|
||||||
|
false,true,"D"
|
||||||
|
)))
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7050,7 +7050,9 @@ Partial Class RH_Personal
|
|||||||
TxtSalarioDiarioIntegrado.Text = TxtFISalarioDiarioIntegrado.Text
|
TxtSalarioDiarioIntegrado.Text = TxtFISalarioDiarioIntegrado.Text
|
||||||
Using ObjPersonal As ClsRH = New ClsRH()
|
Using ObjPersonal As ClsRH = New ClsRH()
|
||||||
ObjPersonal.IniciaTransacSQL()
|
ObjPersonal.IniciaTransacSQL()
|
||||||
If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, TxtSalarioDiarioM.Text.ToDecimal(), TxtFISalarioDiarioIntegrado.Text.ToDecimal(), TxtSalarioDiarioImSS.Text.ToDecimal(), TxtSalarioDiarioM.Text.ToDecimal()) Then
|
If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||||
|
TxtSalarioDiarioM.Text.ToDecimal(), TxtFISalarioDiarioIntegrado.Text.ToDecimal(), TxtSalarioDiarioImSS.Text.ToDecimal(),
|
||||||
|
TxtSalarioDiarioM.Text.ToDecimal(), False, False, "A") Then
|
||||||
|
|
||||||
|
|
||||||
ObjPersonal.Commit()
|
ObjPersonal.Commit()
|
||||||
@@ -7085,7 +7087,7 @@ Partial Class RH_Personal
|
|||||||
Using ObjPersonal As ClsRH = New ClsRH()
|
Using ObjPersonal As ClsRH = New ClsRH()
|
||||||
ObjPersonal.IniciaTransacSQL()
|
ObjPersonal.IniciaTransacSQL()
|
||||||
If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSSSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
If ObjPersonal.UpdateSalarios(CvePersonal, TxtFechamodIMSSSalario.Text.ToDate().ToString("yyyy/MM/dd"), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||||
TxtSalarioDiario.Text.ToDecimal(), TxtMImssSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), -1) Then
|
TxtSalarioDiario.Text.ToDecimal(), TxtMImssSDI.Text.ToDecimal(), TxtMImssSalarioDiarioImSS.Text.ToDecimal(), -1, False, True, "B") Then
|
||||||
|
|
||||||
|
|
||||||
ObjPersonal.Commit()
|
ObjPersonal.Commit()
|
||||||
|
|||||||
@@ -1,19 +1,323 @@
|
|||||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TripsChecks.aspx.cs" Inherits="VYA_TripsChecks" %>
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TripsChecks.aspx.cs" Inherits="VYA_TripsChecks" %>
|
||||||
|
|
||||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
<style>
|
||||||
|
.trip-button {
|
||||||
|
display: inline-block;
|
||||||
|
width: 150px;
|
||||||
|
text-align: center;
|
||||||
|
margin: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trip-button img {
|
||||||
|
width: 150px;
|
||||||
|
height: auto;
|
||||||
|
border: 2px solid #ddd;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
transition: transform 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trip-button img:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.trip-button p {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.odometer-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.odometer-btn {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
line-height: 1;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-ok {
|
||||||
|
background-color: green;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-detected {
|
||||||
|
background-color: red;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-next {
|
||||||
|
background-color: blue;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.gridview-style {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gridview-style td {
|
||||||
|
padding: 10px;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
.requerido{color:darkred}
|
||||||
|
</style>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12">
|
||||||
|
|
||||||
|
<asp:Panel ID="PnlPaso1" runat="server">
|
||||||
|
|
||||||
|
<div class="portlet light xspadding bordered" id="idnecesaria1">
|
||||||
|
<div class="portlet-title ">
|
||||||
|
<div class="tools">
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption">
|
||||||
|
Paso 1: Seleccione el Tipo de Unidad
|
||||||
|
</div>
|
||||||
|
<div class="tools">
|
||||||
|
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||||
|
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<div class="btn-group">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-offset-2 col-sm-4">
|
||||||
|
<!-- Botón para Trip Autobus -->
|
||||||
|
<asp:ImageButton ID="imgBtnAutobus" runat="server" ImageUrl="~/imagenes/autobus.png" OnClick="ImgBtnAutobus_Click" CssClass="trip-button" />
|
||||||
|
<p>TRIP AUTOBUS</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4">
|
||||||
|
<!-- Botón para Trip Sprinter -->
|
||||||
|
<asp:ImageButton ID="imgBtnSprinter" runat="server" ImageUrl="~/imagenes/sprinter.png" OnClick="ImgBtnSprinter_Click" CssClass="trip-button" />
|
||||||
|
<p>TRIP SPRINTER</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</asp:Panel>
|
||||||
|
<asp:Panel ID="PnlPaso2" runat="server">
|
||||||
|
|
||||||
|
<div class="portlet light xspadding bordered" id="idnecesaria">
|
||||||
|
<div class="portlet-title ">
|
||||||
|
<div class="tools">
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption">
|
||||||
|
Paso 2: CHECK PT
|
||||||
|
</div>
|
||||||
|
<div class="tools">
|
||||||
|
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||||
|
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<div class="btn-group">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Tipo de Unidad</label>
|
||||||
|
<asp:DropDownList ID="DdlTipoUnidad" data-text="Todos" AppendDataBoundItems="true" AutoPostBack="true"
|
||||||
|
DataTextField="TipoActivoFijo" DataValueField="CveTipoActivoFijo" OnSelectedIndexChanged="DdlTipoUnidad_SelectedIndexChanged"
|
||||||
|
CssClass="form-control ddlFiltros input-sm select2me Widthall" ClientIDMode="Static"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Unidad</label>
|
||||||
|
<asp:DropDownList ID="DdlAF" DataValueField="CveActivoFijo" DataTextField="CodDesc" Class="form-control select2me" Width="100%" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="odometro">Folio</label>
|
||||||
|
<asp:TextBox ID="TxtFolio" runat="server" CssClass="form-control text-right" Text="0" Style="width: 100%;" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Fecha</label>
|
||||||
|
|
||||||
|
<div style="width: 115px">
|
||||||
|
<div class="input-group input-sm input-small date date-picker "
|
||||||
|
data-date-format="dd/mm/yyyy"
|
||||||
|
style="width: 100px !important; padding: 0px;">
|
||||||
|
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control"
|
||||||
|
MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendario" class="btn default" Text="<i class='fa fa-calendar'></i>"
|
||||||
|
runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI"
|
||||||
|
Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI"
|
||||||
|
PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Chofer</label>
|
||||||
|
<asp:DropDownList ID="DdlChofer" data-text="Todos" AppendDataBoundItems="true"
|
||||||
|
DataTextField="NombreCompleto" DataValueField="CvePersonal" CssClass="form-control ddlFiltros input-sm select2me Widthall" ClientIDMode="Static"
|
||||||
|
Style="width: 100%;" runat="server">
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="odometro">ODÓMETRO</label>
|
||||||
|
<div class="odometer-container">
|
||||||
|
<button type="button" class="odometer-btn" onclick="updateOdometer(-1)">-</button>
|
||||||
|
<asp:TextBox ID="txtOdometer" runat="server" CssClass="form-control text-center" Text="0" Style="width: 80px;" />
|
||||||
|
<button type="button" class="odometer-btn" onclick="updateOdometer(1)">+</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group text-right">
|
||||||
|
|
||||||
|
<asp:Button ID="btnContinuar" runat="server" CssClass="btn btn-primary" Text="Continuar" OnClientClick="setPaso(3); return false;" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</asp:Panel>
|
||||||
|
<asp:Panel ID="PnlPaso3" runat="server">
|
||||||
|
|
||||||
|
<div class="portlet light xspadding bordered" id="idnecesaria3">
|
||||||
|
<div class="portlet-title ">
|
||||||
|
<div class="tools">
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption">
|
||||||
|
Paso 3:
|
||||||
|
</div>
|
||||||
|
<div class="tools">
|
||||||
|
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
|
||||||
|
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<div class="btn-group">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body" style="display:none;">
|
||||||
|
<div>
|
||||||
|
<h4>
|
||||||
|
<asp:Label ID="lblFormulario" runat="server" Font-Bold="True" />
|
||||||
|
</h4>
|
||||||
|
<asp:GridView ID="gvPreguntas" runat="server" GridLines="none" AutoGenerateColumns="False" ShowHeader="false" DataKeyNames="CvePregunta,Valor"
|
||||||
|
CssClass="gridview-style" OnRowDataBound="gvPreguntas_RowDataBound" >
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField HeaderText="Acciones">
|
||||||
|
<ItemTemplate>
|
||||||
|
<h4>
|
||||||
|
<asp:Label ID="lblPregunta" runat="server" Text='<%# Eval("Pregunta") %>'></asp:Label>*<br />
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<asp:Button ID="btnOk" runat="server" Text="OK" OnClick="btnOk_Click" />
|
||||||
|
<asp:Button ID="btnDetected" runat="server" Text="Detectado" OnClick="btnDetected_Click" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
<div class="form-group">
|
||||||
|
<h4>
|
||||||
|
<asp:Label ID="lblFormularioobserv" runat="server"></asp:Label><br />
|
||||||
|
</h4>
|
||||||
|
<asp:TextBox ID="TxtObservaciones" runat="server" TextMode="multiline" CssClass="Widthall" Columns="50" Rows="5"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
|
||||||
|
<asp:Button ID="btnAnt" runat="server" CssClass="btn btn-default" Text="Anterior" OnClick="btnAnt_Click" />
|
||||||
|
<asp:Button ID="BtnCancel" runat="server" CssClass="btn btn-default" Text="Cancelar" OnClick="BtnCancel_Click" />
|
||||||
|
<asp:Button ID="btnNext" runat="server" CssClass="btn btn-default" Text="Siguiente" OnClick="btnNext_Click" />
|
||||||
|
<asp:Button ID="btnGuardar" runat="server" CssClass="btn btn-primary" Text="Guardar" OnClick="btnGuardar_Click" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
<script>
|
||||||
|
function setPaso(id){
|
||||||
|
if (id == 3) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function updateOdometer(change) {
|
||||||
|
// Get the odometer input field
|
||||||
|
var odometerInput = document.getElementById('<%= txtOdometer.ClientID %>');
|
||||||
|
|
||||||
|
// Convert the current value to a number and update it by the change amount
|
||||||
|
var currentValue = parseInt(odometerInput.value, 10);
|
||||||
|
if (isNaN(currentValue)) {
|
||||||
|
currentValue = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the value
|
||||||
|
odometerInput.value = currentValue + change;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,274 @@
|
|||||||
using System;
|
using CrystalDecisions.Shared.Json;
|
||||||
|
using System;
|
||||||
|
using System.Activities.Expressions;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
|
using Extensiones;
|
||||||
|
|
||||||
public partial class VYA_TripsChecks : System.Web.UI.Page
|
public partial class VYA_TripsChecks : ClsPaginas
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region "Propiedades"
|
||||||
|
|
||||||
|
private int Paso
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ViewState["Paso"].ToEntero();
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
PnlPaso1.Visible = (value == 1);
|
||||||
|
PnlPaso2.Visible = (value == 2 || value == 3);
|
||||||
|
PnlPaso3.Visible = (value == 3 || value == 2);
|
||||||
|
ViewState["Paso"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int _currentFormIndex
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ViewState["_currentFormIndex"].ToEntero();
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["_currentFormIndex"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private DataTable _dtPreguntas
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (ViewState["_dtPreguntas"] != null)
|
||||||
|
return (DataTable)ViewState["_dtPreguntas"];
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["_dtPreguntas"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
Paso = (Request["Paso"] != null && Request["Paso"].ToString().ToEntero() > 0) ? Request["Paso"].ToString().ToEntero() : 1;
|
||||||
|
_currentFormIndex = (Request["FormIndex"] != null && Request["FormIndex"].ToString().ToEntero() > 0) ? Request["FormIndex"].ToString().ToEntero() : 1;
|
||||||
|
CargaCombos();
|
||||||
|
LoadData();
|
||||||
|
BindForm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CargaCombos()
|
||||||
|
{
|
||||||
|
|
||||||
|
DataTable dttipoaf = get_GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("MedidaVehicularClave IN (2,3)");
|
||||||
|
DdlTipoUnidad.DataSource = dttipoaf;
|
||||||
|
DdlTipoUnidad.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||||
|
DdlTipoUnidad.DataBind();
|
||||||
|
|
||||||
|
//CvePuesto =702 valor fijo V&A
|
||||||
|
DataTable dtchofer = get_GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltraParametros("CvePuesto = 702 and CveEstatusPersonal = 1", "NombreCompleto");
|
||||||
|
DdlChofer.DataSource = dtchofer;
|
||||||
|
DdlChofer.DataBind();
|
||||||
|
DdlChofer.Items.Insert(0, new ListItem("-", "-1"));
|
||||||
|
}
|
||||||
|
public void cargaUnidades()
|
||||||
|
{
|
||||||
|
DataTable dt = get_GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros(string.Format(" EstadoActivoFijo= 'Activo' ", DdlTipoUnidad.SelectedValue));
|
||||||
|
DdlAF.DataSource = dt;
|
||||||
|
DdlAF.DataBind();
|
||||||
|
DdlAF.Items.Insert(0, new ListItem("-", "-1"));
|
||||||
|
|
||||||
|
}
|
||||||
|
#region "Paso 1"
|
||||||
|
protected void ImgBtnAutobus_Click(object sender, ImageClickEventArgs e)
|
||||||
|
{
|
||||||
|
DdlTipoUnidad.SelectedValue = "181";
|
||||||
|
Paso = 2;
|
||||||
|
cargaUnidades();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ImgBtnSprinter_Click(object sender, ImageClickEventArgs e)
|
||||||
|
{
|
||||||
|
DdlTipoUnidad.SelectedValue = "184";
|
||||||
|
Paso = 2;
|
||||||
|
cargaUnidades();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
protected void DdlTipoUnidad_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
cargaUnidades();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region "Formulario"
|
||||||
|
private void LoadData()
|
||||||
|
{
|
||||||
|
_dtPreguntas = new DataTable();
|
||||||
|
using(ClsTransportes nom =new ClsTransportes())
|
||||||
|
{
|
||||||
|
if(nom.VIA_FormularioTrip(-1,UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa))
|
||||||
|
{
|
||||||
|
_dtPreguntas =nom.DtResultados;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//// Para la demostración, aquí va un código para llenar el DataTable con datos ficticios.
|
||||||
|
//_dtPreguntas.Columns.Add("CveFormulario", typeof(int));
|
||||||
|
//_dtPreguntas.Columns.Add("Formulario", typeof(string));
|
||||||
|
//_dtPreguntas.Columns.Add("CvePregunta", typeof(int));
|
||||||
|
//_dtPreguntas.Columns.Add("Pregunta", typeof(string));
|
||||||
|
//_dtPreguntas.Columns.Add("Valor", typeof(int));
|
||||||
|
//_dtPreguntas.Columns.Add("OrdenPregunta", typeof(int));
|
||||||
|
//_dtPreguntas.Columns.Add("OrdenFormulario", typeof(int));
|
||||||
|
|
||||||
|
//// Agregar datos de prueba
|
||||||
|
//_dtPreguntas.Rows.Add(1, "Formulario 1", 1, "Pregunta 1", null, 1, 1);
|
||||||
|
//_dtPreguntas.Rows.Add(1, "Formulario 1", 2, "Pregunta 2", null, 2, 1);
|
||||||
|
//_dtPreguntas.Rows.Add(2, "Formulario 2", 3, "Pregunta 3", null, 1, 2);
|
||||||
|
//_dtPreguntas.Rows.Add(2, "Formulario 2", 4, "Pregunta 4", null, 2, 2);
|
||||||
|
//_dtPreguntas.Rows.Add(2, "Formulario 2", 5, "Pregunta 5", null, 1, 3);
|
||||||
|
//_dtPreguntas.Rows.Add(2, "Formulario 2", 6, "Pregunta 6", null, 2, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BindForm()
|
||||||
|
{
|
||||||
|
var filteredRowsant = _dtPreguntas.FiltraParametros($"OrdenFormulario = {_currentFormIndex - 1}");
|
||||||
|
var filteredRowsnext = _dtPreguntas.FiltraParametros($"OrdenFormulario = {_currentFormIndex + 1}");
|
||||||
|
btnAnt.Visible = filteredRowsant.Rows.Count > 0;
|
||||||
|
btnNext.Visible = filteredRowsnext.Rows.Count > 0;
|
||||||
|
btnGuardar.Visible = !(filteredRowsnext.Rows.Count > 0);
|
||||||
|
var filteredRows = _dtPreguntas.Select($"OrdenFormulario = {_currentFormIndex}");
|
||||||
|
var sortedRows = filteredRows.CopyToDataTable();
|
||||||
|
if(sortedRows.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
lblFormulario.Text = $"{sortedRows.Rows[0]["Formulario"]}:";
|
||||||
|
lblFormularioobserv.Text = $"Observaciones {sortedRows.Rows[0]["Formulario"]}";
|
||||||
|
|
||||||
|
}
|
||||||
|
gvPreguntas.DataSource = sortedRows;
|
||||||
|
gvPreguntas.DataBind();
|
||||||
|
UpDatos.Update();
|
||||||
|
}
|
||||||
|
protected void gvPreguntas_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||||
|
{
|
||||||
|
string valor = e.Row.DataKey("Valor");
|
||||||
|
|
||||||
|
// Botón btnOk
|
||||||
|
Button btnOk = (Button)e.Row.FindControl("btnOk");
|
||||||
|
if (btnOk != null)
|
||||||
|
{
|
||||||
|
btnOk.CssClass = valor == "1" ? "btn btn-primary" : "btn btn-default";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Botón btnDetected
|
||||||
|
Button btnDetected = (Button)e.Row.FindControl("btnDetected");
|
||||||
|
if (btnDetected != null)
|
||||||
|
{
|
||||||
|
btnDetected.CssClass = valor == "0" ? "btn btn-primary" : "btn btn-default";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateValue(int cvePregunta, int newValue)
|
||||||
|
{
|
||||||
|
foreach (DataRow row in _dtPreguntas.Rows)
|
||||||
|
{
|
||||||
|
if (Convert.ToInt32(row["CvePregunta"]) == cvePregunta)
|
||||||
|
{
|
||||||
|
row["Valor"] = newValue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void btnOk_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Button btnOk = (Button)sender;
|
||||||
|
GridViewRow row = (GridViewRow)btnOk.NamingContainer;
|
||||||
|
int cvePregunta = row.DataKey("CvePregunta").ToEntero();
|
||||||
|
|
||||||
|
UpdateValue(cvePregunta, 1);
|
||||||
|
BindForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnDetected_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Button btnDetected = (Button)sender;
|
||||||
|
GridViewRow row = (GridViewRow)btnDetected.NamingContainer;
|
||||||
|
int cvePregunta = row.DataKey("CvePregunta").ToEntero();
|
||||||
|
|
||||||
|
UpdateValue(cvePregunta, 0);
|
||||||
|
BindForm();
|
||||||
|
}
|
||||||
|
public bool ValidarGridView()
|
||||||
|
{
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
foreach (GridViewRow row in gvPreguntas.Rows)
|
||||||
|
{
|
||||||
|
// Obtener el valor del DataKey correspondiente a la fila actual
|
||||||
|
string valor = row.DataKey("Valor");
|
||||||
|
|
||||||
|
// Verificar si el valor es diferente de '0' o '1'
|
||||||
|
if (valor != "0" && valor != "1")
|
||||||
|
{
|
||||||
|
ok = false;
|
||||||
|
|
||||||
|
// Marcar lblPregunta como requerido si el valor es diferente
|
||||||
|
Label lblPregunta = (Label)row.FindControl("lblPregunta");
|
||||||
|
if (lblPregunta != null)
|
||||||
|
{
|
||||||
|
lblPregunta.CssClass = "requerido"; // Añade tu clase CSS para marcar como requerido
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnNext_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ValidarGridView())
|
||||||
|
{
|
||||||
|
// Incrementar el índice del formulario
|
||||||
|
_currentFormIndex++;
|
||||||
|
BindForm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void btnAnt_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_currentFormIndex--;
|
||||||
|
BindForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void BtnCancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Paso = 1;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
protected void btnGuardar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnContinuar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user