Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.AsyncTimeout = TimeSpan.FromSeconds(30);
        PageAsyncTask pat = new PageAsyncTask(BeginAsync, EndAsync, TimeoutAsync, null, true);

        RegisterAsyncTask(pat);
    }
        protected async void Page_Load(object sender, EventArgs e)
        {
            AsyncMode = true;

            if (Environment.MachineName.ToLower().Contains("cody"))
            {
                redirectURI = "http://localhost:59785/Default.aspx";
            }
            this.txtlog.Text = "";

            if (Request.QueryString["signoff"] == "Y")
            {
                dictionary.Clear();
                try { await oauthClient.RevokeTokenAsync("refreshToken"); } catch { }
            }

            if (!dictionary.ContainsKey("accessToken"))
            {
                if (Request.QueryString.Count > 0)
                {
                    var response = new AuthorizeResponse(Request.QueryString.ToString());
                    if (response.State != null)
                    {
                        if (oauthClient.CSRFToken == response.State)
                        {
                            if (response.RealmId != null)
                            {
                                if (!dictionary.ContainsKey("realmId"))
                                {
                                    dictionary.Add("realmId", response.RealmId);
                                }
                            }

                            if (response.Code != null)
                            {
                                authCode = response.Code;
                                Output("Authorization code obtained.", false);
                                PageAsyncTask t = new PageAsyncTask(PerformCodeExchange);
                                Page.RegisterAsyncTask(t);
                                Page.ExecuteRegisteredAsyncTasks();
                            }
                        }
                        else
                        {
                            Output("Invalid State", false);
                            dictionary.Clear();
                        }
                    }
                }
            }
            else
            {
                mainButtons.Visible = false;
                connected.Visible   = true;
                if (Page.IsPostBack && dictionary.ContainsKey("accessToken") && dictionary.ContainsKey("realmId"))
                {
                    await CallAll();
                }
            }
        }
 protected void btncountshots_Click(object sender, EventArgs e)
 {
     if (tbxLimite.Text.ToString().Trim() == "")
     {
         tbxLimite.Text = "0";
     }
     if (tbxLimite.Text.ToString().Trim() != "")
     {
         if (Int32.Parse(tbxLimite.Text) < 0)
         {
             ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('¡Advertencia!', '" + "Ingrese una cantidad mayor a 0 en el límite." + "', 'error');", true);
             return;
         }
         try
         {
             int ini           = fechaINI.SelectedDate.Day;
             int fin           = FechaFin.SelectedDate.Day;
             int validateYear1 = fechaINI.SelectedDate.Year;
             int validateYear2 = FechaFin.SelectedDate.Year;//null is 001
             int month1        = fechaINI.SelectedDate.Month;
             int month2        = FechaFin.SelectedDate.Month;
             var pageAsyncTask = new PageAsyncTask(j => ShotHistoryDataAsync(j, Session["Player"].ToString(), Int32.Parse(tbxLimite.Text), ini, fin, validateYear1, validateYear2, month1, month2));
             this.RegisterAsyncTask(pageAsyncTask);
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('¡Advertencia!', '" + "Error en la carga de datos, por favor vuelva al menú principal." + "', 'error');", true);
         }
     }
 }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["user"] == null || Session["user"].ToString() == "")
                {
                    Response.Redirect("login.aspx");
                }

                if (Session["rol"].ToString().ToUpper().CompareTo("TRAINER") != 0)
                {//User Player - specific palyer in session
                    var pageAsyncTask = new PageAsyncTask(x => PlayersAsync(x, Session["user"].ToString()));
                    this.RegisterAsyncTask(pageAsyncTask);
                }
                else
                {
                    //to trainer cases
                    var playersAsync = new PageAsyncTask(p => AllPlayersAsync(p));
                    this.RegisterAsyncTask(playersAsync);
                }
                lblUsuario.Text  = Session["user"].ToString();
                Session["Shots"] = "";
                Session["Shot"]  = "";
                //load the shots
            }
        }
	public void Page_Load( Object sender, EventArgs e )
	{
		// we have to do all the usual tricks to see any output before the
		// page `renders' completely by asp.net standards.. remember to flush
		for( int i = 0; i < 100; i++ )
		{
			Response.Write( "<span></span>" );
		}

		m_doAsyncDelegate = new DoAsyncDelegate( DoAsync );

		m_asyncTask = new PageAsyncTask(
	   new BeginEventHandler( this.BeginLoad ),
	   new EndEventHandler( this.EndLoad ),
	   null, null, false
		);
		
		Response.Write("Working");
		Response.Flush();

		// can't be done in the handlers themselves.. have to be before 
		// prerender event has fired...
		// AttachHandlers();
		
		RegisterAsyncTask( m_asyncTask );

		
	}
