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 SwitchboardInvitation CreateInvitation(User invitee) { SwitchboardInvitation invite = new SwitchboardInvitation(this, invitee); Invitations.Add(invite); return(invite); }
public void OnGameInvitation(string room, string sender) { _guiDispatcher.Invoke(() => { var invitation = new Invitation(sender, room); invitation.OnResponse += OnInvitationResponse; Invitations.Add(invitation); }); }
/// <inheritdoc /> /// <summary> /// Invites the specified character spawn. /// </summary> /// <param name="characterSpawn">The character spawn.</param> /// <exception cref="T:System.NotImplementedException"></exception> public void Invite(ICharacterSpawn characterSpawn) { if (Invitations.Contains(characterSpawn)) { return; } Invitations.Add(characterSpawn); }
internal void AddInvitation(Invitation newInvitation) { if (newInvitation.ToUser.Equals(Id)) { Invitations.Add(newInvitation); } //TODO: create exception class else { throw new ArgumentException("User's ids are not equal"); } }
/// <summary> /// Add a mapping for another application (user will gain access to all applications once the invitation is accepted). /// </summary> /// <param name="applicationId">application id</param> /// <param name="invitedByUser">user that made this invitation</param> /// <exception cref="ArgumentNullException">invitedByUser</exception> /// <exception cref="ArgumentOutOfRangeException">applicationId</exception> public void Add(int applicationId, string invitedByUser) { if (invitedByUser == null) { throw new ArgumentNullException("invitedByUser"); } if (applicationId <= 0) { throw new ArgumentOutOfRangeException("applicationId"); } Invitations.Add(new ApplicationInvitation { ApplicationId = applicationId, InvitedBy = invitedByUser, InvitedAtUtc = DateTime.UtcNow }); }
public void SendRequestForTender(int supplierId) { Invitations.Add(new Invitation(supplierId, Enums.InvitationStatus.New, Enums.InvitationRequestType.Request)); EntityUpdated(); }
internal void AddInvitation(Invitation invitation) { Invitations.Add(invitation); }