Exemple #1
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 UpdateDate(string id, string date, string fileName)
 {
     var validateFileAndStatus = new VerifierFileAndStatus(fileName);
     fileName = validateFileAndStatus.VerifyFileName();
     var validateDateAndDuDate = new VerifierDateAndDueDate(date);
     var tempdate = validateDateAndDuDate.VerifyTempDate();
     var xml = new XMLRepository(fileName);
        // xml.UpdateDate(id, tempdate);
 }
Exemple #3
0
        public void UpdateDate(string id, string date, string fileName)
        {
            var validateFileAndStatus = new VerifierFileAndStatus(fileName);

            fileName = validateFileAndStatus.VerifyFileName();
            var validateDateAndDuDate = new VerifierDateAndDueDate(date);
            var tempdate = validateDateAndDuDate.VerifyTempDate();
            var xml      = new XMLRepository(fileName);
            // xml.UpdateDate(id, tempdate);
        }
 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");
 }