Beispiel #1
0
        public void SelectSession(BE.Session session)
        {
            //bool success = true;
            
            InvokeOperation<bool> assignAttendee = context.AssignAttendeeToSession(session.SessionId, personId);

            assignAttendee.Completed += delegate
            {
                bool success = assignAttendee.Value;

                if (success)
                {
                    var mySession =
                        (from s in MyAgenda
                         where s.StartTime == session.StartTime
                         select s).First();

                    if (mySession != null)
                    {
                        mySession.Title = session.Title;
                        mySession.Speaker = session.Speaker;
                        mySession.SessionId = session.SessionId;
                    }

                    NotifyOfPropertyChange(() => MyAgenda);

                    MyNotifyPropertyChanged("MyAgenda");
                }
                else
                {
                    System.Windows.MessageBox.Show("The session you have select is already full. \r Please choose another session.", "FYI", System.Windows.MessageBoxButton.OK);

                }
            };
        }
Beispiel #2
0
        public void RemoveSessionFromMyAgenda(BE.Session session)
        {
            InvokeOperation assignAttendee = context.DropSessionAttendee(session.SessionId, personId);

            assignAttendee.Completed += delegate { };

            var mySession =
                (from s in MyAgenda
                 where s.StartTime == session.StartTime
                 select s).First();

            if (mySession != null)
            {
                mySession.Title = "(empty slot)";
                mySession.Speaker = string.Empty;
                mySession.SessionId = 0;
            }

            NotifyOfPropertyChange(() => MyAgenda);

            MyNotifyPropertyChanged("MyAgenda");
        }