コード例 #1
0
ファイル: CalculateChange.cs プロジェクト: dannylith/MyWork
        public static bool SubtractMoney(string key, IVendingItemsRepository fileRepo)
        {
            Dictionary <string, VendingItem> products = fileRepo.GetAll();

            decimal productPrice = products[key].Price;

            if (Money >= productPrice)
            {
                Money -= productPrice;
                return(true);
            }

            return(false);
        }
コード例 #2
0
ファイル: CheckInventory.cs プロジェクト: dannylith/MyWork
 public CheckInventory(IVendingItemsRepository fileRepo)
 {
     this.fileRepo = fileRepo;
 }
コード例 #3
0
 public UpdateVendingRepo(IVendingItemsRepository fileRepo)
 {
     this.fileRepo = fileRepo;
 }
コード例 #4
0
ファイル: GetProductList.cs プロジェクト: dannylith/MyWork
 public GetProductList(IVendingItemsRepository fileRepo)
 {
     this.fileRepo = fileRepo;
 }