Exemple #1
0
    protected void btn_Query_Click(object sender, EventArgs e)
    {
        try
        {
            #region 參數

            CAAModel.CAACommon CAAComm = new CAAModel.CAACommon();

            ParameterList.Clear();
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_WASH_NO.Text, "string", this.CheckBoxLikeSearch.Checked)); //V_WASH_NO
            ParameterList.Add(CAAComm.GetValueSetParameter(this.txt_DUE_NO.Text, "string", this.CheckBoxLikeSearch.Checked)); //V_CUBE_NO
            ParameterList.Add(GetValueSetOP(this.slp_WASH_AMT.Operator)); //V_WASH_AMT_OP
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_WASH_AMT.Text, "int", false)); //N_WASH_AMT
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_WASH_DATE.StartDate, "string", false)); //V_WASH_DATE_S
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_WASH_DATE.EndDate, "string", false)); //V_WASH_DATE_E            
            ParameterList.Add(CAAComm.GetValueSetParameter(this.slp_CREATEUID.Text, "string", this.CheckBoxLikeSearch.Checked)); //V_CREATEUID           
            ParameterList.Add(CAAComm.GetValueSetParameter(this.TextBoxRowCountLimit.Text, "int", false)); //N_ROWNUM
            ParameterList.Add(CAAComm.GetValueSetParameter(Session["UID"].ToString(), "string", false)); //V_LOG_UID

            #endregion

            DataTable dt = new DataTable();

            CAAModel.MaintainAccountRecord BCO = new CAAModel.MaintainAccountRecord(ConntionDB);
            dt = BCO.QueryAccountSetByLike(ParameterList);

            //抓取本頁初次登記的時間
            string SessionIDName = "CAA081_" + PageTimeStamp.Value;

            Session["SessionID"] = SessionIDName;
            Session[SessionIDName] = dt;
            gv_WASH.DataSource = dt;
            gv_WASH.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) < 0) ? 10 : int.Parse(TextBoxPagesize.Text);
            gv_WASH.PageIndex = 0;
            gv_WASH.DataBind();

            #region 將Key值存到Session中

            ArrayList arl_Key = new ArrayList();
            ArrayList arl_Key_C = new ArrayList();
            foreach (DataRow drRow in dt.Rows)
            {
                arl_Key.Add(drRow["WASH_NO"].ToString());
                arl_Key_C.Add(drRow["CUBE_NO"].ToString());
            }

            Session["CAA082_SortKey" + this.PageTimeStamp.Value] = arl_Key;
            Session["CAA082_SortKey_C" + this.PageTimeStamp.Value] = arl_Key_C;

            #endregion

            if (dt.Rows.Count == 0)
            { this.ErrorMsgLabel.Text = "查無資料"; }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }