void SetStatusInvitationnForJoinGroupEventModule_After(Invitation sender, CommonEventArgs eventArgs) { if (eventArgs.EventOperationType == EventOperationType.Instance().Update()) { InvitationService invitationService = DIContainer.Resolve<InvitationService>(); Invitation invitation = invitationService.Get(sender.Id); if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().InviteJoinGroup() && invitation.Status == InvitationStatus.Accept) { GroupService groupService = new GroupService(); GroupMember member=GroupMember.New(); member.GroupId=sender.RelativeObjectId; member.UserId = sender.UserId; member.IsManager = false; groupService.CreateGroupMember(member); } else if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().ApplyJoinGroup() && invitation.Status == InvitationStatus.Accept) { GroupService groupService = new GroupService(); GroupMember member = GroupMember.New(); member.GroupId = sender.RelativeObjectId; member.UserId = sender.SenderUserId; member.IsManager = false; groupService.CreateGroupMember(member); IEnumerable<long> a= groupService.GetGroupMemberApplies(sender.RelativeObjectId,GroupMemberApplyStatus.Pending,20,1).Where(n=>n.UserId==sender.SenderUserId).Select(m=>m.Id); groupService.ApproveGroupMemberApply(a,true); } else if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().ApplyJoinGroup() && invitation.Status == InvitationStatus.Refuse) { GroupService groupService = new GroupService(); IEnumerable<long> a = groupService.GetGroupMemberApplies(sender.RelativeObjectId, GroupMemberApplyStatus.Pending, 20, 1).Where(n => n.UserId == sender.SenderUserId).Select(m => m.Id); groupService.ApproveGroupMemberApply(a,false); } } }
void SetStatusInvitationnForJoinGroupEventModule_After(Invitation sender, CommonEventArgs eventArgs) { if (eventArgs.EventOperationType == EventOperationType.Instance().Update()) { InvitationService invitationService = DIContainer.Resolve <InvitationService>(); Invitation invitation = invitationService.Get(sender.Id); if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().InviteJoinGroup() && invitation.Status == InvitationStatus.Accept) { GroupService groupService = new GroupService(); GroupMember member = GroupMember.New(); member.GroupId = sender.RelativeObjectId; member.UserId = sender.UserId; member.IsManager = false; groupService.CreateGroupMember(member); } else if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().ApplyJoinGroup() && invitation.Status == InvitationStatus.Accept) { GroupService groupService = new GroupService(); GroupMember member = GroupMember.New(); member.GroupId = sender.RelativeObjectId; member.UserId = sender.SenderUserId; member.IsManager = false; groupService.CreateGroupMember(member); IEnumerable <long> a = groupService.GetGroupMemberApplies(sender.RelativeObjectId, GroupMemberApplyStatus.Pending, 20, 1).Where(n => n.UserId == sender.SenderUserId).Select(m => m.Id); groupService.ApproveGroupMemberApply(a, true); } else if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().ApplyJoinGroup() && invitation.Status == InvitationStatus.Refuse) { GroupService groupService = new GroupService(); IEnumerable <long> a = groupService.GetGroupMemberApplies(sender.RelativeObjectId, GroupMemberApplyStatus.Pending, 20, 1).Where(n => n.UserId == sender.SenderUserId).Select(m => m.Id); groupService.ApproveGroupMemberApply(a, false); } } }
void SetStatusInvitationnForJoinGroupEventModule_After(Invitation sender, CommonEventArgs eventArgs) { if (eventArgs.EventOperationType == EventOperationType.Instance().Update()) { InvitationService invitationService = DIContainer.Resolve <InvitationService>(); Invitation invitation = invitationService.Get(sender.Id); if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().InviteJoinGroup() && invitation.Status == InvitationStatus.Accept) { GroupService groupService = new GroupService(); GroupMember member = GroupMember.New(); member.GroupId = sender.RelativeObjectId; member.UserId = sender.UserId; member.IsManager = false; groupService.CreateGroupMember(member); } else if (invitation != null && invitation.InvitationTypeKey == InvitationTypeKeys.Instance().ApplyJoinGroup() && invitation.Status == InvitationStatus.Accept) { GroupService groupService = new GroupService(); GroupMember member = GroupMember.New(); member.GroupId = sender.RelativeObjectId; member.UserId = sender.SenderUserId; member.IsManager = false; groupService.CreateGroupMember(member); } } }