Пример #1
0
        public void delete_admin(Admin _admin)
        {
            IserviceEvent spe = new ServiceEvent();
            int           id  = this.Get(x => x.isSuperAdmin == true).idAdmin;
            List <Event>  eve = spe.GetMany(x => x.adminid == _admin.idAdmin).ToList();

            foreach (Event i in eve)
            {
                i.adminid = id;
                spe.Update(i);
                spe.Commit();
            }
            this.Delete(_admin);
            this.Commit();
        }
Пример #2
0
        public dynamic Univstat()
        {
            IserviceEvent spe      = new ServiceEvent();
            IserviceUniv  spun     = new serviceUniv();
            int           total    = spe.GetAll().Count();
            var           univstat = spun.GetAll().Select(x => new { name = x.UnivName, y = spe.GetMany(s => s.hostedby.idUniv == x.idUniv).Count() }).ToList();


            return(univstat.Select(x => new { name = x.name, y = x.y }));
        }