Exemplo n.º 1
0
 internal bool Update(Event updatedEvent)
 {
     Event evnt = db.Events.Find(updatedEvent.Id);
     evnt.IsDeleted = updatedEvent.IsDeleted;
     evnt.IsVisible = updatedEvent.IsVisible;
     evnt.EventImage = updatedEvent.EventImage;
     evnt.Description = updatedEvent.Description;
     evnt.Title = updatedEvent.Title;
     evnt.Date = updatedEvent.Date;
     evnt.FromTime = updatedEvent.FromTime;
     evnt.Latitude = updatedEvent.Latitude;
     evnt.Location = updatedEvent.Location;
     evnt.Longtitude = updatedEvent.Longtitude;
     evnt.ToTime = updatedEvent.ToTime;
     db.SaveChanges();
     return true;
 }
Exemplo n.º 2
0
        public static EventModel EventToEventModel(Event evnt)
        {
            return new EventModel
            {
                CreatedOn = evnt.CreatedOn,
                Id = evnt.Id,
                IsDeleted = evnt.IsDeleted,
                IsVisible = evnt.IsVisible,
                Description = evnt.Description,
                EventImage = evnt.EventImage,
                Title = evnt.Title,
                EventDate = evnt.Date,
                FromTime = DateTime.Parse(evnt.FromTime.ToString()),
                ToTime = DateTime.Parse(evnt.ToTime.ToString()),
                Latitude = evnt.Latitude,
                Longtitude = evnt.Longtitude,
                Location = evnt.Location



            };
        }
Exemplo n.º 3
0
 internal Event Add(Event evnt)
 {
     db.Events.Add(evnt);
     db.SaveChanges();
     return evnt;
 }