示例#1
0
 void SearchResidentialProperties()
 {
     try
     {
         Session["QueryString"] = "Residential";
         Property1.MLSDataWebServiceSoapClient mlsClient = new Property1.MLSDataWebServiceSoapClient();
         DataTable dt = new DataTable();
         if (Convert.ToString(Session["QueryString"]) == "Residential" || Convert.ToString(Session["QueryString"]) == "IDXImagesResidential")
         {
             dt = mlsClient.GetResidentialPropertiesTop3("0", "0", "0", "0", "0", "0", "0");
         }
         else
         {
             dt = mlsClient.GetResidentialPropertiesTop3(Session["SearchText"].ToString(), Session["HomeType"].ToString(), Session["MinPrice"].ToString(), Session["MaxPrice"].ToString(), Session["Beds"].ToString(), Session["Baths"].ToString(), Session["SaleLease"].ToString());
         }
         if (dt.Rows.Count > 0)
         {
             imgresi1.ImageUrl = dt.Rows[0]["pImage"].ToString();
             string s = dt.Rows[0]["RemarksForClients"].ToString();
             if (s.Length > 100)
             {
             }
             hlresi1.NavigateUrl = "../Search.aspx?Municipality=Toronto &PropertyType=Residential";
             //hlresi1.NavigateUrl = "../Search.aspx?Municipality=" + "Toronto&PropertyType=" + dt.Rows[0]["pType"].ToString();
             string s1 = dt.Rows[1]["RemarksForClients"].ToString();
             if (s1.Length > 100)
             {
             }
             imgresi2.ImageUrl   = dt.Rows[1]["pImage"].ToString();
             hlresi2.NavigateUrl = "../Search.aspx?Municipality=" + "Mississauga &PropertyType=Residential";
             string s2 = dt.Rows[2]["RemarksForClients"].ToString();
             if (s2.Length > 100)
             {
             }
             imgresi3.ImageUrl   = dt.Rows[2]["pImage"].ToString();
             hlresi3.NavigateUrl = "../Search.aspx?Municipality=" + "Brampton &PropertyType=Residential";
             string s3 = dt.Rows[3]["RemarksForClients"].ToString();
             if (s3.Length > 100)
             {
             }
             imgresi4.ImageUrl   = dt.Rows[3]["pImage"].ToString();
             hlresi3.NavigateUrl = "../Search.aspx?Municipality=" + "Markham &PropertyType=Residential";
             string s4 = dt.Rows[4]["RemarksForClients"].ToString();
             if (s4.Length > 100)
             {
             }
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
     }
     finally
     {
     }
 }
示例#2
0
        void SearchResidentialProperties()
        {
            //Session["QueryString112"] = "Residential";
            try
            {
                Property1.MLSDataWebServiceSoapClient mlsClient = new Property1.MLSDataWebServiceSoapClient();
                DataTable dt = new DataTable();
                //if (Convert.ToString(Session["QueryString112"]) == "Residential" || Convert.ToString(Session["QueryString"]) == "IDXImagesResidential")
                dt = mlsClient.GetResidentialPropertiesTop3("0", "0", "0", "0", "0", "0", "0");
                //else
                //dt = mlsClient.GetResidentialPropertiesTop3 (Session["SearchText"].ToString(), Session["HomeType"].ToString(), Session["MinPrice"].ToString(), Session["MaxPrice"].ToString(), Session["Beds"].ToString(), Session["Baths"].ToString(), Session["SaleLease"].ToString());
                if (dt.Rows.Count > 0)
                {
                    //imgresi.ImageUrl = dt.Rows[2]["pImage"].ToString();
                    imgresi1.ImageUrl = dt.Rows[0]["pImage"].ToString();

                    string s = dt.Rows[0]["RemarksForClients"].ToString();
                    if (s.Length > 100)
                    {
                        //txtDescription = txtDescription.Substring(0, txtDescription.IndexOf(",", 100)).Trim();

                        resiRemarksForClients1.Text = GetText(s);
                    }
                    lbladdressresi1.Text = dt.Rows[0]["Address"].ToString() + ", " + dt.Rows[0]["Municipality"].ToString() + ", " + dt.Rows[0]["PostalCode"].ToString();

                    lblresimls1.Text        = dt.Rows[0]["mls"].ToString();
                    lblresistatus1.Text     = dt.Rows[0]["SaleLease"].ToString();
                    lblresitype1.Text       = dt.Rows[0]["TypeOwn1Out"].ToString();
                    lblresiprice1.Text      = dt.Rows[0]["ListPrice"].ToString();
                    btnResview1.NavigateUrl = "../Search.aspx?Municipality=Toronto";
                    // btnResview1.NavigateUrl = "../PropertyDetails.aspx?MLSID=" + dt.Rows[0]["MLS"].ToString() + "&PropertyType=" + dt.Rows[0]["pType"].ToString();
                    hlresi1.NavigateUrl = btnResview1.NavigateUrl;
                    string s1 = dt.Rows[1]["RemarksForClients"].ToString();
                    if (s1.Length > 100)
                    {
                        resiRemarksForClients2.Text = GetText(s1);
                    }
                    imgresi2.ImageUrl       = dt.Rows[1]["pImage"].ToString();
                    lbladdressresi2.Text    = dt.Rows[1]["Address"].ToString() + ", " + dt.Rows[1]["Municipality"].ToString() + ", " + dt.Rows[1]["PostalCode"].ToString();
                    lblresimls2.Text        = dt.Rows[1]["mls"].ToString();
                    lblresistatus2.Text     = dt.Rows[1]["SaleLease"].ToString();
                    lblresitype2.Text       = dt.Rows[1]["TypeOwn1Out"].ToString();
                    lblresiprice2.Text      = dt.Rows[1]["ListPrice"].ToString();
                    btnResview2.NavigateUrl = "../Search.aspx?Municipality=Mississauga";
                    // btnResview2.NavigateUrl = "../PropertyDetails.aspx?MLSID=" + dt.Rows[1]["MLS"].ToString() + "&PropertyType=" + dt.Rows[1]["pType"].ToString();
                    hlresi2.NavigateUrl = btnResview2.NavigateUrl;
                    string s2 = dt.Rows[2]["RemarksForClients"].ToString();
                    if (s2.Length > 100)
                    {
                        resiRemarksForClients3.Text = GetText(s2);
                    }
                    imgresi3.ImageUrl       = dt.Rows[2]["pImage"].ToString();
                    lbladdressresi3.Text    = dt.Rows[2]["Address"].ToString() + ", " + dt.Rows[2]["Municipality"].ToString() + ", " + dt.Rows[2]["PostalCode"].ToString();
                    lblresimls3.Text        = dt.Rows[2]["mls"].ToString();
                    lblresistatus3.Text     = dt.Rows[2]["SaleLease"].ToString();
                    lblresitype3.Text       = dt.Rows[2]["TypeOwn1Out"].ToString();
                    lblresiprice3.Text      = dt.Rows[2]["ListPrice"].ToString();
                    btnResview3.NavigateUrl = "../Search.aspx?Municipality=Brampton";
                    // btnResview3.NavigateUrl = "../PropertyDetails.aspx?MLSID=" + dt.Rows[2]["MLS"].ToString() + "&PropertyType=" + dt.Rows[2]["pType"].ToString();
                    hlresi3.NavigateUrl = btnResview3.NavigateUrl;

                    string s3 = dt.Rows[3]["RemarksForClients"].ToString();
                    if (s3.Length > 100)
                    {
                        resiRemarksForClients4.Text = GetText(s3);
                    }
                    imgresi4.ImageUrl       = dt.Rows[3]["pImage"].ToString();
                    lbladdressresi4.Text    = dt.Rows[3]["Address"].ToString() + ", " + dt.Rows[3]["Municipality"].ToString() + ", " + dt.Rows[3]["PostalCode"].ToString();;
                    lblresimls4.Text        = dt.Rows[3]["mls"].ToString();
                    lblresistatus4.Text     = dt.Rows[3]["SaleLease"].ToString();
                    lblresitype4.Text       = dt.Rows[3]["TypeOwn1Out"].ToString();
                    lblresiprice4.Text      = dt.Rows[3]["ListPrice"].ToString();
                    btnResview4.NavigateUrl = "../Search.aspx?Municipality=Markham";
                    // btnResview4.NavigateUrl = "../PropertyDetails.aspx?MLSID=" + dt.Rows[3]["MLS"].ToString() + "&PropertyType=" + dt.Rows[3]["pType"].ToString();
                    hlresi4.NavigateUrl = btnResview3.NavigateUrl;
                    //DataList1.DataSource = dt;
                    //DataList1.DataBind();
                }
                else
                {
                    //resultSearch.Visible = true;
                    //pagesLink.Visible = false;
                    //resultSearch.Text = "Property is not available ";
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
            }
        }