コード例 #1
0
        protected void btnPersonas_Click(object sender, EventArgs e)
        {
            activosController ac = new activosController();
            pruebaEntities    db = new pruebaEntities();

            GridViewTodo.DataSource = db.personas.ToList();
            GridViewTodo.DataBind();
        }
コード例 #2
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            activosController ac = new activosController();
            pruebaEntities    db = new pruebaEntities();

            if (txtID.Text != "" && dropTipo.Text != "" && calCompra.SelectedDate != null && txtSerial.Text != "")
            {
                int id = Convert.ToInt32(txtID.Text);
                GridViewTodo.DataSource = ac.Getactivo(id);
            }
            else
            {
                GridViewTodo.DataSource = db.activos.ToList();
            }
            GridViewTodo.DataBind();
        }