Beispiel #1
0
        public void ChangeJoinMethod(Party party, JoinMethodEnum joinMethod)
        {
            party.JoinMethodID = (int)joinMethod;
            DeleteAllPartyInvites(party);

            ConditionalSaveChanges(partyRepository);
        }
        public ActionResult ChangeJoinMethod(JoinMethodEnum joinMethod, int partyID)
        {
            var party   = partyRepository.GetById(partyID);
            var citizen = SessionHelper.LoggedCitizen;

            MethodResult result;

            if ((result = partyService.CanChangeJoinMethod(citizen, party)).IsError)
            {
                return(RedirectBackWithError(result));
            }

            partyService.ChangeJoinMethod(party, joinMethod);

            AddInfo("Join method was changed!");
            return(RedirectToAction("View", new { partyID = partyID }));
        }