예제 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EventPresentations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEventPresentations(EventPresentation eventPresentation)
 {
     base.AddObject("EventPresentations", eventPresentation);
 }
예제 #2
0
 private void AddClosed(object sender, DeactivationEventArgs e)
 {
     if (vm.WasCancelled)
         return;
     if (!context.IsSubmitting)
     {
         var newPresentation = vm.Presentation;
         BusyMessage = "Adding New Presentation...Please wait.";
         IsBusy = true;
         // verify we are truly adding a new presentation
         if (newPresentation.Id == 0)
         {
             // Map Model.Presentation to new Presentation
             var entityPresentation = new Presentation
                                          {
                                              Name = newPresentation.Name,
                                              Description = newPresentation.Description,
                                              Level = newPresentation.Level
                                          };
             // default EventPresentation status is Registered
             var eventPresentation = new EventPresentation
                                         {
                                             EventId = App.Event.Id,
                                             ApprovalStatus = "Registered",
                                             PresentationId = newPresentation.Id
                                         };
             var presentationSpeaker = new PresentationSpeaker
                                           {
                                               PresentationsAsSpeaker_Id = newPresentation.Id,
                                               Speakers_Id = App.LoggedInPerson.Id
                                           };
             entityPresentation.EventPresentations.Add(eventPresentation);
             entityPresentation.PresentationSpeakers.Add(presentationSpeaker);
             context.Presentations.Add(entityPresentation);
         }
         try
         {
             context.SubmitChanges(ChangesSubmitted, null);
         }
         catch (DomainOperationException dex)
         {
             EventAggregator.Publish(new ErrorWindowEvent {Exception = dex, ViewModelName = "SpeakerViewModel"});
             _loggingService.LogException(dex);
         }
     }
 }
예제 #3
0
 /// <summary>
 /// Create a new EventPresentation object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="presentationId">Initial value of the PresentationId property.</param>
 /// <param name="approvalStatus">Initial value of the ApprovalStatus property.</param>
 /// <param name="eventId">Initial value of the EventId property.</param>
 public static EventPresentation CreateEventPresentation(global::System.Int32 id, global::System.Int32 presentationId, global::System.String approvalStatus, global::System.Int32 eventId)
 {
     EventPresentation eventPresentation = new EventPresentation();
     eventPresentation.Id = id;
     eventPresentation.PresentationId = presentationId;
     eventPresentation.ApprovalStatus = approvalStatus;
     eventPresentation.EventId = eventId;
     return eventPresentation;
 }