Exemple #6
0
        protected void btnGo_click(object sender, EventArgs e)
        {
            switch (lstOperation.SelectedValue.ToUpperInvariant())
            {
            case "PAGE":
                PageAsyncTask task = new PageAsyncTask(
                    new BeginEventHandler(BeginPageRequest),
                    new EndEventHandler(EndPageRequest),
                    new EndEventHandler(TimeoutPageRequest),
                    null);
                RegisterAsyncTask(task);
                break;

            case "WIKI":
                AddOnPreRenderCompleteAsync(
                    new BeginEventHandler(BeginPagesListRequest),
                    new EndEventHandler(EndPagesListRequest)
                    );
                break;

            case "TEXT":
                mlwImport.ActiveViewIndex = 3;
                ITranslator translator = new Translator();
                txtTranslated.Text = translator.Translate(txtText.Text);
                break;
            }
        }
Exemple #7
0
        public void BeginExecuteAsyncTask()
        {
            try
            {
                // Define the asynchronuous task.
                PageAsyncTask pageAsyncTask = new PageAsyncTask(this.OnBegin, this.OnEnd, this.OnTimeout, true);

                // Register the asynchronous task.
                this._mainPage.RegisterAsyncTask(pageAsyncTask);

                // Execute the register asynchronous task.
                this._mainPage.ExecuteRegisteredAsyncTasks();
            }
            catch (Exception ex)
            {
                //------------------------------------------------------------------------------------------------------
                // LOG
                //------------------------------------------------------------------------------------------------------
                //
                string errorMsg = string.Format("{0}-{1}", ex.Message, ex.StackTrace);
                //
                LogModel.Log(string.Format("ASYNCTASK_BeginExecuteAsyncTask_ERROR : {0} ", errorMsg)
                             , string.Empty
                             , LogModel.LogType.Error);
            }
        }
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            uoHiddenFieldRequestDate.Value = Request.QueryString["dt"];
            if (!IsPostBack)
            {
                List <PortAgentHotelVehicle> PortAgentHotelVehicle = new List <PortAgentHotelVehicle>();

                uoListViewHotelCount.DataSource = PortAgentHotelVehicle;
                uoListViewHotelCount.DataBind();



                PageAsyncTask TaskCombo = new PageAsyncTask(OnBeginComboExceptions, OnEndComboExceptions, null, "Async2", true);
                Page.RegisterAsyncTask(TaskCombo);
            }
            else
            {
                //HiddenField uoHiddenFieldPopupCalendar = (HiddenField)Master.FindControl("uoHiddenFieldPopupCalendar");

                //if (uoHiddenFieldPopupCalendar.Value == "1" || (sChangeDate == "1"))
                //{
                //    //uoHiddenFieldPopupCalendar.Value = "0";
                //    string sURL = "PortAgentDashboardNew.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + Request.QueryString["dt"];
                //    Context.RewritePath(sURL);
                //}


                string sChangeDate = "";
                if (Request.QueryString["chDate"] != null)
                {
                    sChangeDate = Request.QueryString["chDate"];
                }

                HiddenField uoHiddenFieldPopupCalendar = (HiddenField)Master.FindControl("uoHiddenFieldPopupCalendar");
                if (uoHiddenFieldPopupCalendar.Value == "1" || (Session["DateFrom"] == null))
                {
                    uoHiddenFieldRequestDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy");
                }

                if (Session["DateFrom"] != null)
                {
                    uoHiddenFieldRequestDate.Value = GlobalCode.Field2DateTime(Session["DateFrom"]).ToString("MM/dd/yyyy");
                }
                else
                {
                    uoHiddenFieldRequestDate.Value = Session["dt"].ToString();
                }

                //uoHiddenFieldPopupCalendar.Value = "0";
                string sURL = "PortAgentDashboardNew.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + uoHiddenFieldRequestDate.Value;
                Context.RewritePath(sURL);
            }


            PageAsyncTask TaskIMS = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async1", true);

            Page.RegisterAsyncTask(TaskIMS);

            uoHyperLinkDashboard.NavigateUrl = "/Hotel/HotelNonTurnPorts2.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + Request.QueryString["dt"];
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        // 指定异步执行时的超时时间
        Page.AsyncTimeout = TimeSpan.FromMilliseconds(5000);

        // 设置一个较小的值,验证超时回调
        //Page.AsyncTimeout = TimeSpan.FromMilliseconds(10);

        /*
        ASP.NET 4.5 与 4.0 不兼容
        在当前应用程序配置中,不支持给 PageAsyncTask 构造函数提供非 null 的“timeoutHandler”或为 true 的“executeInParallel”参数值。
        要变通解决此问题,请在 Web.config 中添加以下配置开关:
        <appSettings>
         <add key = "aspnet:UseTaskFriendlySynchronizationContext" value = "false" />
        </appSettings >
        有关详细信息,请参阅: http://go.microsoft.com/fwlink/?LinkId=252465。
        */

        PageAsyncTask task = new PageAsyncTask(
            BeginProcess,
            ThreadHelper.BuildSyncContextCallback(EndProcess),
            ThreadHelper.BuildSyncContextCallback(TimeoutProcess),
            null,
            false);

        // 注册异步任务
        RegisterAsyncTask(task);

        // 开始运行
        ExecuteRegisteredAsyncTasks();
    }
    public void Page_Load( Object sender, EventArgs e )
    {
        // we have to do all the usual tricks to see any output before the
        // page `renders' completely by asp.net standards.. remember to flush
        for( int i = 0; i < 100; i++ )
        {
            Response.Write( "<span></span>" );
        }

        m_doAsyncDelegate = new DoAsyncDelegate( DoAsync );

        m_asyncTask = new PageAsyncTask(
           new BeginEventHandler( this.BeginLoad ),
           new EndEventHandler( this.EndLoad ),
           null, null, false
        );

        Response.Write("Working");
        Response.Flush();

        // can't be done in the handlers themselves.. have to be before
        // prerender event has fired...
        // AttachHandlers();

        RegisterAsyncTask( m_asyncTask );
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["user"] == null || Session["user"].ToString() == "")
         {
             Response.Redirect("login.aspx");
         }
         if (Session["Player"] == null || Session["Player"].ToString() == "")
         {
             Response.Redirect("index.aspx");
         }
         if (Session["Shot"] == null || Session["Shot"].ToString() == "")
         {
             Response.Redirect("login.aspx");
         }
         lblUsuario.Text = Session["user"].ToString();
         try
         {
             var pageAsyncTask = new PageAsyncTask(x => ShotDataAsync(x, Session["Shot"].ToString()));
             this.RegisterAsyncTask(pageAsyncTask);
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('¡Advertencia!', '" + "Error en la carga de datos, por favor vuelva al menú principal." + "', 'error');", true);
         }
     }
 }
