/// <summary> /// Create a new EventStatusOption object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="eventStatusID">Initial value of the EventStatusID property.</param> /// <param name="eventOptionID">Initial value of the EventOptionID property.</param> public static EventStatusOption CreateEventStatusOption(global::System.Guid id, global::System.Guid eventStatusID, global::System.Guid eventOptionID) { EventStatusOption eventStatusOption = new EventStatusOption(); eventStatusOption.ID = id; eventStatusOption.EventStatusID = eventStatusID; eventStatusOption.EventOptionID = eventOptionID; return eventStatusOption; }
/// <summary> /// Deprecated Method for adding a new object to the EventStatusOptions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEventStatusOptions(EventStatusOption eventStatusOption) { base.AddObject("EventStatusOptions", eventStatusOption); }
private void EventStatusOptionOnPropertyChanged(object sender, PropertyChangedEventArgs e) { IsDirty = true; var option = sender as EventOptionModel; if (e.PropertyName == "IsChecked") { if (option.IsChecked) { var eventStatusOption = new EventStatusOption() { ID = Guid.NewGuid(), EventStatusID = SelectedEventStatus.EventStatus.ID, EventOptionID = option.EventOption.ID }; _adminDataUnit.EventStatusOptionsRepository.Add(eventStatusOption); } else { var eventStatusOption = SelectedEventStatus.EventStatus.EventStatusOptions.FirstOrDefault(x => x.EventOptionID == option.EventOption.ID); _adminDataUnit.EventStatusOptionsRepository.Delete(eventStatusOption); } SaveChangesCommand.RaiseCanExecuteChanged(); } }