Exemple #1
0
 public Task(string Name, string Description, TaskCategory Category, int Priority, int Weight, DateTime Deadline, TimeSpan Duration, Task Parent)
 {
     this.Name = Name;
     this.Description = Description;
     this.Category = Category;
     this.Priority = Priority;
     this.Weight = Weight;
     this.Deadline = Deadline;
     this.Duration = Duration;
     ParentTask = Parent;
     this.Subtasks = new List<Task>();
     Percentage = 0;
 }
 public void Add(string taskName, string description, string txtDate, string txtDueDate, string fileName, string category)
 {
     var validateNameAndDescr = new VerifierNameAndDescription(taskName, description);
     if (!validateNameAndDescr.VerifyName())
         return;
     var validateDateAndDuDate = new VerifierDateAndDueDate(txtDate, txtDueDate);
     var tempDate = validateDateAndDuDate.VerifyTempDate();
     var dueDate = validateDateAndDuDate.VerifyDueDate();
     if (dueDate)
     {
         var tempDueDate = validateDateAndDuDate.VerifyDueTempDate();
         var validateFileAndStatus = new VerifierFileAndStatus(fileName);
         var newTask = new Task(taskName, validateNameAndDescr.VerifyDescription(), tempDate, tempDueDate,
             GlobalConstants.ToDo, category);
         tasks.Add(newTask);
         var service = new TaskService(validateFileAndStatus.VerifyFileName());
         service.AddTask(newTask);
         Console.WriteLine("The task was successfuly added");
     }
     else
         Console.WriteLine("Date cannot be greater then DuDate");
 }
 public void AddTask(Task task)
 {
     repository.AddTask(task);
 }