Exemple #1
0
        private void PopulateBlessTargets()
        {
            // reset to only MasterData
            BlessTargets.Items.Clear();
            BlessTargets.Items.Add("MasterData");

            if (mProject != null)
            {
                foreach (MOG_User user in mProject.GetUsers())
                {
                    BlessTargets.Items.Add(user.GetUserName());
                }
            }

            BlessTargets.SelectedIndex = 0;
        }
Exemple #2
0
        public void LoadFromProject(MOG_Project project)
        {
            mProject = project;

            lvUsers.Items.Clear();

            foreach (MOG_User user in project.GetUsers())
            {
                AddUser(user, mPrivileges.GetUserGroup(user.GetUserName()));
            }

            // Load up the SMTP server
            if (project.GetConfigFile().KeyExist("PROJECT", "EmailSmtp"))
            {
                tbEmailSMTP.Text = project.GetConfigFile().GetString("PROJECT", "EmailSmtp");
            }
        }
        private void LoadProjectUsers(MOG_Project pProject, TreeNode project)
        {
            SortedList <string, List <string> > departments = new SortedList <string, List <string> >();

            // Add all the users to the AssignTo subMenu
            ArrayList users = pProject.GetUsers();

            if (users != null)
            {
                TreeNode Users = CreateNode("Users", "Users", new RemoteSettings());

                for (int u = 0; u < users.Count; u++)
                {
                    MOG_User user = (MOG_User)users[u];

                    // Does this department exist?
                    if (departments.ContainsKey(user.GetUserDepartment().ToLower()) == false)
                    {
                        // No, then add it with the user
                        List <string> userList = new List <string>();
                        userList.Add(user.GetUserName());

                        departments.Add(user.GetUserDepartment().ToLower(), userList);
                    }
                    else
                    {
                        // yup, its already there so add this user to the array
                        departments[user.GetUserDepartment().ToLower()].Add(user.GetUserName());
                    }
                }

                foreach (string department in departments.Keys)
                {
                    TreeNode departmentNode = CreateNode(department, "Users", new RemoteSettings());
                    foreach (string userName in departments[department])
                    {
                        departmentNode.Nodes.Add(CreateNode(userName, "User", new RemoteSettings()));
                    }
                    Users.Nodes.Add(departmentNode);
                }

                project.Nodes.Add(Users);
            }
        }
Exemple #4
0
        internal static List <string> GetDepartments(string projectname)
        {
            List <string> departments = new List <string>();

            MOG_Project project = MOG_ControllerSystem.GetSystem().GetProject(projectname);

            if (project != null)
            {
                foreach (MOG_User user in project.GetUsers())
                {
                    if (departments.Contains(user.GetUserDepartment()) == false)
                    {
                        departments.Add(user.GetUserDepartment());
                    }
                }
            }

            return(departments);
        }
Exemple #5
0
        static public List <string> GetUsers(string projectname, string department)
        {
            List <string> users = new List <string>();

            MOG_Project project = MOG_ControllerSystem.GetSystem().GetProject(projectname);

            if (project != null)
            {
                foreach (MOG_User user in project.GetUsers())
                {
                    // Is this user within the same department as the one specified
                    if (string.Compare(user.GetUserDepartment(), department, true) == 0)
                    {
                        users.Add(user.GetUserName());
                    }
                }
            }

            return(users);
        }