コード例 #1
0
    protected virtual void Page_Init(object sender, EventArgs e)
    {
        dtPageStartTime = DateTime.Now;

        if (Context.Session != null)
        {
            bool bIsNewSessionOverride = false;

            if (Context.Items["IsNewSessionOverride"] != null)
                bIsNewSessionOverride = (bool)Context.Items["IsNewSessionOverride"];

            if (Session.IsNewSession && !bIsNewSessionOverride)
            {
                Response.Redirect("~/Default.aspx");
                return;
            }

        }

        bIsProduction = XnGR_WBS_Page.IsProductionMode();

        if (ConfigurationManager.AppSettings["WBSBookingMode"] == "Production")
            bIsBookThrough = true;
        else
            bIsBookThrough = false;

        if (ConfigurationManager.AppSettings["GuestDetailsTestPrefill"] == "1")
            bIsGuestDetailsTestPrefill = true;
        else
            bIsGuestDetailsTestPrefill = false;

        bIsParentPreRender = false;
        bIsDeepLinkNav = false;

        objEventLog = (FileLog)Application["EventLog"];
        objExceptionEventLog = (ExceptionLog)Application["ExceptionEventLog"];

        wbsAPIRouter = WBSAPIRouter.GetWbsApiRouter(Context.Cache, objEventLog, objExceptionEventLog, bIsProduction, (int)Application["WBSAPIRouter.RequestExpirationSeconds"], (int)Application["WBSAPIRouter.WindowUnitSeconds"], (int)Application["WBSAPIRouter.WindowUnits"]);
        wbsAPIRouterData = null;
        wbsIISAsyncResult = null;

        wbsAPI = new WBSAPIRouterHelper(Session, Page, objEventLog, objExceptionEventLog, bIsProduction);
        wbsPG = new WBSPGHelper(Session, Page, objEventLog, objExceptionEventLog, bIsProduction);
        wbsUI = new WBSUIHelper(Session, Page);

        wbsPerfCounters = WBSPerfCounters.GetWbsPerfCounters(Context.Cache, objEventLog, objExceptionEventLog, (string)Application["WBSPerfCounters.PerformanceMonitorGroupName"]);
        wbsServiceTimesUpdater = WBSServiceTimesUpdater.GetWbsServiceTimesUpdater(Context.Cache, objEventLog, objExceptionEventLog, bIsProduction, (int)Application["WBSAPIRouter.RequestExpirationSeconds"], (int)Application["WBSAPIRouter.WindowUnitSeconds"], (int)Application["WBSAPIRouter.WindowUnits"], (string)Application["WBSPerfCounters.PerformanceMonitorGroupName"]); // retrieved only as a "keep-alive" mechanism

        wbsMonitor = WBSMonitor.GetWbsMonitor(Context.Cache, objEventLog, objExceptionEventLog, bIsProduction, (int)Application["WBSMonitor.ExpirationSeconds"]); // Used for pending prepay bookings logging

        this.InitPageErrors();

        if (!IsPostBack)
        {
            if (Request.QueryString.Get("CrossPageErrors") == "1")
                this.RestoreCrossPageErrors();

            if (Request.QueryString.Get("DeepLinkNav") == "1") // used wtih Response.Redirect
                bIsDeepLinkNav = true;

            if ((string)Context.Items["DeepLinkNav"] == "1") // used with Server.Transfer
                bIsDeepLinkNav = true;
        }

        return;
    }
コード例 #2
0
    // Globalization support properties and methods
    protected override void InitializeCulture()
    {
        WBSUIHelper objWBSUIHelper = new WBSUIHelper(Session, Page);

        Culture = objWBSUIHelper.SelectedCulture;
        UICulture = objWBSUIHelper.SelectedUICulture;

        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(objWBSUIHelper.SelectedCulture);
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(objWBSUIHelper.SelectedUICulture);

        base.InitializeCulture();
    }