public void AddSupplierInvitation(List <int> checkedCommericalRegesterNo, List <int> unCheckedcommericalRegesterNo) { List <int> commericalNos = new List <int>(); foreach (var item in Invitations.Where(x => x.InvitationTypeId == 1 && x.StatusId != (int)Enums.InvitationStatus.Approved && x.IsActive == true)) { commericalNos.Add(item.CommericalRegisterNo); } foreach (var item in checkedCommericalRegesterNo) { if (!commericalNos.Contains(item)) { Invitations.Add(new Invitation(item, Enums.InvitationStatus.New, Enums.InvitationRequestType.Invitation)); } } foreach (var item in unCheckedcommericalRegesterNo) { Invitation invitation = Invitations.Where(x => x.CommericalRegisterNo == item && x.IsActive == true).FirstOrDefault(); if (invitation != null) { invitation.DeActive(); } } EntityUpdated(); }
public void OnInvitationResponse(string room) { _guiDispatcher.Invoke(() => { var invitation = Invitations.Where(i => i.Room == room).FirstOrDefault(); Invitations.Remove(invitation); }); }
public void InitInvitations(User user) { user.Invitations = Invitations.Where(x => x.SendFromUserId == user.Id).ToList(); foreach (var invitation in user.Invitations) { invitation.SendToUser = Users.SingleOrDefault(x => x.Id == invitation.SendToUserId); } }
public void InitRequests(User user) { user.Requests = Invitations.Where(x => x.SendToUserId == user.Id).ToList(); foreach (var request in user.Requests) { request.SendFromUser = Users.SingleOrDefault(x => x.Id == request.SendFromUserId); } }