示例#1
0
 /// <summary>
 /// Create a new EventTypeOption object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="eventTypeID">Initial value of the EventTypeID property.</param>
 /// <param name="eventOptionID">Initial value of the EventOptionID property.</param>
 public static EventTypeOption CreateEventTypeOption(global::System.Guid id, global::System.Guid eventTypeID, global::System.Guid eventOptionID)
 {
     EventTypeOption eventTypeOption = new EventTypeOption();
     eventTypeOption.ID = id;
     eventTypeOption.EventTypeID = eventTypeID;
     eventTypeOption.EventOptionID = eventOptionID;
     return eventTypeOption;
 }
示例#2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EventTypeOptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEventTypeOptions(EventTypeOption eventTypeOption)
 {
     base.AddObject("EventTypeOptions", eventTypeOption);
 }
示例#3
0
        private void EventTypeOptionOnPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            IsDirty = true;

            var option = sender as EventOptionModel;

            if (e.PropertyName == "IsChecked")
            {
                if (option.IsChecked)
                {
                    var eventTypeOption = new EventTypeOption()
                    {
                        ID = Guid.NewGuid(),
                        EventTypeID = SelectedEventType.EventType.ID,
                        EventOptionID = option.EventOption.ID
                    };

                    _adminDataUnit.EventTypeOptionsRepository.Add(eventTypeOption);
                }
                else
                {
                    var eventTypeOption = SelectedEventType.EventType.EventTypeOptions.FirstOrDefault(x => x.EventOptionID == option.EventOption.ID);
                    _adminDataUnit.EventTypeOptionsRepository.Delete(eventTypeOption);
                }

                SaveChangesCommand.RaiseCanExecuteChanged();
            }
        }