Ejemplo n.º 1
0
        public override void boton_Click(int indice)
        {
            //frmReportes visor;
            Dialogos.frmSeleccionAnioMes seleccionAnioMes;
            switch (indice)
            {
            case 0:     //Formulas Asientos de Sueldos
                frmABMConceptos frmFormulasAsientos = new frmABMConceptos();
                frmFormulasAsientos.abrirParaAsientosDeSueldos();
                break;

            case 1:     //Generar Asiento de Sueldos
                frmLiquidacionTabla frmLiqui = new frmLiquidacionTabla();
                frmLiqui.abrirParaTabla(101);
                break;

            case 2:     //Reporte Asiento de Sueldos
                seleccionAnioMes = new Sueldos.View.Dialogos.frmSeleccionAnioMes();
                if (seleccionAnioMes.ShowDialog() == DialogResult.OK)
                {
                    /*Reportes.CRAsientoDeSueldo crAsientoDeSueldo = new Sueldos.View.Reportes.CRAsientoDeSueldo();
                     * crAsientoDeSueldo.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAsientoDeSueldos", "anioMes", seleccionAnioMes.AnioMes));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crAsientoDeSueldo.SetParameterValue(crAsientoDeSueldo.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crAsientoDeSueldo.SetParameterValue(crAsientoDeSueldo.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * visor = new frmReportes(crAsientoDeSueldo);
                     * visor.ShowDialog();*/
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAsientoDeSueldos", "anioMes", seleccionAnioMes.AnioMes);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ReporteAsientoDeSueldos(ds, emp.RazonSocial, Application.ProductVersion, seleccionAnioMes.AnioMesDescripcion);
                }
                break;

            case 3:     //Reporte por Centro de Costo
                seleccionAnioMes = new Sueldos.View.Dialogos.frmSeleccionAnioMes();
                if (seleccionAnioMes.ShowDialog() == DialogResult.OK)
                {
                    /*  Reportes.CRAsientoDeSueldoPorCentroCosto crAsientoDeSueldoPorCentroCosto = new Sueldos.View.Reportes.CRAsientoDeSueldoPorCentroCosto();
                     * crAsientoDeSueldoPorCentroCosto.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAsientoDeSueldosPorCentroCosto", "anioMes", seleccionAnioMes.AnioMes));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crAsientoDeSueldoPorCentroCosto.SetParameterValue(crAsientoDeSueldoPorCentroCosto.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crAsientoDeSueldoPorCentroCosto.SetParameterValue(crAsientoDeSueldoPorCentroCosto.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * visor = new frmReportes(crAsientoDeSueldoPorCentroCosto);
                     * visor.ShowDialog(); */
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAsientoDeSueldosPorCentroCosto", "anioMes", seleccionAnioMes.AnioMes);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ReportePorCentroDeCosto(ds, emp.RazonSocial, Application.ProductVersion, seleccionAnioMes.AnioMesDescripcion);
                }
                break;

            case 4:
                break;

            case 5:
                break;
            }
        }
