예제 #1
0
 protected void cmdSearch_Click(object sender, EventArgs e)
 {
     //Response.Redirect(URLConstant.BuildSearchURL(ddlCategoryId.SelectedValue.ToString(), ddlCountryId.SelectedValue.ToString(), Server.UrlEncode(txtQuery.Text.ToString()), ddlSortById.SelectedValue.ToString(), Server.UrlEncode(strPageHeading), ddlGSEType.SelectedValue.ToString(), ddlASAMembersOnlyYN.Checked.ToString()));
     Response.Redirect(URLConstant.BuildSearchURL(
                           ddlCountryId.SelectedValue.ToString(),
                           ddlGSEType.SelectedValue.ToString(),
                           "False",
                           "",
                           chkNew.Items[0].Selected.ToString(),
                           chkNew.Items[1].Selected.ToString(),
                           "True",
                           "True",
                           "True",
                           "", "", "",
                           "", "", "",
                           "", "",
                           "", "",
                           "", "",
                           ddlManufacturer.SelectedValue.ToString(),
                           "0",
                           ""));
 }
예제 #2
0
    protected void Search()
    {
        try
        {
            List <Advert> lstAdvert   = new List <Advert>();
            int           rowPerPage  = 1000;
            int           rowStart    = 0;
            int           totalRecord = 0;


            //contruction the URL
            // todo:Jim
            //strQueryString = ResolveUrl(URLConstant.BuildAdsDetailURL(ddlCategoryId.SelectedValue.ToString(), ddlCountryId.SelectedValue.ToString(), Server.UrlEncode(strQuery), ddlSortById.SelectedValue.ToString(), Server.UrlEncode(strPageHeading), page, ddlGSEType.SelectedValue.ToString(), ddlASAMembersOnlyYN.Checked.ToString()));
            strSearchURL = ResolveUrl(URLConstant.BuildEmbeddedSearchURL(
                                          CountryId, GSETypeId,
                                          ASAMembersOnlyYN, SortBy, NewYN, UsedYN, ForRentYN, ForLeaseYN, ForSaleYN,
                                          QtyId1, QtyUnitId1, QtyValue1, QtyId2, QtyUnitId2, QtyValue2,
                                          SpecId1, SpecOptionId1,
                                          SpecId2, SpecOptionId2,
                                          SpecId3, SpecOptionId3,
                                          Manufacturer,
                                          AccountId,
                                          strPageHeading));

            strQueryString = ResolveUrl(URLConstant.BuildEmbeddedAdsDetailURL(
                                            CountryId, GSETypeId,
                                            ASAMembersOnlyYN, SortBy, NewYN, UsedYN, ForRentYN, ForLeaseYN, ForSaleYN,
                                            QtyId1, QtyUnitId1, QtyValue1, QtyId2, QtyUnitId2, QtyValue2,
                                            SpecId1, SpecOptionId1,
                                            SpecId2, SpecOptionId2,
                                            SpecId3, SpecOptionId3,
                                            Manufacturer,
                                            AccountId,
                                            strPageHeading));



            // Convert the selected value from the drop down into the parameteres required for the search
            switch (CountryId.Length)
            {
            case 2:
                RegionId = "";
                break;

            case 3:
                RegionId  = CountryId;
                CountryId = "";
                break;

            default:
                CountryId = "";
                RegionId  = "";
                break;
            }



            // If a GSEType has not been specified, don't do a search
            //if (GSETypeId != "0" && !String.IsNullOrEmpty(GSETypeId))
            if (!String.IsNullOrEmpty(Request.QueryString.ToString()))
            {
                lstAdvert = AdvertAction.GetAdvertByFilterSearch(
                    rowPerPage,
                    rowStart,
                    CountryId,
                    RegionId,
                    SortBy,
                    GSETypeId,
                    ASAMembersOnlyYN,
                    NewYN,
                    UsedYN,
                    ForRentYN,
                    ForLeaseYN,
                    ForSaleYN,
                    QtyId1,
                    QtyUnitId1,
                    QtyValue1,
                    QtyId2,
                    QtyUnitId2,
                    QtyValue2,
                    SpecId1,
                    SpecOptionId1,
                    SpecId2,
                    SpecOptionId2,
                    SpecId3,
                    SpecOptionId3,
                    Manufacturer,
                    AccountId,
                    out totalRecord);

                //Set Empty list message
                grdAdverts.EmptyDataText = "You search did not match any adverts. We would suggest to try with different criteria.";

                //Bind Grid
                plSearchResults.Visible = true;
                grdAdverts.Visible      = true;
                grdAdverts.PageIndex    = page;
                grdAdverts.DataSource   = lstAdvert;
                grdAdverts.DataBind();

                intTotalRec = totalRecord;

                // setting up the paging numbering
                // this.SetPaging(totalRecord, page, rowPerPage, strSearchURL);
            }
        }
        catch (Exception ex)
        {
            ctlNotifier.intResponseCode = 1;
            ctlNotifier.strResponse     = "An error occured while retrieving search results." + ex.ToString();
        }
    }