Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["IdInmueble"] == null || Session["IdInmueble"].ToString() == "")
                {
                    Response.Redirect("Propiedades.aspx");
                }
                try
                {
                    InmueblesBLL bllInmuebles = new InmueblesBLL();

                    dt = bllInmuebles.SeleccionaInmueblesPorID(Convert.ToInt32(Session["IdInmueble"].ToString()));


                    if (dt.Rows.Count != 0)
                    {
                        Session["grd_ItemList2"] = dt;

                        LlenarDetailsView();

                        DetailsView1.DataSource = dt;
                        DetailsView1.DataBind();

                        bindData();

                        GoogleMarker marker = new GoogleMarker(dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString());

                        GoogleMap1.Markers.Add(marker);

                        Coordinate coordinate = Geocode.GetCoordinates(dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString());
                        decimal    latitude   = coordinate.Latitude;
                        decimal    longitude  = coordinate.Longitude;



                        GoogleMap1.Latitude = convert(latitude);   //-32.9400639;

                        GoogleMap1.Longitude = convert(longitude); //-60.6600255;

                        marker.Text = dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString();

                        string g = marker.ToJsonString();
                    }
                    else if (dt.Rows.Count == 0)
                    {
                    }
                }
                catch
                {
                }
            }
        }
Пример #2
0
    public void SaveProfile()
    {
        try
        {
            _ObjProfile.AddressLine1 = AddressLine1;
            _ObjProfile.AddressLine2 = AddressLine2;
            _ObjProfile.Zip          = PostalCode;
            _ObjProfile.CountryID    = CountryID;
            _ObjProfile.RegionID     = RegionID;
            _ObjProfile.CityID       = CityID;

            StringBuilder address = new StringBuilder();
            _Country  = cmbCountry.SelectedItem.Text;
            _City     = cmbCity.SelectedItem.Text;
            _Province = cmbRegion.SelectedItem.Text;

            if (!string.IsNullOrEmpty(AddressLine1))
            {
                address.Append(AddressLine1);
            }
            if (!string.IsNullOrEmpty(AddressLine2))
            {
                address.Append(", " + AddressLine2);
            }
            if (!string.IsNullOrEmpty(_City))
            {
                address.Append(", " + _City);
            }
            if (!string.IsNullOrEmpty(_Province))
            {
                address.Append(", " + _Province);
            }
            if (string.IsNullOrEmpty(", " + _Country))
            {
                address.Append(", " + _Country);
            }

            Coordinate cord = Geocode.GetCoordinates(address.ToString());
            _ObjProfile.Latitude  = (float)cord.Latitude;
            _ObjProfile.Longitude = (float)cord.Longitude;

            GoProGoDC.ProfileDC.SubmitChanges(System.Data.Linq.ConflictMode.FailOnFirstConflict);
        }
        catch (Exception ex)
        {
            ThrowError(this, new ControlErrorArgs()
            {
                InnerException = ex, Message = ex.Message, Severity = 3
            });
        }
    }
