//load public void LoadList() { string filePath = Application.dataPath + filename1; if (File.Exists(filePath)) { if (File.ReadAllText(filePath).Length != 0) { myAccounts = JasonManager.GetAccountList(File.ReadAllText(filePath)); } else { List <CustomerAccount> mylistofcustomers = new List <CustomerAccount> (); myAccounts = new AccountList(mylistofcustomers); } findAccPanel.InitFindAccount(myAccounts); newAccPanel.InitNewAccount(myAccounts.CustomerAccountList); } else { List <CustomerAccount> mylist = new List <CustomerAccount>(); newAccPanel.InitNewAccount(mylist); } }
//save public void SaveList(AccountList accounts) { string filepath = Application.dataPath + filename1; File.WriteAllText(filepath, JasonManager.SetAccountList(accounts)); }