コード例 #1
0
ファイル: ShopList.cs プロジェクト: 106820026/Shopping_List
 // 選取商品後更新視窗
 private void UpdateItemClick(Button button)
 {
     _shopListPresentationModel.GetCurrentProduce(_itemTabControlPages.GetCurrentPage(), (int)(button.Tag), _itemTabControl.SelectedTab.Text); // 取得目前商品id
     _descriptionRichTextBox.Text = _shopListPresentationModel.GetDetail();                                                                    // 顯示商品詳細資料
     _stockLabel.Text             = _shopListPresentationModel.GetQuantity();                                                                  // 顯示庫存
     _priceLabel.Text             = _shopListPresentationModel.GetPrice();                                                                     // 顯示價錢
     _addToCartButton.Enabled     = _shopListPresentationModel.IsAlreadyInCart();                                                              // 如已加入購物車 就不可再次加入
 }
コード例 #2
0
 public void GetPriceTest()
 {
     Assert.AreEqual(_ShopListPresentationModel.GetPrice(), "");
     _ShopListPresentationModel.GetCurrentProduce("1", 0, "主機板");
     Assert.AreEqual(_ShopListPresentationModel.GetPrice(), int.Parse(_ShopListPresentationModel.CurrentProduct.ProductPrice).ToString("#,0"));
 }