Exemple #1
0
        protected void btnPesquisar_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    classes.Etapa         model      = ObterObjetoEtapa();
                    IList <classes.Etapa> ListaEtapa = manterEtapa.ObterPorFiltro(model);
                    WebFormHelper.PreencherGrid(ListaEtapa, this.dgvEtapa);

                    if (ListaEtapa != null && ListaEtapa.Count > 0)
                    {
                        WebFormHelper.PreencherGrid(ListaEtapa, this.dgvEtapa);
                        pnlEtapa.Visible = true;
                    }
                    else
                    {
                        pnlEtapa.Visible = false;
                        WebFormHelper.ExibirMensagem(enumTipoMensagem.Alerta, "Nenhuma Informação Encontrada");
                    }
                }
                catch (AcademicoException ex)
                {
                    WebFormHelper.ExibirMensagem(enumTipoMensagem.Erro, ex.Message);
                }
            }
        }
Exemple #2
0
        private classes.Etapa ObterObjetoEtapa()
        {
            classes.Etapa model = new classes.Etapa();

            if (!string.IsNullOrWhiteSpace(this.txtNome.Text))
            {
                model.Nome = this.txtNome.Text.Trim();
            }

            return(model);
        }