/// <summary> /// Takes event and participant objects and creates a new EventParticipantType and returns it. /// </summary> /// <param name="evt"></param> /// <param name="participant"></param> /// <returns></returns> public static EventParticipantType AddParticipantType(Event evt, Participant participant) { var eventParticipantType = EventParticipantType.NewEventParticipantType(); eventParticipantType.Event = evt; eventParticipantType.ParticipantID = participant.ParticipantID; eventParticipantType.EventParticipantTypeName = participant.ParticipantGroup; return(eventParticipantType); }
/// <summary> /// Add an EventParticipantType /// </summary> /// <param name="participant"></param> /// <remarks>Check if an event participant type exists. If yes return it, otherwise create a /// new event participant type object and return it.</remarks> /// <returns></returns> public EventParticipantType AddEventParticipantType(Participant participant) { var eventParticipantType = this.EventParticipantTypes.FirstOrDefault(ept => ept.ParticipantID == participant.ParticipantID); if (eventParticipantType != null) { return(eventParticipantType); } eventParticipantType = EventParticipantType.AddParticipantType(this, participant); return(eventParticipantType); }
/// <summary> /// Deprecated Method for adding a new object to the EventParticipantTypes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEventParticipantTypes(EventParticipantType eventParticipantType) { base.AddObject("EventParticipantTypes", eventParticipantType); }
/// <summary> /// Create a new EventParticipantType object. /// </summary> /// <param name="eventParticipantTypeID">Initial value of the EventParticipantTypeID property.</param> /// <param name="eventID">Initial value of the EventID property.</param> /// <param name="participantID">Initial value of the ParticipantID property.</param> /// <param name="eventParticipantTypeName">Initial value of the EventParticipantTypeName property.</param> /// <param name="createdBy">Initial value of the CreatedBy property.</param> /// <param name="createdOn">Initial value of the CreatedOn property.</param> /// <param name="modifiedBy">Initial value of the ModifiedBy property.</param> /// <param name="modifiedOn">Initial value of the ModifiedOn property.</param> /// <param name="stamp">Initial value of the Stamp property.</param> /// <param name="active">Initial value of the Active property.</param> public static EventParticipantType CreateEventParticipantType(global::System.Int32 eventParticipantTypeID, global::System.Int32 eventID, global::System.Int32 participantID, global::System.String eventParticipantTypeName, global::System.Int32 createdBy, global::System.DateTime createdOn, global::System.Int32 modifiedBy, global::System.DateTime modifiedOn, global::System.Byte[] stamp, global::System.Boolean active) { EventParticipantType eventParticipantType = new EventParticipantType(); eventParticipantType.EventParticipantTypeID = eventParticipantTypeID; eventParticipantType.EventID = eventID; eventParticipantType.ParticipantID = participantID; eventParticipantType.EventParticipantTypeName = eventParticipantTypeName; eventParticipantType.CreatedBy = createdBy; eventParticipantType.CreatedOn = createdOn; eventParticipantType.ModifiedBy = modifiedBy; eventParticipantType.ModifiedOn = modifiedOn; eventParticipantType.Stamp = stamp; eventParticipantType.Active = active; return eventParticipantType; }
public static EventParticipantType NewEventParticipantType() { EventParticipantType newObject = new EventParticipantType(); BsoArchiveEntities.Current.AddToEventParticipantTypes(newObject); BsoArchiveEntities.SetDefaultValue(newObject); return newObject; }