public CalendarForGroup GetSchedule(string idName) { string SchedulePath = shedulerPath + Path.DirectorySeparatorChar + idName + ".json"; string scheduleJson = File.ReadAllText(SchedulePath); CalendarForGroup Schedule = JsonConvert.DeserializeObject <CalendarForGroup>(scheduleJson); return(Schedule); }
public CalendarForGroup CreateUpdateSchedule(CalendarForGroup schedule) { int lenthId = AllGetSchedule().Count() + 1; schedule.Id = lenthId; string newSchedulePath = shedulerPath + Path.DirectorySeparatorChar + schedule.Name + ".json"; // string newSchedulePath = Path.Combine(shedulerPath, $"{ Path.DirectorySeparatorChar}", fileName); File.WriteAllText(newSchedulePath, JsonConvert.SerializeObject(schedule)); return(schedule); }