Пример #3
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        if (rbServiceProviders.Checked)
        {
            if (rmSupplyOptions.SelectedItem.Text.Equals("Main Search"))
            {
                if (tbMainSearch.Text.Trim().Length > 1 && cmbCity.SelectedItem != null)
                {
                    Response.Redirect(string.Format("~/ServiceBrowsing/CategoryCityList.aspx?CityID={0}&Str={1}&Type=MainSearch", cmbCity.SelectedItem.Value, tbMainSearch.Text.Trim()));
                }
                else
                {
                    ThrowError(this, new ControlErrorArgs()
                    {
                        InnerException = null, Message = "Search is too general.", Severity = 6
                    });
                }
            }
            else if (rmSupplyOptions.SelectedItem.Text.Equals("Name Search"))
            {
                if (tbFirstName.Text.Trim().Length > 0 && tbLastName.Text.Trim().Length > 0 && cmbCity.SelectedItem != null)
                {
                    Response.Redirect(string.Format("~/ServiceBrowsing/CategoryCityList.aspx?CityID={0}&FirstName={1}&LastName={2}&Type=NameSearch", cmbCity.SelectedItem.Value, tbFirstName.Text.Trim(), tbLastName.Text.Trim()));
                }
                else
                {
                    ThrowError(this, new ControlErrorArgs()
                    {
                        InnerException = null, Message = "Please provide full name.", Severity = 6
                    });
                }
            }
            else if (rmSupplyOptions.SelectedItem.Text.Equals("Category Search"))
            {
                if (cmbCategory.SelectedItem != null && tbCategorySearch.Text.Trim().Length > 1 && cmbCity.SelectedItem != null)
                {
                    Response.Redirect(string.Format("~/ServiceBrowsing/CategoryCityList.aspx?CityID={0}&Str={1}&CategoryID={2}&Type=CategorySearch", cmbCity.SelectedItem.Value, tbCategorySearch.Text.Trim(), cmbCategory.SelectedItem.Value));
                }
                else
                {
                    ThrowError(this, new ControlErrorArgs()
                    {
                        InnerException = null, Message = "Search is too general.", Severity = 6
                    });
                }
            }
            else if (rmSupplyOptions.SelectedItem.Text.Equals("Distance Search"))
            {
                if (tbDistanceSearch.Text.Trim().Length > 1 && tbZip.Text.Trim().Length > 2 && cmbCity.SelectedItem != null && cmbCountry.SelectedValue != null)
                {
                    //Check if the country is allowed for zip code search, if country is not allowed then simply throw
                    //user error that zip code search is not available in your area.
                    //try to get coordinates for zip code including country, region and city
                    tblCountry cou  = GoProGo.Business.Entities.Geo.GetCountryByID(int.Parse(cmbCountry.SelectedValue));
                    Coordinate cord = Geocode.GetCoordinates(string.Format("{0},{1},{2}", tbZip.Text.Trim(), cmbCity.SelectedItem.Text, cmbCountry.SelectedItem.Text));

                    if (cou != null && cou.IsZipSearchAllowed == true)
                    {
                        Response.Redirect(string.Format("~/ServiceBrowsing/CategoryCityList.aspx?CityID={0}&Str={1}&IsKM={2}&Lat={3}&Long={4}&Type=DistanceSearch",
                                                        cmbCity.SelectedItem.Value,
                                                        tbDistanceSearch.Text.Trim(),
                                                        GoProGo.Business.Entities.Geo.IsCountryKM(cou).ToString(),
                                                        cord.Latitude.ToString(),
                                                        cord.Longitude.ToString()
                                                        ));
                    }
                    else
                    {
                        ThrowError(this, new ControlErrorArgs()
                        {
                            InnerException = null, Message = "Country is not allowed for Zip/Postal Code search."
                        });
                    }
                }
                else
                {
                    ThrowError(this, new ControlErrorArgs()
                    {
                        InnerException = null, Message = "Search is too general.", Severity = 6
                    });
                }
            }
            else
            {
                ThrowError(this, new ControlErrorArgs()
                {
                    InnerException = null, Message = "Please select a City.", Severity = 6
                });
            }
        }
        else
        {
            if (rmSupplyOptions.SelectedItem.Text.Equals("Main Search"))
            {
                if (tbMainSearch.Text.Trim().Length > 1 && cmbCity.SelectedItem != null)
                {
                    Response.Redirect(string.Format("~/DemandBrowsing/CategoryCityList.aspx?CityID={0}&Str={1}&Type=MainSearch", cmbCity.SelectedItem.Value, tbMainSearch.Text.Trim()));
                }
                else
                {
                    ThrowError(this, new ControlErrorArgs()
                    {
                        InnerException = null, Message = "Search is too general.", Severity = 6
                    });
                }
            }
            else if (rmSupplyOptions.SelectedItem.Text.Equals("Category Search"))
            {
                if (cmbCategory.SelectedItem != null && tbCategorySearch.Text.Trim().Length > 1 && cmbCity.SelectedItem != null)
                {
                    Response.Redirect(string.Format("~/DemandBrowsing/CategoryCityList.aspx?CityID={0}&Str={1}&CategoryID={2}&Type=CategorySearch", cmbCity.SelectedItem.Value, tbCategorySearch.Text.Trim(), cmbCategory.SelectedItem.Value));
                }
                else
                {
                    ThrowError(this, new ControlErrorArgs()
                    {
                        InnerException = null, Message = "Search is too general.", Severity = 6
                    });
                }
            }
            else if (rmSupplyOptions.SelectedItem.Text.Equals("Demand Type Search"))
            {
                if (cmbDemandType.SelectedItem != null && tbDemandTypeSearch.Text.Trim().Length > 1 && cmbCity.SelectedItem != null)
                {
                    Response.Redirect(string.Format("~/DemandBrowsing/CategoryCityList.aspx?CityID={0}&Str={1}&DemandTypeID={2}&Type=CategorySearch", cmbCity.SelectedItem.Value, tbCategorySearch.Text.Trim(), cmbDemandType.SelectedItem.Value));
                }
                else
                {
                    ThrowError(this, new ControlErrorArgs()
                    {
                        InnerException = null, Message = "Search is too general.", Severity = 6
                    });
                }
            }
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            InmueblesBLL bllInmuebles = new InmueblesBLL();

            dt = bllInmuebles.SeleccionaInmueblesPorID(Convert.ToInt32(Session["IdInmueble"].ToString()));

            if (dt.Rows.Count != 0)
            {
                Session["grd_ItemList2"] = dt;

                LlenarDetailsView();

                DetailsView1.DataSource = dt;
                DetailsView1.DataBind();
                DetailsView2.DataSource = dt;
                DetailsView2.DataBind();

                GoogleMarker marker = new GoogleMarker(dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString());


                GoogleMap1.Markers.Add(marker);

                Coordinate coordinate = Geocode.GetCoordinates(dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString());
                decimal    latitude   = coordinate.Latitude;
                decimal    longitude  = coordinate.Longitude;

                GoogleMap1.Latitude = convert(latitude);   //-32.9400639;

                GoogleMap1.Longitude = convert(longitude); //-60.6600255;

                marker.Text = dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString();

                string g = marker.ToJsonString();



                string strRutaFoto = Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + "01" + "_thumb.jpg");

                Boolean strFoto = (System.IO.File.Exists(strRutaFoto));

                if (strFoto)
                {
                    Image1.Visible = true;

                    Image1.ImageUrl = this.Page.ResolveClientUrl("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + "01" + "_thumb.jpg");
                }
                else
                {
                    Image1.Visible = false;
                }



                //Googleimagen.ImageUrl = this.Page.ResolveUrl("http://maps.google.com/staticmap?zoom=15&size=320x342&markers=" + longitude + "," + latitude + "&key=ABQIAAAApU_iFCnQtFqCJz_RVHKf6hSIMON3V3yf7e-rtPXBV5YPjpYuCRQqSKQQMFkEFT-8V8ujIAr2-XcoIQ");

                Googleimagen.ImageUrl = "http://maps.google.com/staticmap?zoom=15&size=259x250&markers=" + GoogleMap1.Latitude.ToString().Replace(",", ".") + "," + GoogleMap1.Longitude.ToString().Replace(",", ".") + "&key=ABQIAAAApU_iFCnQtFqCJz_RVHKf6hSIMON3V3yf7e-rtPXBV5YPjpYuCRQqSKQQMFkEFT-8V8ujIAr2-XcoIQ";
            }
            else if (dt.Rows.Count == 0)
            {
            }

            HiddenFielddireccion.Value               = dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString();
            HiddenFieldzona.Value                    = dt.Rows[0]["Zona"].ToString();
            HiddenFieldtipoinmueble.Value            = dt.Rows[0]["TipoDeInmueble"].ToString();
            HiddenFieldestadoinmueble.Value          = dt.Rows[0]["Estado"].ToString();
            HiddenFieldprovincia.Value               = dt.Rows[0]["NombreProvincia"].ToString();
            HiddenFieldlocalidad.Value               = dt.Rows[0]["NombreLocalidad"].ToString();
            HiddenFieldpiso.Value                    = dt.Rows[0]["Piso"].ToString();
            HiddenFielddepartamento.Value            = dt.Rows[0]["Departamento"].ToString();
            HiddenFieldentrecalle.Value              = dt.Rows[0]["Calle1"].ToString();
            HiddenFieldycalle.Value                  = dt.Rows[0]["Calle2"].ToString();
            HiddenFieldmetroscuadcubiertos.Value     = dt.Rows[0]["MetroCuadrados"].ToString();
            HiddenFieldmetroscuadsemicubiertos.Value = dt.Rows[0]["MetrosCuadradosSemiCub"].ToString();
            HiddenFieldposicion.Value                = dt.Rows[0]["Frente"].ToString();
            HiddenFieldcochera.Value                 = dt.Rows[0]["Fondo"].ToString();
            HiddenFieldposicion.Value                = dt.Rows[0]["Posicion"].ToString();
            HiddenFieldcochera.Value                 = dt.Rows[0]["Cocheras"].ToString();
            HiddenFieldAntiguedad.Value              = dt.Rows[0]["Antiguedad"].ToString();
            HiddenFieldAntiguedadA.Value             = dt.Rows[0]["AntiguedadA"].ToString();
            HiddenFieldOperacion.Value               = dt.Rows[0]["Operacion"].ToString();
            HiddenFieldPrecioVenta.Value             = dt.Rows[0]["PrecioVenta"].ToString();
            HiddenFieldPrecioAlquiler.Value          = dt.Rows[0]["PrecioAlquiler"].ToString();
            HiddenFieldComision.Value                = dt.Rows[0]["Comision"].ToString();
            HiddenFieldFechaAlta.Value               = dt.Rows[0]["FechaAlta"].ToString();
            HiddenFieldFechaActualiza.Value          = dt.Rows[0]["FechaActualiza"].ToString();
            HiddenFieldMailUsuario.Value             = dt.Rows[0]["MailUsuario"].ToString();
            HiddenFieldObservaciones.Value           = dt.Rows[0]["Observaciones"].ToString();
            HiddenFieldimagen.Value                  = this.Page.ResolveClientUrl(Session["IdInmueble"].ToString() + "-" + "01" + "_thumb.jpg");
            HiddenFieldgooglemapsimage.Value         = "http://maps.googleapis.com/maps/api/staticmap?markers=" + GoogleMap1.Latitude.ToString().Replace(",", ".") + "," + GoogleMap1.Longitude.ToString().Replace(",", ".") + "&zoom=15&size=260x194&sensor=false";
        }
        catch
        {
        }
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            InmueblesBLL bllInmuebles = new InmueblesBLL();

            dt = bllInmuebles.SeleccionaInmueblesPorID(Convert.ToInt32(Session["IdInmueble"].ToString()));

            if (dt.Rows.Count != 0)
            {
                Session["grd_ItemList2"] = dt;

                LlenarDetailsView();

                DetailsView1.DataSource = dt;
                DetailsView1.DataBind();
                DetailsView2.DataSource = dt;
                DetailsView2.DataBind();

                GoogleMarker marker = new GoogleMarker(dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString());


                GoogleMap1.Markers.Add(marker);

                Coordinate coordinate = Geocode.GetCoordinates(dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString());
                decimal    latitude   = coordinate.Latitude;
                decimal    longitude  = coordinate.Longitude;

                GoogleMap1.Latitude = convert(latitude);   //-32.9400639;

                GoogleMap1.Longitude = convert(longitude); //-60.6600255;

                marker.Text = dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString() + "," + dt.Rows[0]["NombreProvincia"].ToString();

                string g = marker.ToJsonString();



                string strRutaFoto = Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + "01" + "_thumb.jpg");

                Boolean strFoto = (System.IO.File.Exists(strRutaFoto));

                if (strFoto)
                {
                    Image1.Visible = true;

                    Image1.ImageUrl = this.Page.ResolveClientUrl("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + "01" + "_thumb.jpg");
                }
                else
                {
                    Image1.Visible = false;
                }



                //Googleimagen.ImageUrl = this.Page.ResolveUrl("http://maps.google.com/staticmap?zoom=15&size=320x342&markers=" + longitude + "," + latitude + "&key=ABQIAAAApU_iFCnQtFqCJz_RVHKf6hSIMON3V3yf7e-rtPXBV5YPjpYuCRQqSKQQMFkEFT-8V8ujIAr2-XcoIQ");

                Googleimagen.ImageUrl = "http://maps.google.com/staticmap?zoom=15&size=259x250&markers=" + GoogleMap1.Latitude.ToString().Replace(",", ".") + "," + GoogleMap1.Longitude.ToString().Replace(",", ".") + "&key=ABQIAAAApU_iFCnQtFqCJz_RVHKf6hSIMON3V3yf7e-rtPXBV5YPjpYuCRQqSKQQMFkEFT-8V8ujIAr2-XcoIQ";
            }
            else if (dt.Rows.Count == 0)
            {
            }
        }
        catch
        {
        }
    }