Ejemplo n.º 2
0
        public override void boton_Click(int indice)
        {
            //frmReportes visor;
            Dialogos.frmSeleccionAnioMes seleccionAnioMes;
            switch (indice)
            {
            case 0:     //ABM Anticipos
                frmABManticipos abmAnticipos = new frmABManticipos();
                break;

            case 1:     //Emisión de Anticipos
                frmAnticipo anticipo = new frmAnticipo();
                anticipo.abrirParaNuevo();
                break;

            case 2:     //Reporte de Anticipos por Tipo
                //TODO agregar dialogo que solicita aniomes
                seleccionAnioMes = new Sueldos.View.Dialogos.frmSeleccionAnioMes();
                if (seleccionAnioMes.ShowDialog() == DialogResult.OK)
                {
                    /*  Reportes.CRAnticiposPorTipo crAnticiposPorTipo = new Sueldos.View.Reportes.CRAnticiposPorTipo();
                     * crAnticiposPorTipo.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAnticiposPorAnioMes", "anioMes", seleccionAnioMes.AnioMes));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crAnticiposPorTipo.SetParameterValue(crAnticiposPorTipo.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crAnticiposPorTipo.SetParameterValue(crAnticiposPorTipo.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * visor = new frmReportes(crAnticiposPorTipo);
                     * visor.ShowDialog();*/
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAnticiposPorAnioMes", "anioMes", seleccionAnioMes.AnioMes);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ReporteDeAnticiposPorTipo(ds, emp.RazonSocial, "SOffT " + Application.ProductVersion);
                }
                break;

            case 3:     //Reporte de Anticipos Por Legajo
                //TODO agregar dialogo que solicita aniomes
                seleccionAnioMes = new Sueldos.View.Dialogos.frmSeleccionAnioMes();
                if (seleccionAnioMes.ShowDialog() == DialogResult.OK)
                {
                    /*  Reportes.CRAnticiposPorLegajo crAnticiposPorLegajo = new Sueldos.View.Reportes.CRAnticiposPorLegajo();
                     * crAnticiposPorLegajo.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAnticiposPorAnioMes", "anioMes", seleccionAnioMes.AnioMes));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crAnticiposPorLegajo.SetParameterValue(crAnticiposPorLegajo.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crAnticiposPorLegajo.SetParameterValue(crAnticiposPorLegajo.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * visor = new frmReportes(crAnticiposPorLegajo);
                     * visor.ShowDialog(); */
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteAnticiposPorAnioMes", "anioMes", seleccionAnioMes.AnioMes);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ReporteDeAnticiposPorLegajo(ds, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 4:     //Acreditaciones
                frmAcreditacionesAnticipos frmacre = new frmAcreditacionesAnticipos();
                break;
            }
        }
Ejemplo n.º 3
0
        private void btnGenerarArchivo_Click(object sender, EventArgs e)
        {
            String nroEmpresa = "";

            if (Convert.ToInt32(this.cmbTipoAnticipo.SelectedValue) > 0)
            {
                int idConvenio = Convert.ToInt32(this.cmbConvenio.SelectedValue);
                //*****************//
                this.saveFileDialogBancos.Filter = "Texto TXT (*.txt)|*.txt";
                switch (int.Parse(cmbBancos.SelectedValue.ToString()))
                {
                case 1:
                    nroEmpresa = Bapro.cabecera.rotuloArchivo;
                    //this.saveFileDialogBancos.FileName = Bapro.cabecera.rotuloArchivo;
                    break;

                case 2:
                    nroEmpresa = BancoGalicia.nombreArchivo;
                    //this.saveFileDialogBancos.FileName = BancoGalicia.nombreArchivo;
                    break;
                }
                this.saveFileDialogBancos.FileName = nroEmpresa;
                if (saveFileDialogBancos.ShowDialog() == DialogResult.OK)
                {
                    int anioMes = Convert.ToInt32(this.cmbAnios.SelectedValue.ToString() + this.cmbMeses.SelectedValue.ToString().PadLeft(2, '0'));

                    Cursor.Current = Cursors.WaitCursor;
                    switch (int.Parse(cmbBancos.SelectedValue.ToString()))
                    {
                    case 1:
                        Bapro.generaArchivoDesdeAnticipos(anioMes, Convert.ToInt32(this.cmbTipoAnticipo.SelectedValue), this.saveFileDialogBancos.FileName, chkConvenido.Checked, idConvenio);
                        break;

                    case 2:
                        BancoGalicia.generaArchivoDesdeAnticipos(anioMes, Convert.ToInt32(this.cmbTipoAnticipo.SelectedValue), this.saveFileDialogBancos.FileName, this.dtpFechaAcreditacion.Value, chkConvenido.Checked, idConvenio);
                        break;

                    default:
                        MessageBox.Show("Banco no definido para exportar.");
                        break;
                    }
                    Cursor.Current = Cursors.Default;

                    //instancio reporte//

                    /*     Sueldos.View.Reportes.CRReporteBapro reporteAcreditacionBancariaBapro = new Sueldos.View.Reportes.CRReporteBapro();
                     *   DataSet ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "anticiposConsultarParaAcreditar", "@anioMes", anioMes, "@idTipoAnticipo", Convert.ToInt32(this.cmbTipoAnticipo.SelectedValue));
                     *   ds.Tables[0].TableName = "liquidacionesNetosPorLegajo";
                     *   reporteAcreditacionBancariaBapro.SetDataSource(ds);
                     *   reporteAcreditacionBancariaBapro.SetParameterValue(reporteAcreditacionBancariaBapro.Parameter_FechaAcreditacion.ParameterFieldName, dtpFechaAcreditacion.Value.ToShortDateString());
                     *   reporteAcreditacionBancariaBapro.SetParameterValue(reporteAcreditacionBancariaBapro.Parameter_LiquidacionDescripcion.ParameterFieldName, "Anticipo " + cmbTipoAnticipo.Text + " " + cmbMeses.Text + " " + cmbAnios.Text);
                     *   frmReportes visor = new frmReportes(reporteAcreditacionBancariaBapro);
                     *   visor.ShowDialog(this);*/


                    this.Cursor = Cursors.WaitCursor;
                    DataSet ds;
                    if (chkConvenido.Checked)
                    {
                        ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "anticiposConsultarParaAcreditarPorBanco", "@anioMes", anioMes, "@idTipoAnticipo", Convert.ToInt32(this.cmbTipoAnticipo.SelectedValue), "@idBanco", int.Parse(cmbBancos.SelectedValue.ToString()));
                    }
                    else
                    {
                        ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "anticiposConsultarParaAcreditarPorBancoPorConvenio", "@anioMes", anioMes, "@idTipoAnticipo", Convert.ToInt32(this.cmbTipoAnticipo.SelectedValue), "@idBanco", int.Parse(cmbBancos.SelectedValue.ToString()), "@idConvenio", idConvenio);
                    }
                    ///Cambiamos el nombre de tabla para que el crystal report no de problemas en tiempo de ejecución, dado
                    ///que el reporte se usa tambien para acreditaciones de sueldos.
                    ds.Tables[0].TableName = "liquidacionesNetosPorLegajo";
                    this.Cursor            = Cursors.Default;
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.AcreditacionDeAnticipos(ds, dtpFechaAcreditacion.Value.ToShortDateString(), "Anticipo " + cmbTipoAnticipo.Text + " " + cmbMeses.Text + " " + cmbAnios.Text, emp.RazonSocial, nroEmpresa);
                }
            }
            else
            {
                MessageBox.Show("Debe seleccionar al menos un tipo de anticipos");
            }
            this.btnGenerarArchivo.Enabled = false;
        }