Exemple #12
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         PageAsyncTask TaskExcp = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async", true);
         Page.RegisterAsyncTask(TaskExcp);
     }
 }
        protected async void Page_Load(object sender, EventArgs e)
        {
            CLogger cu = new CLogger();

            oauthClient.CustomLogger = cu.GetCustomLogger();
            oauthClient.EnableAdvancedLoggerInfoMode = true;
            oauthClient.EnableSerilogRequestResponseLoggingForConsole = true;
            oauthClient.EnableSerilogRequestResponseLoggingForDebug   = true;
            oauthClient.EnableSerilogRequestResponseLoggingForFile    = true;
            oauthClient.EnableSerilogRequestResponseLoggingForTrace   = true;
            oauthClient.ServiceRequestLoggingLocationForFile          = @"C:\Documents\Serilog_log";//check correct path on machine

            //SeriLogger seri = new SeriLogger();
            //seri.Log(TraceLevel.Verbose, "Nimisha typing");
            AsyncMode = true;
            if (!dictionary.ContainsKey("accessToken"))
            {
                if (Request.QueryString.Count > 0)
                {
                    var response = new AuthorizeResponse(Request.QueryString.ToString());

                    if (response.State != null)
                    {
                        //if (oauthClient.CSRFToken == response.State)
                        //{
                        if (response.RealmId != null)
                        {
                            // seri.Log(TraceLevel.Verbose, response.RealmId);
                            if (!dictionary.ContainsKey("realmId"))
                            {
                                dictionary.Add("realmId", response.RealmId);
                            }
                        }

                        if (response.Code != null)
                        {
                            authCode = response.Code;

                            Output("Authorization code obtained.");
                            PageAsyncTask t = new PageAsyncTask(PerformCodeExchange);
                            Page.RegisterAsyncTask(t);
                            Page.ExecuteRegisteredAsyncTasks();
                        }
                        //}
                        //else
                        //{
                        //    Output("Invalid State");
                        //    dictionary.Clear();
                        //}
                    }
                }
            }
            else
            {
                mainButtons.Visible = false;
                connected.Visible   = true;
            }
        }
        protected void btnSearch_click(object sender, EventArgs e)
        {
            try
            {
                string LoeNo    = "";
                string IDNumber = "";

                ImmigrationBLL BLL = new ImmigrationBLL();
                LoeNo    = txtLOEControlNo.Text;
                IDNumber = txtUniqeID.Text;

                if (IDNumber == "" && LoeNo == "")
                {
                    AlertMessage("Please enter Unique ID or LOE Control No to search crew verification.");
                    return;
                }
                ClearGridCrewVerification();

                List <CrewImmigration> Immigration = new List <CrewImmigration>();
                Immigration = BLL.CrewImmigration(0, GlobalCode.Field2Long(IDNumber), 0, LoeNo, "");

                Session["immigration"] = Immigration;

                if (Immigration.Count == 0)
                {
                    if (GlobalCode.Field2Long(IDNumber) > 0 && LoeNo == "")

                    {
                        txtUniqeID.Text = IDNumber.ToString();
                        AlertMessage("Unique ID does not exist in the system.");
                        txtUniqeID.Text = "";
                    }

                    else if (IDNumber == "" && LoeNo != "")
                    {
                        txtLOEControlNo.Text = LoeNo;
                        AlertMessage("This LOE is either invalid or does not exists in the system, please try search by Unique ID..");
                        txtLOEControlNo.Text = "";
                    }
                    else if (GlobalCode.Field2Long(IDNumber) > 0 && LoeNo != "")
                    {
                        txtLOEControlNo.Text = LoeNo;
                        txtUniqeID.Text      = IDNumber.ToString();
                        AlertMessage("This Unique ID and LOE combination does not exist in our system, please try seaching by Unique ID only");
                        txtLOEControlNo.Text = "";
                        txtUniqeID.Text      = "";
                    }
                    return;
                }

                crewverification(Immigration, 0);

                PageAsyncTask TaskPort1 = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async1", true);
                Page.RegisterAsyncTask(TaskPort1);
            }
            catch (Exception ex)
            { throw ex; }
        }
