Exemplo n.º 1
0
        protected void CargarGrillaFavoritos()
        {
            try
            {
                DataGrid1.Visible = false;

                InmueblesBLL bllInmuebles = new InmueblesBLL();

                dt = bllInmuebles.SeleccionaInmueblesFavoritos(rblOperacion.SelectedValue);

                if (dt.Rows.Count != 0)
                {
                    DataGrid1.DataSource       = null;
                    DataGrid1.DataSource       = dt;
                    DataGrid1.CurrentPageIndex = 0;
                    DataGrid1.DataBind();
                    Session["grd_ItemList"] = dt;
                    DataGrid1.Visible       = true;
                }
                else if (dt.Rows.Count == 0)
                {
                }
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        public ArrayList FetchDepartamentos()
        {
            InmueblesBLL bllInmuebles = new InmueblesBLL();
            Inmueble     objInmueble  = new Inmueble();
            ArrayList    mailItems    = new ArrayList();
            DataTable    dt           = bllInmuebles.SeleccionaTiposDeInmueblesPorPadre("DEPARTAMENTO");



            foreach (DataRow r in dt.Rows)
            {
                string g = r.Field <String>("NombreMenu");
                // string h = r.Field<String>("IdTipoDeInmueble");
                //mailItems.Add(new { Name = r.Field<String>("NombreMenu") + " (" + bllInmuebles.SeleccionaCantidadInmuebles(Convert.ToInt32(r.Field<int>("IdTipoDeInmueble"))) + ")", ImageUrl = "img/inbox.gif" });
                mailItems.Add(new { Name = r.Field <String>("NombreMenu"), ImageUrl = "img/inbox.gif" });
            }


            //mailItems.Add(new { Name = "DE PASILLO (" + bllInmuebles.SeleccionaCantidadInmuebles(1) + ")", ImageUrl = "img/mailbox.gif" });
            //mailItems.Add(new { Name = "AMUEBLADOS (" + bllInmuebles.SeleccionaCantidadInmuebles(2) + ")", ImageUrl = "img/mailbox.gif" });
            //mailItems.Add(new { Name = "1 AMBIENTE (" + bllInmuebles.SeleccionaCantidadInmuebles(3) + ")", ImageUrl = "img/mailbox.gif" });
            //mailItems.Add(new { Name = "1 DORMITORIO (" + bllInmuebles.SeleccionaCantidadInmuebles(4) + ")", ImageUrl = "img/inbox.gif" });
            //mailItems.Add(new { Name = "2 DORMITORIOS (" + bllInmuebles.SeleccionaCantidadInmuebles(5) + ")", ImageUrl = "img/drafts.gif" });
            //mailItems.Add(new { Name = "3 DORMITORIOS (" + bllInmuebles.SeleccionaCantidadInmuebles(6) + ")", ImageUrl = "img/outbox.gif" });
            //mailItems.Add(new { Name = "4 DORMITORIOS O MAS (" + bllInmuebles.SeleccionaCantidadInmuebles(7) + ")", ImageUrl = "img/junk.gif" });

            return(mailItems);
        }
Exemplo n.º 3
0
        protected void CargarGrilla(object sender, CommandEventArgs e)
        {
            try
            {
                DataGrid1.Visible = false;

                InmueblesBLL bllInmuebles = new InmueblesBLL();

                ArrayList arlInmobiliarias = new ArrayList();

                DataTable dtTipos = bllInmuebles.SeleccionaTiposDeInmuebles();

                Inmueble objInmueble = new Inmueble();

                objInmueble.IDOperacion = Convert.ToInt32(rblOperacion.SelectedValue);

                string[] tipoDeInmuebleEntero = e.CommandArgument.ToString().Split('(');

                int cant = 0;

                string tipo = "null";

                foreach (string tipo2 in tipoDeInmuebleEntero)
                {
                    if (cant == 0)
                    {
                        //tipo = tipo2.Substring(0, tipo2.Length - 1);
                        tipo = tipo2;
                        cant = cant + 1;
                    }
                }

                dtTipos = bllInmuebles.SeleccionaTiposDeInmuebles();

                foreach (DataRow r in dtTipos.Rows)
                {
                    if (r.Field <string>("TipoPadre") + " " + r.Field <string>("NombreMenu") == tipo)
                    {
                        dt = bllInmuebles.SeleccionaInmueblesBusqueda(objInmueble, r.Field <int>("IdTipoDeInmueble"));
                    }
                }


                if (dt.Rows.Count != 0)
                {
                    DataGrid1.DataSource       = null;
                    DataGrid1.DataSource       = dt;
                    DataGrid1.CurrentPageIndex = 0;
                    DataGrid1.DataBind();
                    Session["grd_ItemList"] = dt;
                    DataGrid1.Visible       = true;
                }
                else if (dt.Rows.Count == 0)
                {
                }
            }
            catch
            {
            }
        }
Exemplo n.º 4
0
        public ArrayList FetchOtrosInmuebles()
        {
            ArrayList    mailItems    = new ArrayList();
            InmueblesBLL bllInmuebles = new InmueblesBLL();
            Inmueble     objInmueble  = new Inmueble();
            DataTable    dt           = bllInmuebles.SeleccionaTiposDeInmueblesPorPadre("OTRO");



            foreach (DataRow r in dt.Rows)
            {
                string g = r.Field <String>("NombreMenu");
                // string h = r.Field<String>("IdTipoDeInmueble");
                //mailItems.Add(new { Name = r.Field<String>("NombreMenu") + " (" + bllInmuebles.SeleccionaCantidadInmuebles(Convert.ToInt32(r.Field<int>("IdTipoDeInmueble"))) + ")", ImageUrl = "img/inbox.gif" });
                mailItems.Add(new { Name = r.Field <String>("NombreMenu"), ImageUrl = "img/inbox.gif" });
            }

            //mailItems.Add(new { Name = "COCHERAS (" + bllInmuebles.SeleccionaCantidadInmuebles(12) + ")", ImageUrl = "img/mailbox.gif" });
            //mailItems.Add(new { Name = "DEPOSITOS Y GALPONES (" + bllInmuebles.SeleccionaCantidadInmuebles(13) + ")", ImageUrl = "img/mailbox.gif" });
            //mailItems.Add(new { Name = "HOTELES, PENSIONES Y PIEZAS (" + bllInmuebles.SeleccionaCantidadInmuebles(14) + ")", ImageUrl = "img/mailbox.gif" });
            //mailItems.Add(new { Name = "LOCALES COMERCIALES,INDUSTRIALES Y OFICINAS (" + bllInmuebles.SeleccionaCantidadInmuebles(15) + ")", ImageUrl = "img/mailbox.gif" });
            //mailItems.Add(new { Name = "TERRENOS (" + bllInmuebles.SeleccionaCantidadInmuebles(16) + ")", ImageUrl = "img/mailbox.gif" });

            return(mailItems);
        }
Exemplo n.º 5
0
        protected void btnOpcion_Click(object sender, EventArgs e)
        {
            if (ddlOpciones.SelectedIndex == 0)
            {
            }
            else if (ddlOpciones.SelectedIndex == 1)
            {
                dt = (DataTable)Session["grd_ItemList2"];

                if (dt.Rows[0]["IdUsuario"].ToString() == Session["UserID"].ToString())
                {
                    Session["IdInmueble"] = dt.Rows[0]["IdInmueble"].ToString();

                    Response.Redirect("ModificarPropiedad.aspx");
                }
            }
            else if (ddlOpciones.SelectedIndex == 2)
            {
                dt = (DataTable)Session["grd_ItemList2"];

                //if (dt.Rows[0]["IdUsuario"].ToString() == Session["UserID"].ToString())
                //{
                Session["IdInmueble"] = dt.Rows[0]["IdInmueble"].ToString();

                Response.Redirect("AltaImagen.aspx");
                //}
            }
            else if (ddlOpciones.SelectedIndex == 3)
            {
                dt = (DataTable)Session["grd_ItemList2"];

                if (dt.Rows[0]["IdUsuario"].ToString() == Session["UserID"].ToString())
                {
                    Session["IdInmueble"] = dt.Rows[0]["IdInmueble"].ToString();

                    InmueblesBLL bllInmuebles = new InmueblesBLL();
                    bllInmuebles.Delete(Session["IdInmueble"].ToString());


                    for (int i = 1; i <= 10; i++)
                    {
                        try
                        {
                            File.Delete(Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + i + ".jpg"));
                            File.Delete(Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + i + "_thumb.jpg"));
                        }
                        catch
                        {
                        }
                    }

                    Response.Redirect("MisPropiedades.aspx");
                }
            }
        }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["IdInmueble"] == null || Session["IdInmueble"].ToString() == "")
         {
             Response.Redirect("Propiedades.aspx");
         }
         this.bllInmuebles = new InmueblesBLL();
         EditarPropiedad();
     }
 }
