Beispiel #1
0
 public async Task <IActionResult> AddPost(ProductAndCategoryBase item)
 {
     try
     {
         await _webApiCalls.AddProductAsync(item.CategoryId, item.Description, item.ModelName, item.ModelNumber, item.ProductImage, item.ProductImageLarge, item.ProductImageThumb, item.UnitCost, item.CurrentPrice, item.UnitsInStock, item.IsFeatured);
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(string.Empty, "There was an error adding the product.");
     }
     return(RedirectToAction(nameof(Index)));
 }