Example #1
0
        public void SetUserInbox(string name)
        {
            if (MOG_ControllerProject.GetProject() != null)
            {
                // Is this user valid?
                if (MOG_ControllerProject.GetProject().GetUser(name) != null)
                {
                    // Is this user different from the current user?
                    if (string.Compare(name, mCurrentUsersBox, true) != 0)
                    {
                        MOG_Privileges privs = MOG_ControllerProject.GetPrivileges();

                        if (privs.GetUserPrivilege(MOG_ControllerProject.GetUserName(), MOG_PRIVILEGE.ViewOtherUsersInbox) ||
                            String.Compare(MOG_ControllerProject.GetUserName(), name, true) == 0)
                        {
                            mInboxAssetsDirectory  = "";
                            mOutboxAssetsDirectory = "";
                            mCurrentUsersBox       = name;

                            // Set the active user
                            guiUser user = new guiUser(mainForm);
                            user.SetActiveUser(name);

                            // Are we in our inbox or another teammate
                            Color formBackColor = SystemColors.Window;
                            if (string.Compare(name, MOG_ControllerProject.GetUserName(), true) != 0)
                            {
                                // We are not in our boxes, so lets color them
                                formBackColor = Color.LavenderBlush;
                            }

                            mainForm.AssetManagerInboxListView.BackColor  = formBackColor;
                            mainForm.AssetManagerSentListView.BackColor   = formBackColor;
                            mainForm.AssetManagerTrashListView.BackColor  = formBackColor;
                            mainForm.AssetManagerDraftsListView.BackColor = formBackColor;

                            RefreshAllWindows();
                        }
                        else
                        {
                            MOG_Prompt.PromptResponse("Insufficient Privileges", "Your privileges do not allow you to view other users' inboxes.");
                        }
                    }
                    else
                    {
                        // User is the same, so just update our gui to show correct department and user
                        SetActiveUser(mCurrentUsersBox);
                    }
                }
            }
        }
        public void AssetImportFromShell(string[] files, bool separate, bool looseFileMatching)
        {
            // If we are not the login user, switch us
            if (string.Compare(MOG_ControllerProject.GetActiveUser().GetUserName(), MOG_ControllerProject.GetUser().GetUserName(), true) != 0)
            {
                guiUser user = new guiUser(mAssetManager.mainForm);
                mAssetManager.mainForm.AssetManagerActiveUserComboBox.Text = MOG_ControllerProject.GetUser().GetUserName();
                user.SetActiveUser(MOG_ControllerProject.GetUser().GetUserName());
                mAssetManager.RefreshActiveWindow();
            }

            if (separate)
            {
                guiAssetController.ImportSeparately(files, looseFileMatching);
            }
            else
            {
                guiAssetController.ImportAsOne(files, looseFileMatching);
            }
        }