Exemplo n.º 1
0
    /// <summary>
    /// 查詢通路資料
    /// </summary>
    private void QueryAllChanData()
    {
        try
        {
            #region 取得資料
            ALOModel.MaintainDisRecord BCO = new ALOModel.MaintainDisRecord(ConnectionDB);
            ArrayList ParameterList = new ArrayList();//20091113
            ParameterList.Clear();
            ParameterList.Add(s_DIS_NO);
            ParameterList.Add(s_ITEM);
            ParameterList.Add(s_PERIOD);
            ParameterList.Add(null); // CHAN_NO預設查全部
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(s_SESSION_ID);
            #endregion

            #region DataBind
            DataTable dt_Return = BCO.QueryDisChanTmp(ParameterList);
            if (dt_Return != null)
            {
                dt_Chan = dt_Return;

                DataView dv = dt_Chan.DefaultView;

                if (ViewState["SortingCondition_Chan"] != null)
                {
                    dv.Sort = ViewState["SortingCondition_Chan"].ToString();
                }
                gv_Chan.DataSource = dv;
                //設定分頁大小
                iCurrentGvPageIndex_Chan = 0;
                gv_Chan.PageSize = 10;
                gv_Chan.PageIndex = iCurrentGvPageIndex_Chan;
                gv_Chan.DataBind();

            }
            if (dt_Return == null || (dt_Return != null && dt_Return.Rows.Count <= 0))
            {
                this.RightMsgLabel.Text = "查無資料";
            }
            dt_Return.Dispose();
            #endregion
        }
        catch (Exception ex)
        {
            this.ErrorMsgLabel.Text = ex.Message;
            return;
        }
    }