Exemplo n.º 7
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
                {
                }
            }
        }
Exemplo n.º 8
0
    protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        //CalcularSesion();

        if (e.CommandName == "Editar")
        {
            dt = (DataTable)Session["grd_ItemList2"];

            if (dt.Rows[0]["IdUsuario"].ToString() == Membership.GetUser().ProviderUserKey.ToString())
            {
                Session["IdInmueble"] = dt.Rows[0]["IdInmueble"].ToString();

                Response.Redirect("ModificarPropiedad.aspx");
            }
        }

        else if (e.CommandName == "Eliminar")
        {
            dt = (DataTable)Session["grd_ItemList2"];

            if (dt.Rows[0]["IdUsuario"].ToString() == Membership.GetUser().ProviderUserKey.ToString())
            {
                //Response.Write("<script>window.alert('Hola');</script>");
                //Response.Redirect("ModificarPropiedad.aspx?id="
                //   + dt.Rows[0]["IdInmueble"].ToString());

                //CalcularSesion();

                Session["IdInmueble"] = dt.Rows[0]["IdInmueble"].ToString();

                InmueblesBLL bllInmuebles = new InmueblesBLL();
                bllInmuebles.Delete(Session["IdInmueble"].ToString());


                for (int i = 1; i <= 10; i++)
                {
                    try
                    {
                        File.Delete(Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + i + ".jpg"));
                        File.Delete(Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + i + "_thumb.jpg"));
                    }
                    catch
                    {
                    }
                }

                Response.Redirect("MisPropiedades.aspx");
            }
        }
    }