Exemple #15
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (this.IsPostBack)
     {
         PageAsyncTask pat = new PageAsyncTask(BeginAsync, EndAsync, null, null, true);
         RegisterAsyncTask(pat);
     }
 }
Exemple #16
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation),
                                                   new EndEventHandler(EndAsyncOperation),
                                                   new EndEventHandler(TimeoutAsyncOperation), null);

            RegisterAsyncTask(task);
            WritePress();
        }
    private void GetPage()
    {
        BeginEventHandler beh = new BeginEventHandler(BeginAsync);
        EndEventHandler   eeh = new EndEventHandler(EndAsync);
        PageAsyncTask     pat = new PageAsyncTask(beh, eeh, null, null, true);

        this.RegisterAsyncTask(pat);
        this.ExecuteRegisteredAsyncTasks();
    }
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session["strPrevPage"] = Request.RawUrl;
         PageAsyncTask TaskPort1 = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async1", true);
         Page.RegisterAsyncTask(TaskPort1);
     }
 }
Exemple #19
0
        // Метод работает в потоке из пула потоков IIS
        protected void Page_Load(object sender, EventArgs e)
        {
            Trace.Write("До регистрации задачи в Page_Load " + Thread.CurrentThread.ManagedThreadId);

            PageAsyncTask task = new PageAsyncTask(GetDataAsync);

            RegisterAsyncTask(task);

            Trace.Write("После регистрации задачи в Page_Load " + Thread.CurrentThread.ManagedThreadId);
        }
Exemple #20
0
        protected void ddlPlayer_SelectedIndexChanged(object sender, EventArgs e)
        {
            string val = ddlPlayer.SelectedItem.Value.ToString();

            if (val != "" || val.CompareTo("-1") != 0)
            {
                var pageAsyncTask = new PageAsyncTask(x => ShotsByPlayerAsync(x, val));
                this.RegisterAsyncTask(pageAsyncTask);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageAsyncTask pat = new PageAsyncTask(BeginAsync1, EndAsync1, null, null, true);

        this.RegisterAsyncTask(pat);
        pat = new PageAsyncTask(BeginAsync2, EndAsync2, null, null, true);
        this.RegisterAsyncTask(pat);
        pat = new PageAsyncTask(BeginAsync3, EndAsync3, null, null, false);
        this.RegisterAsyncTask(pat);
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            PageAsyncTask task = new PageAsyncTask(
                new BeginEventHandler(BeginAsyncOperation),
                new EndEventHandler(EndAsyncOperation),
                new EndEventHandler(TimeoutAsyncOperation),
                null
                );

            RegisterAsyncTask(task);
        }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncGetHotelSearchAreaList = true;

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
Exemple #24
0
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List <InvoiceHeader> InvoiceHeader = new List <InvoiceHeader>();
                ListView1.DataSource = null;
                ListView1.DataBind();

                PageAsyncTask TaskIMS = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async1", true);
                Page.RegisterAsyncTask(TaskIMS);
            }
        }
Exemple #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                APSGateway.Instance.InvalidateProcessableExtensionsCache();
            }

            PageAsyncTask asyncTask = new PageAsyncTask(BeginHandler, EndHandler, TimeoutHandler, null);

            Page.RegisterAsyncTask(asyncTask);
            Page.ExecuteRegisteredAsyncTasks();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PageAsyncTask t = new PageAsyncTask(LoadDataAsync);

                // Register the asynchronous task.
                Page.RegisterAsyncTask(t);

                // Execute the register asynchronous task.
                Page.ExecuteRegisteredAsyncTasks();
            }
        }
Exemple #27
0
        protected void RegisterAsyncTask()
        {
            this.AsyncTimeout = new TimeSpan(0, 0, 30); //TODO: config

            PageAsyncTask task = new PageAsyncTask(
                new BeginEventHandler(BeginAsyncRequest),
                new EndEventHandler(EndAsyncRequest),
                new EndEventHandler(TimeoutAsyncRequest),
                null
                );

            this.RegisterAsyncTask(task);
        }
        protected void btn_clicklogin2(object sender, EventArgs e)
        {
            try
            {
                var pageAsyncTask = new PageAsyncTask(c => LoginAsync(c, this.tbxUser.Text.ToString(), this.tbxClave.Text.ToString()));

                this.RegisterAsyncTask(pageAsyncTask);
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('¡Advertencia!', 'Usuario o Clave Incorrecta', 'error');", true);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["SFID"] != null)
                {
                    uoHiddenFieldSeafaredID.Value = Request.QueryString["SFID"].ToString();
                }

                PageAsyncTask TaskPort1 = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async1", true);
                Page.RegisterAsyncTask(TaskPort1);
            }
        }
