コード例 #1
0
        private void Imprimir(int IdEmpresa, decimal IdEmpleado, int IdSolicitud)
        {
            try
            {
                List_Reporte = BusReporte.Get_List_Vacaciones(IdEmpresa, IdEmpleado, IdSolicitud);
                XROL_Rpt013_rpt Rept = new XROL_Rpt013_rpt();


                Rept.Set(List_Reporte);
                Rept.ShowPreview();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #2
0
        private void ucGe_Menu_event_btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                InfoCalendario = Bus_Calendario.Get_Info_Calendario(Convert.ToDateTime(txtFechaIngreso.EditValue));

                int DiadAdicionales = 0;
                int AnioIngreso     = (int)InfoCalendario.AnioFiscal;
                int MesIngreso      = (int)InfoCalendario.Mes_x_anio;
                int DiaIngreso      = (int)InfoCalendario.dia_x_mes;

                DateTime FechaInicioVaca = Convert.ToDateTime(Convert.ToString(DiaIngreso) + "/" + Convert.ToString(MesIngreso) + "/" + Convert.ToString(AnioIngreso + Convert.ToInt32(txtAnioServicio.EditValue) - 1));

                DateTime FechaFinVacaciones = Convert.ToDateTime(Convert.ToString(DiaIngreso - 1) + "/" + Convert.ToString(MesIngreso) + "/" + Convert.ToString(AnioIngreso + Convert.ToInt32(txtAnioServicio.EditValue)));


                ro_corte_actual = Convert.ToDateTime(txtFechaIngreso.EditValue);
                List_Reporte    = BusReporte.Get_List_Vacaciones(param.IdEmpresa, info.IdEmpleado, FechaInicioVaca, Convert.ToDateTime(FechaFinVacaciones));
                XROL_Rpt013_rpt Rept = new XROL_Rpt013_rpt();

                Rept.Parameters["ro_fechaIngreso"].Value = txtFechaIngreso.EditValue.ToString();
                Rept.Parameters["ro_corte_actual"].Value = Convert.ToString(FechaFinVacaciones).Substring(0, 10);
                if (Convert.ToInt32(txtAnioServicio.Text) > 5)
                {
                    DiadAdicionales = Convert.ToInt32(txtAnioServicio.Text) - 5;
                }
                Rept.Parameters["ro_dias_adicionales"].Value = DiadAdicionales;
                Rept.Parameters["ro_periodo"].Value          = FechaInicioVaca.ToString().Substring(0, 10) + " al " + FechaFinVacaciones.ToString().Substring(0, 10);

                if (List_Reporte.Count() == 0)
                {
                    MessageBox.Show("No existen ingreso para el empleado en el periodo seleccionado");
                }
                else
                {
                    Rept.Set(List_Reporte);
                    Rept.ShowPreviewDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }