选择下拉菜单选项完成搜索

.aspx

  <asp:DropDownList runat="server" name="pointRange" class="selectRange" title="积分范围"
                            ID="SelectPointRange" OnSelectedIndexChanged="SelectPointRange_SelectedIndexChanged"
                            OnTextChanged="SelectPointRange_TextChanged" AutoPostBack="true">
                            <asp:ListItem Value="range0">请选择积分范围</asp:ListItem>
                            <asp:ListItem Value="range1">0~300</asp:ListItem>
                            <asp:ListItem Value="range2">300~500</asp:ListItem>
                            <asp:ListItem Value="range3">500~1000</asp:ListItem>
                            <asp:ListItem Value="range4">1000~2000</asp:ListItem>
                            <asp:ListItem Value="range5">2000以上</asp:ListItem>
                        </asp:DropDownList>

 

 

 <asp:Repeater runat="server" ID="rptStoreProduct">
                            <ItemTemplate>
                                <div class="box box-onsale">
                                    <div class="top">
                                        <p>
                                            <a href="/Store/StoreProductView.aspx?Id=<%# Eval("Id")%>" target="_blank">
                                                <%# Eval("Name")%></a></p>
                                    </div>
                                    <div class="pdt">
                                        <div class="tupian">
                                            <span class="onsale"><a href="/Store/StoreProductView.aspx?Id=<%# Eval("Id")%>" target="_blank">
                                                <img src="<%# _objStoreProductSerivce.GetPicturePath(Eval("MidIsMainPictureSrcFullPath").ToString()) %>" /></a></span></div>
                                        <p class="bids">
                                            商城价:<%# RM901.Web.Common.PriceFormat(Eval("SellPrice").ToString())%></p>
                                        <p class="winner">
                                            <%-- 市场价:<%# RM901.Web.Common.PriceFormat(Eval("MarketPrice").ToString())%></p>--%>
                                            所需积分:<%# RM901.Web.Common.PriceFormat(Eval("AllPoint").ToString())%></p>
                                    </div>
                                    <div class="bot">
                                        <span>
                                            <input type="submit" value="我要兑换" onclick="javascript:window.open('/Store/StoreProductView.aspx?Id=<%# Eval("Id")%>');"
                                                class="bid bid-onsale" /></span>
                                    </div>
                                </div>
                            </ItemTemplate>
                        </asp:Repeater>

 

.aspx.cs

 private void BindStoreProductAllRegion()
        {
            int intSelectIndex = int.Parse(this.SelectPointRange.SelectedIndex.ToString());
            if (intSelectIndex == 0)
            {
                rptStoreProduct.DataSource = _objStoreProductInfoList;
                rptStoreProduct.DataBind();
            }
            else if (intSelectIndex == 1)
            {
            _intPointMin = 0;
            _intPointMax = 300;
            StoreWebServiceWrapper.Init();
            StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
            StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode,_intPointMin,_intPointMax,StoreProductInfoStatus.Published,"",30,1);
            rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
            rptStoreProduct.DataBind();
            }
            else if (intSelectIndex == 2)
            {
                  
                    _intPointMin = 300;
                    _intPointMax = 500;
                    StoreWebServiceWrapper.Init();
                    StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                    StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                    rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                    rptStoreProduct.DataBind();
                }
            else if (intSelectIndex == 3)
            {
                    _intPointMin = 500;
                    _intPointMax = 1000;
                    StoreWebServiceWrapper.Init();
                    StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                    StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                    rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                    rptStoreProduct.DataBind();
                }
            else  if (intSelectIndex == 4)
            {
                          
                           
                    _intPointMin = 1000;
                    _intPointMax = 2000;
                    StoreWebServiceWrapper.Init();
                    StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                    StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                    rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                    rptStoreProduct.DataBind();
                }
            else
            {
                _intPointMin = 2000;
                _intPointMax = 10000000;
                StoreWebServiceWrapper.Init();
                StoreWebServiceWrapper.SetURL(_strStoreWebServicePath);
                StoreProductInfoListStruct objStoreProductInfoListStruct = StoreWebServiceWrapper.Current.StoreProductSearchSplitPageListByPointScopeStatus(_strWebServiceSafeCode, _intPointMin, _intPointMax, StoreProductInfoStatus.Published, "", 30, 1);
                rptStoreProduct.DataSource = objStoreProductInfoListStruct.StoreProductInfoList;
                rptStoreProduct.DataBind();
 
            }
 
       }

 

  protected void SelectPointRange_SelectedIndexChanged(object sender, EventArgs e)
            {
                BindStoreProductAllRegion();
            }

 

 

 

 

posted @ 2012-09-20 17:47  yuloe2012  阅读(571)  评论(0编辑  收藏  举报