示例#1
0
        private static void DeleteAccount()
        {
            var account = new Account();

            Console.WriteLine("Account Deletion");
            Console.WriteLine("Type the ID of the account you want to delete: ");
            account.Identification = Console.ReadLine();
            account = AccManagement.RetrieveById(account);
            if (account != null)
            {
                Console.WriteLine(" ==> " + account.GetEntityInformation());
                Console.WriteLine("Are you sure? Y/N");
                var delete = Console.ReadLine();

                if (delete.Equals("Y", StringComparison.CurrentCultureIgnoreCase))
                {
                    AccManagement.Delete(account);
                    Console.WriteLine("Account Deletion Successfull");
                }
            }
            else
            {
                throw new Exception("ERROR: No Accounts Registered");
            }
        }
示例#2
0
        private static void SearchAccount()
        {
            var account = new Account();

            Console.WriteLine();
            Console.WriteLine("Type the ID number of the account you want to search: ");
            account.Identification = Console.ReadLine();
            Console.WriteLine();
            account = AccManagement.RetrieveById(account);
            if (account != null)
            {
                Console.WriteLine(" ==> " + account.GetEntityInformation());
            }
            else
            {
                Console.WriteLine("ERROR: Account Not Found");
            }
        }