Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.but_File_To_Temp.Attributes.Add("onclick", "javascript:if (confirm('《警告!此匯入動作會將已存在路線路順資料停用日變更為輸入的【路線啟用日-1】,是否確定匯入?》')){this.disabled=true;"
                                                                                    + "document.getElementById('" + this.but_Unusual_Report.ClientID + "').disabled=true;"
                                                                                    + "document.getElementById('" + this.ButtonQuery.ClientID + "').disabled=true;"
                                                                                    + "__doPostBack('uploadFile','');}else{return false;}");        
        #region
        try
        {
            if (!IsPostBack)
            {
                //SLP_SLPDate1.Text = DateTime.Now.AddDays(1).ToString("yyyy/MM/dd");

                hiddenNextDay.Value = DateTime.Now.AddDays(1).ToString("yyyyMMdd");

                
                //寫入首次載入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')
                                                    );

                GMToolbar1.PageCode = this.ToString().ToUpper().Substring(4, this.ToString().Length - 9);
                GMToolbar1.GMToolbarStatus = WUI_GMToolbarV.GMToolbarStatusEnum.OneFormMaintain;
                GMToolbar1.PageProgramCode = "STM24";// this.PageProgramCode;

                //設定GridView預設的狀態

                Initialization_Component();
                ToolBarInit();
                //設定頁面狀態

                this.hid_FrmStatus.Value = "fmBroswe";
                this.hid_FrmStatus.Visible = true;
                #region 清空 UploadStatusPanel 的值


                //上傳結果
                this.UploadStatusPanel1.UploadSum = 0;
                this.UploadStatusPanel1.UploadOK = 0;
                this.UploadStatusPanel1.UploadNG = 0;
                //匯入結果
                this.UploadStatusPanel1.ImportSum = 0;
                this.UploadStatusPanel1.ImportOK = 0;
                this.UploadStatusPanel1.ImportNG = 0;

                #endregion

                #region 預設系統功能鍵及Focus欄位

                this.Form.Attributes["onkeypress"] += "return STMCommon_WebForm_FireDefaultButton(event,'" + this.ButtonQuery.ClientID + "');";

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(((TextBox)this.SLP_SLPDate1.FindControl("TextBoxCode")).ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM241", s_ScriptManager_Script, true);

                #endregion
            }
            else
            {
                if (Request.Form["__EVENTTARGET"] == "uploadFile")
                {
                    ClientFileToServerTemp();
                }
                
            }

        }
        catch (Exception ex)
        {
            this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
        #endregion
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Page_Load事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            ErrorMsgLabel.Text = "";
            ResultMsgLabel.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')
                                                    );


                //設定GridView預設的狀態


                Initialization_Component();


                #region 設定 Page_Status 狀態
                //該頁面共有4種狀態
                //檢視 VIEW
                //新增 INSERT
                //編輯 EDIT


                //該頁面共有4種狀態
                //查詢 QUERY
                //檢視 VIEW
                //編輯 EDIT
                //新增 INSERT
                //模式指定
                string mode = "VIEW";
                try { mode = Request["mode"].ToString(); }
                catch { }

                this.hid_PageStatus.Value = mode;
                this.txt_PageStatus.Text = mode;
                if (mode != "INSERT")
                {
                    this.hiddenID.Value = Request.QueryString["ID"].ToString();
                    this.hiddenROUTE.Value = Request.QueryString["ROUTE"].ToString();
                    this.hiddenEFF_START.Value = Request.QueryString["EFF_START"].ToString();

                }

                #endregion

                Session["STM23_DTL_" + PageTimeStamp.Value] = null;

                SetPageStatus();//設定各種模式預設值     


                SetDefaultValue();

                #region 預設Focus欄位

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(Route.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM232", s_ScriptManager_Script, true);

                #endregion

            }


        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally
        {
            Finally_Function();
            this.panel_chan_parent.Attributes.Add("style", "display:none");
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            AuthorityControls(this);

            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 STMCommon_WebForm_FireDefaultButton(event,'" + this.ButtonQuery.ClientID + "');";

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(SLP_STORE.TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM041", s_ScriptManager_Script, true);

                #endregion
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// Page_Load事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            ErrorMsgLabel.Text = "";
            ResultMsgLabel.Text = "";
            gvMsgLabel.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')
                                                    );
                //設定最後一次產生時間
                BCO.CreateStoreUniqueFile bco = new CreateStoreUniqueFile(ConntionDB);
                string workDate = bco.GetLastWorkTime();
                Lab_Date.Text = workDate;

                //設定GridView預設的狀態


                Initialization_Component();

                //設定ToolBar預設狀態


                ToolBarInit();


                //該頁面共有4種狀態


                //查詢 QUERY
                //檢視 VIEW
                //新增 INSERT
                //編輯 EDIT
                this.hid_PageStatus.Value = "QUERY";
                this.txt_PageStatus.Text = "QUERY";

                #region 預設系統功能鍵及Focus欄位

                this.Form.Attributes["onkeypress"] += "return STMCommon_WebForm_FireDefaultButton(event,'" + this.Btn_Query.ClientID + "');";

                BCO.STMCommon STMComm = new BCO.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(CheckBox1.ClientID, false);
                ScriptManager.RegisterStartupScript(this.up_ErrorMsg, typeof(UpdatePanel), "STM031", s_ScriptManager_Script, true);

                #endregion

            }


        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {

        ErrorMsgLabel.Text = "";
        try
        {
            if (!IsPostBack)
            {
                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')
                                          );

                // ((WUI_MPContent)this.Master).PageProgramCode = PageProgramCode;
                //              ((WUI_MPContent)this.Master).PageCode = this.ToString().ToUpper().Substring(4, this.ToString().Length - 9);

                //模式指定
                string mode = "readonly";
                try { mode = Request["mode"].ToString(); }
                catch { }
                FormViewMode fvm;
                switch (mode)
                {
                    case "edit": fvm = FormViewMode.Edit; break;
                    case "insert": fvm = FormViewMode.Insert; break;
                    case "readonly":
                    default:
                        fvm = FormViewMode.ReadOnly;
                        break;
                }//switch mode
                ChangeFormMSTMode(fvm);
                //設定ToolBar預設狀態
                ToolBarInit();

                #region 預設Focus欄位

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(((WUI.SLP.SLPUnique)FormView1.FindControl("TextBoxCode")).TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM112", s_ScriptManager_Script, true);

                #endregion
                
            }//first
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }//Page_Load
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region
        try
        {
            ErrorMsgLabel.Text = "";
            TextBox txtPRICE_DIS = (TextBox)this.SLP_SLPNumber_PRICE_DIS.FindControl("TextBoxCode");

            txtPRICE_DIS.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtPRICE_DIS.ClientID + "'));");
            
            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();

                //JavaScript註冊
                JS_Process();

                this.SetClinetFocus(((TextBox)SLP_StoreGroup_B.FindControl("TextBoxCode")).ClientID);
                if (Request.QueryString["Requery"] != null)
                {
                    if (Request.QueryString["Requery"].ToString() == "true")
                    {
                        //SLP_Store1.Text = Session["txtSLP_Store1"] == null ? "" : Session["txtSLP_Store1"].ToString();
                        //SLP_Store2.Text = Session["txtSLP_Store2"] == null ? "" : Session["txtSLP_Store2"].ToString();

                        //databind();
                    }
                }


                #region 預設系統功能鍵及Focus欄位

                this.Form.Attributes["onkeypress"] += "return STMCommon_WebForm_FireDefaultButton(event,'" + this.ButtonQuery.ClientID + "');";

                BCO.STMCommon STMComm = new BCO.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(SLP_StoreGroup_B.TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM181", s_ScriptManager_Script, true);

                #endregion
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
        #endregion
    }//page_load
Ejemplo n.º 7
0
    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')
                                                    );
                //設定GridView預設的狀態

                Initialization_Component();
                //設定ToolBar預設狀態

                if (Request.QueryString["Requery"] != null)
                {
                    if (Request.QueryString["Requery"].ToString() == "true")
                    {
                        databind();
                    }
                }
                TextBox txtPRICE = (TextBox)this.SLP_PRICE_SUBSIDY_PERCENT.FindControl("TextBoxCode") ;
                TextBox txtCOST = (TextBox)this.SLP_COST_SUBSIDY_PERCENT.FindControl("TextBoxCode");
               
                txtPRICE.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtPRICE.ClientID + "'));");
                txtCOST.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtCOST.ClientID + "'));");
                
                //TextBox txt_ACCEPT_DATE_START_START = (TextBox)((ASP.wui_slp_slp_slpdate_ascx)this.SLP_ACCEPT_DATE_START.FindControl("SLP_SLPDate1")).FindControl("TextBoxCode");//訂單日期起
                //TextBox txt_ACCEPT_DATE_START_END = (TextBox)((ASP.wui_slp_slp_slpdate_ascx)this.SLP_ACCEPT_DATE_START.FindControl("SLP_SLPDate2")).FindControl("TextBoxCode");//訂單日期迄

                //#region 設定結束欄位預設值=開始欄位設定值


                //txt_ACCEPT_DATE_START_START.Attributes.Add("onblur", "Set_TheSameValue('" + txt_ACCEPT_DATE_START_START.ClientID + "','" + txt_ACCEPT_DATE_START_END.ClientID + "','Date');");

                //#endregion

                //#region 檢查結束欄位一定要大於或等於開始欄位


                ////txt_BUSDATE_E.Attributes.Add("onblur", "CheckValue('" + txt_BUSDATE_B.ClientID + "','" + txt_BUSDATE_E.ClientID + "');");
                ////this.slp_Z_O_E.Attributes.Add("onblur", "CheckValue('" + this.slp_Z_O_B.ClientID + "','" + this.slp_Z_O_E.ClientID + "');");
                ////txt_MANUFACTURE_E.Attributes.Add("onblur", "CheckValue('" + txt_MANUFACTURE_B.ClientID + "','" + txt_MANUFACTURE_E.ClientID + "');");

                //#endregion

                #region 預設系統功能鍵及Focus欄位

                this.Form.Attributes["onkeypress"] += "return STMCommon_WebForm_FireDefaultButton(event,'" + this.ButtonQuery.ClientID + "');";

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(txtPROMOTE_ID.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM271", s_ScriptManager_Script, true);

                #endregion
            }

            ToolBarInit();
          
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
        #endregion
    }//page_load