Exemple #30
0
    private void EndAsync(IAsyncResult ar)
    {
        using (SqlCommand cmd = (SqlCommand)ar.AsyncState)
        {
            using (cmd.Connection)
            {
                int rows = cmd.EndExecuteNonQuery(ar);
            }
        }
        PageAsyncTask pat = new PageAsyncTask(BeginAsync2, EndAsync2, null, null, true);

        this.RegisterAsyncTask(pat);
        this.ExecuteRegisteredAsyncTasks();
    }
Exemple #31
0
        /// <summary>
        /// Method POST
        /// </summary>
        /// <param name="responseText">返回的网页内容</param>
        public bool MethodPostUrl(out string responseText)
        {
            bool IsContinue = true;

            if (_Fc.ReadFileCache())
            {
                responseText = _Fc.FileText;
                _CacheRead   = true;
            }
            else
            {
                PageAsyncTask taskStream = new PageAsyncTask(
                    new BeginEventHandler(_WebAsync.BeginAsyncStream),
                    new EndEventHandler(_WebAsync.EndAsyncStream),
                    new EndEventHandler(_WebAsync.TimeoutAsyncOperation),
                    null
                    );

                PageAsyncTask taskOperation = new PageAsyncTask(
                    new BeginEventHandler(_WebAsync.BeginAsyncResponse),
                    new EndEventHandler(_WebAsync.EndAsyncResponse),
                    new EndEventHandler(_WebAsync.TimeoutAsyncOperation),
                    null
                    );

                Page p = new Page();
                if (_Ts.TotalSeconds > 0)
                {
                    p.AsyncTimeout = _Ts;
                }
                p.RegisterAsyncTask(taskStream);
                p.RegisterAsyncTask(taskOperation);
                p.ExecuteRegisteredAsyncTasks();

                responseText = _WebAsync.Value;

                if (_WebAsync.Timeout)
                {
                    IsContinue = false;
                }

                if (_Fc.CacheUsed && IsContinue)
                {
                    _Fc.WriteFileCache(responseText);
                }
            }

            return(IsContinue);
        }
