public void RegisterSpeakerForEvent(Speaker speaker, Event ev)
 {
     EventsSpeaker evs =
         _conferenceware.EventsSpeakers.SingleOrDefault(
             x => x.Speaker == speaker && x.Event == ev);
     if (evs == null)
     {
         evs = new EventsSpeaker { Speaker = speaker, Event = ev };
         _conferenceware.EventsSpeakers.InsertOnSubmit(evs);
     }
 }
 public void UnRegisterAttendeeForEvent(Attendee attendee, Event ev)
 {
     EventsAttendee eva =
         _conferenceware.EventsAttendees.SingleOrDefault(
             x => x.Attendee == attendee && x.Event == ev);
     _conferenceware.EventsAttendees.DeleteOnSubmit(eva);
 }
		private void detach_Events(Event entity)
		{
			this.SendPropertyChanging();
			entity.Location = null;
		}
 public void RegisterAttendeeForEvent(Attendee attendee, Event ev)
 {
     EventsAttendee eva =
         _conferenceware.EventsAttendees.SingleOrDefault(
             x => x.Attendee == attendee && x.Event == ev);
     if (eva == null)
     {
         eva = new EventsAttendee { Attendee = attendee, Event = ev };
         _conferenceware.EventsAttendees.InsertOnSubmit(eva);
     }
 }
Esempio n. 5
0
 public void RegisterAttendeeForEvent(Attendee attendee, Event ev)
 {
     var eva = new EventsAttendee();
     eva.Attendee = attendee;
     eva.Event = ev;
     ev.EventsAttendees.Insert(0, eva);
     attendee.EventsAttendees.Insert(0, eva);
 }
Esempio n. 6
0
 public void UnRegisterAttendeeForEvent(Attendee attendee, Event ev)
 {
     throw new NotImplementedException();
 }
Esempio n. 7
0
        public ActionResult Create(FormCollection collection)
        {
            var eventToCreate = new Event();

            // This will try to update all the fields in the model based on the form collection
            if (TryUpdateModel(eventToCreate, "Event", collection))
            {
                _repository.AddEvent(eventToCreate);
                _repository.Save();
                return RedirectToAction("Index");
            }
            return View("Create", MakeEditDataFromEvent(eventToCreate));
        }
Esempio n. 8
0
 public void AddEvent(Event ev)
 {
     ev.id = ++_eventMaxId;
     _events.Add(ev);
 }
 partial void UpdateEvent(Event instance);
 partial void DeleteEvent(Event instance);
 partial void InsertEvent(Event instance);
		private void detach_Events(Event entity)
		{
			this.SendPropertyChanging();
			entity.TimeSlot = null;
		}
		private void attach_Events(Event entity)
		{
			this.SendPropertyChanging();
			entity.TimeSlot = this;
		}
 public void UnRegisterSpeakerForEvent(Speaker speaker, Event ev)
 {
     EventsSpeaker evs =
         _conferenceware.EventsSpeakers.SingleOrDefault(
             x => x.Speaker == speaker && x.Event == ev);
     _conferenceware.EventsSpeakers.DeleteOnSubmit(evs);
 }
Esempio n. 15
0
 private EventEditData MakeEditDataFromEvent(Event e)
 {
     List<Speaker> allSpeakers = _repository.GetAllSpeakers().ToList();
     foreach (Speaker listedSpeaker in e.Speakers)
     {
         allSpeakers.Remove(listedSpeaker);
     }
     List<Attendee> allAttendees = _repository.GetAllAttendees().ToList();
     foreach (Attendee listedAttendee in e.Attendees)
     {
         allAttendees.Remove(listedAttendee);
     }
     return new EventEditData
             {
                 Event = e,
                 Timeslots =
                     new SelectList(_repository.GetAllTimeSlots(), "id", "StringValue"),
                 Locations =
                     new SelectList(_repository.GetAllLocations(), "id", "StringValue"),
                 Attendees =
                     new SelectList(
                     allAttendees.OrderBy(
                         x => x.People.name),
                     "person_id",
                     "People.name"),
                 Speakers =
                     new SelectList(
                     allSpeakers.OrderBy(x => x.People.name),
                     "person_id",
                     "People.name")
             };
 }
 public void AddEvent(Event ev)
 {
     _conferenceware.Events.InsertOnSubmit(ev);
 }
 private static bool EqualEvents(Event ev1, Event ev2)
 {
     return ev1.is_visible == ev2.is_visible
            && ev1.location_id == ev2.location_id
            && ev1.max_attendees == ev2.max_attendees
            && ev1.name == ev2.name
            && ev1.timeslot_id == ev2.timeslot_id
            && ev1.description == ev2.description;
 }
Esempio n. 18
0
 public void DeleteEvent(Event ev)
 {
     _events.Remove(ev);
 }
 /// <summary>
 /// Creates third tshirt example
 /// </summary>
 /// <returns>Example location 3</returns>
 private static Event GenerateNewEvent3()
 {
     var ev = new Event
     {
         name = "Event3",
         description = "desc3",
         is_visible = true,
         Location = new Location
                     {
                         building_name = "bldg3",
                         max_capacity = 13,
                         room_number = "13A",
                         notes = "notes3"
                     },
         TimeSlot = new TimeSlot
                     {
                         start_time = new DateTime(2010, 3, 1, 12, 0, 0),
                         end_time = new DateTime(2010, 3, 1, 13, 0, 0)
                     }
     };
     return ev;
 }
Esempio n. 20
0
 public void RegisterSpeakerForEvent(Speaker speaker, Event ev)
 {
     var evs = new EventsSpeaker();
     evs.Speaker = speaker;
     evs.Event = ev;
     ev.EventsSpeakers.Insert(0, evs);
     speaker.EventsSpeakers.Insert(0, evs);
 }
 public void DeleteEvent(Event ev)
 {
     _conferenceware.Events.DeleteOnSubmit(ev);
 }
Esempio n. 22
0
 public void UnRegisterSpeakerForEvent(Speaker speaker, Event ev)
 {
     throw new NotImplementedException();
 }
		private void attach_Events(Event entity)
		{
			this.SendPropertyChanging();
			entity.Location = this;
		}