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

                int idnomina   = Convert.ToInt32(Parameters["IdNomina"].Value);
                int iddivision = Convert.ToInt32(Parameters["iddivision"].Value);
                int idEmpresa  = param.IdEmpresa;

                if (iddivision != 0)
                {
                    oListado = oReporteBus.GetListConsultaGeneral(param.IdEmpresa, idnomina, iddivision);
                }
                else
                {
                    oListado = oReporteBus.GetListConsultaGeneral(param.IdEmpresa, idnomina);
                }
                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());
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "XROL_Rpt001_rpt_BeforePrint", ex.Message), ex)
                      {
                          EntityType = typeof(XROL_Rpt001_rpt)
                      };
            }
        }
예제 #2
0
        private void XROL_Rpt001_rpt_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            try
            {
                XROL_Rpt001_Bus         oReporteBus = new XROL_Rpt001_Bus();
                List <XROL_Rpt001_Info> oListado    = new List <XROL_Rpt001_Info>();

                int idnomina       = Convert.ToInt32(Parameters["IdNomina"].Value);
                int iddepartamento = Convert.ToInt32(Parameters["IdDepartamento"].Value);
                int idcargo        = Convert.ToInt32(Parameters["IdCargo"].Value);
                int idEmpresa      = param.IdEmpresa;

                if (idnomina == 0 && iddepartamento == 0 && idcargo == 0)
                {
                    oListado        = oReporteBus.GetListConsultaGeneral(idEmpresa);
                    this.DataSource = oListado.ToArray();
                    return;
                }

                if (idnomina != 0 && iddepartamento == 0 && idcargo == 0)
                {
                    oListado        = oReporteBus.GetListConsultaGeneral(idEmpresa);
                    this.DataSource = oListado.ToArray();
                    return;
                }

                if (idnomina != 0 && idcargo != 0)
                {
                    oListado        = oReporteBus.GetListConsultaGeneral(idEmpresa, idnomina, idcargo);
                    this.DataSource = oListado.ToArray();
                    return;
                }


                if (idnomina != 0 && iddepartamento != 0)
                {
                    oListado        = oReporteBus.GetListConsultaGeneral(idEmpresa, idnomina, iddepartamento);
                    this.DataSource = oListado.ToArray();
                    return;
                }
            }

            catch (Exception ex)
            {
                oLog.Log_Error(ex.ToString());
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "XROL_Rpt001_rpt_BeforePrint", ex.Message), ex)
                      {
                          EntityType = typeof(XROL_Rpt001_rpt)
                      };
            }
        }