Beispiel #1
0
        public async Task <IActionResult> Edit(int id, CustomerProduct customerProduct, bool payment = false)
        {
            if (id != customerProduct.CustomerProductId)
            {
                return(RedirectToAction("Edit", new { id }));
            }
            try
            {
                await _cust.UpdateCustomerProductWithId(customerProduct);

                // TODO: Add update logic here
                if (payment)
                {
                    return(RedirectToAction("Details"));
                }
                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View("Error", "Home"));
            }
        }