public void AcceptGroupJoinRequest(long groupId, long userId) { if (!IsHeadman(groupId)) { throw new Exception("只有组长才能同意进组请求"); } GroupMember m = member_repo.GetFirstOrDefaultObject(g => g.GroupId == groupId && g.MemberId == userId); m.IsAccepted = true; member_repo.Save(m); }
public void AcceptGroupJoinRequest(long groupId, long userId) { Account account = Server.HttpContext.Session["Account"] as Account; Group gp = GetObject(groupId); if (gp.HeadmanId != account.Id) { throw new Exception("只有组长才能同意进组请求"); } GroupMember m = member_repo.GetFirstOrDefaultObject(g => g.GroupId == groupId && g.MemberId == userId); m.IsAccepted = true; member_repo.Save(m); }