Ejemplo n.º 4
0
        public override void boton_Click(int indice)
        {
            Dialogos.frmSeleccionAnioMes frmFecha;
            switch (indice)
            {
            case 0:
                //Borrador de Liquidacion
                selLiquidacionTipo = new frmSeleccionLiquidacionPorTipos();
                if (selLiquidacionTipo.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    DataSet ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRecibosSueldoDetalle", "@idLiquidacion", selLiquidacionTipo.LiquidacionId);
                    this.Cursor = Cursors.Default;
                    ReportesCreador.BorradorDeLiquidacion(ds, selLiquidacionTipo.LiquidacionDescripcion, empresa.RazonSocial, empresa.CUIT, empresa.Domicilio, empresa.Actividad);
                }
                break;

            case 1:
                //Recibos de Sueldo
                frmSeleccionLiquidacionPorTiposConFechaAcreditacion selLiquidacion = new Dialogos.frmSeleccionLiquidacionPorTiposConFechaAcreditacion();
                if (selLiquidacion.ShowDialog() == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    DataSet dsRecibosSueldos = new DataSet();
                    Model.DB.ejecutarDataSet(ref dsRecibosSueldos, Model.TipoComando.SP, "reporteRecibosSueldoDetalle", "@idLiquidacion", selLiquidacion.LiquidacionId);
                    Model.DB.ejecutarDataSet(ref dsRecibosSueldos, Model.TipoComando.SP, "reporteRecibosSueldoGeneral", "@idLiquidacion", selLiquidacion.LiquidacionId);
                    this.Cursor = Cursors.Default;
                    ReportesCreador.RecibosDeSueldo(dsRecibosSueldos, selLiquidacion.FechaPago.ToString());
                }
                break;

            case 2:     //Libro Ley
                selLiquidacionTipo = new frmSeleccionLiquidacionPorTipos();
                if (selLiquidacionTipo.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    DataSet ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRecibosSueldoDetalle", "@idLiquidacion", selLiquidacionTipo.LiquidacionId);
                    this.Cursor = Cursors.Default;
                    ReportesCreador.LibroLey(ds, selLiquidacionTipo.LiquidacionDescripcion, empresa.RazonSocial, empresa.CUIT, empresa.Domicilio, empresa.Actividad);
                }
                break;

            case 3:     //Rubricas para Libro Ley
                DataSet dsRubricas = Model.DB.ejecutarDataSet(
                    Model.TipoComando.SP, "empresaConsultarParaRubrica", "@idEmpresa", 1, "@cantPaginas", new Sueldos.View.Dialogos.frmSeleccionValor("Páginas").Valor);
                Sueldos.Reportes.CrystalReport.ReportesCreador.RubricasLibroLey(dsRubricas);
                break;

            case 4:     //Netos por Legajo
                selLiquidacionTipo = new frmSeleccionLiquidacionPorTipos();
                if (selLiquidacionTipo.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteLiquidacionesNetoPorLegajo", "@idLiquidacion", selLiquidacionTipo.LiquidacionId);
                    this.Cursor = Cursors.Default;
                    ReportesCreador.NetosPorLegajo(ds, selLiquidacionTipo.LiquidacionDescripcion, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 5:     //Netos Por Forma de Pago
                selLiquidacionTipo = new frmSeleccionLiquidacionPorTipos();
                if (selLiquidacionTipo.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteLiquidacionesNetoPorFormaDePago", "@idLiquidacion", selLiquidacionTipo.LiquidacionId);
                    this.Cursor = Cursors.Default;
                    ReportesCreador.NetosPorFormaDePago(ds, selLiquidacionTipo.LiquidacionDescripcion, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 6:     //Netos por Area
                frmFecha = new frmSeleccionAnioMes();
                if (frmFecha.ShowDialog() == DialogResult.OK)
                {
                    DataSet resultado = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteNetoPorLegajoAreaConvenioAnioMes", "anioMes", frmFecha.AnioMes);
                    resultado.DataSetName = "reporteNetoPorLegajoAreaConvenioAnioMes";
                    Model.DataSetTo.CSV(resultado, Model.Delimitador.PuntoComa);
                    resultado.Dispose();
                }
                break;

            case 7:     //Listado de Conceptos
                this.Cursor = Cursors.WaitCursor;
                DataSet dsConceptos = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteConceptos");
                this.Cursor = Cursors.Default;
                ReportesCreador.ListadoDeConceptos(dsConceptos);
                break;

            case 8:     //Conceptos Liquidados
                selLiquidacionTipo = new frmSeleccionLiquidacionPorTipos();
                if (selLiquidacionTipo.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteLiquidacionesTotalesPorConcepto", "@idLiquidacion", selLiquidacionTipo.LiquidacionId);
                    this.Cursor = Cursors.Default;
                    ReportesCreador.ConceptosLiquidados(ds, selLiquidacionTipo.LiquidacionDescripcion, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 9:
                //Borrador de Liquidacion
                selLiquidacionTipo = new frmSeleccionLiquidacionPorTipos();
                if (selLiquidacionTipo.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    DataSet ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRecibosSueldoDetalle", "@idLiquidacion", selLiquidacionTipo.LiquidacionId);
                    this.Cursor = Cursors.Default;
                    ReportesCreador.BorradorDeLiquidacionPorConvenio(ds, selLiquidacionTipo.LiquidacionDescripcion, empresa.RazonSocial, empresa.CUIT, empresa.Domicilio, empresa.Actividad);
                }
                break;

            case 10:     //Netos por Centro de Costo
                frmFecha = new frmSeleccionAnioMes();
                if (frmFecha.ShowDialog() == DialogResult.OK)
                {
                    DataSet resultado = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteNetoPorLegajoPorCentroDeCostoAnioMes", "anioMes", frmFecha.AnioMes);
                    resultado.DataSetName = "reporteNetoPorLegajoPorCentroDeCostoAnioMes";
                    Model.DataSetTo.CSV(resultado, Model.Delimitador.PuntoComa);
                    resultado.Dispose();
                }
                break;
            }
        }
Ejemplo n.º 5
0
        public override void boton_Click(int indice)
        {
            //frmReportes visor;
            switch (indice)
            {
            case 0:     //ABM de Fichadas
                frmABMfichadas abmFichadas = new frmABMfichadas();
                //this.pasaAsistencia();
                break;

            case 1:     //Consulta de Fichadas
                frmRango = new Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    /*  Reportes.CRRelojFichadasEntreFechas crRel = new Sueldos.View.Reportes.CRRelojFichadasEntreFechas();
                     * crRel.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechas", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crRel.SetParameterValue(crRel.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crRel.SetParameterValue(crRel.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * frmRepo = new frmReportes();
                     * frmRepo.abrir(crRel);*/
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechas", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ConsultaDeFichadas(ds, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 2:     //Captura de Fichadas
                Reloj.View.frmReloj frmRel = new Reloj.View.frmReloj();
                //frmReloj frmRel = new frmReloj();
                frmRel.ShowDialog();
                break;

            case 3:     //Actualizar Fichadas
                frmActualizarFichadas frmActF = new frmActualizarFichadas();
                frmActF.ShowDialog();
                break;

            case 4:     //Consulta de Ausencias
                frmRango = new Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    /*Reportes.CRAusencias crAus = new Sueldos.View.Reportes.CRAusencias();
                     * crAus.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteAusencias", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta));
                     * crAus.SetParameterValue(0, frmRango.FechaDesde);
                     * crAus.SetParameterValue(1, frmRango.FechaHasta);
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crAus.SetParameterValue(crAus.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crAus.SetParameterValue(crAus.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * frmRepo = new frmReportes();
                     * frmRepo.abrir(crAus);*/
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteAusencias", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ConsultaDeAusencias(ds, frmRango.FechaDesde, frmRango.FechaHasta, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 5:     //Asistencia
                frmAsistencia frmAs = new frmAsistencia();
                frmAs.abrir();
                break;

            case 6:     //Impresión de Etiquetas
                frmBarcode FrmBarcode = new frmBarcode();
                //FrmBarcode.ShowDialog();
                //MessageBox.Show("no implementado");
                break;

            case 7:     //Cálculo de Horas Extras
                frmHorasExtras frmHH = new frmHorasExtras();
                frmHH.ShowDialog();
                break;

            case 8:     //Informe Horas Extras
                frmRango = new Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    /*   Reportes.CRHorasExtras crHoras = new Sueldos.View.Reportes.CRHorasExtras();
                     * crHoras.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechasHorasExtra", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crHoras.SetParameterValue(crHoras.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crHoras.SetParameterValue(crHoras.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * frmRepo = new frmReportes();
                     * frmRepo.abrir(crHoras);*/
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechasHorasExtra", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.InformeDeHorasExtra(ds, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 9:
                Sofft.ViewComunes.Dialogos.frmSeleccionFecha fecha = new Sofft.ViewComunes.Dialogos.frmSeleccionFecha();
                if (fecha.ShowDialog() == DialogResult.OK)
                {
                    /* Reportes.CRTablaAsistencia reporte = new Reportes.CRTablaAsistencia();
                     *
                     * reporte.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "asistenciaConsultarConNovedades", "fecha", fecha.Fecha.Year * 100 + fecha.Fecha.Month));
                     * reporte.SetParameterValue(reporte.Parameter_anio.ParameterFieldName, fecha.Fecha.Year);
                     * reporte.SetParameterValue(reporte.Parameter_mes.ParameterFieldName, fecha.Fecha.Month);
                     * reporte.SetParameterValue(reporte.Parameter_Fecha.ParameterFieldName, fecha.Fecha);
                     * visor = new frmReportes(reporte);
                     * visor.ShowDialog(this); */
                    DataSet ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "asistenciaConsultarConNovedades", "fecha", fecha.Fecha.Year * 100 + fecha.Fecha.Month);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ImpresionDeAsistencia(ds, fecha.Fecha);
                }
                break;

            case 10:     //Gestión de Huellas Digitales
                Reloj.View.frmFingerPrintUtils FrmFingerUtls = new Reloj.View.frmFingerPrintUtils();
                FrmFingerUtls.ShowDialog();
                break;

            case 11:     //Ausencias por Empleado
                frmRango = new Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteAusenciasCantidad", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ConsultaDeAusenciasPorEmpleado(ds, frmRango.FechaDesde, frmRango.FechaHasta, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 12:     //Ausencias por Tipo
                frmRango = new Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteAusenciasCantidad", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ConsultaDeAusenciasPorTipo(ds, frmRango.FechaDesde, frmRango.FechaHasta, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 13:     //exportar fichadas
                DataSet fichadas = null;
                frmRango = new  Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    //Cargo lista de fichadas
                    fichadas = fichadasNegocio.getAll(frmRango.FechaDesde, frmRango.FechaHasta);
                    //Model.DataSetTo.CSV(fichadas, Model.Delimitador.PuntoComa);
                    Model.DataSetTo.XLS(fichadas, "Fichadas");
                    //Sofft.Utils.Excel.ExcelUtils.ExportToExcel(fichadas);
                    fichadas.Dispose();
                    this.Cursor = Cursors.Default;
                }
                break;

            case 14:     //Consulta de Fichadas Por Reloj
                frmRango = new Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    /*  Reportes.CRRelojFichadasEntreFechas crRel = new Sueldos.View.Reportes.CRRelojFichadasEntreFechas();
                     * crRel.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechas", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crRel.SetParameterValue(crRel.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crRel.SetParameterValue(crRel.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * frmRepo = new frmReportes();
                     * frmRepo.abrir(crRel);*/
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechas", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ConsultaDeFichadasPorReloj(ds, emp.RazonSocial, Application.ProductVersion);
                }
                break;

            case 15:     //Consulta de Llegadas tarde
                frmRango = new Sofft.ViewComunes.Dialogos.frmRangoFechas();
                if (frmRango.ShowDialog(this) == DialogResult.OK)
                {
                    /*  Reportes.CRRelojFichadasEntreFechas crRel = new Sueldos.View.Reportes.CRRelojFichadasEntreFechas();
                     * crRel.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechas", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta));
                     * EmpresaEntity emp = new ConsultaEmpresas().getEmpresa(1);
                     * crRel.SetParameterValue(crRel.Parameter_empresa.ParameterFieldName, emp.RazonSocial);
                     * crRel.SetParameterValue(crRel.Parameter_soft.ParameterFieldName, "SOffT " + Modulo.version);
                     * frmRepo = new frmReportes();
                     * frmRepo.abrir(crRel);*/
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    DataSet       ds  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteRelojConsultarFechasLlegadasTarde", "@desde", frmRango.FechaDesde, "@hasta", frmRango.FechaHasta);
                    ds.Tables[0].TableName = "reporteRelojConsultarFechas";
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ConsultaDeFichadas(ds, emp.RazonSocial, Application.ProductVersion);
                }
                break;
            }
        }
Ejemplo n.º 6
0
        public override void boton_Click(int indice)
        {
            DataSet ds;

            //frmReportes visor;
            Dialogos.frmSeleccionAnioMes frmFecha;
            EmpresaEntity empresa = new ConsultaEmpresas().getById(1);

            switch (indice)
            {
            case 0:     //Jornada Legal
                ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteHorarios");
                Model.DB.ejecutarDataSet(ref ds, Model.TipoComando.SP, "empresaConsultar", "@idEmpresa", 1);
                Sueldos.Reportes.CrystalReport.ReportesCreador.JornadaLegal(ds);
                break;

            case 1:     //Consulta de campos empledo
                //TODO Incorporar el filtro de estado de empleado
                Dialogos.frmSeleccionCampoEmpleado seleccionCampo = new Sueldos.View.Dialogos.frmSeleccionCampoEmpleado();
                if (seleccionCampo.ShowDialog() == DialogResult.OK)
                {
                    if (seleccionCampo.Filtrado)
                    {
                        if (seleccionCampo.Historico)
                        {
                            ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteEmpleadosPorCampoEmpleadoValorHistorico",
                                                          "indice", seleccionCampo.Indice,
                                                          "contenido", seleccionCampo.Contenido,
                                                          "idEstado", seleccionCampo.Estado,
                                                          "idLiquidacion", seleccionCampo.LiquidacionID);
                        }
                        else
                        {
                            ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteEmpleadosPorCampoEmpleadoValor",
                                                          "indice", seleccionCampo.Indice,
                                                          "contenido", seleccionCampo.Contenido,
                                                          "idEstado", seleccionCampo.Estado);
                        }
                        ds.Tables[0].TableName = "ReporteEmpleadosPorCampoEmpleado";
                    }
                    else
                    {
                        if (seleccionCampo.Historico)
                        {
                            ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteEmpleadosPorCampoEmpleadoHistorico",
                                                          "indice", seleccionCampo.Indice,
                                                          "tipo", seleccionCampo.Tipo,
                                                          "idEstado", seleccionCampo.Estado,
                                                          "idLiquidacion", seleccionCampo.LiquidacionID);
                        }
                        else
                        {
                            ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteEmpleadosPorCampoEmpleado",
                                                          "indice", seleccionCampo.Indice,
                                                          "tipo", seleccionCampo.Tipo,
                                                          "idEstado", seleccionCampo.Estado);
                        }
                        ds.Tables[0].TableName = "ReporteEmpleadosPorCampoEmpleado";
                    }
                    EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.ConsultaDeCamposEmpledo(
                        ds,
                        seleccionCampo.ContenidoDescripcion,
                        seleccionCampo.LiquidacionDescripcion,
                        seleccionCampo.IndiceDescripcion,
                        seleccionCampo.EstadoDescripcion,
                        emp.RazonSocial,
                        Application.ProductVersion);
                }

                break;

            case 2:     //Acumulados por Tipo
                frmFecha = new Sueldos.View.Dialogos.frmSeleccionAnioMes();
                if (frmFecha.ShowDialog() == DialogResult.OK)
                {
                    ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteAcumuladosPorTipo",
                                                  "anioMes", frmFecha.AnioMes);
                    Sueldos.Reportes.CrystalReport.ReportesCreador.AcumuladosPorTipo(ds);
                }
                break;

            case 3:     //Sindicatos
                //TODO cpereyra
                MessageBox.Show("No implementado todavia");

                Dialogos.frmSeleccionItem selItem = new Dialogos.frmSeleccionItem();
                selItem.Nombre = "Sindicato";
                selItem.Lista  = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "tablasConsultarContenidoyDetalleParaCombo",
                                                          "tabla", "empleadosSueldos",
                                                          "indice", 14);
                selItem.HabilitarTodos = false;

                if (selItem.ShowDialog() == DialogResult.OK)
                {
                    frmFecha = new Sueldos.View.Dialogos.frmSeleccionAnioMes();
                    if (frmFecha.ShowDialog() == DialogResult.OK)
                    {
                        ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "reporteSindicatos",
                                                      "idSindicato", selItem.SelectedID,
                                                      "anioMes", frmFecha.AnioMes);
                        List <string> titulos = new List <string>();
                        System.Data.Common.DbDataReader rs = Model.DB.ejecutarDataReader(Model.TipoComando.SP, "reporteSindicatosDescripcion", "idSindicato", selItem.SelectedID);
                        while (rs.Read())
                        {
                            titulos.Add(rs["Descripcion"].ToString());
                        }
                        Sueldos.Reportes.CrystalReport.ReportesCreador.Sindicatos(ds, titulos, selItem.SelectedDescripcion, frmFecha.AnioMesDescripcion);
                    }
                }
                break;

            case 4:     //Vacaciones Por Año
                frmFecha = new Sueldos.View.Dialogos.frmSeleccionAnioMes();
                if (frmFecha.ShowDialog() == DialogResult.OK)
                {
                    string  fecha     = "31/12/" + frmFecha.Anio;
                    DataSet resultado = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "vacacionesCalculaDiasTodos", "fechaTope", fecha);
                    resultado.DataSetName = "vacacionesCalculaDiasTodos";
                    Model.DataSetTo.CSV(resultado, Model.Delimitador.PuntoComa);
                    resultado.Dispose();
                }
                break;

            case 5:     //Fechas de Jubilación
                ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "ReporteEmpleadosPorFechaDeJubilacion");
                Sueldos.Reportes.CrystalReport.ReportesCreador.FechasDeJubilacion(ds, empresa.RazonSocial, Application.ProductVersion);
                break;
            }
        }
