private Menu ConfirmDeleteSession(CallbackQuery callback) { Menu menu; var sessionId = SessionIdFromCallbackData(callback.data); var session = GetSessionById(sessionId); if (session == null) { menu = new NoMatchingSessionMenu(sessionId); } else { menu = new DeleteSessionConfirmMenu(session); } return(menu); }
private Menu MarkSessionLive(CallbackQuery callback) { Menu menu; var sessionId = SessionIdFromCallbackData(callback.data); var session = GetSessionById(sessionId); if (session == null) { menu = new NoMatchingSessionMenu(sessionId); } else { session.MarkLive(); _database.SaveSession(session); menu = new SessionCompleteLiveMenu(); } return(menu); }
private Menu DeleteSession(CallbackQuery callback) { Menu menu; var sessionId = SessionIdFromCallbackData(callback.data); var session = GetSessionById(sessionId); if (session == null) { menu = new NoMatchingSessionMenu(sessionId); } else { _sessions.Remove(session); _database.RemoveSession(session); menu = new DeleteSessionConfirmedMenu(); } return(menu); }