Beispiel #1
0
        public static comunidades SelectComunidad(int id)
        {
            comunidades comunidad = null;

            try
            {
                comunidad = (
                    from c in ORM.bd.comunidades
                    where c.id == id
                    select c).FirstOrDefault();
            }
            catch (EntityException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(comunidad);
        }
Beispiel #2
0
        public static List <socios> SelectAllSociosByComunidad(int id_comunidad)
        {
            List <socios> socios = null;
            comunidades   com    = ORM.bd.comunidades.Find(id_comunidad);

            try
            {
                socios = (
                    from s in ORM.bd.socios
                    where s.id_comunidad == id_comunidad
                    select s).ToList();
            }
            catch (EntityException ex)
            {
                SqlException sqlEx = (SqlException)ex.InnerException.InnerException;
                MessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            return(socios);
        }