public static void AddEvent(TheEvent theEvent) { List <TheEvent> existingEvents = JSONHandler.ReadRessources <TheEvent>(Ressources.EVENTS); existingEvents.Add(theEvent); File.WriteAllText(paths[(int)Ressources.EVENTS], "{\n\"Events\" : " + JsonConvert.SerializeObject(existingEvents) + "\n}"); }
public void AddEvent(string user, string activity, string category, string time, string place, int partecipants) { string EventID = Guid.NewGuid().ToString(); string UserID = Guid.NewGuid().ToString(); string eventLogTime = DateTime.Now.ToString(); TheEvent theEvent = new TheEvent(EventID, UserID, user, activity, category, time, place, partecipants); JSONHandler.AddEvent(theEvent); }