示例#1
0
 public void SortDescending(string fileName, string sortBy)
 {
     var validateFileAndStatus = new VerifierFileAndStatus(fileName);
     fileName = validateFileAndStatus.VerifyFileName();
     var view= new TaskView(fileName);
     view.SortDesc(sortBy);
 }
示例#2
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");
            }
        }
示例#3
0
 public void Search(string word, string fileName)
 {
     var validateFileAndStatus = new VerifierFileAndStatus(fileName);
     fileName = validateFileAndStatus.VerifyFileName();
     var view = new TaskView(fileName);
     view.ViewTaskMatch(word);
 }
示例#4
0
 public void GetTaskByCategory(string fileName, string category)
 {
     var validateFileAndStatus = new VerifierFileAndStatus(fileName);
     fileName = validateFileAndStatus.VerifyFileName();
     var view = new TaskView(fileName);
     view.ViewTaskByCategory(category);
 }
示例#5
0
 public void GetTask(string fileName)
 {
     var validateFileName = new VerifierFileAndStatus(fileName);
     fileName = validateFileName.VerifyFileName();
     var xml = new XMLRepository(fileName);
        // xml.GetTasks();
 }
示例#6
0
        public void GetTask(string fileName)
        {
            var validateFileName = new VerifierFileAndStatus(fileName);

            fileName = validateFileName.VerifyFileName();
            var xml = new XMLRepository(fileName);
            // xml.GetTasks();
        }
示例#7
0
        public void Search(string word, string fileName)
        {
            var validateFileAndStatus = new VerifierFileAndStatus(fileName);

            fileName = validateFileAndStatus.VerifyFileName();
            var view = new TaskView(fileName);

            view.ViewTaskMatch(word);
        }
示例#8
0
        public void GetTaskByCategory(string fileName, string category)
        {
            var validateFileAndStatus = new VerifierFileAndStatus(fileName);

            fileName = validateFileAndStatus.VerifyFileName();
            var view = new TaskView(fileName);

            view.ViewTaskByCategory(category);
        }
示例#9
0
        public void SortDescending(string fileName, string sortBy)
        {
            var validateFileAndStatus = new VerifierFileAndStatus(fileName);

            fileName = validateFileAndStatus.VerifyFileName();
            var view = new TaskView(fileName);

            view.SortDesc(sortBy);
        }
示例#10
0
        public void UpdateStatus(string id, string status, string fileName)
        {
            var validateFileAndStatus = new VerifierFileAndStatus(fileName, status);

            status   = validateFileAndStatus.VerifyStatus();
            fileName = validateFileAndStatus.VerifyFileName();
            var xml = new XMLRepository(fileName);
            // xml.UpdateStatus(id, status);
        }
示例#11
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);
 }
示例#12
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);
        }
示例#13
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");
 }
示例#14
0
 public void UpdateStatus(string id, string status, string fileName)
 {
     var validateFileAndStatus = new VerifierFileAndStatus(fileName, status);
     status = validateFileAndStatus.VerifyStatus();
     fileName = validateFileAndStatus.VerifyFileName();
     var xml = new XMLRepository(fileName);
        // xml.UpdateStatus(id, status);
 }