OI Temas, Cat Checadores
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveChecador,Checador,CveModelo,CveSubProyecto,SubProyecto,CveUsuario,Estatus,FechaIng,IPLocal,Puerto" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveChecador,Checador,CveModelo,CveSubProyecto,SubProyecto,CveUsuario,Estatus,FechaIng,IPLocal,Puerto"
|
||||
EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Checador" DataField="Checador" />
|
||||
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" />
|
||||
@@ -53,28 +54,34 @@
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Checadores</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtChecador" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtChecador" runat="server" ControlToValidate="TxtChecador" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Checador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="TxtChecador">Checador:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlSubProyecto">Subproyecto:</label>
|
||||
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
|
||||
|
||||
|
||||
|
||||
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="form-control select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCODdlSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="DdlSubProyecto"><asp:label runat="server" ID="LblSubProyecto" for="DdlSubProyecto">Subproyecto:</asp:label>:</label>
|
||||
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlModelo">Modelo:</label>
|
||||
<asp:DropDownList ID="DdlModelo" Width="100%" runat="server" AppendDataBoundItems="true" ValidationGroup="GrpGuardar" CssClass="select2me">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlModelo" Width="100%" runat="server" AppendDataBoundItems="true" ValidationGroup="GrpGuardar" CssClass="form-control select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="zkteco" Value="1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlModelo" runat="server" ControlToValidate="DdlModelo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Modelo''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceDdlModelo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModelo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="DdlModelo">Modelo:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
@@ -97,31 +104,7 @@
|
||||
<asp:CheckBox runat="server" ID="ChkEstatus" CssClass="make-switchsd" data-size="small" Text=" " />
|
||||
</div>
|
||||
|
||||
</br>
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvChecadorSubProyectos" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvChecadorSubProyectos_RowDataBound" Width="90%"
|
||||
DataKeyNames="CveSubProyecto,CveChecador"
|
||||
EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" />
|
||||
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</br>
|
||||
|
||||
@@ -26,8 +26,9 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
CargaSubProyectos();
|
||||
CargaDatos();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,14 +39,19 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
{
|
||||
GvDatos.DataSource = ObjRH.DtResultados;
|
||||
}
|
||||
|
||||
ObjRH.Dispose();
|
||||
GvDatos.DataBind();
|
||||
GvDatos.HeaderRow.Cells[1].Text = LblSubProyecto.Text;
|
||||
}
|
||||
|
||||
private void CargaSubProyectos()
|
||||
{
|
||||
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
DdlSubProyecto.DataBind();
|
||||
|
||||
CargarCentrosDeCosto(null, DdlSubProyecto,null, LblSubProyecto);
|
||||
|
||||
}
|
||||
|
||||
protected void BtnAgregarChecador_Click(object sender, EventArgs e)
|
||||
@@ -56,11 +62,7 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
TxtIPLocal.Text = "";
|
||||
TxtPuerto.Text = "";
|
||||
BtnChecadorAgregar.Text = "Agregar";
|
||||
divChkEstatus.Visible = false;
|
||||
|
||||
GvChecadorSubProyectos.DataSource = null;
|
||||
GvChecadorSubProyectos.DataBind();
|
||||
GvChecadorSubProyectos.Visible = false;
|
||||
divChkEstatus.Visible = false;
|
||||
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
@@ -78,39 +80,12 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// bool errorProceso = false;
|
||||
//ObjRH.IniciaTransacSQL();
|
||||
{
|
||||
|
||||
if (ObjRH.UpdateChecadores(CveChecador,TxtChecador.Text,DdlSubProyecto.SelectedValue.ToEntero(),TxtIPLocal.Text,TxtPuerto.Text,Estatus: ChkEstatus.Checked, CveModelo: DdlModelo.SelectedValue.ToEntero()))
|
||||
{
|
||||
Alert("Checador actualizado correctamente");
|
||||
}
|
||||
|
||||
foreach(GridViewRow GvRow in GvChecadorSubProyectos.Rows)
|
||||
{
|
||||
if(GvRow.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
CheckBox Chk = GvRow.FCCheckBox("Chk");
|
||||
if (!ObjRH.AddRemoveChecadoresSubProyectos(CveChecador, GvRow.DataKey("CveSubProyecto").ToEntero(), UsuarioActual.CveUsuario, Chk.Checked))
|
||||
{
|
||||
//errorProceso = true;
|
||||
Alert("Ocurrió un error.",ModExtensiones.TipoMensaje.MsgError);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if (errorProceso)
|
||||
//{
|
||||
// ObjRH.RollBack();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ObjRH.Commit();
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
ObjRH.Dispose();
|
||||
CargaDatos();
|
||||
@@ -133,21 +108,6 @@ public partial class RH_CatChecadores : ClsPaginas
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estatus") == "Activo";
|
||||
divChkEstatus.Visible = true;
|
||||
|
||||
GvChecadorSubProyectos.Visible = true;
|
||||
|
||||
ClsRH objRH = new ClsRH();
|
||||
|
||||
if (objRH.GetChecadoresSubProyectos(CveChecador, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvChecadorSubProyectos.DataSource = objRH.DtResultados;
|
||||
}
|
||||
|
||||
GvChecadorSubProyectos.DataBind();
|
||||
objRH.Dispose();
|
||||
|
||||
|
||||
|
||||
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVRegDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros"
|
||||
<asp:GridView ID="GVRegDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" DataKeyNames="CvePersonal,NombreCompleto"
|
||||
CssClass="ADSCROLLER2 table table-striped table-advance table-hover Widthall" data-rows="1" data-cols="3" data-heightmenos="100" data-heightfijo="600" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Codigo" ItemStyle-HorizontalAlign="Left" >
|
||||
@@ -309,7 +309,7 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlAsistenciaInacistencia" Width="150" runat="server" CssClass="select2me" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias"></asp:DropDownList></td>
|
||||
<asp:DropDownList ID="DdlAsistenciaInacistencia" Width="150" runat="server" CssClass="select2me" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias" ></asp:DropDownList></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -330,6 +330,8 @@
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -337,8 +339,8 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
|
||||
<asp:Button ID="BtnEstusAsistenciaModal" runat="server" class="btn btn-success" Text="Aceptar" ValidationGroup="GrpAsistencia" />
|
||||
<asp:Button ID="BtnGuardar" Visible="true" runat="server" Text="Guardar" class="btn btn-primary" OnClick="BtnGuardar_Click" />
|
||||
<asp:Button ID="BtnEstusAsistenciaModal" Visible="false" runat="server" class="btn btn-success" Text="Aceptar" />
|
||||
<button id="Button4" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||
|
||||
</div>
|
||||
@@ -383,10 +385,7 @@
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="RfvcRfvTxtFechaModal" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaModal" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="CVCCVTxtFechaModal" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaModal" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
|
||||
</td></tr>
|
||||
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -126,6 +126,33 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Property CvePersonalSeleccionado As Integer
|
||||
Get
|
||||
If ViewState("CvePersonalSeleccionado") Is Nothing Then
|
||||
ViewState("CvePersonalSeleccionado") = -1
|
||||
End If
|
||||
Return ViewState("CvePersonalSeleccionado").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePersonalSeleccionado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FechaSeleccionada As Date
|
||||
Get
|
||||
If ViewState("FechaSeleccionada") Is Nothing Then
|
||||
ViewState("FechaSeleccionada") = MinFecha
|
||||
End If
|
||||
Return ViewState("FechaSeleccionada").ToString.ToDate
|
||||
End Get
|
||||
Set(value As Date)
|
||||
ViewState("FechaSeleccionada") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub RH_RepChecadorIncidencias_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
@@ -408,20 +435,20 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
DTAsistenciasInasistencias = objRH.DtResultados
|
||||
End If
|
||||
|
||||
If objRH.ChecadorPreAsistenciaRegistrosAsistenciasGet(CveTipoPeriodo, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
DTAsistenciasInasistenciasReg = objRH.DtResultados
|
||||
'If objRH.ChecadorPreAsistenciaRegistrosAsistenciasGet(CveTipoPeriodo, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
' DTAsistenciasInasistenciasReg = objRH.DtResultados
|
||||
|
||||
If DTAsistenciasInasistenciasReg.Rows.Count > 0 Then
|
||||
BtnAgregar.Visible = False
|
||||
BtnEstusAsistenciaModal.Visible = False
|
||||
DdlAsistenciaInacistencia.Enabled = False
|
||||
Else
|
||||
BtnAgregar.Visible = True
|
||||
BtnEstusAsistenciaModal.Visible = True
|
||||
DdlAsistenciaInacistencia.Enabled = True
|
||||
End If
|
||||
UpAgregar.Update()
|
||||
End If
|
||||
' If DTAsistenciasInasistenciasReg.Rows.Count > 0 Then
|
||||
' BtnAgregar.Visible = False
|
||||
' BtnEstusAsistenciaModal.Visible = False
|
||||
' 'DdlAsistenciaInacistencia.Enabled = False
|
||||
' Else
|
||||
' BtnAgregar.Visible = True
|
||||
' BtnEstusAsistenciaModal.Visible = True
|
||||
' 'DdlAsistenciaInacistencia.Enabled = True
|
||||
' End If
|
||||
' UpAgregar.Update()
|
||||
'End If
|
||||
|
||||
objRH.Dispose()
|
||||
|
||||
@@ -1499,7 +1526,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
If arrayComands.Length > 1 Then Filtro = arrayComands(1) Else Filtro = ""
|
||||
|
||||
lnkLink.CommandArgument = lnkLink.Text
|
||||
lnkLink.CommandArgument = $"{lnkLink.Text}|{e.Row.DataKey("CvePersonal")}|{e.Row.DataKey("NombreCompleto")}"
|
||||
|
||||
If Instruccion = "-" Then
|
||||
lnkLink.Text = "<i class='fa fa-check-square' aria-hidden='true'></i>"
|
||||
@@ -1620,6 +1647,8 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
Public Sub DetalleDia_Click(sender As Object, e As EventArgs)
|
||||
|
||||
CvePersonalSeleccionado = -1
|
||||
|
||||
Dim lnkLinkSender As LinkButton = DirectCast(sender, LinkButton)
|
||||
Dim DTDatos As New DataTable
|
||||
Dim DTTipoAsistenciaInasistencia As DataTable
|
||||
@@ -1640,6 +1669,10 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
objRH.Dispose()
|
||||
|
||||
Instruccion = arrayComands(0)
|
||||
CvePersonalSeleccionado = arrayComands(2).ToEntero
|
||||
|
||||
LtlAsistenciaHorariosModal.Text = arrayComands(3)
|
||||
|
||||
DTTipoAsistenciaInasistencia = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(" TipoCorto = '" & Instruccion & "' ")
|
||||
|
||||
If DTTipoAsistenciaInasistencia.Rows.Count > 0 Then
|
||||
@@ -1662,6 +1695,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
DTDatos = DtResultados.FiltraParametros(Filtro)
|
||||
lblModalFecha.Text = DTDatos(0)("Fecha").ToString().ToDate.ToString("dd/MM/yyyy")
|
||||
FechaSeleccionada = DTDatos(0)("Fecha").ToString().ToDate
|
||||
|
||||
lnkModalImg.Text = ""
|
||||
|
||||
@@ -1949,4 +1983,18 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If DdlAsistenciaInacistencia.SelectedValue.ToEntero > 0 Then
|
||||
Dim ObjPersonal As New ClsRH
|
||||
If ObjPersonal.AddAsistencia(CvePersonalSeleccionado, -1, DdlSubProyecto.SelectedValue.ToEntero, FechaSeleccionada,
|
||||
DdlAsistenciaInacistencia.SelectedValue.ToEntero, 100, 0, 0, -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "C") Then
|
||||
Alert("Registro Actualziado Correctamente.")
|
||||
|
||||
End If
|
||||
ObjPersonal.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user