Esempio n. 1
0
        //----------------------------------------------------------------------

        public IEnumerable <Users> getProjectUsers(int pid, int Lid)
        {
            List <Users> c     = new List <Users>();
            handleUsers  users = new handleUsers();

            foreach (var item in getJoinedProjects(Lid))
            {
                if (item.projectID == pid)
                {
                    if (item.memberOne != 0)
                    {
                        if (users.isUser(item.memberOne))
                        {
                            c.Add(users.getUser(item.memberOne));
                        }
                    }
                    if (item.memberTwo != 0)
                    {
                        if (users.isUser(item.memberTwo))
                        {
                            c.Add(users.getUser(item.memberTwo));
                        }
                    }
                    if (item.memberThree != 0)
                    {
                        if (users.isUser(item.memberThree))
                        {
                            c.Add(users.getUser(item.memberThree));
                        }
                    }
                }
            }
            return(c);
        }
Esempio n. 2
0
        //-------------------------------------------------------------------

        public IEnumerable <Users> getAllRelatedMembers(int leaderId)
        {
            List <teamLeaderProjects> t = bda.TL_Project.ToList().Where
                                          (
                item => item.ProjectState == 1 && item.teamleaderID == leaderId
                                          ).ToList();
            List <Users> relatedMembers = new List <Users>();
            handleUsers  users          = new handleUsers();

            foreach (var tp in t)
            {
                if (tp.memberOne != 0)
                {
                    Users user = users.getUser(tp.memberOne);
                    if (user != null)
                    {
                        relatedMembers.Add(user);
                    }
                }
                if (tp.memberTwo != 0)
                {
                    Users user = users.getUser(tp.memberTwo);
                    if (user != null)
                    {
                        relatedMembers.Add(user);
                    }
                }
                if (tp.memberThree != 0)
                {
                    Users user = users.getUser(tp.memberThree);
                    if (user != null)
                    {
                        relatedMembers.Add(user);
                    }
                }
            }
            return(relatedMembers);
        }