diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 5ac824654..f57a14a3c 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2251,7 +2251,30 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function GetchecadorAdistencia(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean + Public Function AsistenciaDetallePorTurnoGet(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As Boolean + Dim retorno As Boolean = False + + Try + DTSet = New DataSet() + DataAdapter("PA_RH_AsistenciaDetallePorTurnoGet", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + End With + SqlAdapter.Fill(DTSet) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener la asistenciadetalle.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener la asistenciadetalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetchecadorAsistencia(FechaInicio As DateTime, FechaFin As DateTime, CveEmpresa As Integer) As Boolean Dim retorno As Boolean = False Try @@ -2266,10 +2289,10 @@ Public Class ClsNominas retorno = True Catch sqEx As SqlException retorno = False - OnError("Ocurrió un error al Realizar el calculo de asistencia.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al realizar el calculo de asistencia.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception retorno = False - OnError("Ocurrió un error al Realizar el calculo de asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + OnError("Ocurrió un error al realizar el calculo de asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno End Function diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ca3dfd4b8..56ab4a401 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3896,7 +3896,7 @@ Public Class ClsPaginas If Application("GlobalSIGAppPaginas") Is Nothing Then PaginaDict = New System.Collections.Hashtable - PaginaDict.Add("/Nomina/ChecadorAsistencia.aspx".ToUpper(), -1) + PaginaDict.Add("/Nomina/ChecadorAsistencia.aspx".ToUpper(), 921) PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919) 'PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index c7f26d458..c7d98a06d 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -2438,8 +2438,53 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Try Return Retorno + End Function + + + Public Function UpAsistenciaDetalle(CveEmpresa As Integer, registros As List(Of RequestUpAsistenciaDetalle)) As Boolean + Dim Retorno As Boolean = False + Dim xmlProductos As System.Xml.Linq.XDocument = Nothing + If registros IsNot Nothing AndAlso registros.Count > 0 Then + xmlProductos = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("registros", From x In registros Select New System.Xml.Linq.XElement("registro", New System.Xml.Linq.XElement("CveAsistenciaDetalle", x.CveAsistenciaDetalle), New System.Xml.Linq.XElement("CvePersonal", x.CvePersonal), New System.Xml.Linq.XElement("CveAsistenciasInasistencias", x.CveAsistenciasInasistencias), New System.Xml.Linq.XElement("CveSubProyecto", x.CveSubProyecto), New System.Xml.Linq.XElement("Fecha", x.Fecha)))) + End If + Data = New DataTable + SqlDataAdapter("PA_RH_AsistenciaDetalleUP") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString() + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar la Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function AddChecadorRegistro(CveEmpresa As Integer, registros As List(Of RequestAddChecadorRegistro)) As Boolean + Dim Retorno As Boolean = False + Dim xmlProductos As System.Xml.Linq.XDocument = Nothing + If registros IsNot Nothing AndAlso registros.Count > 0 Then + xmlProductos = New System.Xml.Linq.XDocument(New System.Xml.Linq.XElement("registros", From x In registros Select New System.Xml.Linq.XElement("registro", New System.Xml.Linq.XElement("CveChecador", x.CveChecador), New System.Xml.Linq.XElement("CvePersonal", x.CvePersonal), New System.Xml.Linq.XElement("ChecadorID", x.ChecadorID), New System.Xml.Linq.XElement("Fecha", x.Fecha)))) + End If + Data = New DataTable + SqlDataAdapter("PA_RH_ChecadorAsistenciaAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString() + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar la Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno End Function - Public Function AddAsistenciaMasiva(CvePeriodo As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -7088,3 +7133,16 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo End Sub #End Region End Class +Public Class RequestAddChecadorRegistro + Public Property CveChecador As Integer + Public Property CvePersonal As Integer + Public Property ChecadorID As Integer + Public Property Fecha As DateTime +End Class +Public Class RequestUpAsistenciaDetalle + Public Property CveAsistenciaDetalle As Integer + Public Property Fecha As DateTime + Public Property CvePersonal As Integer + Public Property CveAsistenciasInasistencias As Integer + Public Property CveSubProyecto As Integer +End Class diff --git a/General/ExcelToBD.aspx b/General/ExcelToBD.aspx new file mode 100644 index 000000000..6b74bf170 --- /dev/null +++ b/General/ExcelToBD.aspx @@ -0,0 +1,102 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ExcelToBD.aspx.cs" Inherits="General_ExcelToBD" %> + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + Paso 1: cargar plantilla +
+
+ +
+
+
+ ingrese el archivo a cargar + +
+ Cargar excel + +
+
+
+ +
+
+ +
+
+
+ + Paso 2: Configuración +
+
+ Mostrar + +
+
+
+
+
+
+ + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+
+ Continuar +
+
+
+
+
+
+
+
+ + + diff --git a/General/ExcelToBD.aspx.cs b/General/ExcelToBD.aspx.cs new file mode 100644 index 000000000..cabe4ccdb --- /dev/null +++ b/General/ExcelToBD.aspx.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using ClosedXML.Excel; +using Extensiones; + +public partial class General_ExcelToBD : System.Web.UI.Page +{ + #region propiedades + + private string URLFile + { + get + { + if (ViewState["URLFile"] == null) { return ""; } + else { return ViewState["URLFile"].ToString(); } + } + + set { ViewState["URLFile"] = value; } + } + private string extension + { + get + { + if (ViewState["extension"] == null) { return ""; } + else { return ViewState["extension"].ToString(); } + } + + set { ViewState["extension"] = value; } + } + private List workBooks + { + get + { + if (ViewState["workBooks"] == null) { return null; } + else { return (List)ViewState["workBooks"]; } + } + + set { ViewState["workBooks"] = value; } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void LnkCargarArchivo_Click(object sender, EventArgs e) + { + List filesgral = TxtArchivoXls.getfiles().Archivos; + workBooks = new List(); + foreach (Archivo fileItem in filesgral) + { + extension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", ""); + URLFile = fileItem.FileUrl; + } + using (var workbook = new XLWorkbook(URLFile)) + { + int position = 1; + foreach (IXLWorksheet wokitem in workbook.Worksheets) + { + workBooks.Add(new ADSWorksBooks() { Name = wokitem.Name, position = position++ }); + } + + + } + DdlWorkBooks.DataSource = workBooks; + DdlWorkBooks.DataBind(); + if (workBooks.Count > 0) + { + DdlWorkBooks.SelectedIndex = 0; + DdlWorkBooks_SelectedIndexChanged(null,null); + } + } + + protected void DdlWorkBooks_SelectedIndexChanged(object sender, EventArgs e) + { + using (var workbook = new XLWorkbook(URLFile)) + { + + int Filas = 0; + int columnas = 0; + IXLWorksheet workSheet = workbook.Worksheet(DdlWorkBooks.SelectedValue.ToEntero()); + Filas = workSheet.LastColumnUsed().CellCount(); + columnas = workSheet.LastRowUsed().CellCount(); + TxtFilas.Text = Filas.ToString(); + TxtInicia.Text = "1"; + TxtColumnas.Text = Filas.ToString(); + } + + } + + protected void Lnkdoit_Click(object sender, EventArgs e) + { + + } + + protected void LnkContinuar_Click(object sender, EventArgs e) + { + int Filas = 0; + int columnas = 0; + using (var workbook = new XLWorkbook(URLFile)) + { + IXLWorksheet workSheet = workbook.Worksheet(DdlWorkBooks.SelectedValue.ToEntero()); + } + } +} + +[Serializable] +public class ADSWorksBooks +{ + public int position { get; set; } + public string Name { get; set; } +} \ No newline at end of file diff --git a/Metronic/assets/global/images/spritemap.png b/Metronic/assets/global/images/spritemap.png new file mode 100644 index 000000000..d711b0f0e Binary files /dev/null and b/Metronic/assets/global/images/spritemap.png differ diff --git a/Metronic/assets/global/images/spritemap@2x.png b/Metronic/assets/global/images/spritemap@2x.png new file mode 100644 index 000000000..ed29b88b6 Binary files /dev/null and b/Metronic/assets/global/images/spritemap@2x.png differ diff --git a/Nomina/ChecadorAsistencia.aspx b/Nomina/ChecadorAsistencia.aspx index e9b06823b..01a90f0c2 100644 --- a/Nomina/ChecadorAsistencia.aspx +++ b/Nomina/ChecadorAsistencia.aspx @@ -38,6 +38,9 @@ +
  • + Agregar registro +
  • @@ -122,12 +125,15 @@