예제 #1
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;
            }
        }
예제 #2
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());
        }