Esempio n. 1
0
 /// <summary>
 /// Page Load event
 /// </summary>
 /// <remarks>
 /// This event fires when a user goes to a page. It is used to track a user’s progress through a lesson and determine when they have completed their training requirement.
 /// The event will call the Toolbook.RecordPageVisited method.
 /// </remarks>
 private void Page_Load()
 {
     if (!PageContext.Current.IsPreviewMode)
     {
         BusinessServices.Toolbook objToolbook = new BusinessServices.Toolbook();
         objToolbook.RecordPageVisited(PageContext.Current.SessionID, PageContext.Current.PageID);
     }
 }
Esempio n. 2
0
        }        //Lesson_OnLoad

        /// <summary>
        /// LessonPage_OnLoad
        /// </summary>
        /// <param name="sessionID">This is the session id that maps to the lesson that is currently loading</param>
        /// <param name="postData">This is the collection of http post data variables</param>
        private void LessonPage_OnLoad(SqlString sessionID, NameValueCollection postData)
        {
            string strToolbookPageID;

            // Verify the necessary post parameters have been supplied
            strToolbookPageID = postData.Get("TBPageID");
            if (strToolbookPageID.Length == 0)
            {
                OutputToToolBook(
                    cm_strReturnCodeCriticalError                                                  // paramater 1 - ReturnCode
                    + cm_strDelimiter + "TBListener Error 1. Missing required parameter: TBPageID" // paramater 2 - Error Message
                    );
                return;
            }

            try
            {
                BusinessServices.Toolbook objToolBook = new BusinessServices.Toolbook();
                if (objToolBook.RecordPageVisited(sessionID, strToolbookPageID))
                {
                    // Normal condition -> tell TB "c_strReturnCodeOK", i.e. it can continue
                    OutputToToolBook(
                        cm_strReturnCodeOK                                              // paramater 1 - ReturnCode
                        + cm_strDelimiter + ""                                          // paramater 2 - Error Message
                        );
                    return;
                }
                else
                {
                    // Error condition
                    OutputToToolBook(
                        cm_strReturnCodeCriticalError                                                     // paramater 1 - ReturnCode
                        + cm_strDelimiter + "TBListener Error 15. " + ResourceManager.GetString("Error2") //"	// paramater 2 - Error Message
                        );
                    return;
                }
            }
            catch (Exception ex)
            {
                // log the error
                ErrorHandler.ErrorLog Error = new ErrorHandler.ErrorLog(ex);

                OutputToToolBook(
                    cm_strReturnCodeCriticalError                               // paramater 1 - ReturnCode
                    + cm_strDelimiter + "TBListener Error 16. Unknown Error"    // paramater 2 - Error Message
                    );
                return;
            }
        }         // LessonPage_OnLoad