Exemplo n.º 1
0
        private void btnSalvar_Click(object sender, RoutedEventArgs e)
        {
            if (txtNome.Text.Length == 0 || txtId.Text.Length == 0 ||
                txtDtInicio.Text.Length == 0 || txtDtFinal.Text.Length == 0)
            {
                Alerta alerta = new Alerta("Favor preencher todos os campos");
                alerta.Show();
            }
            else if (!Util.Util.verificarStringNumero(txtId.Text))
            {
                Alerta alerta = new Alerta("Preencha o campo Id com numero");
                alerta.Show();
            }
            else
            {// int codigo, int ss, string tipo, int id, string nome, string sistema, string linguagem, string processo, string tipoProjeto,
             // string situacao, int conclusividade, decimal pfprev, decimal pfreal, decimal apropriacao, DateTime dtInicio, DateTime dtEntrega, DateTime dtFinal

                Projeto   p      = preencherProjeto();
                ProjetoBO projBO = new ProjetoBO();
                projBO.salvar(p);

                Alerta alerta = new Alerta("Salvo com sucesso.");
                alerta.Show();

                prepararTela();
                preencherLista(new Dictionary <string, string>());
            }
        }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
        private void btnExcluir_Click(object sender, RoutedEventArgs e)
        {
            int codigo = Convert.ToInt32(txtCodigo.Text);

            if (codigo > 0)
            {
                ProjetoBO projBO = new ProjetoBO();
                Projeto   p      = preencherProjeto();
                projBO.excluir(p);

                Alerta alerta = new Alerta("Excluido com sucesso.");
                alerta.Show();
            }

            prepararTela();
            preencherLista(new Dictionary <string, string>());
        }
Exemplo n.º 4
0
 private void AtualizarDashBoard()
 {
     ViewData["painel"]  = ProjetoBO.CarregarDadosPainel(base.SessionProjetoModel);
     ViewData["bitolas"] = ProjetoBO.CarregarDadosBitola(base.SessionProjetoModel);
 }
Exemplo n.º 5
0
 public JsonResult AlteraParametro(int id)
 {
     ProjetoBO.AlteraParametroTerminal(base.SessionProjetoModel, id);
     return(Json(new { Msg = "OK", Id = id }));
 }
Exemplo n.º 6
0
 public ActionResult Parametros()
 {
     ProjetoBO.OrganizeDadosParaParametroInicial(base.SessionProjetoModel);
     return(View(base.SessionProjetoModel));
 }
Exemplo n.º 7
0
        private void realizarUpload(string file)
        {
            string       msg  = "";
            ComboBoxItem item = (ComboBoxItem)cmbTipoCarga.SelectedItem;

            string[] linhas = System.IO.File.ReadAllLines(file);
            if (linhas.Length > 1 && validarArquivo(item.Content.ToString(), linhas[0]))
            {
                msg = "Arquivo incluido com sucesso";
                if (item.Content.Equals(Constantes.FUNCIONARIO))
                {
                    List <Funcionario> listaFuncionario = recuperarListaFuncionario(linhas);
                    FuncionarioBO      funcBO           = new FuncionarioBO();
                    funcBO.Incluir(listaFuncionario);
                }
                else if (item.Content.Equals(Constantes.TAREFA))
                {
                    List <Tarefa> listaTarefa = recuperarListaTarefa(linhas);
                    TarefaBO      tarefaBO    = new TarefaBO();
                    tarefaBO.Incluir(listaTarefa);
                }
                else if (item.Content.Equals(Constantes.DEFEITO) || item.Content.Equals(Constantes.RELATO))
                {
                    List <Bug> listaBug = recuperarListaBug(linhas);
                    BugBO      bugBO    = new BugBO(Constantes.DEFEITO);
                    bugBO.incluirLista(listaBug);
                }
                else if (item.Content.Equals(Constantes.APROPRIACAO))
                {
                    List <Apropriacao> listaApropriacao         = recuperarListaApropriacao(linhas);
                    ApropriacaoBO      apropBO                  = new ApropriacaoBO();
                    List <int>         listaTarefasInexistentes = apropBO.validarListaApropriacaoInexistente(listaApropriacao);
                    if (listaTarefasInexistentes.Count > 0)
                    {
                        msg = "As seguintes tarefas não estão cadastradas: ";
                        foreach (int i in listaTarefasInexistentes)
                        {
                            msg += i + ", ";
                        }
                        msg.Substring(0, msg.Length - 2);
                    }
                    else
                    {
                        apropBO.incluirLista(listaApropriacao);
                    }
                }
                else if (item.Content.Equals(Constantes.ITEM_BACKLOG))
                {
                    List <ItemBacklog> listaItemBacklog = recuperarListaItemBacklog(linhas);
                    ItemBacklogBO      itemBO           = new ItemBacklogBO();
                    itemBO.incluirLista(listaItemBacklog);
                }
                else if (item.Content.Equals(Constantes.SPRINT))
                {
                    List <Sprint> listaSprint = recuperarListaSprint(linhas);
                    SprintBO      itemBO      = new SprintBO();
                    itemBO.incluirLista(listaSprint);
                }
                else if (item.Content.Equals(Constantes.PROJETO))
                {
                    List <Projeto> listaProjeto = recuperarListaProjeto(linhas);
                    ProjetoBO      itemBO       = new ProjetoBO();
                    itemBO.incluirLista(listaProjeto);
                }
                else if (item.Content.Equals(Constantes.SISCOP))
                {
                    List <Siscop> listaSiscop = recuperarListaSiscop(linhas);
                    SiscopBO      itemBO      = new SiscopBO();
                    itemBO.incluirLista(listaSiscop);
                }
            }
            else
            {
                msg = "Arquivo sem dados ou invalido";
            }
            Alerta alerta = new Alerta(msg);

            alerta.Show();
        }