Example #1
0
        public ActionResult Read(int id)
        {
            var bll   = new BLL.newMember();
            var model = bll.GetModel(p => p.id == id);

            model.state = 3;
            bll.Update(model, new[] { "id", "state" });
            int userID = Common.User.GetUserID(Session["Username"].ToString());

            ViewBag.ApplyResult = bll.GetRecordCount(p => p.userID == userID & p.state != 0 & p.state != 3);
            var list = new BLL.newMember().GetModels(p => p.userID == userID & p.state != 0 & p.state != 3);

            return(View("Result", list));
        }
Example #2
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;
        }
Example #3
0
        //执行添加操作
        public bool ExectudeQuit(int clubID)
        {
            int userID = Common.User.GetUserID(Session["Username"].ToString());

            //回传给前台view的model
            var bll = new BLL.newMember();
            //判断是否提交了社团的申请且申请未通过审核
            //state为0表示暂未审核
            bool hasApply = bll.Exist(p => (p.userID == userID & p.clubID == clubID & p.state == 0));

            if (hasApply)
            {
                //删除记录
                var model = bll.GetModel(p => (p.userID == userID & p.clubID == clubID & p.state == 0));
                bll.Delete(model, false);
                ViewBag.NewClubs = bll.GetRecordCount(p => (p.userID == userID & p.state == 0));;
                return(true);
            }
            else
            {
                return(false);
            }
        }