Ejemplo n.º 1
0
        public ActionResult Info(int id)
        {
            //获取用户的id
            int userID = Common.User.GetUserID(Session["Username"].ToString());
            //获取我加入的社团数据
            //获取每个社团审核通过的活动
            var activities = new BLL.clubActivity().GetModel(p => p.id == id & p.state == 1);
            //将需要的社团活动信息填充入list
            var model = new Activity();

            model.ActivityID    = activities.id;
            model.ActivityInfo  = activities.other;
            model.ActivityName  = activities.name;
            model.ActivityPlace = activities.place;
            model.ActivityTime  = activities.time;
            model.ClubID        = activities.clubID;
            model.ClubName      = Common.Club.getClubName(activities.clubID);

            var info = new ActivityMoreInfo();

            info.Activity = model;
            //获取活动的所有评论
            var comments = new BLL.comment().GetModels(p => p.actID == id).ToList();

            info.Comments = comments;

            return(View(info));
        }
Ejemplo n.º 2
0
        public ActionResult Mine()
        {
            //获取用户的id
            int userID = Common.User.GetUserID(Session["Username"].ToString());
            //获取我加入的社团数据
            var mineClub = new BLL.clubMember().GetModels(p => p.userid == userID);
            var list     = new List <Activity>();

            foreach (var item in mineClub)
            {
                //获取每个社团审核通过的活动
                var activities = new BLL.clubActivity().GetModels(p => p.clubID == item.clubid & p.state == 1);
                //将需要的社团活动信息填充入list

                foreach (var j in activities)
                {
                    var model = new Activity();
                    model.ActivityID    = j.id;
                    model.ActivityInfo  = j.other;
                    model.ActivityName  = j.name;
                    model.ActivityPlace = j.place;
                    model.ActivityTime  = j.time;
                    model.ClubID        = item.clubid;
                    model.ClubName      = Common.Club.getClubName(item.clubid);
                    //将活动信息添加到list中
                    list.Add(model);
                }
            }
            return(View(list));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 执行申请状态更新
        /// </summary>
        /// <param name="id"></param>
        /// <param name="state"></param>
        public void Update(int id, int state)
        {
            var bll   = new BLL.clubActivity();
            var model = bll.GetModel(p => p.id == id);

            model.state = state;
            bll.Update(model, new[] { "id", "state" });
            //更新申请个数
            ViewBag.ActivityApply = new BLL.clubActivity().GetRecordCount(p => p.state == 0);
        }
Ejemplo n.º 4
0
        public ActionResult Read(int id)
        {
            var bll   = new BLL.clubActivity();
            var model = bll.GetModel(p => p.id == id);

            model.state = 3;
            bll.Update(model, new[] { "id", "state" });
            var list = GetList();

            ViewBag.Result = list.Count;
            return(View("Index", list));
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Model.clubactivity> GetList()
        {
            int userID = Common.User.GetUserID(Session["Username"].ToString());
            //获取我管理的所有社团的活动申请结果
            var clubList = new BLL.clubManager().GetModels(p => p.userID == userID);
            //获取这些社团的活动信息
            var list = new List <Model.clubactivity>();

            foreach (var item in clubList)
            {
                var act = new BLL.clubActivity().GetModels(p => p.clubID == item.cludID & p.state != 0 & p.state != 3);
                foreach (var j in act)
                {
                    list.Add(j);
                }
            }
            return(list);
        }
Ejemplo n.º 6
0
        public BaseController()
        {
#if DEBUG
            ViewBag.Username = "******";
#endif
            //初始化页面数据,通过ViewBag传递给view
            //获取用户id
            BLL.user user      = new BLL.user();
            string   name      = ViewBag.Username;
            var      userModel = user.GetModel(p => p.name == name);
            //验证用户权限
            if (!new BLL.clubManager().Exist(p => p.userID == userModel.id))
            {
                //返回用户登录界面
                Response.Redirect("/manager/Login/Login");
            }

            ViewBag.Clubs = new BLL.ClubBLL().GetRecordCount();
            //获取我管理的所有社团的活动申请结果
            var clubList = new BLL.clubManager().GetModels(p => p.userID == userModel.id);
            //获取这些社团的活动信息
            var list = new List <Model.clubactivity>();
            foreach (var item in clubList)
            {
                var act = new BLL.clubActivity().GetModels(p => p.clubID == item.cludID & p.state != 0 & p.state != 3);
                foreach (var j in act)
                {
                    list.Add(j);
                }
            }
            //页面申请结果数量
            ViewBag.Result = list.Count;
            //页面入社申请结果数量
            var newMember      = new BLL.newMember();
            int newMemberCount = 0;
            foreach (var item in clubList)
            {
                var act = new BLL.clubActivity().GetModels(p => p.clubID == item.cludID & p.state != 0 & p.state != 3);
                newMemberCount += newMember.GetRecordCount(p => p.state == 0 & p.clubID == item.cludID);
            }
            ViewBag.NewMember = newMemberCount;
        }
Ejemplo n.º 7
0
        public BaseController()
        {
#if DEBUG
            ViewBag.Username = "******";
#endif
            //初始化页面数据,通过ViewBag传递给view
            //获取用户id
            BLL.user user      = new BLL.user();
            string   name      = ViewBag.Username;
            var      userModel = user.GetModel(p => p.name == name);

            //获取所有社团数
            DushBoard model = new DushBoard();
            model.Clubs = new BLL.ClubBLL().GetRecordCount();
            //获取我加入的社团数
            model.Mine = new BLL.clubMember().GetRecordCount(p => p.userid == userModel.id);
            //获取申请中的新社团
            model.NewClubs = new BLL.newMember().GetRecordCount(p => p.userID == userModel.id & p.state == 0);

            ViewBag.Clubs    = model.Clubs;
            ViewBag.Mine     = model.Mine;
            ViewBag.NewClubs = model.NewClubs;

            //获取通知与活动个数
            ViewBag.Message  = new BLL.messageBLL().GetRecordCount(p => p.to == userModel.id & p.state == 0);
            ViewBag.Activity = new BLL.clubActivity().GetRecordCount(p => p.state == 1);
            //获取我所有加入的社团,然后查询
            int count     = 0;
            var mineClubs = new BLL.clubMember().GetModels(p => p.userid == userModel.id);
            foreach (var item in mineClubs)
            {
                count += new BLL.clubActivity().GetRecordCount(p => p.clubID == item.clubid & p.state == 1);
            }
            ViewBag.mineActivity = count;
            //获取未读申请结果个数
            ViewBag.ApplyResult = new BLL.newMember().GetRecordCount(p => p.userID == userModel.id & p.state != 0 & p.state != 3);
            //未读的创办社团消息
            ViewBag.ClubApplyResult = new BLL.newClub().GetModels(p => p.userID == userModel.id & p.state != 0 & p.state != 3).ToList().Count;
            //申请中的社团
            ViewBag.ClubApply = new BLL.newClub().GetModels(p => p.userID == userModel.id & p.state == 0).ToList().Count;
        }
Ejemplo n.º 8
0
        // GET: teacher/NewActivity
        public ActionResult Index()
        {
            List <Activity> list = new List <Activity>();
            //获取未审核的活动
            var activities = new BLL.clubActivity().GetList(p => p.state == 0);

            //将需要的社团活动信息填充入list

            foreach (var item in activities)
            {
                var model = new Activity();
                model.ActivityID    = item.id;
                model.ActivityInfo  = item.other;
                model.ActivityName  = item.name;
                model.ActivityPlace = item.place;
                model.ActivityTime  = item.time;
                model.ClubID        = item.clubID;
                model.ClubName      = Common.Club.getClubName(item.clubID);
                //将活动信息添加到list中
                list.Add(model);
            }

            return(View(list));
        }