Ejemplo n.º 1
0
 public ActionResult UnsubscribeAnEvent(int userId, int EventId)
 {
     DML.UsersToEvent usersToEvent = new DML.UsersToEvent();
     usersToEvent.EventID = EventId;
     usersToEvent.UserID  = userId; //BLL.UserManager.GetByUsername(User.Identity.Name, BLL.UserManager.UserRelatedData.None).ID;
     BLL.UsersToEventManager.Remove(usersToEvent);
     return(RedirectToAction("EventSingle", "Event", new { id = EventId }));
 }
Ejemplo n.º 2
0
        public ActionResult JoinAnEvent(int id, int groupID)
        {
            if (!BLL.UsersToGroupManager.IsMember(Core.SessionManager.UserID, groupID) && !BLL.EventManager.GetEventByID(id).IsPublic)
            {
                return(RedirectToAction("NotFound", "Error"));
            }

            DML.UsersToEvent usersToEvent = new DML.UsersToEvent();
            usersToEvent.EventID = id;
            usersToEvent.UserID  = Core.SessionManager.UserID;

            Event events = BLL.EventManager.GetEventByID(id, EventManager.EventRelatedData.User);

            if (events.UsersToEvents.Count < events.MaxUsers)
            {
                BLL.UsersToEventManager.Add(usersToEvent);
            }

            return(RedirectToAction("EventSingle", "Event", new { id = id }));
        }