Esempio n. 1
0
        public static List<M_ShortTask> ViewUserTask(string userid, int eventID)
        {
            List<Role> userRoles = RoleController.ViewUserEventRoles(userid, eventID);
            List<M_ShortTask> myTask = new List<M_ShortTask>();
            foreach (Role r in userRoles)
            {
                List<Task> tasks = TaskController.ViewTasksByRole(eventID, r.RoleID);

                foreach (Task t in tasks)
                {
                    M_ShortTask st = new M_ShortTask();

                    st.Name = t.TaskName;
                    st.Date = ConvertDate(t.DueDate);
                    st.Key = t.TaskID;

                    myTask.Add(st);
                }

            }

            return myTask;
        }
Esempio n. 2
0
        public static List<M_ShortTask> ViewEventTask(string userid, int eventID)
        {
            if (!CanViewTask(userid, eventID))
                throw new FaultException<SException>(new SException(),
                      new FaultReason("Error, no rights to view task"));

            List<M_ShortTask> myTask = new List<M_ShortTask>();
            List<Task> tasks = TaskController.GetTasksByEvent(userid, eventID);

            foreach (Task t in tasks)
            {
                M_ShortTask st = new M_ShortTask();

                st.Name = t.TaskName;
                st.Date = ConvertDate(t.DueDate);
                st.Key = t.TaskID;

                myTask.Add(st);
            }

            return myTask;
        }