示例#1
0
        public dynamic Themestat()
        {
            IserviceEvent spe = new ServiceEvent();
            var           eve = spe.GetAll();

            var _event = eve.GroupBy(s => s.theme).Select(s => new { thname = s.Key.designation, thval = s.Count() }).ToList();

            return(_event);
        }
示例#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 }));
        }
示例#3
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();
        }