예제 #1
0
        private void RefrescarDatos()
        {
            List <comunidades> comunidades = ComunidadORM.SelectAllComunidades();
            List <comunidades> comunidadesOriginal;

            comunidadesOriginal = (from c in comunidades
                                   let a = new comunidades()
            {
                id = c.id, nombre = GestorIdiomas.getComunidad(c.nombre)
            }
                                   select a).ToList();
            socios = SocioORM.SelectAllSocios();
            bindingSourceComunidades.DataSource = comunidadesOriginal;
            if (socios == null)
            {
                DialogResult result = MessageBox.Show(Strings.errorBD, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                if (result == DialogResult.OK || result == DialogResult.Abort)
                {
                    Application.Exit();
                }
            }
            else if ((bool)FormLogin.socioLogin.estatal)
            {
                bindingSourceSocios.DataSource = socios;
            }
            else
            {
                List <socios> sociosComunidad = SocioORM.SelectAllSociosByComunidad((int)FormLogin.socioLogin.id_comunidad);
                bindingSourceSocios.DataSource  = sociosComunidad;
                labelFilterComunidad.Visible    = false;
                comboBoxFilterComunidad.Visible = false;
                buttonClean.Visible             = false;
            }
        }
예제 #2
0
 private void pictureBoxLupa_Click(object sender, EventArgs e)
 {
     if (textBoxSearch.Text.Equals(""))
     {
         if (FormLogin.socioLogin.estatal)
         {
             bindingSourceSocios.DataSource = SocioORM.SelectAllSocios();
         }
         else
         {
             List <socios> sociosComunidad = SocioORM.SelectAllSociosByComunidad((int)FormLogin.socioLogin.id_comunidad);
             bindingSourceSocios.DataSource = sociosComunidad;
         }
     }
     else
     {
         String busqueda = textBoxSearch.Text;
         if (FormLogin.socioLogin.estatal)
         {
             bindingSourceSocios.DataSource = SocioORM.SelectSocioBySearch(busqueda);
         }
         else
         {
             bindingSourceSocios.DataSource = SocioORM.SelectSocioBySearchAndComunity(busqueda, FormLogin.socioLogin.id_comunidad.Value);
         }
     }
 }
예제 #3
0
 private void comboBoxFilterComunidad_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxFilterComunidad.SelectedItem != null)
     {
         List <socios> sociosFilter = SocioORM.SelectAllSociosByComunidad(int.Parse(comboBoxFilterComunidad.SelectedValue.ToString()));
         bindingSourceSocios.DataSource = sociosFilter;
     }
 }