Exemple #32
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (IsPostBack)
            {
                return;
            }

            for (var i = 0; i < 100; i++)
            {
                var task = new PageAsyncTask(BeginRequest, EndRequest, null, null, true);
                RegisterAsyncTask(task);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Trace.Write("Thread = " + Thread.CurrentThread.ManagedThreadId.ToString(), "-> AddOnPreRenderCompleteAsync in Page_Load");

            // Асинхронная задача для данной страницы.
            PageAsyncTask task = new PageAsyncTask(
                OnBegin,   // Начало асинхронной операции.
                OnEnd,     // Завершение асинхронной операции.
                OnTimeOut, // Действие в случае если вышло время ожидания указанное в атрибуте AsyncTimeout директивы @ Page.
                null       // Значение для аргумента extraData метода OnBegin.
                );

            // Регистрация задачи. По умолчанию, вызов задачи происходит после события PreRender.
            RegisterAsyncTask(task);
        }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncBookHotel = false;

        if (!IsPostBack)
        {
            bAsyncBookHotel = true;
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncGetHotelDescriptiveInfo = false;
        bAsyncReadHotelBooking = false;

        if (!IsPostBack)
        {
            Session["SelectedRoom"] = "1";

            bAsyncGetHotelDescriptiveInfo = true;
            bAsyncReadHotelBooking = true;
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncGetHotelAvailInfo = false;
        bAsyncGetHotelAvailCalendarInfo = false;

        if (!IsPostBack)
        {
            Session["SelectedRoom"] = "1";
            Session["AvailCalRequested"] = false;

            WbsUiHelper.UpdateRatePlanPaymentPolicies();
        }

        else
        {
            this.ConfigureLanguageSelectorControl();
            this.ConfigureProfileLoginNameControl();
            this.ConfigureBookingStepControl();
            this.ConfigureErrorDisplayControl();
            this.ConfigureRestrictionDateDisplayControl();
            this.ConfigureStaySelectorControl();
            this.ConfigureAvailCalSelectorControl();
            this.ConfigureRoomRateSelectControl();
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
    private void BookRoom()
    {
        bAsyncBookHotel = true;
          if (WBSPGHelper.IsOnlinePayment(PaymentGatewayInfos, HotelBookingPaymentAllocations, GuestDetailsEntryInfo.PaymentCardType))
          {
         bPrepayBooking = true;

         HotelDescriptiveInfo objHotelDescriptiveInfo = new HotelDescriptiveInfo();

         if (HotelDescriptiveInfoRS.HotelDescriptiveInfos.Length != 0)
         {
            objHotelDescriptiveInfo = HotelDescriptiveInfoRS.HotelDescriptiveInfos[0];
         }

         HotelPaymentRQ objHotelPaymentRQ = (HotelPaymentRQ)Session["HotelPaymentRQ"];
         HotelPaymentRS objHotelPaymentRS = (HotelPaymentRS)Session["HotelPaymentRS"];

         string strFailedPrepayBookingID = Guid.NewGuid().ToString();

         FailedPrepayBookingInfo objFailedPrepayBookingInfo = new FailedPrepayBookingInfo
                                                                  {
                                                                     PostingDateTime = DateTime.Now,
                                                                     HotelName = objHotelDescriptiveInfo.HotelName,
                                                                     StayCriteria = StayCriteriaSelection,
                                                                     RoomRates = RoomRateSelections,
                                                                     AddOnPackages = AddOnPackageSelections,
                                                                     GuestDetails = GuestDetailsEntryInfo,
                                                                     PaymentRequestInfo = objHotelPaymentRQ,
                                                                     PaymentResponseInfo = objHotelPaymentRS
                                                                  };

         Session["FailedPrepayBookingID"] = strFailedPrepayBookingID;
         Session["FailedPrepayBookingInfo"] = objFailedPrepayBookingInfo;

         string strFailedPrepayBookingInfo = XHS.WBSUIBizObjects.Serializer.ToString(objFailedPrepayBookingInfo);

         this.WbsMonitor.AddItem(strFailedPrepayBookingID, strFailedPrepayBookingInfo);
          }
          PageAsyncTask task = new PageAsyncTask(BeginAsyncOperation, EndAsyncOperation, TimeoutAsyncOperation, null);
          RegisterAsyncTask(task);
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

          if (Step > BookingSteps.SelectHotel && Step <= BookingSteps.GuestInfo && !string.IsNullOrWhiteSpace(Request.QueryString[Constants.QueryString.StartOver]))
         ScriptManager.RegisterClientScriptBlock(this, GetType(), "DefaultPage"
            , string.Format("startOverPrompt(\"{0}\");", GetGlobalResourceObject("JSResources", "StartOverConfirmation"))
            , true);

          if (Step >= BookingSteps.SelectHotel
          && (Session[Constants.Sessions.PropertyListHotelSearchRS] == null || ((HotelSearchRS)Session[Constants.Sessions.PropertyListHotelSearchRS]).HotelListItems == null))
         bAsyncGetHotelSearchPropertyList = true;

          if (Step >= BookingSteps.SelectStayDate
         && (HotelDescriptiveInfoRS == null
               || HotelDescriptiveInfoRS.HotelDescriptiveInfos == null
               || ((StayCriteriaSelection != null && !String.IsNullOrWhiteSpace(StayCriteriaSelection.HotelCode)) && HotelDescriptiveInfoRS.HotelDescriptiveInfos[0].HotelCode != StayCriteriaSelection.HotelCode)))
         bAsyncGetHotelDescriptiveInfo = true;

          if (Step == BookingSteps.SelectStayDate
          && (Session[Constants.Sessions.HotelAvailabilityCalendarRS] == null
              || ((HotelAvailabilityRS)Session[Constants.Sessions.HotelAvailabilityCalendarRS]).HotelRoomAvailInfos == null
              || ((HotelAvailabilityRS)Session[Constants.Sessions.HotelAvailabilityCalendarRS]).HotelRoomAvailInfos.Length == 0
              || ((StayCriteriaSelection != null && string.IsNullOrWhiteSpace(StayCriteriaSelection.HotelCode)) && ((HotelAvailabilityRS)Session[Constants.Sessions.HotelAvailabilityCalendarRS]).HotelRoomAvailInfos[0].HotelCode != StayCriteriaSelection.HotelCode))
         )
         bAsyncGetHotelAvailCalendarInfo = true;

          ConfiguresControls();

          PageAsyncTask task = new PageAsyncTask(BeginAsyncOperation, EndAsyncOperation, TimeoutAsyncOperation, null);
          RegisterAsyncTask(task);

          return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncGetHotelSearchAreaList = false;
        bAsyncGetHotelSearchPropertyList = false;
        bAsyncGetLoginProfile = false;
        bAsyncGetLinkedProfile = false;

        bProcessProfileLogin = false;

        if (!IsPostBack)
        {
            bAsyncGetHotelSearchAreaList = true;
            bAsyncGetHotelSearchPropertyList = true;
        }

        else
        {
            this.ConfigureLanguageSelectorControl();
            this.ConfigureProfileLoginControl();
            this.ConfigureProfileLoginNameControl();
            this.ConfigureBookingStepControl();
            this.ConfigureErrorDisplayControl();
            this.ConfigureRestrictionDateDisplayControl();
            this.ConfigureStaySelectorControl();
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        this.EventLog.Write(Page.Session.SessionID + ", enter Page_Load, " + DateTime.Now.ToString("MM dd yyyy HH:mm:ss.ffffff"));

        base.Page_Load(sender, e);

        bAsyncGetHotelAvailInfo = false;

        if (!IsPostBack)
        {
            bAsyncGetHotelAvailInfo = true;
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        this.EventLog.Write(Page.Session.SessionID + ", exit Page_Load, " + DateTime.Now.ToString("MM dd yyyy HH:mm:ss.ffffff"));

        return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncBookHotel = false;
        bPrepayBooking = false;

        PaymentGatewayInfo[] objPaymentGatewayInfos = (PaymentGatewayInfo[])Session[Constants.Sessions.PaymentGatewayInfos];
        PaymentGatewayInfo objPaymentGatewayInfo = (PaymentGatewayInfo)Session[Constants.Sessions.PaymentGatewayInfo];
        HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations = (HotelBookingPaymentAllocation[])Session[Constants.Sessions.HotelBookingPaymentAllocations];
        GuestDetailsEntryInfo objGuestDetailsEntryInfo = (GuestDetailsEntryInfo)Session["GuestDetailsEntryInfo"];

        if (WBSPGHelper.IsOnlinePayment(objPaymentGatewayInfos, objHotelBookingPaymentAllocations, objGuestDetailsEntryInfo.PaymentCardType))
        {
            bPrepayBooking = true;

            StayCriteriaSelection objStayCriteriaSelection = (StayCriteriaSelection)Session[Constants.Sessions.StayCriteriaSelection];
            RoomRateSelection[] objRoomRateSelections = (RoomRateSelection[])Session["RoomRateSelections"];
            AddOnPackageSelection[] objAddOnPackageSelections = (AddOnPackageSelection[])Session["AddOnPackageSelections"];

            HotelDescriptiveInfoRS objHotelDescriptiveInfoRS = (HotelDescriptiveInfoRS)Session["HotelDescriptiveInfoRS"];

            HotelDescriptiveInfo objHotelDescriptiveInfo = new HotelDescriptiveInfo();

            if (objHotelDescriptiveInfoRS.HotelDescriptiveInfos.Length != 0)
            {
                objHotelDescriptiveInfo = objHotelDescriptiveInfoRS.HotelDescriptiveInfos[0];
            }

            HotelPaymentRQ objHotelPaymentRQ = (HotelPaymentRQ)Session["HotelPaymentRQ"];
            HotelPaymentRS objHotelPaymentRS = (HotelPaymentRS)Session["HotelPaymentRS"];

            string strFailedPrepayBookingID = Guid.NewGuid().ToString();

            FailedPrepayBookingInfo objFailedPrepayBookingInfo = new FailedPrepayBookingInfo();
            objFailedPrepayBookingInfo.PostingDateTime = DateTime.Now;
            objFailedPrepayBookingInfo.HotelName = objHotelDescriptiveInfo.HotelName;
            objFailedPrepayBookingInfo.StayCriteria = objStayCriteriaSelection;
            objFailedPrepayBookingInfo.RoomRates = objRoomRateSelections;
            objFailedPrepayBookingInfo.AddOnPackages = objAddOnPackageSelections;
            objFailedPrepayBookingInfo.GuestDetails = objGuestDetailsEntryInfo;
            objFailedPrepayBookingInfo.PaymentRequestInfo = objHotelPaymentRQ;
            objFailedPrepayBookingInfo.PaymentResponseInfo = objHotelPaymentRS;

            Session["FailedPrepayBookingID"] = strFailedPrepayBookingID;
            Session["FailedPrepayBookingInfo"] = objFailedPrepayBookingInfo;

            string strFailedPrepayBookingInfo = XHS.WBSUIBizObjects.Serializer.ToString(objFailedPrepayBookingInfo);

            this.WbsMonitor.AddItem(strFailedPrepayBookingID, strFailedPrepayBookingInfo);
        }

        bAsyncBookHotel = true;

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

          WbsUiHelper.InitProfileLoginInfo();
          WbsUiHelper.InitStayCriteriaSelection();
          WbsUiHelper.InitRoomRateSelections();
          WbsUiHelper.InitAddOnPackageSelections();
          WbsUiHelper.InitGuestDetailsEntryInfo();
          WbsUiHelper.InitCancelDetailsEntryInfo();
          //Init Session Step
          Session[Constants.Sessions.CurrentBookingStep] = BookingSteps.SelectHotel;

          if (!string.IsNullOrWhiteSpace(Request.QueryString.Get(Constants.DeeplinkParams.Account)))
          {
         bAsyncGetLoginProfile = true;
         bAsyncGetLinkedProfile = false;
          }

          if (!string.IsNullOrWhiteSpace(Request.QueryString[Constants.DeeplinkParams.Command]) &&
          Request.QueryString.Get(Constants.DeeplinkParams.Command).Equals(Constants.DeeplinkParams.CmdStayCriteria, StringComparison.InvariantCultureIgnoreCase))
          {
         bAsyncGetHotelSearchPropertyList = true;
          }

          PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
          RegisterAsyncTask(task);

          return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

          if (!IsPostBack)
          {
         Session["SelectedRoom"] = "1";
          }

          else
          {
         this.ConfigureRemoteContentContainerControl();
         this.ConfigureConfirmationControl();
         //this.ConfigureLanguageSelectorControl();
         this.ConfigureErrorDisplayControl();
         this.ConfigureStaySelectorControl();
         this.ConfigureAvailCalSelectorControl();
         this.ConfigureRoomQuantitySelectorControl();
         this.ConfigureCancelRoomSelectorControl();
          }

          PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
          RegisterAsyncTask(task);

          InitStayCriteriaSeletion();
          return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncGetSearchHotelAvailCalendarInfo = false;

        if (!IsPostBack)
        {
            HotelDescriptiveInfoRS objHotelDescriptiveInfoRS = (HotelDescriptiveInfoRS)Session["SearchHotelDescriptiveInfoRS"];

            if (objHotelDescriptiveInfoRS.HotelDescriptiveInfos == null) // can occur with step back after deep link
            {
                Response.Redirect("~/Pages/SearchHotel.aspx");
            }

        }

        else
        {
            this.ConfigureLanguageSelectorControl();
            this.ConfigureProfileLoginNameControl();
            this.ConfigureBookingStepControl();
            this.ConfigureErrorDisplayControl();
            this.ConfigureSearchHotelSelectorControl();
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncGetHotelAvailCalendarInfo = false;

        if (!IsPostBack)
        {
            Session["SelectedRoom"] = "1";

            bAsyncGetHotelAvailCalendarInfo = true;
        }

        else
        {
            this.ConfigureLanguageSelectorControl();
            this.ConfigureProfileLoginNameControl();
            this.ConfigureBookingStepControl();
            this.ConfigureErrorDisplayControl();
            this.ConfigureStaySelectorControl();
            this.ConfigureAvailCalSelectorControl();
            this.ConfigureAlternateHotelSelectorControl();
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

        bAsyncGetHotelSearchAreaList = false;
        bAsyncGetHotelSearchPropertyList = false;
        bAsyncGetSearchHotelDescriptiveInfo = false;
        bAsyncGetSearchHotelAvailCalendarInfo = false;

        if (!IsPostBack)
        {
            if (this.IsDeepLinkNav) // Here from DeepLink.aspx, SearchHotel.aspx by-passed
            {
                bAsyncGetHotelSearchAreaList = true;
                bAsyncGetHotelSearchPropertyList = true;
            }

            bAsyncGetSearchHotelDescriptiveInfo = true;
            bAsyncGetSearchHotelAvailCalendarInfo = true;
        }

        PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
        RegisterAsyncTask(task);

        return;
    }
	public void RegisterAsyncTask(PageAsyncTask task) {}
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

          bAsyncGetHotelSearchAreaList = false;
          bAsyncGetHotelSearchPropertyList = false;
          bAsyncGetHotelDescriptiveInfo = false;
          bAsyncGetHotelAvailInfo = false;
          bAsyncGetAlernateHotelDescriptiveInfo = false;

          if (!IsPostBack)
          {
         if (this.IsDeepLinkNav) // if here from DeepLink.aspx, then SearchHotel.aspx or SelectHotel.aspx was by-passed
         {
            WbsUiHelper.InitRoomRateSelections();
            WbsUiHelper.InitAddOnPackageSelections();
            WbsUiHelper.InitGuestDetailsEntryInfo();

            if (this.IsGuestDetailsTestPrefill)
               WbsUiHelper.PrefillGuestDetailsEntryInfoForTesting();

            if (ConfigurationManager.AppSettings["EnableHotelSearch"] == "1")
            {
               bAsyncGetHotelSearchAreaList = true;
               bAsyncGetHotelSearchPropertyList = true;
            }

            else
            {
               bAsyncGetHotelSearchPropertyList = true;
            }

         }

         bAsyncGetHotelDescriptiveInfo = true;
         bAsyncGetHotelAvailInfo = true;

         Session.Add("AlternateHotelDescriptiveInfoRS", new HotelDescriptiveInfoRS()); // init in case not requested
          }

          PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
          RegisterAsyncTask(task);

          return;
    }
    protected void CancelRoomCompleted(object sender, EventArgs e)
    {
        this.ValidateCancelRoomSelections(ucCancelRoomSelectorControl.ConfirmationNumberSelections);

          CancelDetailsEntryInfo.SelectedConfirmationNumbersToCancel = ucCancelRoomSelectorControl.ConfirmationNumberSelections;
          Session["CancelDetailsEntryInfo"] = CancelDetailsEntryInfo;

          if (!this.IsPageError)
          {
         //Response.Redirect("~/Pages/CancelRoom.aspx");
         bAsyncCancelBooking = true;
         PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
         RegisterAsyncTask(task);
          }

          return;
    }
    protected override void Page_Load(object sender, EventArgs e)
    {
        base.Page_Load(sender, e);

          bAsyncGetHotelSearchPropertyList = false;

          bProcessProfileLogin = false;

          if (!IsPostBack)
          {
         Session["SelectedRoom"] = "1";

         bAsyncGetHotelSearchPropertyList = true;
          }

          else
          {
         this.ConfigureErrorDisplayControl();
         this.ConfigureCancelDetailsEntryControl();
         ConfigureRemoteContentContainerControl();
          }

          PageAsyncTask task = new PageAsyncTask(new BeginEventHandler(BeginAsyncOperation), new EndEventHandler(EndAsyncOperation), new EndEventHandler(TimeoutAsyncOperation), null);
          RegisterAsyncTask(task);

          return;
    }