Ejemplo n.º 1
0
 public EventsController(EventInterface iEvent, GameInterface iGame, CharacterInterface iChar, AccountInterface iAcct)
 {
     eventInterface = iEvent;
     charInterface = iChar;
     gameInterface = iGame;
     accountInterface = iAcct;
 }
Ejemplo n.º 2
0
        public CommitResponse AddNewEventAttendee(int charID, int eventID, int roleID, string note, int status, int? memberID)
        {
            int memID = 0;
            if (memberID != null)
                memID = (int)memberID;
            else
            {
                Member Member = new AccountInterface(LeetRaidsDB).GetMemberByCharacterID(charID);
                memID = Member.MemberID;
            }

            EventAttendee attendee = new EventAttendee()
            {
                CharacterID = charID,
                EventID = eventID,
                RoleID = roleID,
                Note = String.Empty,
                Status = status,
                MemberID = memID
            };

            bool success = false;

            try
            {

                if (IsMemberAlreadyAttendee(eventID, memID))
                {
                    return new CommitResponse() { success = false, errorMsg = Errors.MEMBER_ALREADY_HAS_CHARACTER_IN_EVENT };
                }
                LeetRaidsDB.EventAttendees.InsertOnSubmit(attendee);
                LeetRaidsDB.SubmitChanges();
                success = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return new CommitResponse() { success = success };
        }
Ejemplo n.º 3
0
 public AccountController(AccountInterface currentAccountInterface, GameInterface currentGameInterface, CharacterInterface currentCharInterface)
 {
     accountInterface = currentAccountInterface;
     gameInterface = currentGameInterface;
     charInterface = currentCharInterface;
 }