Exemple #1
0
    /// <summary>
    /// BUTTON [模板設定查詢]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnQUERY_Click(object sender, EventArgs e)
    {
        #region 檢查條件

        BCO.ITMCommon ITMComm = new BCO.ITMCommon();

        ArrayList arl_Check_Condition = Check_Condition("BUTTON [模板設定查詢]鈕");

        #region 如果檢查有誤,則Return

        if (arl_Check_Condition[1].ToString() != string.Empty)
        {
            #region 錯誤訊息

            this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString();

            #endregion

            #region Focus欄位

            if (arl_Check_Condition[0].ToString() != string.Empty)
            {
                string s_ScriptManager_Script = ITMComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true);
                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "ITM111", s_ScriptManager_Script, true);
            }

            #endregion

            return;
        }

        #endregion

        #endregion

        ParameterList.Clear();
        ParameterList.Add(slpCHAN_NO.Text);
        ParameterList.Add(slpT_DATE.Text);
        ParameterList.Add(Session["UID"].ToString());
        DataTable dt_Return = new DataTable();

        BCO.MaintainReturnTemplate bco = new BCO.MaintainReturnTemplate(ConntionDB);
        dt_Return = bco.QueryRegularReturnItem(ParameterList);

        string SessionIDName = "ITM111_StoreCount" + PageTimeStamp.Value;
        txtSTORE_COUNT.Text = Session[SessionIDName].ToString();

        if (dt_Return.Rows.Count == 0)
        {
            txtSTORE_COUNT.Text = Page.Request.Form[txtSTORE_COUNT.UniqueID];
            ErrorMsgLabel.Text = "模板日期 : " + slpT_DATE.Text + " 查無資料";
            return;
        }
        string strLockUID = string.Empty;
        string strLockTime = string.Empty;
        int iChkResult = QueryControlChk(out strLockUID, out strLockTime);
        if (iChkResult == 1)
        {
            string script = "if(confirm('使用者:" + strLockUID + " 從 " + strLockTime.Substring(0, 16) + " 正在使用中,如果確定執行將中斷正在執行的作業?')==true){document.getElementById('" + btnEnter.ClientID + "').click();}";
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EXEC", script, true);
        }
        else
        {
            EnterResult();
        }
    }
Exemple #2
0
    private void LoadPageGrid()
    {
        #region 傳入參數

        ParameterList.Clear();
        ParameterList.Add(GetValueSetParameter(this.txtCHAN_NO.Text.Trim(), "string", false));
        ParameterList.Add(GetValueSetParameter(this.txtT_DATE.Text.Trim(), "string", false));
        ParameterList.Add(Session["UID"].ToString());

        #endregion

        #region 取得資料

        DataTable dt_Return = new DataTable();

        BCO.MaintainReturnTemplate bco = new BCO.MaintainReturnTemplate(ConntionDB);
        dt_Return = bco.QueryRegularReturnItem(ParameterList);
        if (dt_Return.Rows.Count == 0) //預防設定完後,以滑鼠右鍵選擇重整後又可操作設定鈕,以使與原操作後的畫面狀態一致
        {
            btnSet.Enabled = false;
            btnSelectALL.Enabled = false;
            btnCancelALL.Enabled = false;
            GMToolbar1.ButtonEnableControl(WUI_GMToolbarV.ButtonType.Save, false, "", this.btnSet, WUI_GMToolbarV.ClickAction.ButtonClick);
        }

        #endregion

        #region CHECKBOX LIST
        ha.Clear();
        for (int i = 0; i < dt_Return.Rows.Count; i++)
        {
            ha.Add(i, false);
        }
        Session["ha"] = ha;

        #endregion

        #region 資料與GridView繫結

        //抓取本頁初次登記的時間

        string SessionIDName = "ITM112_gv_ItemInfo" + PageTimeStamp.Value;
        Session[SessionIDName] = dt_Return;

        this.gv_ITM11.DataSource = dt_Return;
        this.gv_ITM11.PageSize = 10;
        this.gv_ITM11.PageIndex = 0;
        this.gv_ITM11.DataBind();
        this.gv_ITM11.Visible = true;
        #endregion
    }