/// <summary> /// page載入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { #region try { ErrorMsgLabel.Text = ""; //結算Timeout設定 Session.Timeout = 5; //分為單位 ((ScriptManager)Page.Controls[0].Controls[3].FindControl("ScriptManager1")).AsyncPostBackTimeout = Session.Timeout * 60; //秒為單位 if (!IsPostBack) { //寫入首次載入Page TimeStamp PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}", DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString().PadLeft(2, '0'), DateTime.Now.Day.ToString().PadLeft(2, '0'), DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0'), DateTime.Now.Second.ToString().PadLeft(2, '0') ); //設定GridView預設的狀態 Initialization_Component(); //設定ToolBar預設狀態 ToolBarInit(); //註冊JS JS_Process(); CAMModel.PauseClosing bco = new CAMModel.PauseClosing(ConntionDB); hidCLOSE_YM.Value = bco.GetCloseYM(); #region 預設系統功能鍵及Focus欄位 this.Form.Attributes["onkeypress"] += "return CAMCommon_WebForm_FireDefaultButton(event,'" + this.btnQuery.ClientID + "');"; CAMModel.CAMCommon CAMComm = new CAMModel.CAMCommon(); string s_ScriptManager_Script = CAMComm.ToMakeUp_SetFocus_Script(slp_BALANCE_DATE_S.TextBoxCode_Object.ClientID, false); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "CAM111", s_ScriptManager_Script, true); #endregion string strClientS = ((TextBox)slpPROMOTE_ID_S.FindControl("TextBoxCode")).ClientID; string strClientE = ((TextBox)slpPROMOTE_ID_E.FindControl("TextBoxCode")).ClientID; string strScript = "document.getElementById('" + strClientE + "').value = document.getElementById('" + strClientS + "').value;"; strScript += "document.getElementById('" + strClientE + "')['onkeyup']();"; ((TextBox)slpPROMOTE_ID_S.FindControl("TextBoxCode")).Attributes.Add("onblur", strScript); } else { if (Request.Form["__EVENTTARGET"] == "Update") { DoUpdate(); } } } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0]; //直接取第一個 } finally { Finally_Function(); } #endregion }
/// <summary> /// page載入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { #region try { ErrorMsgLabel.Text = ""; if (!IsPostBack) { //寫入首次載入Page TimeStamp PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}", DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString().PadLeft(2, '0'), DateTime.Now.Day.ToString().PadLeft(2, '0'), DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0'), DateTime.Now.Second.ToString().PadLeft(2, '0') ); //設定GridView預設的狀態 Initialization_Component(); //設定ToolBar預設狀態 ToolBarInit(); #region 預設系統功能鍵及Focus欄位 this.Form.Attributes["onkeypress"] += "return CAMCommon_WebForm_FireDefaultButton(event,'" + this.btnQuery.ClientID + "');"; CAMModel.CAMCommon CAMComm = new CAMModel.CAMCommon(); string s_ScriptManager_Script = CAMComm.ToMakeUp_SetFocus_Script(slp_ACCT_MONTH.TextBoxCode_Object.ClientID, false); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "CAM221", s_ScriptManager_Script, true); #endregion } } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0]; //直接取第一個 } finally { Finally_Function(); } #endregion }
/// <summary> /// page載入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { ErrorMsgLabel.Text = ""; //結算Timeout設定 Session.Timeout = 30; //分為單位 ((ScriptManager)Page.Controls[0].Controls[3].FindControl("ScriptManager1")).AsyncPostBackTimeout = Session.Timeout * 60; //秒為單位 #region CAM02功能權限設定 SetAuthority(); #endregion if (!IsPostBack) { //寫入首次載入Page TimeStamp PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}", DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString().PadLeft(2, '0'), DateTime.Now.Day.ToString().PadLeft(2, '0'), DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0'), DateTime.Now.Second.ToString().PadLeft(2, '0') ); //設定控制項預設的狀態 Initialization_Component(); //設定ToolBar預設狀態 ToolBarInit(); //註冊JS JS_Process(); #region 預設系統功能鍵及Focus欄位 this.Form.Attributes["onkeypress"] += "return CAMCommon_WebForm_FireDefaultButton(event,'" + this.btnQuery.ClientID + "');"; CAMModel.CAMCommon CAMComm = new CAMModel.CAMCommon(); string s_ScriptManager_Script = CAMComm.ToMakeUp_SetFocus_Script(this.RdlKIND1.Enabled ? this.RdlKIND1.ClientID : this.RdlKIND2.ClientID, false); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "CAM011", s_ScriptManager_Script, true); #endregion RdlKIND2_CheckedChanged(null, null); } else { if (Request.Form["__EVENTTARGET"] == "Update") { DoUpdate(); } } } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0]; //直接取第一個 } finally { Finally_Function(); } }
protected void Page_Load(object sender, EventArgs e) { try { this.ErrorMsgLabel.Text = string.Empty; this.RightMsgLabel.Text = string.Empty; if (!IsPostBack) { //寫入首次載入Page TimeStamp PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}", DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString().PadLeft(2, '0'), DateTime.Now.Day.ToString().PadLeft(2, '0'), DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0'), DateTime.Now.Second.ToString().PadLeft(2, '0') ); UserID.Value = Session["UID"].ToString(); DataTable dt1 = new DataTable(); dt1 = (DataTable)Session["UserInfo"]; UserName.Value = dt1.Rows[0]["Name"].ToString(); //設定ToolBar預設狀態 ToolBarInit(); //註冊JS JS_Process(); #region 預設系統功能鍵及Focus欄位 this.Form.Attributes["onkeypress"] += "return CAMCommon_WebForm_FireDefaultButton(event,'" + this.but_Print1.ClientID + "');"; BCO.CAMCommon CAMComm = new BCO.CAMCommon(); string s_ScriptManager_Script = CAMComm.ToMakeUp_SetFocus_Script(((TextBox)((ASP.wui_slp_slp_slpdate_ascx)this.slp_BUS_DATE.FindControl("SLP_SLPDate1")).FindControl("TextBoxCode")).ClientID, false); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "CAM081", s_ScriptManager_Script, true); #endregion } } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0]; //直接取第一個 } finally { Finally_Function(); } }
protected void Page_Load(object sender, EventArgs e) { try { #region 清空Message this.ErrorMsgLabel.Text = string.Empty; #endregion if (!IsPostBack) { #region 寫入首次載入Page TimeStamp PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}", DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString().PadLeft(2, '0'), DateTime.Now.Day.ToString().PadLeft(2, '0'), DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0'), DateTime.Now.Second.ToString().PadLeft(2, '0') ); #endregion #region 設定ToolBar預設狀態 ToolBarInit(); #endregion //註冊JS JS_Process(); #region 預設系統功能鍵 this.Form.DefaultButton = this.btnExport.UniqueID; #endregion } } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message; } finally { #region Focus欄位 if (!IsPostBack) { BCO.CAMCommon CAMCommon = new BCO.CAMCommon(); string s_ScriptManager_Script = CAMCommon.ToMakeUp_SetFocus_Script(this.btnExport.ClientID, false); ScriptManager.RegisterStartupScript(this.up_ErrorMsg, typeof(UpdatePanel), "CAM361", s_ScriptManager_Script, true); } #endregion } }
/// <summary> /// page載入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { #region try { ErrorMsgLabel.Text = ""; //按鈕權限控制 AuthorityControls(this); if (!IsPostBack) { //寫入首次載入Page TimeStamp PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}", DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString().PadLeft(2, '0'), DateTime.Now.Day.ToString().PadLeft(2, '0'), DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0'), DateTime.Now.Second.ToString().PadLeft(2, '0') ); //設定預設的狀態 Initialization_Component(); //設定ToolBar預設狀態 ToolBarInit(); if (Request.QueryString["Store"] != null) { slp_STORE.Text = Request.QueryString["Store"].ToString(); } #region 預設系統功能鍵及Focus欄位 this.Form.Attributes["onkeypress"] += "return CAMCommon_WebForm_FireDefaultButton(event,'" + this.btnQuery.ClientID + "');"; CAMModel.CAMCommon CAMComm = new CAMModel.CAMCommon(); string s_ScriptManager_Script = CAMComm.ToMakeUp_SetFocus_Script(slp_GROUP_NO.TextBox_Code.ClientID, false); ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "CAM231", s_ScriptManager_Script, true); #endregion string strClientS = ((TextBox)slpPROMOTE_ID_S.FindControl("TextBoxCode")).ClientID; string strClientE = ((TextBox)slpPROMOTE_ID_E.FindControl("TextBoxCode")).ClientID; string strScript = "document.getElementById('" + strClientE + "').value = document.getElementById('" + strClientS + "').value;"; strScript += "document.getElementById('" + strClientE + "')['onkeyup']();"; ((TextBox)slpPROMOTE_ID_S.FindControl("TextBoxCode")).Attributes.Add("onblur", strScript); } } catch (Exception ex) { WaringLogProcess(ex.Message); this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0]; //直接取第一個 } finally { Finally_Function(); } #endregion }