public static void CreateEvent(string calendarName, string id, string title, DateTime date, int status, long ownerId) { int calID = CalendarId(calendarName); if (SimilarEventExists(calID, title, date)) { // MLW TODO remove these SMap.GetLogger().Trace("An event already exists for " + calendarName + "; Name:" + title + "; ID=" + id + "; " + date.ToString()); return; } else { SMap.GetLogger().Trace("Adding a new event for " + calendarName + "; Name:" + title + "; ID=" + id + "; " + date.ToString()); } CalendarEvent.NameFromEventId(id); DnDSignUpEntities entities = new DnDSignUpEntities(); Event e = new Event(); e.EventId = id; e.Title = title; e.AllDay = true; e.CalendarId = calID; e.StartTime = date; e.EndTime = date; e.Status = status; e.OwnerId = ownerId; entities.Events.Add(e); entities.SaveChanges(); }
public CalendarEvent(Event e, long? spouseId/*, Boolean isPlayer*/) { ID = e.EventId; Title = e.Title; StartDateTime = e.StartTime; EndDateTime = e.EndTime; IsAllDay = e.AllDay; Status = e.Status; OwnerId = e.OwnerId; if (spouseId != null) SpouseId = (long)spouseId; else SpouseId = User.FBID_Def; //IsPlayer = isPlayer; }