Пример #1
0
        private void closePage(bool closeAll, bool checkFirst)
        {
            if (checkFirst && pageMode != PageFunctions.View)
            {
                bool doClose = checkForChanges();
                if (!doClose)
                {
                    return;
                }
            }
            clearChanges();
            MessageFunctions.CancelInfoAlert();

            Globals.SelectedHistory = ProjectFunctions.GetHistoryRecord(projectID, focusStage);
            bool closeFully = closeAll ? true : !fromProjectPage;

            if (closeFully)
            {
                ProjectFunctions.ReturnToTilesPage();
            }
            else
            {
                ProjectFunctions.ReturnToSourcePage(pageMode);
            }
        }
        // -------------- Data updates -------------- //



        // --------- Other/shared functions --------- //

        private void setCurrentClient(Clients client, ClientProxy clientProxy = null)
        {
            try
            {
                if (client == null && clientProxy == null)
                {
                    Globals.SelectedClient = null;
                    PageHeader.Content     = defaultHeader;
                    if (!projectSelected)
                    {
                        MessageFunctions.CancelInfoAlert();
                    }
                }
                else
                {
                    if (client == null)
                    {
                        client = ClientFunctions.GetClientByID(clientProxy.ID);
                    }
                    Globals.SelectedClient = client;
                    PageHeader.Content     = defaultHeader + " for Client " + client.ClientCode + " (" + client.ClientName + ")";
                    if (!projectSelected)
                    {
                        MessageFunctions.InfoAlert("This effectively sets the current client to " + client.ClientName + " until the name filter is changed/cleared "
                                                   + " or a different project is selected (the projects drop-down list is unaffected)", "Client " + client.ClientCode + " selected");
                    }
                }
            }
            catch (Exception generalException) { MessageFunctions.Error("Error processing project client selection", generalException); }
        }
Пример #3
0
 public static void CompleteLogIn()
 {
     MessageFunctions.CancelInfoAlert();
     PageFunctions.MenuSecurity();
     Globals.FavouriteProjectID = StaffFunctions.MainProjectID(MyStaffID);
     PageFunctions.ToggleMainMenus(true);
     PageFunctions.ShowTilesPage();
 }
 private void clearChanges()
 {
     ProjectFunctions.ClearAnyChanges();
     selectedProjectProduct = null;
     MessageFunctions.CancelInfoAlert();
 }