private void lblProductName_Click(object sender, EventArgs e) { var productforinfo = _repo.GetProduct(ProductName); FormProductInfo productinfoform = new FormProductInfo(productforinfo); productinfoform.Show(); }
private void AddToCartClickedInUserControl(object sender, EventArgs e) { if (sender is UserControlShop userControl) { var product = _repo.GetProduct(userControl.ProductName); _cart.AddProductToCart(product); lblItemsInCart.Visible = true; picCartButtonCircle.Visible = true; lblItemsInCart.Text = $"{_cart.ShoppingList.Count}"; } }
public async Task <IActionResult> GetProduct(string barcode) { if (barcode.Length != 13) { return(BadRequest("Barkod 13 simvol olmalıdır.")); } var result = await _repo.GetProduct(barcode); if (result.IsSucces) { return(Ok(result.Content)); } return(StatusCode(520, result.Message)); }