Ejemplo n.º 8
0
    /// <summary>
    /// 檢查條件
    /// </summary>
    /// <param name="s_Type"></param>
    /// <returns></returns>
    private ArrayList Check_Condition()
    {
        #region 宣告

        BCO.STMCommon STMComm = new BCO.STMCommon();
        ArrayList arl_Return = new ArrayList();
        arl_Return.Add(string.Empty);//該欄位放Focus欄位之ClientID
        arl_Return.Add(string.Empty);//該欄位放錯誤訊息

        #endregion

        return arl_Return;
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 取得頁面上的資料
    /// </summary>
    /// <param name="s_ITEM">品號</param>
    private void Get_PageDataMainAndDetl(string s_ITEM)
    {
        #region 傳入參數

        BCO.STMCommon STMComm = new BCO.STMCommon();

        ArrayList arl_Key = new ArrayList();
        string s_Request_Key = Request.QueryString["STM352_PageTimeStamp"];
        arl_Key = ((ArrayList)Session["STM352_SearchKey" + s_Request_Key]);

        ParameterList.Clear();
        ParameterList.Add(GetValueSetParameter(s_ITEM, "string", false));//[品號]

        for (int i = 0; i < 7; i++)
        {
            if (arl_Key[i].ToString() == string.Empty)
            {
                ParameterList.Add(DBNull.Value);
            }
            else
            { 
                ParameterList.Add(arl_Key[i]);
            }
        }

        ParameterList.Add(TextBoxRowCountLimit.Text);

        #endregion

        #region 連結資料庫

        BCO.STM35_BCO bco = new BCO.STM35_BCO(ConntionDB);
        DataTable ds_Return = bco.QueryDataItem(ParameterList);

        #endregion

        

        string s_RequestString = Request.QueryString["STM352_Type"];

        if (ds_Return.Rows.Count == 0 || s_ITEM == string.Empty)
        {
            if (s_RequestString != "ToolBar")
            {
                ScriptManager.RegisterStartupScript(this.UpdatePanel3, typeof(UpdatePanel), "STM35", "alert('查無資料');", true);
                Response.Redirect("STM351.aspx?Code=STM35", false);
            }

            ScriptManager.RegisterStartupScript(this.UpdatePanel3, typeof(UpdatePanel), "STM35", "alert('查無此筆資料或已被其他使用者刪除,請點選上一筆/下一筆鈕或回查詢頁重新查詢!');", true);
            TabContainer2.Enabled = false;
        }
        else
        {

            #region 將資料寫入相關欄位 MAIN
            DataRow dr_Return_ITEM = ds_Return.Rows[0];

            this.SLP_ITEM.Text = s_ITEM;
            this.txtITEM_WDS.Text = dr_Return_ITEM["ITEM_MAP"].ToString();
            this.SLP_VENDOR.Text = dr_Return_ITEM["VENDOR"].ToString();
            this.slp_TAX_TYPE.Text = dr_Return_ITEM["TAX_TYPE"].ToString();
            this.slp_ROOT_NO.Text = dr_Return_ITEM["ROOT_NO"].ToString();
            this.SLP_ItemPeriod.Text = dr_Return_ITEM["PERIOD"].ToString();

            this.SLP_PMA.Text = dr_Return_ITEM["PMA"].ToString();//商品群分類
            this.SLP_Category.Text = dr_Return_ITEM["Category"].ToString();//稅別
            this.txt_PRICE.Text = dr_Return_ITEM["PRICE"].ToString();
            this.txt_COST.Text = dr_Return_ITEM["COST"].ToString();
            this.txt_DISCOUNT_RATE.Text = dr_Return_ITEM["DISCOUNT_RATE"].ToString();
            this.slp_CREATEDATE.Text = dr_Return_ITEM["CREATEDATE"].ToString();
            this.slp_CREATEUID.Text = dr_Return_ITEM["CREATEUID"].ToString();
            this.slp_UPDATEDATE.Text = dr_Return_ITEM["UPDATEDATE"].ToString();
            this.slp_UPDATEUID.Text = dr_Return_ITEM["UPDATEUID"].ToString();
            #endregion
            

            #region 設定供應商合約獎勵金資料

            ArrayList arl_Contract = new ArrayList();
            arl_Contract = bco.QueryContract(dr_Return_ITEM["VENDOR"].ToString());

            if (arl_Contract[0].ToString() != string.Empty)
            {
                string CNT_NO = arl_Contract[0].ToString();
                string EDIT_NO = arl_Contract[1].ToString();

                string SessionName = "VDM021_SortKey" + PageTimeStamp.Value;

                arl_Contract.Clear();
                arl_Contract.Add(CNT_NO + "|" + EDIT_NO);

                Session[SessionName] = arl_Contract;

                btnVendor.OnClientClick = "AddIFrameTab('VDM02供應商合約維護處理','../VDM/VDM022.aspx?Code=VDM02&arl_Key=VDM021_SortKey" + PageTimeStamp.Value + "&isToolBar=N&VDM021=EDIT&CNT_NO=" + CNT_NO + "&EDIT_NO=" + EDIT_NO + "');return false;";
                
                //因供應商帳務合約資料錯誤則帳務期別檔會無法抓取資料
                #region 設定期別補貼主檔資料  

                string strSessionName = "ITM031_PK_" + PageTimeStamp.Value;
                Session[strSessionName] = null;

                DataTable dt = new DataTable();
                dt.Columns.Add(new DataColumn("ITEM"));
                dt.Columns.Add(new DataColumn("PERIOD"));
                DataRow dr = dt.NewRow();
                dr["ITEM"] = s_ITEM;
                dr["PERIOD"] = dr_Return_ITEM["PERIOD"].ToString();
                dt.Rows.Add(dr);
                dt.AcceptChanges();
                Session[strSessionName] = dt;

                btnPeriod.OnClientClick = "AddIFrameTab('ITM03期別帳務審核處理','../ITM/ITM032.aspx?Code=ITM03&DataItemIndex=0&SID=" + PageTimeStamp.Value + "');return false;";

                #endregion
            
            }
            else
            {
                btnVendor.OnClientClick = "AddIFrameTab('VDM02供應商合約維護處理','../VDM/VDM021.aspx');return false;";

                btnPeriod.OnClientClick = "AddIFrameTab('ITM03期別帳務審核處理','../ITM/ITM031.aspx');return false;";

            }

            #endregion

            DataBind_S(ParameterList);
            DataBind_SG(ParameterList);
        }

    }
Ejemplo n.º 10
0
    /// <summary>
    /// Page_Load事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            
            ErrorMsgLabel.Text = "";
            ResultMsgLabel.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();

                #region 將SESSION清空

                Session["STM321_" + PageTimeStamp.Value] = null;
                #endregion

                //該頁面共有4種狀態
                //查詢 QUERY
                //檢視 VIEW
                //編輯 MODIFY
                this.hid_PageStatus.Value = "QUERY";
                this.txt_PageStatus.Text = "QUERY";

                SetPageStatus();//設定各種模式預設值


                //R
                #region
                
                COM.SYS.MaintainEnum COM = new COM.SYS.MaintainEnum(ConntionDB);
                
                ParameterList.Clear();
                ParameterList.Add("STM");
                ParameterList.Add("Type");
                
                ddl_STORE_TYPE.DataSource =  COM.QuerySwitch(SYSModel.MaintainEnum.QueryType.MODULE, ParameterList);
                ddl_STORE_TYPE.DataBind();

                this.hid_FrmStatus.Value = "fmBroswe";
                this.hid_FrmStatus.Visible = true;

                #region 清空 UploadStatusPanel 的值


                //上傳結果
                this.UploadStatusPanel1.UploadSum = 0;
                this.UploadStatusPanel1.UploadOK = 0;
                this.UploadStatusPanel1.UploadNG = 0;
                //匯入結果
                this.UploadStatusPanel1.ImportSum = 0;
                this.UploadStatusPanel1.ImportOK = 0;
                this.UploadStatusPanel1.ImportNG = 0;
                #endregion
                #endregion

                #region 預設系統功能鍵及Focus欄位

                this.Form.Attributes["onkeypress"] += "return STMCommon_WebForm_FireDefaultButton(event,'" + this.Btn_Query.ClientID + "');";

                BCO.STMCommon STMComm = new BCO.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(STORE_YY.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM321", s_ScriptManager_Script, true);


                #endregion
            }
            else
            {
                if (Request.Form["__EVENTTARGET"] == "uploadFile")
                {
                    ClientFileToServerTemp();
                    
                }

            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { 
            
            Finally_Function();

        }
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Response.Expires = 0;

            ErrorMsgLabel.Text = "";
            SetAuthority();

            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();

                #region 預設Focus欄位

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(SLP_STORE.TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM252", s_ScriptManager_Script, true);

                #endregion
            }
            else
            {
                if (Request.Form["__EVENTARGUMENT"] == "txt_STORE_Onblur")
                { txt_STORE_Onblur(); }

                if (Request.Form["__EVENTARGUMENT"] == "txt_PAY_RFNO_Onblur")
                { txt_PAY_RFNO_Onblur(); }

                if (Request.Form["__EVENTARGUMENT"] == "txt_RFNO_Onblur")
                { txt_RFNO_Onblur(); }
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }//Page_Load
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            ErrorMsgLabel.Text = "";
            //驗證SESSION過期和登入狀態

            //this.CheckLogin(ref vdb);
            AuthorityControls(this);
            SetAuthCRUD();
            SetAuthority();//判斷功能權限
            if (!IsPostBack)
            {
                //TextBox txtD_O = (TextBox)this.SLP_D_O.FindControl("TextBoxCode");
                //DropDownList ddlSTORE_TYPE = (DropDownList)this.SLP_STORE_TYPE.FindControl("D1");
                //txtD_O.Attributes["onblur"] = "document.getElementById('" + ddlSTORE_TYPE.ClientID + "').focus();";  

                //寫入首次載入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')
                                                    );

                SLP_SHELF_NO_Add.ReadOnly = true;
                SLP_SHELVE_CM3_Add.ReadOnly = true;
                SLP_DISPLAY_NUM_Add.ReadOnly = true;

                ToolBarInit();
                this.btnDelete.Attributes.Add("onclick", "return Check_Store_Save();");

                #region 新增DataSet
                //新增DataSet
                DataSet ds = new DataSet();
                DataTable dt = new DataTable();
                DataColumn[] keys = new DataColumn[2];

                ds.Tables.Add(dt);
                dt.Columns.Add("CODE", Type.GetType("System.String"));//VARCHAR2(50)代號(STORE+SHELF_NO)
                dt.Columns.Add("NAME", Type.GetType("System.String"));//VARCHAR2(50)名稱(店名)
                dt.Columns.Add("STORE", Type.GetType("System.String"));//VARCHAR2(10)門市@
                dt.Columns.Add("SHELF_NO", Type.GetType("System.String"));//VARCHAR2(2)貨架代號@
                dt.Columns.Add("SHELVE_CM3", Type.GetType("System.Int16"));//NUMBER(3)貨架尺寸@個貨架長cm*寬cm*高cm合計
                dt.Columns.Add("DISPLAY_NUM", Type.GetType("System.Int16"));//NUMBER(3)可陳列數
                dt.Columns.Add("CREATEDATE");
                dt.Columns.Add("CREATEUID");
                dt.Columns.Add("UPDATEDATE");
                dt.Columns.Add("UPDATEUID");

                dt.Columns["STORE"].AllowDBNull = false;
                dt.Columns["SHELF_NO"].AllowDBNull = false;

                keys[0] = dt.Columns["STORE"];
                keys[1] = dt.Columns["SHELF_NO"];
                dt.PrimaryKey = keys;

                string SessionIDName = "STM012_" + PageTimeStamp.Value;
                Session[SessionIDName] = ds;

                #endregion

                //模式指定
                string mode = "";
                mode = Request.QueryString["mode"].ToString();
                if (mode == "view")
                {
                    QueryData(Request.QueryString["store"].ToString(), Request.QueryString["date"].ToString());

                    LogHelper LOG = new LogHelper(ConnectionDB);
                    ParameterList.Clear();
                    ParameterList.Add("STM01門市主檔");//0
                    ParameterList.Add(Session["UID"].ToString());//1
                    ParameterList.Add("Q");//2
                    ParameterList.Add(Request.QueryString["store"].ToString());//3
                    ParameterList.Add(Request.ServerVariables["Server_Name"]);//4

                    LOG.AddSafeLog(ParameterList);

                    ReadOnlyMode(false);
                    btnConfirm.Enabled = false; //確認
                    btnCancle.Enabled = false; //取消 
                    lblEFF_DATE_TO.Visible = true;
                    txtEFF_DATE_TO.Visible = true;
                }
                if (mode == "insert")
                {
                    if (Request.QueryString["store"] != null && Request.QueryString["date"] != null) //複製新增
                    {
                        QueryData(Request.QueryString["store"].ToString(), Request.QueryString["date"].ToString());
                        this.txtSTORE.Text = string.Empty;
                        SetClinetFocus(txtSTORE.ClientID);
                    }
                    ReadOnlyMode(true);
                    btnCancel.Visible = false;//取消
                    btnAcctCancle.Visible = true; //取消(回查詢頁
                    lblEFF_DATE_TO.Visible = false;
                    txtEFF_DATE_TO.Visible = false;
                    txtVIRTUAL_FLAG.Text = "0";
                }
                if (lblARMK.Text == "已審核")
                {
                    btnEdt.Enabled = false; //編輯
                    btnDelete.Enabled = false;  //刪除               
                }
            }

            #region 重取DO NAME
            if (SLP_D_O.Text.Length > 0)
            {
                string strDoName = GetDoName();
                TextBox txtDoName = ((TextBox)SLP_D_O.FindControl("TextBoxName"));
                string strJS = @"function CAACommon_set_Focus() 
                              {
                                try 
                                {
                                    document.getElementById('" + txtDoName.ClientID + "').value='" + strDoName + "';";

                strJS += @"
                                }
                                catch(err){setTimeout('CAACommon_set_Focus()', 100);}
                              }

                            CAACommon_set_Focus( );";

                ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, typeof(UpdatePanel), "", strJS, true);
            }
            #endregion

            #region 預設Focus欄位

            STMModel.STMCommon STMComm = new STMModel.STMCommon();
            string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(txtSTORE.ClientID, false);
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM012", s_ScriptManager_Script, true);

            #endregion
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }//Page_Load
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            ErrorMsgLabel.Text = "";

            SetAuthCRUD();

            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();

                //Timeout設定
                Session.Timeout = 45; //分為單位
                ((ScriptManager)Page.Controls[0].Controls[3].FindControl("ScriptManager1")).AsyncPostBackTimeout = Session.Timeout * 60; //秒為單位

                #region 預設Focus欄位

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(txtPROMOTE_ID.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM272", s_ScriptManager_Script, true);

                #endregion
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }//Page_Load
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        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')
                                                    );
                //設定ToolBar預設狀態
                ToolBarInit();


                //該頁面共有2種狀態

                //查詢 QUERY
                //列印 PRINT

                this.hid_PageStatus.Value = "QUERY";
                this.txt_PageStatus.Text = "QUERY";

                #region 設定結束欄位預設值=開始欄位設定值

                TextBox txt_ROUTE_B = (TextBox)this.SLP_Route1.FindControl("TextBoxCode");
                TextBox txt_ROUTE_E = (TextBox)this.SLP_Route2.FindControl("TextBoxCode");
                txt_ROUTE_B.Attributes.Add("onblur", "Set_SLPSameValue('" + txt_ROUTE_B.ClientID + "','" + txt_ROUTE_E.ClientID + "','String');");

                #endregion

                #region 預設系統功能鍵及Focus欄位

                this.Form.Attributes["onkeypress"] += "return STMCommon_WebForm_FireDefaultButton(event,'" + this.Btn_Print.ClientID + "');";

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(SLP_CHAN_NO.TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.up_ErrorMsg, typeof(UpdatePanel), "STM291", s_ScriptManager_Script, true);

                #endregion
            }

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AuthorityControls(this);
        SetAuthCRUD();
        TextBox txtSKU = (TextBox)this.SLP_SKU_C.FindControl("TextBoxCode");
        TextBox txtPeriod = (TextBox)this.SLP_ItemPeriod_C.FindControl("TextBoxCode");
        TextBox txtStore = (TextBox)this.SLP_Store1.FindControl("TextBoxCode");
        this.btnCancel.Attributes.Add("onclick", "javascript:if (confirm('確定取消所有動作')){this.disabled=true;location.href='STM191.aspx';}else{return false;}");
        this.LinkButton1.Attributes.Add("onclick", "AddIFrameTab('門市主檔','../STM/STM011.aspx?Code=STM01')");
        txtStore.Attributes["onblur"] = "StoreOnblur(document.getElementById('" + txtStore.ClientID + "'));";
        txtSKU.Attributes["onblur"] = "ItemPeriodOnblur(document.getElementById('" + txtSKU.ClientID + "') ,document.getElementById('" + txtPeriod.ClientID + "'));";
        txtPeriod.Attributes["onblur"] = "SetTheSameValue1('SLP_ItemPeriod_C_TextBoxCode','txtItemPeriod_END_C');ItemPeriodOnblur(document.getElementById('" + txtSKU.ClientID + "') ,document.getElementById('" + txtPeriod.ClientID + "'));";

        TextBox txtPRICE_DIS_A = (TextBox)this.SLP_SLPNumber_PRICE_DIS_A.FindControl("TextBoxCode");
        TextBox txtPRICE_DIS_B = (TextBox)this.SLP_SLPNumber1.FindControl("TextBoxCode");
        TextBox txtPRICE_DIS_C = (TextBox)this.SLP_SLPNumber_C.FindControl("TextBoxCode");
        TextBox txtPRICE_DIS_D = (TextBox)this.SLP_SLPNumber2.FindControl("TextBoxCode");
        TextBox txtPRICE_DIS_E = (TextBox)this.SLP_SLPNumber3.FindControl("TextBoxCode");

        txtPRICE_DIS_A.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtPRICE_DIS_A.ClientID + "'));");
        txtPRICE_DIS_B.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtPRICE_DIS_B.ClientID + "'));");
        txtPRICE_DIS_C.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtPRICE_DIS_C.ClientID + "'));");
        txtPRICE_DIS_D.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtPRICE_DIS_D.ClientID + "'));");
        txtPRICE_DIS_E.Attributes.Add("onkeydown", "return Check_PercentValue(document.getElementById('" + txtPRICE_DIS_E.ClientID + "'));");

        //限制只能 key 入數字+小數點
        string strJS = "function OnlyNegNumber(obj,len)";
        strJS += " {";
        strJS += "    var tmpCount = 0;";
        strJS += "    var v_cnt=0;  ";
        strJS += "    var v_cnt1=0;  ";

        strJS += "    for (var tmpI = 0; tmpI < obj.value.length; tmpI++) ";
        strJS += "    {";
        strJS += "       tmpCount = obj.value.charCodeAt(tmpI);";
        strJS += "        if(tmpCount == 46)";
        strJS += "        {";
        strJS += "          if(tmpI>len)";
        strJS += "          {";
        strJS += "             obj.value = obj.value.substr(0, tmpI);";
        strJS += "          }";
        strJS += "          break;";
        strJS += "        }";
        strJS += "        else if(tmpI == obj.value.length-1)";
        strJS += "        {";
        strJS += "          if(tmpI>len-1)";
        strJS += "          {";
        strJS += "             obj.value = obj.value.substr(0, tmpI);";
        strJS += "          }";
        strJS += "          break;";
        strJS += "        }";
        strJS += "    }";

        strJS += "    for (var tmpI = 0; tmpI < obj.value.length; tmpI++) ";
        strJS += "    {";
        strJS += "        tmpCount = obj.value.charCodeAt(tmpI);";
        strJS += "        if (tmpI == 0)";
        strJS += "        {";
        strJS += "             if((tmpCount < 48) || (tmpCount > 57))";
        strJS += "            {";
        strJS += "               obj.value = obj.value.substr(0, tmpI);";
        strJS += "            }";
        strJS += "        }";
        strJS += "        else";
        strJS += "        {";
        strJS += "           if(((tmpCount < 48) || (tmpCount > 57)) && tmpCount != 46)";
        strJS += "          {";
        strJS += "           obj.value = obj.value.substr(0, tmpI);";
        strJS += "          }";
        strJS += "        }";
        strJS += "        if (tmpCount == 46)";
        strJS += "        {";
        strJS += "           v_cnt++;";
        strJS += "           v_cnt1++;";
        strJS += "        }";
        strJS += "        else";
        strJS += "        {";
        strJS += "           if (v_cnt1 > 0)";
        strJS += "           {";
        strJS += "              v_cnt1++;";
        strJS += "           }";
        strJS += "        }";
        strJS += "        if (v_cnt > 1)";
        strJS += "        {";
        strJS += "            obj.value = obj.value.substr(0, tmpI);";
        strJS += "        }";
        strJS += "        if (v_cnt1 > 3)";
        strJS += "        {";
        strJS += "            obj.value = obj.value.substr(0, tmpI);";
        strJS += "        }";
        strJS += "    }";
        strJS += " }";

        SLP_SLPNumber_C2.Attributes.Add("onkeyup", strJS + " OnlyNegNumber(this,6)");

        #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();

                //預設三個頁籤裡的新增明細panel須隱藏
                this.panA.Visible = false;
                this.panB.Visible = false;
                this.panC.Visible = false;
                this.btnConfirm.Enabled = false;
                //if (Request.QueryString["Requery"] != null)
                //{
                //    if (Request.QueryString["Requery"].ToString() == "true")
                //    {
                //        //SLP_Store1.Text = Session["txtSLP_Store1"] == null ? "" : Session["txtSLP_Store1"].ToString();
                //        //SLP_Store2.Text = Session["txtSLP_Store2"] == null ? "" : Session["txtSLP_Store2"].ToString();

                //        //databind();
                //    }
                //}

                #region 預設Focus欄位

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(SLP_Store1.TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM192", s_ScriptManager_Script, true);

                #endregion
            }

            ToolBarInit();
            SLP_StoreGroup1.Text = SLP_StoreGroup1.Text;

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
        #endregion
    }//page_load
Ejemplo n.º 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            ErrorMsgLabel.Text = "";

            //結算Timeout設定
            Session.Timeout = 15; //分為單位
            ((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')
                                                    );

                ToolBarInit();

                #region 預設系統功能鍵及Focus欄位

                this.Form.Attributes["onkeypress"] += "return STMCommon_WebForm_FireDefaultButton(event,'" + this.btnQuery.ClientID + "');";

                STMModel.STMCommon STMComm = new STMModel.STMCommon();
                string s_ScriptManager_Script = STMComm.ToMakeUp_SetFocus_Script(SLP_STORE.TextBox_Code.ClientID, false);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "STM251", s_ScriptManager_Script, true);

                #endregion
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }//Page_Load