Esempio n. 1
0
        public bool ChangeCategory(AccountCategoryId newCategory)
        {
            if (newCategory == AccountCategoryId.Lead &&
                Balance >= 10000)
            {
                return(true);
            }

            else if (newCategory == AccountCategoryId.Senior &&
                     Balance >= 5000)
            {
                return(true);
            }

            else if (newCategory == AccountCategoryId.Mid &&
                     Balance >= 1000)
            {
                return(true);
            }
            else if (newCategory == AccountCategoryId.Basic &&
                     Balance >= 0)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
    public bool ChangeCategory(AccountCategoryId AccountCategory)
    {
        if (Balance <= 1000 && AccountCategory == AccountCategoryId.Basic)

        {
            return(true);
        }
        else if (Balance <= 5000 && AccountCategory == AccountCategoryId.Mid)

        {
            return(true);
        }
        else if (Balance <= 10000 && AccountCategory == AccountCategoryId.Senior)

        {
            return(true);
        }
        else if (Balance > 10000 && AccountCategory == AccountCategoryId.Lead)

        {
            return(true);
        }

        else

        {
            return(false);
        }
    }
Esempio n. 3
0
 public static void Category(StoreAccount account, AccountCategoryId category)
 {
     if (account.ChangeCategory(category))
     {
         Console.WriteLine($"Eligible for category change to {category}");
     }
     else
     {
         Console.WriteLine($"Not eligible for category change to {category}");
     }
 }
Esempio n. 4
0
 public StoreAccount(string customerName) : base(customerName)
 {
     AccountCategory = AccountCategoryId.Basic;
 }
Esempio n. 5
0
 public StoreAccount(string owner) : base(owner)
 {
     AccountCategory = AccountCategoryId.Basic;
 }