Beispiel #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Events EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEvents(Event @event)
 {
     base.AddObject("Events", @event);
 }
Beispiel #2
0
        public void Save(Event i_event)
        {
            if (!_eventStore.Contains(i_event))
            {
                /*auto-increment field for competitorID did not seem to
                 work with LinQ for Data Entity Model*/
                long newid = 1;
                if ((from p in hardcardContext.Events
                     select p.EventID).Count() > 0)
                {
                    newid = (from p in hardcardContext.Events
                             select p.EventID).Max() + 1;

                }

                i_event.EventID = newid;

                // fixed to save new events
                i_event.Deleted = false;

                hardcardContext.AddToEvents(i_event);
                hardcardContext.SaveChanges();
                _eventStore.Add(i_event);
            }
            else
            {
                hardcardContext.SaveChanges();
            }
        }
Beispiel #3
0
 /// <summary>
 /// Create a new Event object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="eventName">Initial value of the EventName property.</param>
 public static Event CreateEvent(global::System.Int64 id, global::System.String eventName)
 {
     Event @event = new Event();
     @event.Id = id;
     @event.EventName = eventName;
     return @event;
 }
Beispiel #4
0
 public void Delete(Event i_event)
 {
     i_event.Deleted = true;
     hardcardContext.SaveChanges();
     _eventStore.Remove(i_event);
 }