protected void Timer_Tick(object sender, EventArgs e) { int TimerTotalValue = Convert.ToInt32(((HiddenField)this.FindControl("TimerTotal")).Value) - 1; ((HiddenField)this.FindControl("TimerTotal")).Value = TimerTotalValue.ToString(); ((Label)this.FindControl("WcfError_Label")).Text = "目前無法連線至 WCF 服務,請確認 CrazyKTV 系統設定裡有啟用 WCF 服務, " + TimerTotalValue.ToString() + " 秒後系統將會再次嘗試連線。"; if (TimerTotalValue == 0) { ((UpdateProgress)this.FindControl("UpdateProgress")).Visible = true; } if (TimerTotalValue == -1) { if (CrazyKTVWCF.checkWCF() == false) { Response.Redirect("/gui_wcferror.aspx"); } else { System.Threading.Thread.Sleep(200); GuiGlobal.SingerTypeDTStatus = GlobalFunctions.GetSingerTypeDT(); System.Threading.Thread.Sleep(200); GuiGlobal.AllSongDTStatus = GlobalFunctions.GetAllSongDT(); if (GuiGlobal.SingerTypeDTStatus && GuiGlobal.AllSongDTStatus) { Response.Redirect("/default.aspx"); } else { Response.Redirect("/gui_wcferror.aspx"); } } } }
protected void Application_Start(object sender, EventArgs e) { System.Threading.Thread.Sleep(500); if (CrazyKTVWCF.checkWCF()) { if (GuiGlobal.SingerTypeDTStatus == false) { GuiGlobal.SingerTypeDTStatus = GlobalFunctions.GetSingerTypeDT(); System.Threading.Thread.Sleep(200); } if (GuiGlobal.AllSongDTStatus == false) { GuiGlobal.AllSongDTStatus = GlobalFunctions.GetAllSongDT(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Form["ddlanguage"] == null) { ddlanguage.SelectedValue = "zh-CHT"; ddActions.SelectedValue = "Waiting List"; currentList1.Visible = true; } // check if the WCF is alive if (CrazyKTVWCF.WCFlive == false) { if (CrazyKTVWCF.checkWCF() == false) { // Response.Redirect("ErrorDeadWCF.aspx"); } } GlobalFunctions.currentlang = ddlanguage.SelectedValue.ToString(); // if WCF is alive then continue with other process System.Threading.Thread.Sleep(150); // to display "loading" icon for 0.15 second }