protected void Page_Load(object sender, EventArgs e)
        {
            Miembros  m      = new Miembros();
            DataTable dt     = new DataTable();
            string    filtro = "1=1";

            MiembrosDataGrid.DataSource = m.Listado(" * ", filtro, "");
            MiembrosDataGrid.DataBind();
        }
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            Miembros Consulta = new Miembros();
            string   filtro   = "1=1";

            if (BuscartextBox.Text.Length > 0)
            {
                filtro = BuscarcomboBox.Text + " like '%" + BuscarcomboBox.Text + "%'";
            }

            MiembrosdataGridView.DataSource = Consulta.Listado("MiembroId, Nombres, Apellidos, Parentesco", filtro, "");
        }
Esempio n. 3
0
        public void LlenarDropDownList()
        {
            Cuentas      cuenta     = new Cuentas();
            TiposEgresos tipoEgreso = new TiposEgresos();
            Miembros     miembro    = new Miembros();

            CuentaIdDropDownList.DataSource     = cuenta.Listado(" * ", "1=1", "");
            CuentaIdDropDownList.DataTextField  = "Descripcion";
            CuentaIdDropDownList.DataValueField = "CuentaId";
            CuentaIdDropDownList.DataBind();

            TipoEgresoIdDropDownList.DataSource     = tipoEgreso.Listado(" * ", "1=1", "");
            TipoEgresoIdDropDownList.DataTextField  = "Descripcion";
            TipoEgresoIdDropDownList.DataValueField = "TipoEgresoId";
            TipoEgresoIdDropDownList.DataBind();

            MiembroIdDropDownList.DataSource     = miembro.Listado(" * ", "1=1", "");
            MiembroIdDropDownList.DataTextField  = "Nombre";
            MiembroIdDropDownList.DataValueField = "MiembroId";
            MiembroIdDropDownList.DataBind();
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                FechaTexBox.Text = DateTime.Now.ToString();

                MiembroDropDownList.DataSource     = Miembro.Listado(" * ", "1=1", "");
                MiembroDropDownList.DataTextField  = "Nombre";
                MiembroDropDownList.DataValueField = "MiembroId";
                MiembroDropDownList.DataBind();

                CuentaDropDownList.DataSource     = Cuenta.Listado(" * ", "1=1", "");
                CuentaDropDownList.DataTextField  = "Descripcion";
                CuentaDropDownList.DataValueField = "CuentaId";
                CuentaDropDownList.DataBind();

                TipoIngresoDropDownList.DataSource     = TipodeIngreso.Listado(" * ", "1=1", "");
                TipoIngresoDropDownList.DataTextField  = "Descripcion";
                TipoIngresoDropDownList.DataValueField = "TipoIngresoId";
                TipoIngresoDropDownList.DataBind();
            }
        }
        protected void BtnBuscar_Click(object sender, EventArgs e)
        {
            Miembros  m      = new Miembros();
            DataTable dt     = new DataTable();
            string    filtro = "1=1";

            if (BuscarPorDropdown.SelectedIndex == 0) // MiembroId
            {
                if (TbFiltro.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "MiembroId = " + TbFiltro.Text;
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 1) //Nombre de miembro
            {
                if (TbFiltro.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "Nombre like '%" + TbFiltro.Text + "%'";
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 2) // esActivo
            {
                if (TbFiltro.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "esActivo = " + TbFiltro.Text;
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 3) //UsuarioId
            {
                if (TbFiltro.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "UsuarioId = " + TbFiltro.Text;
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 4) //apellido
            {
                if (TbFiltro.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "Apellidos like '%" + TbFiltro.Text + "%'";
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 5) //parentesco
            {
                if (TbFiltro.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "Parentesco like '%" + TbFiltro.Text + "%'";
                }
            }
            dt = m.Listado("MiembroId, Nombre, esActivo, UsuarioId, Apellidos, Parentesco ", filtro, "");
            MiembrosDataGrid.DataSource = dt;
            MiembrosDataGrid.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Miembros miembro = new Miembros();

                MiembrosRptViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
                MiembrosRptViewer.Reset();
                MiembrosRptViewer.LocalReport.ReportPath = Server.MapPath(@"~\Rpts/MiembrosRpt.rdlc");

                MiembrosRptViewer.LocalReport.DataSources.Clear();

                MiembrosRptViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("Miembros", miembro.Listado(" * ", "1=1", "")));
                MiembrosRptViewer.LocalReport.Refresh();
            }
        }
Esempio n. 7
0
        public void ListadoTest()
        {
            Miembros miembro = new Miembros();

            Assert.IsTrue(miembro.Listado(" * ", "1=1", "").Rows.Count > 0);
        }