Exemplo n.º 9
0
        public ArrayList FetchContactItems()
        {
            ArrayList    mailItems    = new ArrayList();
            InmueblesBLL bllInmuebles = new InmueblesBLL();
            Inmueble     objInmueble  = new Inmueble();

            mailItems.Add(new { Name = "Address Cards", ImageUrl = "_assets/img/contact_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "Detailed Address List", ImageUrl = "_assets/img/contact_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "By Category", ImageUrl = "_assets/img/contact_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "By Company", ImageUrl = "_assets/img/contact_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "By Follow-up Flag", ImageUrl = "_assets/img/contact_small.gif", url = "http://www.grupoinci.com.ar/" });

            return(mailItems);
        }
Exemplo n.º 10
0
        public ArrayList FetchNoteItems()
        {
            InmueblesBLL bllInmuebles = new InmueblesBLL();
            Inmueble     objInmueble  = new Inmueble();
            ArrayList    mailItems    = new ArrayList();

            mailItems.Add(new { Name = "Icons", ImageUrl = "_assets/img/note_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "Note List", ImageUrl = "_assets/img/note_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "Last Seven Days", ImageUrl = "_assets/img/note_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "By Category", ImageUrl = "_assets/img/note_small.gif", url = "http://www.grupoinci.com.ar/" });
            mailItems.Add(new { Name = "By Color", ImageUrl = "_assets/img/note_small.gif", url = "http://www.grupoinci.com.ar/" });

            return(mailItems);
        }
Exemplo n.º 11
0
        public ArrayList FetchMailItems()
        {
            InmueblesBLL bllInmuebles = new InmueblesBLL();
            Inmueble     objInmueble  = new Inmueble();
            ArrayList    mailItems    = new ArrayList();


            mailItems.Add(new { Name = "1 AMBIENTE", ImageUrl = "img/mailbox.gif" });
            mailItems.Add(new { Name = "1 DORMITORIO", ImageUrl = "img/inbox.gif" });
            mailItems.Add(new { Name = "2 DORMITORIOS", ImageUrl = "img/drafts.gif" });
            mailItems.Add(new { Name = "3 DORMITORIOS", ImageUrl = "img/outbox.gif" });
            mailItems.Add(new { Name = "4 DORMITORIOS O MAS", ImageUrl = "img/junk.gif" });

            return(mailItems);
        }
Exemplo n.º 12
0
        protected void IniciaGridView()
        {
            if (ddlTipoDeInmueble.SelectedValue == null || ddlTipoDeInmueble.SelectedValue == "")
            {
                InmueblesBLL bllInmuebles = new InmueblesBLL();
                DataTable    dt           = bllInmuebles.SeleccionaInmuebles(0, Convert.ToInt32(rdOperacion.SelectedValue), ddlOrdenar.SelectedValue.ToString());
                gvInmuebles.DataSource   = dt;
                Session["grd_ItemList2"] = dt;

                if (dt.Rows.Count == 0)
                {
                    btnEditar.Visible   = false;
                    btnEliminar.Visible = false;
                    btnFicha.Visible    = false;
                }
                else
                {
                    btnEditar.Visible   = true;
                    btnEliminar.Visible = true;
                    btnFicha.Visible    = true;
                }
                gvInmuebles.DataBind();
                gvInmuebles.SelectedIndex = -1;
            }
            else
            {
                InmueblesBLL bllInmuebles = new InmueblesBLL();
                DataTable    dt           = bllInmuebles.SeleccionaInmuebles(Convert.ToInt32(ddlTipoDeInmueble.SelectedValue), Convert.ToInt32(rdOperacion.SelectedValue), ddlOrdenar.SelectedValue.ToString());
                gvInmuebles.DataSource   = dt;
                Session["grd_ItemList2"] = dt;

                if (dt.Rows.Count == 0)
                {
                    btnEditar.Visible   = false;
                    btnEliminar.Visible = false;
                    btnFicha.Visible    = false;
                }
                else
                {
                    btnEditar.Visible   = true;
                    btnEliminar.Visible = true;
                    btnFicha.Visible    = true;
                }
                gvInmuebles.DataBind();
                gvInmuebles.SelectedIndex = -1;
            }
        }
Exemplo n.º 13
0
        //Boton Finalizar - Guarda la propiedad y direcciona a la pagina de la Ficha
        protected void btnAceptar0_Click(object sender, EventArgs e)
        {
            cargarPropiedad();

            try
            {
                InmueblesBLL bllInmuebles = new InmueblesBLL();
                string       ID           = bllInmuebles.SeleccionaIdDelUltimoInmueble();

                Session["IdInmueble"] = ID;
                //Response.Redirect("AltaImagenes.Aspx?id=" + ID);
                Response.Redirect("~\\Admin\\FichaPropiedad.aspx");
            }
            catch
            {
            }
        }
Exemplo n.º 14
0
        public AjaxControlToolkit.CascadingDropDownNameValue[] getInmuebles(string knownCategoryValues, string category)
        {
            bllinmuebles = new InmueblesBLL();

            List <AjaxControlToolkit.CascadingDropDownNameValue> values = new List <AjaxControlToolkit.CascadingDropDownNameValue>();

            DataTable dt = bllinmuebles.SeleccionaInmuebles();

            foreach (DataRow dRow in dt.Rows)
            {
                string categoryID   = dRow["IdInmueble"].ToString();
                string categoryName = dRow["Calle"].ToString() + " " + dRow["Numero"].ToString();
                values.Add(new AjaxControlToolkit.CascadingDropDownNameValue(categoryName, categoryID));
            }

            return(values.ToArray());
        }
Exemplo n.º 15
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            List <Inmueble> lista = new List <Inmueble>();

            foreach (GridViewRow dr in gvInmuebles.Rows)
            {
                //lb_IdInmueble
                Inmueble inmu = new Inmueble();
                inmu.IDInmueble = int.Parse((dr.Cells[0].FindControl("lb_IdInmueble") as Label).Text);
                inmu.Favorito   = (dr.Cells[7].FindControl("chkFavoritos") as CheckBox).Checked;
                if (inmu.Favorito)
                {
                    lista.Add(inmu);
                }
            }
            InmueblesBLL bllInmueble = new InmueblesBLL();

            bllInmueble.UpdateFavoritos(lista);
        }
Exemplo n.º 16
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //System.Threading.Thread.Sleep(5000);

            try
            {
                DataGrid1.Visible = false;

                InmueblesBLL bllInmuebles = new InmueblesBLL();

                Inmueble objInmueble = new Inmueble();
                //objInmueble.IDUsuario = Session["UserID"].ToString();
                objInmueble.IDTipoDeInmueble = int.Parse(ddlTipoDeInmueble.SelectedValue.ToString());
                objInmueble.IDOperacion      = int.Parse(ddlOperacion.SelectedValue.ToString());
                objInmueble.IDLocalidad      = int.Parse(ddlLocalidades.SelectedValue.ToString());
                objInmueble.IDProvincia      = int.Parse(ddlProvincias.SelectedValue.ToString());
                objInmueble.IDZona           = int.Parse(ddlZonas.SelectedValue.ToString());

                dt = bllInmuebles.SeleccionaInmueblesBusqueda(objInmueble, objInmueble.IDTipoDeInmueble);
                //dt = bllInmuebles.SeleccionaInmueblesBusqueda2(objInmueble.IDTipoDeInmueble, objInmueble.IDOperacion, "IdInmueble");

                if (dt.Rows.Count != 0)
                {
                    DataGrid1.DataSource       = null;
                    DataGrid1.DataSource       = dt;
                    DataGrid1.CurrentPageIndex = 0;
                    DataGrid1.DataBind();
                    Session["grd_ItemList"] = dt;
                    DataGrid1.Visible       = true;

                    //Oculta la busqueda
                    //CollapsiblePanelExtenderBusqueda.Collapsed = true;
                    //CollapsiblePanelExtenderBusqueda.ClientState = "true";
                }
                else if (dt.Rows.Count == 0)
                {
                }
            }
            catch
            {
            }
        }
