Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
        // this function forwards the inputs for validations check and then forwards to User class
        public static InfoObject editTaskDescription(string email, int taskID, int status, string newDescription)
        {
            Log.Info("Edit existing task description request by: " + email + ". Task ID: " + taskID);
            User CurrUser = (User)currUsers[email];

            if (CurrUser != null && IsValid.IsValidTaskDescreption(newDescription))
            {
                return(CurrUser.editTaskDescreption(taskID, status, newDescription));
            }
            else
            {
                Log.Error("Edit task discription failed. the new description is over 300 chars");
                InfoObject info = new InfoObject(false, "Edit task title failed. the new description is over 300 chars");
                return(info);
            }
        }