Exemplo n.º 1
0
        // this function forwards the inputs for validations check and then forwards to User class
        public static InfoObject editTaskDueDate(string email, int taskID, int status, string newDueDate)
        {
            Log.Info("Edit existing task due date request by: " + email + ". Task ID: " + taskID);
            User CurrUser = (User)currUsers[email];

            if (CurrUser != null && IsValid.IsValidTaskDueDate(newDueDate))
            {
                return(CurrUser.editTaskDueDate(taskID, status, newDueDate));
            }
            else
            {
                Log.Error("Edit task due date failed. invadlid date or date has been past");
                InfoObject info = new InfoObject(false, "Edit task title failed. invadlid date or date has been past");
                return(info);
            }
        }
Exemplo n.º 2
0
        // this function forwards the inputs for validations check and then forwards to User class
        public static InfoObject addTask(string email, string title, string description, string dueDate)
        {
            Log.Info("Add new task request by: " + email + ". Task: " + title);
            User CurrUser = (User)currUsers[email];

            if (CurrUser != null && (IsValid.IsValidTaskTitle(title) & IsValid.IsValidTaskDescreption(description) & IsValid.IsValidTaskDueDate(dueDate)))
            {
                return(CurrUser.addTask(title, description, dueDate));
            }
            else
            {
                Log.Error("Adding task failed.");
                InfoObject info = new InfoObject(false, "Adding task failed.");
                return(info);
            }
        }