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; }
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 }; }
internal Event Add(Event evnt) { db.Events.Add(evnt); db.SaveChanges(); return evnt; }