예제 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Presentations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPresentations(Presentation presentation)
 {
     base.AddObject("Presentations", presentation);
 }
예제 #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 Presentation object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="level">Initial value of the Level property.</param>
 public static Presentation CreatePresentation(global::System.Int32 id, global::System.String name, global::System.String description, global::System.String level)
 {
     Presentation presentation = new Presentation();
     presentation.Id = id;
     presentation.Name = name;
     presentation.Description = description;
     presentation.Level = level;
     return presentation;
 }