//Session Complete Logic - Move to DataSample?
        private void SessionComplete()
        {
            logger.Info("Custom Session Complete");
            StopSequence();

            frmMessageDialog.DisplayBriefMessage("Program Complete");
            DataSample.SessionResultsCalculations();

            frmProgramResults frmObject_SaveSession = new frmProgramResults();
            frmObject_SaveSession.UserID = Convert.ToInt32(GlobalVariables.LoggedInUser.id);
            frmObject_SaveSession.DataSample = DataSample;
            frmObject_SaveSession.SetLabels();

            frmObject_SaveSession.Show();
        }
Exemplo n.º 2
0
        //Load ProgramResults Form - Can be refactored to program results form?
        private void SessionComplete()
        {
            StopSequence();

            frmProgramResults frmObject_SaveSession = new frmProgramResults();

            frmObject_SaveSession.UserID = Convert.ToInt32(GlobalVariables.LoggedInUser.id);
            frmObject_SaveSession.ProgramSelector = DataSample.ProgramSelector;

            switch (DataSample.ProgramSelector)
            {
                case Enumerators.ProgramSelect.FTPTest:
                    frmObject_SaveSession.tabControlResults.SelectedTab = frmObject_SaveSession.tabPageFTPTest;
                    frmObject_SaveSession.FTPTestResult = DataSample.ForwardsConcentricFTP;
                    frmObject_SaveSession.lblFTPResult.Text = Math.Round(DataSample.ForwardsConcentricFTP, 1).ToString();
                    break;
                case Enumerators.ProgramSelect.VO2MaxTest:
                    frmObject_SaveSession.tabControlResults.SelectedTab = frmObject_SaveSession.tabPageVO2Max;
                    frmObject_SaveSession.VO2MaxRel = DataSample.ForwardsConcentricVO2Max;
                    frmObject_SaveSession.VO2Max = DataSample.ForwardsConcentricVO2Max * Convert.ToDouble(GlobalVariables.LoggedInUser.Weight) / 1000;
                    frmObject_SaveSession.MaxConcPower = DataSample.ForwardsConcentricPowerArray.Max();
                    frmObject_SaveSession.lblVO2MaxRel.Text = Math.Round(frmObject_SaveSession.VO2MaxRel, 1).ToString();
                    frmObject_SaveSession.lblVO2Max.Text = Math.Round(frmObject_SaveSession.VO2Max, 1).ToString();
                    frmObject_SaveSession.lblBodyMass.Text = GlobalVariables.LoggedInUser.Weight.ToString();
                    frmObject_SaveSession.lblMaxPowerVO2.Text = Math.Round(frmObject_SaveSession.MaxConcPower, 1).ToString();
                    break;
                default:
                    break;
            }

            frmMessageDialog.DisplayBriefMessage("Program Complete");
            frmObject_SaveSession.Show();
        }