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 { } } }
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 { } }
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 { } }