Esempio n. 1
0
        public void SendInvitationToTargetedUser(CreateInvitationBindModel model)
        {
            var targetedUser = this.Data.GetById(model.TargetedUserId);
            var sender       = this.Data.GetById(model.SenderId);
            var team         = sender.MemberTeams.Where(t => !t.IsDeleted).FirstOrDefault(t => t.Id == model.TeamId);

            Invitation invitation = new Invitation()
            {
                User = targetedUser,
                Team = team,
            };

            targetedUser.Invitations.Add(invitation);
            this.invitations.Add(invitation);
            this.invitations.Save();
        }
Esempio n. 2
0
 public ActionResult SendInvitation([Bind(Include = "TargetedUserId, TeamId, SenderId")] CreateInvitationBindModel model)
 {
     this.service.SendInvitationToTargetedUser(model);
     return(this.RedirectToAction("AllUsers"));
 }