예제 #1
0
        private void XROL_Rpt010_rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            try
            {
                XROL_Rpt010_Bus         oReporteBus = new XROL_Rpt010_Bus();
                List <XROL_Rpt010_Info> oListado    = new List <XROL_Rpt010_Info>();

                int      idEmpresa      = Convert.ToInt32(Parameters["p_IdEmpresa"].Value);
                decimal  idEmpledo      = Convert.ToDecimal(Parameters["p_IdEmpleado"].Value);
                decimal  IdDepartamento = Convert.ToInt32(Parameters["p_IdDepartamento"].Value);
                DateTime fechaInicial   = Convert.ToDateTime(Parameters["s_fechaInicial"].Value);
                DateTime fechaFinal     = Convert.ToDateTime(Parameters["s_fechaFinal"].Value);


                if (idEmpledo > 0)
                {
                    oListado = oReporteBus.GetListPorEmpleado(idEmpresa, IdDepartamento, fechaInicial, fechaFinal, ref mensaje).Where(v => v.IdEmpleado == idEmpledo).ToList();
                }
                else
                {
                    oListado = oReporteBus.GetListPorEmpleado(idEmpresa, IdDepartamento, fechaInicial, fechaFinal, ref mensaje);
                }

                this.DataSource = oListado.ToArray();
            }
            catch (Exception ex)
            {
                oLog.Log_Error(ex.ToString());
            }
        }
예제 #2
0
        private void XROL_Rpt010_rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            try
            {
                XROL_Rpt010_Bus         oReporteBus = new XROL_Rpt010_Bus();
                List <XROL_Rpt010_Info> oListado    = new List <XROL_Rpt010_Info>();

                int      idEmpresa    = Convert.ToInt32(Parameters["p_IdEmpresa"].Value);
                decimal  idEmpledo    = Convert.ToDecimal(Parameters["p_IdEmpleado"].Value);
                decimal  IdNomina     = Convert.ToInt32(Parameters["p_idnomina"].Value);
                DateTime fechaInicial = Convert.ToDateTime(Parameters["s_fechaInicial"].Value);
                DateTime fechaFinal   = Convert.ToDateTime(Parameters["s_fechaFinal"].Value);
                int      IdDivision   = Convert.ToInt32(Parameters["s_iddivision"].Value);



                if (IdDivision > 0)
                {
                    oListado = oReporteBus.GetListPorEmpleado(idEmpresa, IdNomina, IdDivision, fechaInicial, fechaFinal, ref mensaje);
                }
                else
                {
                    if (IdDivision == 0)
                    {
                        oListado = oReporteBus.GetListPorEmpleado(idEmpresa, IdNomina, fechaInicial, fechaFinal, ref mensaje);
                    }


                    if (idEmpledo > 0)
                    {
                        oListado = oReporteBus.GetListPorEmpleado(idEmpresa, IdNomina, idEmpledo, fechaInicial, fechaFinal, ref mensaje);
                    }
                    else
                    {
                        oListado = oReporteBus.GetListPorEmpleado(idEmpresa, IdNomina, fechaInicial, fechaFinal, ref mensaje);
                    }
                }

                this.DataSource         = oListado.ToArray();
                xrPictureBox1.Image     = param.InfoEmpresa.em_logo_Image;
                lblEmpresa.Text         = param.InfoEmpresa.RazonSocial;
                lb_nombrecomercial.Text = param.InfoEmpresa.em_nombre;
            }
            catch (Exception ex)
            {
                oLog.Log_Error(ex.ToString());
            }
        }