public IActionResult Exibir()
        {
            var _repo = new TarefaDAOEntity();

            ViewBag.Alunos = _repo.Alunos();
            return(View("ViewAlunos"));
        }
        public string Consulta(int id)
        {
            TarefaDAOEntity dao   = new TarefaDAOEntity();
            var             aluno = dao.Alunos().First(l => l.Id == id);

            return(aluno.ToString());
        }
        public IActionResult DeleteForm()
        {
            var _repo = new TarefaDAOEntity();

            ViewBag.Tarefas = _repo.Tarefas();
            return(View("DeleteTarefaForm"));
        }
        public IActionResult AddForm()
        {
            var _repo = new TarefaDAOEntity();

            ViewBag.Alunos = _repo.Alunos();
            return(View("AddTarefaForm"));
        }
예제 #5
0
        public IActionResult Index()
        {
            var _repo = new TarefaDAOEntity();

            ViewBag.Tarefa = _repo.Tarefas().Count;
            ViewBag.Aluno  = _repo.Alunos().Count;
            return(View());
        }
        public IActionResult EditForm(int alunoId)
        {
            var _repo = new TarefaDAOEntity();

            ViewBag.Aluno = _repo.Alunos().First(l => l.Id == alunoId);

            return(View("EditForm"));
        }
        public IActionResult Delete(int alunoId)
        {
            var _repo = new TarefaDAOEntity();
            var aluno = _repo.Alunos().First(l => l.Id == alunoId);

            _repo.RemoverAluno(aluno);
            return(View("DoneAction"));
        }
        public IActionResult Delete(int tarefaId)
        {
            var _repo  = new TarefaDAOEntity();
            var tarefa = _repo.Tarefas().First(l => l.Id == tarefaId);

            _repo.ExcluirTarefa(tarefa);
            return(View("DoneAction"));
        }
        public IActionResult Edit(int alunoId, string nome)
        {
            var _repo = new TarefaDAOEntity();
            var al    = _repo.Alunos().First(l => l.Id == alunoId);

            al.Nome = nome;
            _repo.AtualizarAluno(al);
            return(View("DoneAction"));
        }
예제 #10
0
        public IActionResult Cadastrar(string nome)
        {
            Aluno a1 = new Aluno();

            a1.Nome = nome;
            TarefaDAOEntity dao = new TarefaDAOEntity();

            dao.AdicionaraAluno(a1);
            return(View("DoneAction"));
        }
        public IActionResult Cadastrar(int alunoid, string tarefa, string materia, DateTime prazo, DateTime entrega)
        {
            var t        = new Tarefa();
            var contexto = new TarefaDAOEntity();

            var aluno = contexto.contexto.Alunos.First(l => l.Id == alunoid);

            t.Aluno     = aluno;
            t.Nome      = tarefa;
            t.Materia   = materia;
            t.Prazo     = prazo;
            t.DtEntrega = entrega;
            contexto.AdicionarTarefa(t);
            return(View("DoneAction"));
        }
        public IActionResult Edit(int tarefaId, int alunoid, string tarefa, string materia, DateTime prazo, DateTime entrega)
        {
            var _repo = new TarefaDAOEntity();
            var tar   = _repo.Tarefas().First(l => l.Id == tarefaId);

            tar.Nome    = tarefa;
            tar.Materia = materia;
            if (prazo.Ticks != 0)
            {
                tar.Prazo = prazo;
            }
            if (entrega.Ticks != 0)
            {
                tar.DtEntrega = entrega;
            }
            _repo.AtualizarTarefa(tar);
            return(View("DoneAction"));
        }