public JsonResult Join()
        {
            if (!Permission.LoginedNeed(Request, Response, Session))
            {
                return(Json(false));
            }

            User  user  = (User)Session["user"];
            int   gid   = Convert.ToInt32(Request["gid"]);
            Group group = GroupView.GetGroupById(gid);

            if (group == null || group.allow_join == false)
            {
                Json(false);
            }
            if (GroupView.GetGroupMember(user.uid, gid) != null)
            {
                return(Json(false));
            }
            GroupMember member = new GroupMember
            {
                uid  = user.uid,
                gid  = gid,
                rank = (int)MemberRank.MEMBER
            };

            return(Json(GroupView.AddMember(gid, member)));
        }
        public ActionResult Detail(int id = 0)
        {
            if (!Permission.LoginedNeed(Request, Response, Session))
            {
                return(null);
            }

            User        user       = (User)Session["user"];
            GroupMember memberInfo = GroupView.GetGroupMember(user.uid, id);

            if (memberInfo == null)
            {
                Permission.BackToPrevPageOrIndex(Request, Response);
                return(null);
            }

            ViewBag.memberInfo = memberInfo;
            ViewBag.group      = GroupView.GetGroupById(id);
            ViewBag.members    = GroupView.GetGroupMemberByGID(id).Take(5).ToList();

            return(View());
        }