コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            InmueblesBLL bllInmuebles = new InmueblesBLL();

            //12-12-12
            //IdInmueble = Session["IdInmueble"].ToString();
            IdInmueble = Request.QueryString["IdInmueble"];

            dt = bllInmuebles.SeleccionaInmueblesPorID(Convert.ToInt32(IdInmueble));

            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);

                if (dt.Rows[0]["NombreProvincia"].ToString() == "Todas las Provincias")
                {
                    Coordinate coordinate = Geocode.GetCoordinates(dt.Rows[0]["Calle"].ToString() + " " + dt.Rows[0]["Numero"].ToString() + "," + dt.Rows[0]["NombreLocalidad"].ToString());
                    decimal latitude = coordinate.Latitude;
                    decimal longitude = coordinate.Longitude;
                    if (latitude != 0 && longitude != 0)
                    {
                        GoogleMap1.Latitude = convert(latitude);//-32.9400639;

                        GoogleMap1.Longitude = convert(longitude);//-60.6600255;
                    }
                }
                else
                {
                    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;
                    if (latitude != 0 && longitude != 0)
                    {
                        GoogleMap1.Latitude = convert(latitude);//-32.9400639;

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

                //    decimal latitude = coordinate.Latitude;
                //decimal longitude = coordinate.Longitude;
                //if (latitude != 0 && longitude != 0)
                //{
                //    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\\" + IdInmueble + "-" + "01" + "_thumb.jpg");

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

                if (strFoto)
                {
                    Image1.Visible = true;

                    Image1.ImageUrl = this.Page.ResolveClientUrl("~\\Image_Upload\\" + IdInmueble + "-" + "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 = "https://maps.googleapis.com/maps/api/staticmap?zoom=15&size=259x250&markers=" + GoogleMap1.Latitude.ToString().Replace(",", ".") + "," + GoogleMap1.Longitude.ToString().Replace(",", ".") + "&key=ABQIAAAApU_iFCnQtFqCJz_RVHKf6hSIMON3V3yf7e-rtPXBV5YPjpYuCRQqSKQQMFkEFT-8V8ujIAr2-XcoIQ";
                //get inmo name
                ProyectoInmoBLL.InmobiliariasBLL inmobll = new ProyectoInmoBLL.InmobiliariasBLL();
                NombreInmoLogin.Value = inmobll.SelectNombreInmobiliaria(Membership.GetUser().ProviderUserKey.ToString());

            }
            else if (dt.Rows.Count == 0)
            {
            }

            if (dt.Rows[0]["TipoDeInmueble"].ToString() == "TERRENOS")
            {
                HiddenFieldFlagTerreno.Value = "1";
            } else {
                HiddenFieldFlagTerreno.Value = "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();
            HiddenFieldfrente.Value = dt.Rows[0]["Frente"].ToString();
            HiddenFieldfondo.Value = dt.Rows[0]["Fondo"].ToString();
            HiddenFieldmetroscuadcubiertos.Value = dt.Rows[0]["MetroCuadrados"].ToString();
            HiddenFieldmetroscuadsemicubiertos.Value = dt.Rows[0]["MetrosCuadradosSemiCub"].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();
            HiddenFieldimagen.Value = IdInmueble;
            HiddenFieldFechaAlta.Value = dt.Rows[0]["FechaAlta"].ToString();
            HiddenFieldFechaActualiza.Value = dt.Rows[0]["FechaActualiza"].ToString();
            HiddenFieldNombreInmobiliaria.Value = dt.Rows[0]["NombreInmobiliaria"].ToString();
            HiddenFieldNombreUsuario.Value = dt.Rows[0]["NombreUsuario"].ToString();
            HiddenFieldApellidoUsuario.Value = dt.Rows[0]["ApellidoUsuario"].ToString();
            HiddenFieldTelefonoUsuario.Value = dt.Rows[0]["TelefonoUsuario"].ToString();
            HiddenFieldCelularUsuario.Value = dt.Rows[0]["CelularUsuario"].ToString();
            HiddenFieldMailUsuario.Value = dt.Rows[0]["MailUsuario"].ToString();
            HiddenFieldObservaciones.Value = dt.Rows[0]["Observaciones"].ToString();
            HiddenFieldimagen.Value = this.Page.ResolveClientUrl(IdInmueble + "-" + "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
        {

        }
    }
コード例 #2
0
    protected void ContinueButton_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                UsuarioBLL usuariobll = new UsuarioBLL();
                MembershipUser memUser = Membership.GetUser();
                user = usuariobll.GetUsuario(memUser.ProviderUserKey.ToString());

                string compararcampos = comparar();

                memUser.Email = txtEmail.Text;
                user.Telefono = txtTelefono.Text;
                user.Celular = txtCelular.Text;
                user.Nombre = txtNombre.Text;
                user.Apellido = txtApellido.Text;
                user.EmailAlternatiovo = txtEmailAlternativo.Text;

                inmo.Calle = txtCalle.Text;
                inmo.Departamento = txtDepartamento.Text;
                inmo.Numero = txtNumero.Text;
                inmo.Piso = txtPiso.Text;

                ProyectoInmoBLL.InmobiliariasBLL inmobll = new ProyectoInmoBLL.InmobiliariasBLL();
                inmobll.UpdateInmobiliaria(inmo, user.IdInmobiliaria.ToString());
                usuariobll.UpdateUsuario(user, memUser.ProviderUserKey.ToString());
                Membership.UpdateUser(memUser);
                sendmail(memUser.ProviderUserKey.ToString(), compararcampos);
            }
            catch { }
            finally
            {
            }
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            MembershipUser memUser = Membership.GetUser();
            UsuarioBLL usuariobll = new UsuarioBLL();
            user = usuariobll.GetUsuario(memUser.ProviderUserKey.ToString());
            ProyectoInmoBLL.InmobiliariasBLL inmobll= new ProyectoInmoBLL.InmobiliariasBLL();
            inmo = inmobll.SelectInmobiliaria(user.IdInmobiliaria);

            txtNombre.Text = user.Nombre;
            txtApellido.Text = user.Apellido;
            txtCalle.Text = inmo.Calle;
            txtNumero.Text = inmo.Numero;
            txtPiso.Text = inmo.Piso;
            txtDepartamento.Text = inmo.Departamento;
            txtTelefono.Text = user.Telefono;
            txtCelular.Text = user.Celular;
            txtEmail.Text = Membership.GetUser(memUser.UserName).Email;
            txtEmailAlternativo.Text = user.EmailAlternatiovo;
        }
    }
コード例 #4
0
    protected void btnEliminar_Click2(object sender, EventArgs e)
    {
        if (gvInmuebles.SelectedIndex != -1)
        {
            string num;
            InmueblesBLL bllInmuebles = new InmueblesBLL();
            ProyectoInmoBLL.InmobiliariasBLL inmobll = new ProyectoInmoBLL.InmobiliariasBLL();

            if (rblDelete.SelectedValue == "2")
            {
                string g = cboInmobiliarias.SelectedIndex.ToString();

                bllInmuebles.Shared(gvInmuebles.SelectedValue.ToString(), cboInmobiliarias.SelectedValue.ToString(), cboInmobiliarias2.SelectedValue.ToString(), inmobll.SelectNombreInmobiliaria(Membership.GetUser().ProviderUserKey.ToString()));
            }

            bllInmuebles.Delete(gvInmuebles.SelectedValue.ToString());

            for (int i = 1; i <= 10; i++)
            {
                try
                {
                    if (i < 10)
                    {
                        num = 0 + i.ToString();
                    }
                    else
                    {
                        num = i.ToString();
                    }
                    File.Delete(Server.MapPath("~\\Image_Upload\\" + gvInmuebles.SelectedValue.ToString() + "-" + num + ".jpg"));
                    File.Delete(Server.MapPath("~\\Image_Upload\\" + gvInmuebles.SelectedValue.ToString() + "-" + num + "_thumb.jpg"));

                }
                catch
                {
                }
            }

            IniciaGridView();

            Page.Response.Redirect(Page.Request.Url.ToString(), true);
        }
    }