コード例 #1
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            string        Condicion = "";
            UsuariosClass Usuario   = new UsuariosClass();

            if (string.IsNullOrWhiteSpace(BuscarTextBox.Text))
            {
                Condicion = "1=1";
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(BuscarTextBox.Text))
                {
                    Condicion = CamposDropDownList.SelectedValue + " like '%" + BuscarTextBox.Text + "%'";
                }
            }
            ConsultaGridView.DataSource = Usuario.Listado("Nombres, Apellidos, Telefono, Email, Direccion, NombreUsuario, Contrasenia", Condicion, "");
            ConsultaGridView.DataBind();
        }
コード例 #2
0
        private void CargarDropDownList()
        {
            UsuariosClass Usuario = new UsuariosClass();

            UsuarioIdDropDownList.DataSource     = Usuario.Listado(" * ", "1=1", "");
            UsuarioIdDropDownList.DataTextField  = "NombreUsuario";
            UsuarioIdDropDownList.DataValueField = "UsuarioId";
            UsuarioIdDropDownList.DataBind();

            EventosClass Evento = new EventosClass();

            EventoDropDownList.DataSource     = Evento.Listado(" * ", "1=1", "");
            EventoDropDownList.DataTextField  = "NombreEvento";
            EventoDropDownList.DataValueField = "EventoId";
            EventoDropDownList.DataBind();

            EventosDetalleClass Ticket = new EventosDetalleClass();

            TicketDropDownList.DataSource     = Ticket.Listado(" * ", "1=1", "");
            TicketDropDownList.DataTextField  = "DescTicket";
            TicketDropDownList.DataValueField = "PrecioTicket";
            TicketDropDownList.DataBind();
        }