private void preencherLista(Dictionary <string, string> param)
 {
     try
     {
         ProjetoBO projBO = new ProjetoBO();
         tblProjeto.ItemsSource = projBO.recuperar(param);
     }
     catch (Exception ex)
     {
         Alerta alerta = new Alerta();
         alerta.preencherMensagem("Problema ao tentar acessar o banco de dados: \n" + ex.Message);
         alerta.Show();
         this.Close();
     }
 }
Exemple #2
0
        private void preencherLista()
        {
            try
            {
                ProjetoDAO pDAO = new ProjetoDAO();
                tblProjeto.ItemsSource = pDAO.recuperar();
            }
            catch (Exception ex)
            {
                Alerta alerta = new Alerta();
                alerta.preencherMensagem("Problema ao tentar acessar o banco de dados: \n" + ex.Message);
                alerta.Show();

                this.Close();
            }
        }
Exemple #3
0
        private void btnPesquisar_Click(object sender, RoutedEventArgs e)
        {
            Dictionary <string, string> param = new Dictionary <string, string>();

            if (txtFiltroNome.Text.Length > 0)
            {
                param.Add(Sprint.NOME, txtFiltroNome.Text);
            }
            if (cmbFiltroProjeto.SelectedIndex > 0)
            {
                int codigo = Convert.ToInt32(((ComboBoxItem)cmbFiltroProjeto.SelectedItem).Tag);
                param.Add(Sprint.PROJETO, Convert.ToString(codigo));
            }
            if (txtFiltroDtInicio.Text.Length > 0)
            {
                param.Add(Sprint.DTINICIO, txtFiltroDtInicio.Text);
            }
            if (txtFiltroDtFinal.Text.Length > 0)
            {
                param.Add(Sprint.DTFINAL, txtFiltroDtFinal.Text);
            }

            if (param.Count > 0)
            {
                try
                {
                    SprintDAO pDAO = new SprintDAO();
                    tblSprint.ItemsSource = pDAO.recuperar(param);
                }
                catch (Exception ex)
                {
                    Alerta alerta = new Alerta();
                    alerta.preencherMensagem("Problema ao tentar acessar o banco de dados: \n" + ex.Message);
                    alerta.Show();

                    this.Close();
                }
            }
            else
            {
                preencherLista();
            }
        }
Exemple #4
0
        private void btnPesquisar_Click(object sender, RoutedEventArgs e)
        {
            Dictionary <string, string> param = new Dictionary <string, string>();

            if (txtFiltroNome.Text.Length > 0)
            {
                param.Add(Projeto.NOME, txtFiltroNome.Text);
            }
            if (txtFiltroId.Text.Length > 0)
            {
                param.Add(Projeto.ID, txtFiltroId.Text);
            }
            if (txtFiltroDtInicio.Text.Length > 0)
            {
                param.Add(Projeto.DTINICIO, txtFiltroDtInicio.Text);
            }
            if (txtFiltroDtFinal.Text.Length > 0)
            {
                param.Add(Projeto.DTFINAL, txtFiltroDtFinal.Text);
            }

            if (param.Count > 0)
            {
                try
                {
                    ProjetoDAO pDAO = new ProjetoDAO();
                    tblProjeto.ItemsSource = pDAO.recuperar(param);
                }
                catch (Exception ex)
                {
                    Alerta alerta = new Alerta();
                    alerta.preencherMensagem("Problema ao tentar acessar o banco de dados: \n" + ex.Message);
                    alerta.Show();

                    this.Close();
                }
            }
            else
            {
                preencherLista();
            }
        }