コード例 #1
0
    private void BindDatalist(int currentpage)
    {
        pds.AllowPaging      = true;
        pds.PageSize         = 5;
        pds.CurrentPageIndex = currentpage;

        if (keywords == "")
        {
            searchshopinfo_view1TableAdapter userDA = new searchshopinfo_view1TableAdapter();
            DataTable userdt = userDA.GetData();
            if (userdt.Rows.Count > 0)
            {
                pds.DataSource    = userdt.DefaultView;
                dlShop.DataSource = pds;
                dlShop.DataBind();
            }
        }
        else
        {
            shop_selectinfo_view1TableAdapter shopinfoda = new shop_selectinfo_view1TableAdapter();
            DataTable shopinfodt = shopinfoda.Getshopinfobylike('%' + keywords + '%');
            if (shopinfodt.Rows.Count > 0)
            {
                pds.DataSource    = shopinfodt.DefaultView;
                dlShop.DataSource = pds;
                dlShop.DataBind();
            }
        }
    }
コード例 #2
0
ファイル: ShopSearch.aspx.cs プロジェクト: zjplus/phoneSys
    private void BindDatalist(int currentpage)
    {
        pds.AllowPaging = true;
        pds.PageSize = 5;
        pds.CurrentPageIndex = currentpage;

        if (keywords == "")
        {
            searchshopinfo_view1TableAdapter userDA = new searchshopinfo_view1TableAdapter();
            DataTable userdt = userDA.GetData();
            if (userdt.Rows.Count > 0)
            {
                pds.DataSource = userdt.DefaultView;
                dlShop.DataSource = pds;
                dlShop.DataBind();
            }
        }
        else
        {
            shop_selectinfo_view1TableAdapter shopinfoda = new shop_selectinfo_view1TableAdapter();
            DataTable shopinfodt = shopinfoda.Getshopinfobylike('%' + keywords + '%');
            if (shopinfodt.Rows.Count > 0)
            {
                pds.DataSource = shopinfodt.DefaultView;
                dlShop.DataSource = pds;
                dlShop.DataBind();
            }
        }
    }