Ejemplo n.º 1
0
        public IToDoList CadastrarTarefa(TipoRepository tipoRepository, string textoTarefa)
        {
            var toDo = ToDoListFactory.CriarTodo(TipoToDo.Todo, tipoRepository, null, null, textoTarefa);

            GerenciadorTarefa gerenciadorTarefas = new GerenciadorTarefa(new AdicionarTarefa(RepositoryFactory.CriarRepository(tipoRepository), toDo), new RemoverTarefa(RepositoryFactory.CriarRepository(tipoRepository), toDo));

            gerenciadorTarefas.Adicionar();

            return(toDo);
        }
Ejemplo n.º 2
0
        public void ApagarProjeto(TipoRepository tipoRepository, IToDoList toDo)
        {
            if (toDo == null)
            {
                toDo = ToDoListFactory.CriarTodo(TipoToDo.Projeto, tipoRepository, new List <IToDoList>(), string.Empty);
            }

            GerenciadorTarefa gerenciadorTarefas = new GerenciadorTarefa(new AdicionarTarefa(RepositoryFactory.CriarRepository(tipoRepository), toDo), new RemoverTarefa(RepositoryFactory.CriarRepository(tipoRepository), toDo));

            gerenciadorTarefas.Remover();
        }
Ejemplo n.º 3
0
        public IToDoList CadastrarProjeto(TipoRepository tipoRepository, string tituloProjeto, int quantidadeTarefas, List <string> textosTarefas)
        {
            var tarefas = new List <IToDoList>();

            foreach (var textoTarefa in textosTarefas)
            {
                IToDoList toDo = ToDoListFactory.CriarTodo(TipoToDo.Todo, tipoRepository, null, null, textoTarefa);
                tarefas.Add(toDo);
            }

            var projeto = ToDoListFactory.CriarTodo(TipoToDo.Projeto, tipoRepository, tarefas, tituloProjeto);

            GerenciadorTarefa gerenciadorTarefas = new GerenciadorTarefa(new AdicionarTarefa(RepositoryFactory.CriarRepository(tipoRepository), projeto), new RemoverTarefa(RepositoryFactory.CriarRepository(tipoRepository), projeto));

            gerenciadorTarefas.Adicionar();

            return(projeto);
        }