コード例 #1
0
        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}");
        }
コード例 #2
0
ファイル: EventController.cs プロジェクト: EDZIII/whoisapp22
        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);
        }