Exemplo n.º 17
0
        protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
        {
            if (e.CommandName == "Editar")
            {
                dt = (DataTable)Session["grd_ItemList2"];

                if (dt.Rows[0]["IdUsuario"].ToString() == Session["UserID"].ToString())
                {
                    Session["IdInmueble"] = dt.Rows[0]["IdInmueble"].ToString();

                    Response.Redirect("ModificarPropiedad.aspx");
                }
            }

            else if (e.CommandName == "Eliminar")
            {
                dt = (DataTable)Session["grd_ItemList2"];

                if (dt.Rows[0]["IdUsuario"].ToString() == Session["UserID"].ToString())
                {
                    Session["IdInmueble"] = dt.Rows[0]["IdInmueble"].ToString();

                    InmueblesBLL bllInmuebles = new InmueblesBLL();
                    bllInmuebles.Delete(Session["IdInmueble"].ToString());


                    for (int i = 1; i <= 10; i++)
                    {
                        try
                        {
                            File.Delete(Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + i + ".jpg"));
                            File.Delete(Server.MapPath("~\\Image_Upload\\" + Session["IdInmueble"].ToString() + "-" + i + "_thumb.jpg"));
                        }
                        catch
                        {
                        }
                    }

                    Response.Redirect("MisPropiedades.aspx");
                }
            }
        }
