Пример #1
0
        public static String Delete(ref String missatge, esdeveniments esdeveniment)
        {
            Orm.bd.esdeveniments.Remove(esdeveniment);

            missatge = Orm.mySaveChanges();

            return(missatge);
        }
Пример #2
0
        public static String Insert(ref String missatge, esdeveniments nouEsdeveniment)
        {
            Orm.bd.esdeveniments.Add(nouEsdeveniment);

            missatge = Orm.mySaveChanges();

            return(missatge);
        }
Пример #3
0
        public static String Update(ref String missatge, esdeveniments esdeveniment)
        {
            try
            {
                Orm.bd.SaveChanges();
            }
            catch (DbUpdateException ex)
            {
                SqlException sqlException = (SqlException)ex.InnerException.InnerException;
                missatge = Orm.missatgeError(sqlException);
            }

            return(missatge);
        }
Пример #4
0
        public static dynamic Select(esdeveniments esdeveniment)
        {
            var data = esdeveniment.assistir.Join(
                Orm.bd.socis,
                assistir => assistir.id_soci,
                socis => socis.id,
                (assistir, socis) => new
            {
                numSoci   = socis.num,
                nomSoci   = socis.nom,
                text      = assistir.textValoracio,
                puntuacio = assistir.valoracio,
                id        = socis.id,
                cognoms   = socis.cognoms,
                asistents = assistir.quantitat_persones
            }).ToList();

            return(data);
        }