// GREG - please add dowhatif_all_start() and dowhatif_all_end() where applicable protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); string str1 = ""; short x1; int ret; //if (DbUse.InRunProcess(userDir)) { // ShowWhatifs(); // Master.ShowErrorMessage("Cannot load information about What-If Scenarios because calculations are still running in the current model. Please wait and come back later."); // return; //} try { classE1_1.Open(); ret = classE1_1.testresetwid(classE1_1.glngwid); /// sees if glngwid has a record in tblwhatif ... if (ret == 0) { classE1_1.glngwid = 0; // duplicate here !!! } if (!Page.IsPostBack) { // add test for glngwid in tblwhatif!!!! else set to 0 // when saving model, closing, ... check if glngwid != 0 give user choice of save, quit or new whatif name ShowWhatifs(); if (classE1_1.glngwid == 0) { classE1_1.dowhatif_all_start(); MPXWhatfcontrolChoices.SetActiveView(PageR1); } else { set_page2_words(); RefreshWhatifRecords(); SetWhatifRecordsData(); MPXWhatfcontrolChoices.SetActiveView(PageR2); //set words for whatif name, comment etc... } } else { updatingdatasource(); SetWhatifRecordsData(); /* // notupdating datasource!!! * * AccessDataSource1.UpdateCommand = "SELECT [WID], [Name] FROM [tblWhatIf]"; * AccessDataSource1.DataFile = classE1_1.varlocal + "\\mpxmdb.mdb"; * AccessDataSource1.Update(); * AccessDataSource1.DataBind(); * AccessDataSource1.Update(); */ } classE1_1.Close(); } catch (Exception ex) { logFiles.ErrorLog(ex); Master.ShowErrorMessage("MPX internal error has occured."); } }