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); }
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); } }
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}"); } }
public StoreAccount(string customerName) : base(customerName) { AccountCategory = AccountCategoryId.Basic; }
public StoreAccount(string owner) : base(owner) { AccountCategory = AccountCategoryId.Basic; }