Exemplo n.º 18
0
        protected void CargarGrilla(object sender, CommandEventArgs e)
        {
            try
            {
                DataGrid1.Visible = false;

                InmueblesBLL bllInmuebles = new InmueblesBLL();

                ArrayList arlInmobiliarias = new ArrayList();

                Inmueble objInmueble = new Inmueble();

                if (e.CommandArgument.ToString() == "1 AMBIENTE")
                {
                    dt = bllInmuebles.SeleccionaInmueblesBusqueda(objInmueble, 3);
                }
                else if (e.CommandArgument.ToString() == "1 DORMITORIO")
                {
                    dt = bllInmuebles.SeleccionaInmueblesBusqueda(objInmueble, 4);
                }
                else if (e.CommandArgument.ToString() == "2 DORMITORIOS")
                {
                    dt = bllInmuebles.SeleccionaInmueblesBusqueda(objInmueble, 5);
                }

                if (dt.Rows.Count != 0)
                {
                    DataGrid1.DataSource       = null;
                    DataGrid1.DataSource       = dt;
                    DataGrid1.CurrentPageIndex = 0;
                    DataGrid1.DataBind();
                    Session["grd_ItemList"] = dt;
                    DataGrid1.Visible       = true;
                }
                else if (dt.Rows.Count == 0)
                {
                }
            }
            catch
            {
            }
        }
