public void ExecuteTask(string work) { if (File.Exists("Task.json") && _jsonTask.ListAllTasks().Length != 0) { if (_jsonTask.FindTask(work).Type == "Mirror") { _executeSave = new ExecuteSave(mirrorSave); Work parameters = new Work() { informations = _jsonTask.FindTask(work), extentions = _jsonTask.ListConfEXT(), softwares = _jsonTask.ListConfMetier(), priorities = _jsonTask.ListConfPrio() }; _executeSave.DoSaveStrategy(parameters, ProcessVerif); } else if (_jsonTask.FindTask(work).Type == "Differential") { _executeSave = new ExecuteSave(differentialSave); Work parameters = new Work() { informations = _jsonTask.FindTask(work), extentions = _jsonTask.ListConfEXT(), softwares = _jsonTask.ListConfMetier(), priorities = _jsonTask.ListConfPrio() }; _executeSave.DoSaveStrategy(parameters, ProcessVerif); } } else { Console.WriteLine("You have no task created"); } }
//Method to delete a choosed task public void DeleteTask() { if (File.Exists("Task.json")) { _view.ListTasks(_jsonTask.ListAllTasks()); _jsonTask.DeleteTask(_view.TaskChoice()); Continue(); } else { _view.NoTasks(); Continue(); } }