public void FillDataOnForm() { print("Guardando"); dataTemp.profile = tempProfile; dataTemp.SetDate(); dataList.Add(new Data(dataTemp)); string json = JsonHelperItem.ToJson(dataList.ToArray(), true); File.WriteAllText(path, json); }
void RecoveryData() { if (File.Exists(path)) { string json = File.ReadAllText(path); Data[] data = JsonHelperItem.FromJson <Data>(json); User[] users = new User[1]; users[0] = new User("Macaco", "*****@*****.**", "nel", DataManager.Profile.MEDIC); SaveJSON saveJSON = new SaveJSON(data, users); json = JsonHelperItem.ToJson <Data>(data, true); string json2 = JsonHelperUser.ToJson <User>(users, true); FixJSONSave(json, json2, true); //print(json2); //dataList = data.OfType<Data>().ToList(); //FillListMedic(dataList); } else { File.WriteAllText(path, ""); } }