Beispiel #1
0
        /// <summary>
        /// Implementa Save_button_Click
        /// </summary>
        protected override void SubmitAction()
        {
            AlumnoInfo    alumno    = TodosAlumno_CkB.Checked ? null : _alumno;
            PromocionInfo promocion = TodosPromocion_CkB.Checked ? null : _promocion;

            string filtro = GetFilterValues();

            AlumnoReportMng reportMng = new AlumnoReportMng(AppContext.ActiveSchema, string.Empty, filtro);

            AlumnoList    alumnos = GetAlumnoList(alumno, promocion);
            PromocionList promos  = GetPromocionList(promocion);

            if (Documentos_CLB.GetItemCheckState(0) == CheckState.Checked)
            {
                MatriculaPromocionRpt rpt = reportMng.GetMatriculaPromocionReport(alumnos, promos);

                if (rpt != null)
                {
                    ReportViewer.SetReport(rpt);
                    ReportViewer.ShowDialog();
                }
                else
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
                }
            }

            /*if (Documentos_CLB.GetItemCheckState(1) == CheckState.Checked)
             * {
             *  MatriculaPromocionRpt rpt = reportMng.GetMatriculaPromocionReport(list, promocion);
             *
             *  if (rpt != null)
             *  {
             *      ReportViewer.SetReport(rpt);
             *      ReportViewer.ShowDialog();
             *  }
             *  else
             *      MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
             * }*/

            if (Documentos_CLB.GetItemCheckState(2) == CheckState.Checked)
            {
                DocumentacionRpt rpt = reportMng.GetDocumentacionReport(alumnos, promos);

                if (rpt != null)
                {
                    ReportViewer.SetReport(rpt);
                    ReportViewer.ShowDialog();
                }
                else
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
                }
            }
            _action_result = DialogResult.OK;
        }
        /// <summary>Imprime la lista del objetos
        /// <returns>void</returns>
        /// </summary>
        public override void PrintList()
        {
            AlumnoReportMng reportMng = new AlumnoReportMng(AppContext.ActiveSchema);

            RegistroNotasAlumnoRpt report = null;

            bool        defecto = moleQule.Library.Instruction.ModulePrincipal.GetImpresionEmpresaDefaultBoolSetting();
            CompanyInfo empresa = null;

            if (defecto)
            {
                empresa = CompanyInfo.Get(moleQule.Library.Instruction.ModulePrincipal.GetImpresionEmpresaDefaultOidSetting(), false);
            }
            while (empresa == null)
            {
                moleQule.Face.Common.CompanySelectForm form = new Common.CompanySelectForm(this);
                DialogResult result = form.ShowDialog();

                try
                {
                    if (result == DialogResult.OK)
                    {
                        empresa = form.Selected as CompanyInfo;
                    }
                }
                catch
                { empresa = null; }
            }

            switch (FilterType)
            {
            case IFilterType.None:
                report = reportMng.GetDetailNotasReport(_item, _sorted_list, empresa);
                break;

            case IFilterType.Filter:
                report = reportMng.GetDetailNotasReport(_item, _filter_results, empresa);
                break;
            }

            if (report != null)
            {
                report.SetParameterValue("Empresa", empresa.Name);
                //if (empresa.Oid == 2) ((CrystalDecisions.CrystalReports.Engine.TextObject)(report.Section5.ReportObjects["Text1"])).Color = System.Drawing.Color.FromArgb(13, 176, 46);
                ReportViewer.SetReport(report);
                ReportViewer.ShowDialog();
            }
            else
            {
                MessageBox.Show(Resources.Messages.NO_DATA_REPORTS,
                                moleQule.Face.Resources.Labels.ADVISE_TITLE,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
            }
        }
        protected override void PrintAction()
        {
            if (_modulo == null || _promociones.Count == 0)
            {
                return;
            }

            PgMng.Reset(3, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            Alumno_PromocionList list = Alumno_PromocionList.GetListaAdmitidos(_modulo.Oid, FechaExamen_DTP.Value, _promociones, false);

            PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);

            AlumnoReportMng reportMng = new AlumnoReportMng(AppContext.ActiveSchema, string.Empty);

            bool        defecto = moleQule.Library.Instruction.ModulePrincipal.GetImpresionEmpresaDefaultBoolSetting();
            CompanyInfo empresa = null;

            if (defecto)
            {
                empresa = CompanyInfo.Get(moleQule.Library.Instruction.ModulePrincipal.GetImpresionEmpresaDefaultOidSetting(), false);
            }
            while (empresa == null)
            {
                moleQule.Face.Common.CompanySelectForm form = new Common.CompanySelectForm(this);
                DialogResult result = form.ShowDialog();

                try
                {
                    if (result == DialogResult.OK)
                    {
                        empresa = form.Selected as CompanyInfo;
                    }
                }
                catch
                { empresa = null; }
            }

            AlumnosAdmitidosExamenRpt rpt = reportMng.GetAlumnosAdmitidosReport(list, _modulo, empresa);

            PgMng.FillUp();

            rpt.SetParameterValue("Empresa", empresa.Name);
            if (empresa.Oid == 2)
            {
                ((CrystalDecisions.CrystalReports.Engine.TextObject)(rpt.Section5.ReportObjects["Text1"])).Color = System.Drawing.Color.FromArgb(13, 176, 46);
            }
            ShowReport(rpt);

            _action_result = DialogResult.Ignore;
        }
        private void PrintCertificado_BT_Click(object sender, EventArgs e)
        {
            AlumnoReportMng reportMng = new AlumnoReportMng(AppContext.ActiveSchema);

            bool        defecto = moleQule.Library.Instruction.ModulePrincipal.GetImpresionEmpresaDefaultBoolSetting();
            CompanyInfo empresa = null;

            if (defecto)
            {
                empresa = CompanyInfo.Get(moleQule.Library.Instruction.ModulePrincipal.GetImpresionEmpresaDefaultOidSetting(), false);
            }
            while (empresa == null)
            {
                moleQule.Face.Common.CompanySelectForm form = new Common.CompanySelectForm(this);
                DialogResult result = form.ShowDialog();

                try
                {
                    if (result == DialogResult.OK)
                    {
                        empresa = form.Selected as CompanyInfo;
                    }
                }
                catch
                { empresa = null; }
            }

            Library.Instruction.Reports.Alumno.CertificadoNotasRpt rpt = reportMng.GetDetailReport(_entity, empresa);
            rpt.SetParameterValue("Empresa", empresa.Name);
            if (empresa.Oid == 2)
            {
                ((CrystalDecisions.CrystalReports.Engine.TextObject)(rpt.Section5.ReportObjects["Text1"])).Color = System.Drawing.Color.FromArgb(13, 176, 46);
            }
            ReportViewer.SetReport(rpt);
            ReportViewer.ShowDialog();
        }