Beispiel #1
0
        public void Seleccionar()
        {
            if (DropDownList1.SelectedIndex == 0)
            {
                int id = Convert.ToInt32(TextBox1.Text);
                lista = ServicioBll.GetList(p => p.idServicio == id);
                GridView1.DataSource = lista;
                GridView1.DataBind();
            }
            else if (DropDownList1.SelectedIndex == 1)
            {
                if (TextBox1.Text == "")
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debe de Insertar el Nombre');</script>");
                }
                else
                {
                    lista = ServicioBll.GetList(p => p.nombre == TextBox1.Text);
                    GridView1.DataSource = lista;
                    GridView1.DataBind();
                }
            }
            else if (DropDownList1.SelectedIndex == 2)
            {
                lista = ServicioBll.GetListTodo();
                GridView1.DataSource = lista;
                GridView1.DataBind();
            }

            GridView1.DataSource = lista;
            GridView1.DataBind();
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Servicios servicio = new Servicios();

            /*GridView1.DataSource = BLL.ServicioBll.GetListTodo();
             * GridView1.DataBind();*/
            lista = ServicioBll.GetListTodo();
        }