// -------------------------- CreatePageLoadId ----------------------- // create a LoadMaster record for this page. private void CreatePageLoadId( ) { // virtual calls get actual table and row objects. AcLoadMaster lm = NewLoadMaster( ); AcLoadMasterRow row = lm.NewRow( ); // fill the row. row.SessionId = Session.SessionID; row.PageName = PageName; row.PageFileName = PageFileName; row.PageDirPath = PageDirPath; row.LoadTs = DateTime.UtcNow; row.LastPostbackTs = DateTime.UtcNow; row.PostbackCx = 0; row.RawUrl = Request.RawUrl; // the seqnbr of the load of this page within the session. row.Seqn = IncSessionPageLoadSeqn( ); // add the LoadMasterRow to the table. row = lm.Add(this, row); // store the LoadId in ViewState of this page. ViewState["LoadId"] = row.LoadId; }
// ---------------------- UpdatePageLoadId -------------------------- // postback of a page. Update the last postback timestamp in the LoadMaster row // of this page. private void UpdatePageLoadId( ) { // LoadId of the page is stored in view state. string LoadId = GetViewStateValue("LoadId", null); // read the LoadMaster row. AcLoadMaster lm = NewLoadMaster( ); AcLoadMasterRow row = lm.Chain(this, LoadId); // update the postback columns. ++row.PostbackCx; row.LastPostbackTs = DateTime.UtcNow; lm.Update(this, LoadId, row); }