Exemple #1
0
        static public bool SetLoginProject(string name, string branch)
        {
            // Initialize users on the Asset Manager page
            if (mainForm.mAssetManager != null)
            {
                mainForm.mAssetManager.DeInitialize();
            }

            if (MOG_ControllerProject.ProjectExists(name))
            {
                if (MOG_ControllerProject.LoginProject(name, branch) != null)
                {
                    // Initialize branches
                    MainMenuProjectsClass.MOGGlobalBranchesInit(true);
                    UpdateGuiBranch(MOG_ControllerProject.GetBranchName());

                    // Initialize the project icons (clear them first)
                    MogUtil_AssetIcons.ClassIconsClear();
                    MogUtil_AssetIcons.ClassIconInitialize();

                    // Initialize users on the Asset Manager page
                    if (mainForm.mAssetManager != null)
                    {
                        //mainForm.mAssetManager.DeInitialize();
                        mainForm.mAssetManager.Initialize();

                        List <string> departments = guiStartup.GetDepartments(name);
                        mainForm.AssetManagerActiveUserDepartmentsComboBox.Items.Clear();
                        mainForm.AssetManagerActiveUserDepartmentsComboBox.Items.AddRange(departments.ToArray());
                    }

                    // Load web tabs
                    if (mainForm.mWebTabManager != null)
                    {
                        mainForm.mWebTabManager.LoadTabs();
                    }

                    // Update the project related gui stuff
                    UpdateGuiProject(name);

                    // Check if we passed in a valid branch
                    if (branch.Length != 0)
                    {
                        UpdateGuiBranch(MOG_ControllerProject.GetBranchName());
                    }

                    // Save our prefs file
                    guiUserPrefs.SaveStatic_ProjectPrefs();

                    return(true);
                }
            }

            return(false);
        }