private static void SetInstrumentDetails(System.Xml.Linq.XElement node, Instrument instrument, int instrumentID) { instrument.InstrumentID = instrumentID; string artistInstrument1 = node.GetXElement(Constants.Artist.artistInstrumentElement); string artistInstrument2 = node.GetXElement(Constants.Artist.artistInstrument2Element); instrument.Instrument1 = artistInstrument1; instrument.Instrument2 = artistInstrument2; }
public static EventArtist AddEventArtist(Event evt, Artist artist, Instrument instrument) { var eventArtist = EventArtist.NewEventArtist(); eventArtist.Event = evt; eventArtist.Artist = artist; eventArtist.Instrument = instrument; return eventArtist; }
/// <summary> /// Create a new Instrument object. /// </summary> /// <param name="instrumentID">Initial value of the InstrumentID property.</param> /// <param name="instrument1">Initial value of the Instrument1 property.</param> /// <param name="instrument2">Initial value of the Instrument2 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 Instrument CreateInstrument(global::System.Int32 instrumentID, global::System.String instrument1, global::System.String instrument2, global::System.Int32 createdBy, global::System.DateTime createdOn, global::System.Int32 modifiedBy, global::System.DateTime modifiedOn, global::System.Byte[] stamp, global::System.Boolean active) { Instrument instrument = new Instrument(); instrument.InstrumentID = instrumentID; instrument.Instrument1 = instrument1; instrument.Instrument2 = instrument2; instrument.CreatedBy = createdBy; instrument.CreatedOn = createdOn; instrument.ModifiedBy = modifiedBy; instrument.ModifiedOn = modifiedOn; instrument.Stamp = stamp; instrument.Active = active; return instrument; }
/// <summary> /// Deprecated Method for adding a new object to the Instruments EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToInstruments(Instrument instrument) { base.AddObject("Instruments", instrument); }
public static Instrument NewInstrument() { Instrument newObject = new Instrument(); BsoArchiveEntities.Current.AddToInstruments(newObject); BsoArchiveEntities.SetDefaultValue(newObject); return newObject; }
/// <summary> /// Add an event artist /// </summary> /// <param name="artist"></param> /// <param name="instrument"></param> /// <remarks> /// Check if the event artist exists. If it does then return the event artist object, otherwise /// create a new event artist object and return it. /// </remarks> /// <returns></returns> public EventArtist AddEventArtist(Artist artist, Instrument instrument) { var eventArtist = this.EventArtists.FirstOrDefault(ea => ea.ArtistID == artist.ArtistID && ea.InstrumentID == instrument.InstrumentID); if (eventArtist != null) return eventArtist; eventArtist = EventArtist.AddEventArtist(this, artist, instrument); return eventArtist; }