public List <Model.EventDocument> DownloadEventDocuments(Model.Event evt)
 {
     using (var context = new DataContext())
     {
         return(context.GetEventDocuments(evt.Id)
                .Select(d => d.ConvertToviewModelDocument())
                .ToList());
     }
 }
 public List <EventParticipator> DownloadEventPersons(Model.Event evt)
 {
     using (var context = new DataContext())
     {
         var part = context.GetEventParticipators(evt.Id);
         var all  = part.Select(p => new EventParticipator
         {
             Person          = Instance.Persons.FirstOrDefault(x => x.Id == p.PersonId),
             IsParticipating = p.IsParticipating > 0
         }).ToList();
         return(all);
     }
 }
Example #3
0
        private void NewEventExecuted(object obj)
        {
            var newEvent = new Event
            {
                Id          = -1,
                Description = "<<>>",
                Date        = DateTime.Now.Date,
                PersonId    = Person.Id
            };

            if (AddNewEventFunc != null && AddNewEventFunc(newEvent))
            {
                // insert new event!
                using (var context = new DataContext())
                {
                    context.AddEvent(newEvent.ConvertBackToDalModel());
                    RefreshEvents();
                }
            }
        }