Exemplo n.º 19
0
        public AjaxControlToolkit.CascadingDropDownNameValue[] getInmuebles1(string knownCategoryValues, string category)
        {
            bllinmuebles = new InmueblesBLL();

            StringDictionary categoryValues = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);

            int id = Convert.ToInt32(categoryValues["inmuebles"]);

            List <AjaxControlToolkit.CascadingDropDownNameValue> values = new List <AjaxControlToolkit.CascadingDropDownNameValue>();

            DataTable dt = bllinmuebles.SeleccionaInmueblesDistintosDeID(id, 0, 0);

            foreach (DataRow dRow in dt.Rows)
            {
                string categoryID   = dRow["IdInmueble"].ToString();
                string categoryName = dRow["Calle"].ToString() + " " + dRow["Numero"].ToString();
                values.Add(new AjaxControlToolkit.CascadingDropDownNameValue(categoryName, categoryID));
            }

            return(values.ToArray());
        }
Exemplo n.º 20
0
        protected void btnEliminar_Click(object sender, EventArgs e)
        {
            if (gvInmuebles.SelectedIndex != -1)
            {
                InmueblesBLL bllInmuebles = new InmueblesBLL();
                bllInmuebles.Delete(gvInmuebles.SelectedValue.ToString());


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

                IniciaGridView();
            }
        }
Exemplo n.º 21
0
        public ArrayList FetchCasas()
        {
            InmueblesBLL bllInmuebles = new InmueblesBLL();
            Inmueble     objInmueble  = new Inmueble();
            ArrayList    mailItems    = new ArrayList();
            DataTable    dt           = bllInmuebles.SeleccionaTiposDeInmueblesPorPadre("CASA");



            foreach (DataRow r in dt.Rows)
            {
                string g = r.Field <String>("NombreMenu");
                // string h = r.Field<String>("IdTipoDeInmueble");
                //mailItems.Add(new { Name = r.Field<String>("NombreMenu") + " (" + bllInmuebles.SeleccionaCantidadInmuebles(Convert.ToInt32(r.Field<int>("IdTipoDeInmueble"))) + ")", ImageUrl = "img/inbox.gif" });
                mailItems.Add(new { Name = r.Field <String>("NombreMenu"), ImageUrl = "img/inbox.gif" });
            }

            //mailItems.Add(new { Name = "1 DORMITORIO (" + bllInmuebles.SeleccionaCantidadInmuebles(8) + ")", ImageUrl = "img/inbox.gif" });
            //mailItems.Add(new { Name = "2 DORMITORIOS (" + bllInmuebles.SeleccionaCantidadInmuebles(9) + ")", ImageUrl = "img/drafts.gif" });
            //mailItems.Add(new { Name = "3 DORMITORIOS (" + bllInmuebles.SeleccionaCantidadInmuebles(10) + ")", ImageUrl = "img/outbox.gif" });
            //mailItems.Add(new { Name = "4 DORMITORIOS O MAS (" + bllInmuebles.SeleccionaCantidadInmuebles(11) + ")", ImageUrl = "img/junk.gif" });

            return(mailItems);
        }