Ejemplo n.º 7
0
        private void btnGenerarArchivo_Click(object sender, EventArgs e)
        {
            DataSet ds          = null;
            string  fechadepago = "";
            string  nroEmpresa  = "";

            foreach (DataRowView objDataRowView in this.lstFechasDePago.SelectedItems)
            {
                fechadepago = objDataRowView["fechadepago"].ToString();
            }

            if (this.liqCtrlAcreditaciones.TiposSeleccionados.Count > 0)
            {
                int idConvenio = Convert.ToInt32(this.cmbConvenio.SelectedValue);
                //instancio reporte//
                if (chkConvenido.Checked)
                {
                    ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "liquidacionesNetosPorLegajoPorBanco", "@idLiquidacion", this.liqCtrlAcreditaciones.LiquidacionId, "@idFormaDePago", 2, "@idBanco", int.Parse(cmbBancos.SelectedValue.ToString()));
                }
                else
                {
                    ds = Model.DB.ejecutarDataSet(Model.TipoComando.SP, "liquidacionesNetosPorLegajoPorBancoPorConvenio", "@idLiquidacion", this.liqCtrlAcreditaciones.LiquidacionId, "@idFormaDePago", 2, "@idBanco", int.Parse(cmbBancos.SelectedValue.ToString()), "@idConvenio", idConvenio);
                }

                ds.Tables[0].TableName = "liquidacionesNetosPorLegajo"; //esto es porque cambiamos el nombre de la consulta y el crystal toma el nombre viejo para este reporte

                //              Sueldos.View.Reportes.CRReporteBapro reporteAcreditacionBancariaBapro = new Sueldos.View.Reportes.CRReporteBapro ();
                //    reporteAcreditacionBancariaBapro.SetDataSource(Model.DB.ejecutarDataSet(Model.TipoComando.SP, "liquidacionesNetosPorLegajo", "@idLiquidacion", this.liqCtrlAcreditaciones.LiquidacionId, "@idFormaDePago", 2));
                //              reporteAcreditacionBancariaBapro.SetDataSource (ds);
                //*****************//
                this.saveFileDialogBancos.Filter = "Texto TXT (*.txt)|*.txt";
                switch (int.Parse(cmbBancos.SelectedValue.ToString()))
                {
                case 1:
                    nroEmpresa = Bapro.cabecera.rotuloArchivo;
                    //this.saveFileDialogBancos.FileName = Bapro.cabecera.rotuloArchivo;
                    break;

                case 2:
                    nroEmpresa = BancoGalicia.nombreArchivo;
                    //this.saveFileDialogBancos.FileName =  BancoGalicia.nombreArchivo;
                    break;

                case 3:
                    nroEmpresa = BancoCredicoop.nombreArchivo;
                    //this.saveFileDialogBancos.FileName = BancoCredicoop.nombreArchivo;
                    break;
                }
                this.saveFileDialogBancos.FileName = nroEmpresa;
                if (saveFileDialogBancos.ShowDialog() == DialogResult.OK)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    //hay que grabar los tipos seleccionados en  el temporal para que sean tomados por las consultas
                    this.liqCtrlAcreditaciones.GrabarTipoSeleccionados();
                    //en el indice 0 de los tipos seleccionados está la liq. normal.
                    switch (int.Parse(cmbBancos.SelectedValue.ToString()))
                    {
                    case 1:
                        Bapro.generaArchivo(this.liqCtrlAcreditaciones.LiquidacionId, this.saveFileDialogBancos.FileName, (List <int>) this.liqCtrlAcreditaciones.TiposSeleccionados, Convert.ToDateTime(fechadepago), chkConvenido.Checked, idConvenio);
                        break;

                    case 2:
                        BancoGalicia.generaArchivo(this.liqCtrlAcreditaciones.LiquidacionId, this.saveFileDialogBancos.FileName, (List <int>) this.liqCtrlAcreditaciones.TiposSeleccionados, Convert.ToDateTime(fechadepago), chkConvenido.Checked, idConvenio);
                        break;

                    case 3:
                        BancoCredicoop.generaArchivo(this.liqCtrlAcreditaciones.LiquidacionId, this.saveFileDialogBancos.FileName, (List <int>) this.liqCtrlAcreditaciones.TiposSeleccionados, Convert.ToDateTime(fechadepago), chkConvenido.Checked, idConvenio);
                        break;

                    default:
                        MessageBox.Show("Banco no definido para exportar.");
                        break;
                    }
                    Cursor.Current = Cursors.Default;
                    //    MessageBox.Show("El archivo se generó con éxito.");
                }
                //genero el reporte.
                //OJO que no debe generarse sin setear la consulta antes del proceso del archivo, ya que
                //marcaria las liquidaciones como acreditadas antes de imprimir.
                //              reporteAcreditacionBancariaBapro.SetParameterValue (reporteAcreditacionBancariaBapro.Parameter_FechaAcreditacion.ParameterFieldName, Convert.ToDateTime (this.lstFechasDePago.Text));
                //              reporteAcreditacionBancariaBapro.SetParameterValue (reporteAcreditacionBancariaBapro.Parameter_LiquidacionDescripcion.ParameterFieldName, this.liqCtrlAcreditaciones.LiquidacionDescripcion);
                //              frmReportes visor = new frmReportes (reporteAcreditacionBancariaBapro);
                EmpresaEntity emp = new ConsultaEmpresas().getById(1);
                Sueldos.Reportes.CrystalReport.ReportesCreador.AcreditacionDeAnticipos(ds, this.lstFechasDePago.Text, this.liqCtrlAcreditaciones.LiquidacionDescripcion, emp.RazonSocial, nroEmpresa);
                //visor.ShowDialog(this);
            }
            else
            {
                MessageBox.Show("Debe seleccionar al menos una liquidación.");
            }
            this.btnGenerarArchivo.Enabled = false;
        }