Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ok_Click(object sender, EventArgs e)
        {
            var t = CarregaProgressoThread();

            try
            {
                if (!rdb_instituicao_encaminhada.Checked && !rdb_instituicao_solicitada.Checked)
                {
                    throw new Exception("Selecione um tipo de relatório");
                }

                if (tipo_nivelensino != 3)
                {
                    if (rdb_instituicao_solicitada.Checked)
                    {
                        frm_Relatorio_geral frm = new frm_Relatorio_geral(_principalUi, 4, cbo_escola.SelectedValue.ToString());
                        frm.Show();
                    }
                    else //se escola encaminhada
                    {
                        frm_Relatorio_geral frm = new frm_Relatorio_geral(_principalUi, 5, cbo_escola.SelectedValue.ToString());
                        frm.Show();
                    }
                }
                else
                {
                    if (rdb_instituicao_solicitada.Checked)
                    {
                        frm_Relatorio_geral frm = new frm_Relatorio_geral(21, _principalUi);
                        frm.Show();
                    }
                }
                if (t.IsAlive)
                {
                    t.Abort();
                }
                this.Close();
            }
            catch (Exception exception)
            {
                if (t.IsAlive)
                {
                    t.Abort();
                }
                MessageBox.Show(exception.Message, "SIESC", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// Evento do botão gerar
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_gerar_Click(object sender, EventArgs e)
        {
            var t = CarregaProgressoThread();

            try
            {
                switch (nivelEnsino)
                {
                case 1:
                    codigoRelatorio = 23;
                    break;

                case 2:
                    codigoRelatorio = 24;
                    break;

                case 3:
                    codigoRelatorio = 18;
                    break;
                }

                frm_Relatorio_geral frmRelatorioGeral = new frm_Relatorio_geral(codigoRelatorio, cbo_motivo.SelectedValue.ToString(), frmPrincipal);
                frmRelatorioGeral.Show();
                if (t.IsAlive)
                {
                    t.Abort();
                }
                this.Close();
            }
            catch (Exception ex)
            {
                if (t.IsAlive)
                {
                    t.Abort();
                }
                Mensageiro.MensagemErro(ex, frmPrincipal);;
            }
        }