Exemplo n.º 22
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
        {
        }
    }
Exemplo n.º 23
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(",", ".") + "&amp;zoom=15&amp;size=260x194&amp;sensor=false";
        }
        catch
        {
        }
    }
Exemplo n.º 24
0
        protected void cargarPropiedad()
        {
            try
            {
                Inmueble objInmueble = new Inmueble();
                objInmueble.IDInmueble       = Convert.ToInt32(Session["IdInmueble"].ToString());
                objInmueble.IDTipoDeInmueble = int.Parse(ddlTipoDeInmueble.SelectedValue.ToString());
                objInmueble.IDEstado         = int.Parse(ddlEstado.SelectedValue.ToString());
                objInmueble.IDOperacion      = int.Parse(ddlOperacion.SelectedValue.ToString());
                objInmueble.IDLocalidad      = int.Parse(ddlLocalidades.SelectedValue.ToString());
                objInmueble.IDZona           = int.Parse(ddlZonas.SelectedValue.ToString());
                objInmueble.IDProvincia      = int.Parse(ddlProvincias.SelectedValue.ToString());
                objInmueble.Calle            = txtCalle.Text;
                objInmueble.Numero           = txtNumero.Text;
                objInmueble.Piso             = txtPiso.Text;
                objInmueble.Departamento     = txtDepartamento.Text;
                objInmueble.Calle1           = txtCalle1.Text;
                objInmueble.Calle2           = txtCalle2.Text;
                objInmueble.MetrosCuadrados  = double.Parse(txtMetrosCuadrados.Text);


                if (txtAntiguedad.Text != "")
                {
                    objInmueble.AntiguedadA = int.Parse(txtAntiguedad.Text);
                }
                if (txtMetrosCuadradosSemi.Text != "")
                {
                    objInmueble.MetrosCuadradosSemiCubiertos = double.Parse(txtMetrosCuadradosSemi.Text);
                }
                if (txtFrente.Text != "")
                {
                    objInmueble.Frente = double.Parse(txtFrente.Text);
                }
                if (txtFondo.Text != "")
                {
                    objInmueble.Fondo = double.Parse(txtFondo.Text);
                }
                if (txtPrecioDeVenta.Text != "")
                {
                    objInmueble.PrecioVenta = double.Parse(txtPrecioDeVenta.Text);
                }
                if (txtPrecioDeAlquiler.Text != "")
                {
                    objInmueble.PrecioAlquiler = double.Parse(txtPrecioDeAlquiler.Text);
                }

                objInmueble.Observaciones = txtObservaciones.Content;
                objInmueble.Publica       = rblVisible.SelectedValue.ToString();
                objInmueble.Cocheras      = rblCocheras.SelectedValue.ToString();
                objInmueble.Antiguedad    = rblAntiguedad.SelectedValue.ToString();

                if (rblPosicion.SelectedValue.ToString() != "Sin Posición")
                {
                    objInmueble.Posicion = rblPosicion.SelectedValue.ToString();
                }

                objInmueble.MonedaAlquiler = ddlMonedaAlquiler.SelectedValue.ToString();
                objInmueble.MonedaVenta    = ddlMonedaVenta.SelectedValue.ToString();

                InmueblesBLL bllInmuebles = new InmueblesBLL();
                bllInmuebles.Update(objInmueble);
            }
            catch (Exception exe)
            {
                lblError.Text = exe.Message.ToString();
            }
        }