Beispiel #1
0
        private static void AddMemberToList(List<Member> members)
        {
            RegisterLoader rl = new RegisterLoader("register.txt");

            try
            {
                rl.AddNewMember(members);
            }
            catch
            {
                throw new ArgumentException("Something went wrong when trying to add a new member.");
            }
            SaveMembersToFile(members);
        }
Beispiel #2
0
 private static void SaveMembersToFile(List<Member> members)
 {
     RegisterLoader rl = new RegisterLoader("register.txt");
     try
     {
         rl.Save(members);
     }
     catch
     {
         throw new ArgumentException("Something went wrong when attempting to save the members to the file.");
     }
 }
Beispiel #3
0
        private static List<Member> LoadRegister()
        {
            RegisterLoader rl = new RegisterLoader("register.txt");
            List<Member> m = new List<Member>();

            try
            {
                m = rl.Load();
            }
            catch
            {
                throw new ArgumentException("Something went wrong when reading the member register file.");
            }

            return m;
        }