public List <XROL_Rpt013_Info> Get_List_Vacaciones(int IdEmpresa, decimal IdEmpleado, DateTime FechaInicio, DateTime FechaFin) { try { DateTime Fi = Convert.ToDateTime(FechaInicio.ToShortDateString()); DateTime Ff = Convert.ToDateTime(FechaFin.ToShortDateString()); List <XROL_Rpt013_Info> listado = new List <XROL_Rpt013_Info>(); using (EntitiesRolesRptGeneral db = new EntitiesRolesRptGeneral()) { string Querty = "select IdEmpresa,IdEmpleado,pe_apellido,pe_nombre,sum( Ingreso) as Ingreso,pe_mes,pe_anio,pe_cedulaRuc from vwROL_Rpt013 " + "where IdEmpresa ='" + IdEmpresa + "' and IdEmpleado='" + IdEmpleado + "' and pe_FechaIni>='" + Fi + "' and pe_FechaFin<='" + Ff + "' " + " group by IdEmpresa,IdEmpleado,pe_apellido,pe_nombre,pe_mes,pe_anio,pe_cedulaRuc"; var Consulta = db.Database.SqlQuery <XROL_Rpt013_Info>(Querty); //listado = Consulta.ToList(); foreach (var item in Consulta.ToList()) { XROL_Rpt013_Info info = new XROL_Rpt013_Info(); info.IdEmpresa = item.IdEmpresa; info.IdEmpleado = item.IdEmpleado; info.pe_nombreCompleto = item.pe_apellido + " " + item.pe_nombre; info.pe_apellido = item.pe_apellido; info.pe_nombre = item.pe_nombre; info.pe_cedulaRuc = item.pe_cedulaRuc; info.Ingreso = item.Ingreso; info.pe_mes = item.pe_mes; info.pe_anio = item.pe_anio; info.Periodo = item.pe_anio + "-" + item.pe_mes; info.tot_Ingreso = Convert.ToDouble(item.Ingreso); //info.pe_FechaIni = item.pe_FechaIni; //info.pe_FechaFin = item.pe_FechaFin; listado.Add(info); } } return(listado); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public void Set(List <XROL_Rpt013_Info> Lista) { try { if (Lista.Count != 0) { Listado = Lista; info = Listado.FirstOrDefault(); } } catch (Exception ex) { } }
private void TopMargin_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { info = new XROL_Rpt013_Info(); this.DataSource = Listado.ToArray(); foreach (var item in Listado) { info.tot_Ingreso = info.tot_Ingreso + item.tot_Ingreso; } if (info != null) { double ValorDiasAdicional = Math.Round((info.tot_Ingreso / 360) * Convert.ToInt32(ro_dias_adicionales.Value), 2); double vacaciones = Math.Round(info.tot_Ingreso / 24, 2); lb_Valor_adicional.Text = Convert.ToString(ValorDiasAdicional); lbtotal.Text = Convert.ToString(Math.Round(ValorDiasAdicional + vacaciones, 2)); double Iess = Math.Round(Convert.ToDouble(((ValorDiasAdicional + vacaciones) * 9.45) / 100), 2); lb_IESS.Text = Convert.ToString(Iess); lb_neto_recibir.Text = Convert.ToString((vacaciones + ValorDiasAdicional) - Iess); lb_vacaciones.Text = Convert.ToString(vacaciones); tot_ingreso_bruto.Text = Math.Round(info.tot_Ingreso, 2).ToString(); } }
public List <XROL_Rpt013_Info> Get_List_Vacaciones(int IdEmpresa, decimal IdEmpleado, int idsolicitud) { try { //DateTime Fi = Convert.ToDateTime(FechaInicio.ToShortDateString()); //DateTime Ff = Convert.ToDateTime(FechaFin.ToShortDateString()); List <XROL_Rpt013_Info> listado = new List <XROL_Rpt013_Info>(); using (EntitiesRolesRptGeneral db = new EntitiesRolesRptGeneral()) { var querry = (from q in db.vwROL_Rpt013 where q.IdEmpresa == IdEmpresa && q.IdEmpleado == IdEmpleado && q.IdSolicitud == idsolicitud select q); foreach (var item in querry.ToList()) { XROL_Rpt013_Info info = new XROL_Rpt013_Info(); info.IdEmpresa = item.IdEmpresa; info.IdEmpleado = item.IdEmpleado; info.pe_apellido = item.pe_apellido + " " + item.pe_nombre; info.pe_apellido_remplazo = item.pe_apellido_remplazo + " " + item.pe_nombre_remplazo; info.pe_cedulaRuc = item.pe_cedulaRuc; info.Anio_Desde = item.Anio_Desde; info.Anio_Hasta = item.Anio_Hasta; info.AnioServicio = item.AnioServicio; info.Dias_a_disfrutar = item.Dias_a_disfrutar; info.Dias_pendiente = item.Dias_pendiente; info.Dias_q_Corresponde = item.Dias_q_Corresponde; info.pe_nombre_remplazo = item.pe_nombre_remplazo; info.Observacion = item.Observacion; info.Anio_Desde = item.Anio_Desde; info.Anio_Hasta = item.Anio_Hasta; info.AnioServicio = item.AnioServicio; info.Fecha_Desde = item.Fecha_Desde; info.Fecha_Hasta = item.Fecha_Hasta; info.Fecha_Retorno = item.Fecha_Retorno; info.Fecha_Desde = item.Fecha_Desde; info.Fecha_Hasta = item.Fecha_Hasta; info.em_fechaIngaRol = item.em_fechaIngaRol; info.IdSolicitudVaca = item.IdSolicitud; info.de_descripcion = item.de_descripcion; info.ca_descripcion = item.ca_descripcion; info.Observacion = item.Observacion; if (item.Gozadas_Pgadas == true) { info.Gozadas_Pgadas = "Gozadas"; } else { info.Gozadas_Pgadas = "Pagadas"; } if (item.Fecha_Desde.Year == 1) { } info.Fecha = item.Fecha; listado.Add(info); } } return(listado); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }
public List <XROL_Rpt013_Info> Get_List_Vacaciones(int IdEmpresa, decimal IdEmpleado, DateTime fechaInico, DateTime fechafin) { try { //DateTime Fi = Convert.ToDateTime(FechaInicio.ToShortDateString()); //DateTime Ff = Convert.ToDateTime(FechaFin.ToShortDateString()); List <XROL_Rpt013_Info> listado = new List <XROL_Rpt013_Info>(); using (EntitiesRolesRptGeneral db = new EntitiesRolesRptGeneral()) { var querry = (from q in db.vwROL_Rpt013 where q.IdEmpresa == IdEmpresa && q.IdEmpleado == IdEmpleado select q); //string Querty = "select IdEmpresa,IdEmpleado,pe_apellido,pe_nombre,sum( Ingreso) as Ingreso,pe_mes,pe_anio,pe_cedulaRuc from vwROL_Rpt013 " + // "where IdEmpresa ='" + IdEmpresa + "' and IdEmpleado='" + IdEmpleado + "' and pe_FechaIni>='" + Fi + "' and pe_FechaFin<='" + Ff + "' "+ // " group by IdEmpresa,IdEmpleado,pe_apellido,pe_nombre,pe_mes,pe_anio,pe_cedulaRuc"; //var Consulta = db.Database.SqlQuery<XROL_Rpt013_Info>(Querty); //listado = Consulta.ToList(); foreach (var item in querry.ToList()) { XROL_Rpt013_Info info = new XROL_Rpt013_Info(); info.IdEmpresa = item.IdEmpresa; info.IdEmpleado = item.IdEmpleado; info.pe_nombreCompleto = item.pe_apellido + " " + item.pe_nombre; info.pe_apellido = item.pe_apellido; info.pe_nombre = item.pe_nombre; info.pe_cedulaRuc = item.pe_cedulaRuc; info.Anio_Desde = item.Anio_Desde; info.Anio_Hasta = item.Anio_Hasta; info.Anio = item.Anio; info.AnioServicio = item.AnioServicio; info.Dias_a_disfrutar = item.Dias_a_disfrutar; info.Dias_pendiente = item.Dias_pendiente; info.Dias_q_Corresponde = item.Dias_q_Corresponde; info.Gozadas_Pgadas = item.Gozadas_Pgadas; info.pe_nombre_remplazo = item.pe_nombre_remplazo; info.Total_Remuneracion = item.Total_Remuneracion; info.Total_Vacaciones = item.Total_Vacaciones; info.Valor_Cancelar = item.Valor_Cancelar; info.Observacion = item.Observacion; info.Mes = item.Mes; info.Iess = item.Iess; info.Fecha_Desde = item.Fecha_Desde; info.Fecha_Hasta = item.Fecha_Hasta; info.em_fecha_ingreso = item.em_fecha_ingreso; info.IdSolicitudVaca = item.IdSolicitudVaca; info.FechaPago = item.FechaPago; info.Fecha_Retorno = item.FechaPago; info.de_descripcion = item.de_descripcion; info.Fecha = item.Fecha; info.Periodo = item.Anio + "-" + item.Mes; listado.Add(info); } } return(listado); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); mensaje = ex.InnerException + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.InnerException.ToString()); } }