コード例 #1
0
    /// <summary>
    /// 加载绑定
    /// </summary>
    public void BindLoad()
    {
        strWhere += " and O_State='未入住'";
        int DataCount = OrdersBLL.CountNumber(strWhere);                                                                                                              //共多少条记录
        int hPageSize = (DataCount % Convert.ToInt32(HCount.Value)) != 0 ? DataCount / Convert.ToInt32(HCount.Value) + 1 : DataCount / Convert.ToInt32(HCount.Value); //共多少页

        HPageSize.Value        = DataCount.ToString();
        HAllPage.Value         = hPageSize.ToString();
        this.RpNews.DataSource = OrdersBLL.PageSelectOrders(Convert.ToInt32(HCount.Value), Convert.ToInt32(HNowPage.Value), strWhere, "O_Time", "desc");
        this.RpNews.DataBind();
    }
コード例 #2
0
    /// <summary>
    /// 加载绑定
    /// </summary>
    public void BindLoad()
    {
        if (txtNo.Value.Trim().Length != 0)
        {
            strWhere += " and O_No like '%" + txtNo.Value.Trim() + "%'";
        }
        if (txtName.Value.Trim().Length != 0)
        {
            strWhere += " and O_Name like '%" + txtName.Value.Trim() + "%'";
        }
        if (txtTel.Value.Trim().Length != 0)
        {
            strWhere += " and O_Tel like '%" + txtTel.Value.Trim() + "%'";
        }
        if (ddlState.SelectedValue != "全部")
        {
            strWhere += " and O_State='" + ddlState.SelectedValue + "'";
        }
        if (txtBeginTime.Value.Trim().Length != 0 && txtEndTime.Value.Trim().Length != 0)
        {
            strWhere += " and (O_Time>='" + txtBeginTime.Value.Trim() + " 00:00:00' and O_Time<='" + txtEndTime.Value.Trim() + " 23:59:59')";
        }
        if (txtBeginBudget.Value.Trim().Length != 0 && txtEndBudget.Value.Trim().Length != 0)
        {
            strWhere += " and (O_Budget>='" + txtBeginBudget.Value.Trim() + "' and O_Budget<='" + txtEndBudget.Value.Trim() + "')";
        }



        int DataCount = OrdersBLL.CountNumber(strWhere);                                                                                                              //共多少条记录
        int hPageSize = (DataCount % Convert.ToInt32(HCount.Value)) != 0 ? DataCount / Convert.ToInt32(HCount.Value) + 1 : DataCount / Convert.ToInt32(HCount.Value); //共多少页

        HPageSize.Value        = DataCount.ToString();
        HAllPage.Value         = hPageSize.ToString();
        this.RpNews.DataSource = OrdersBLL.PageSelectOrders(Convert.ToInt32(HCount.Value), Convert.ToInt32(HNowPage.Value), strWhere, "O_Time", "desc");
        this.RpNews.DataBind();
    }