private void initProductDetail() { ProductDetailModel productDetail = Productdatabase.GetDetailProductByID(IdProduct); ImageMain = productDetail.Image_product; ImageSub1 = productDetail.Image_product1; ImageSub2 = productDetail.Image_product2; NameProduct = productDetail.Name_product; CategoryProduct = productDetail.Category_product; }
private void operationsProduct() { btnPlus.Click += delegate(object sender, RoutedEventArgs e) { ProductDetailModel productDetail = Productdatabase.GetDetailProductByID(IdProduct); int temp = convertStringToInt(tbNumOfPro.Text) + 1; tbNumOfPro.Text = temp + ""; tbPrice.Text = productDetail.Price_product * temp + ""; }; btnMinus.Click += delegate(object sender, RoutedEventArgs e) { ProductDetailModel productDetail = Productdatabase.GetDetailProductByID(IdProduct); int temp = convertStringToInt(tbNumOfPro.Text) - 1; if (temp < 0) { temp = 0; } tbNumOfPro.Text = temp + ""; tbPrice.Text = productDetail.Price_product * temp + ""; }; }