public static void ExcluirTarefas(ColaboradorProjeto colaboradorProjeto)
 {
     using (var ctx = new ProjectManagerConnection())
     {
         ctx.Entry <ColaboradorProjeto>(colaboradorProjeto).State = EntityState.Deleted;
         ctx.SaveChanges();
     }
 }
 public static void IncluirTarefa(ColaboradorProjeto colaboradorProjeto)
 {
     using (var ctx = new ProjectManagerConnection())
     {
         ctx.ColaboradorProjeto.Add(colaboradorProjeto);
         ctx.SaveChanges();
     }
 }
 public ActionResult ExcluirTarefas(ColaboradorProjeto colaboradorProjeto)
 {
     try
     {
         ColaboradorProjetoDao.ExcluirTarefas(colaboradorProjeto);
         return(RedirectToAction("ListarTarefas"));
     }
     catch (Exception ex)
     {
         ViewBag.MensagemErro = ex.Message;
         return(View("_Erro"));
     }
 }
        public ActionResult AlterarTarefas(ColaboradorProjeto colaboradorProjeto)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }
                ColaboradorProjetoDao.AlterarTarefas(colaboradorProjeto);

                return(RedirectToAction("ListarTarefas"));
            }
            catch (Exception ex)
            {
                ViewBag.MensagemErro = ex.Message;
                return(View("_Erro"));
            }
        }
        public ActionResult IncluirTarefa(ColaboradorProjeto colaboradorProjeto)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }

                ColaboradorProjetoDao.IncluirTarefa(colaboradorProjeto);
                return(RedirectToAction("Index", "Projetos"));
            }
            catch (Exception ex)
            {
                ViewBag.MensagemErro = ex.Message;
                return(View("_Erro"));
            }
        }