예제 #1
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,DateUpdated,FileName,ImageThumb,ImageFull")] ProductImage productImage)
        {
            if (id != productImage.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(productImage);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductImageExists(productImage.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(productImage));
        }
예제 #2
0
        public async Task <IActionResult> Edit(uint id, [Bind("Id,IsDiscontinued,AssociatedCategoryId,AssociatedSnapshotTypeId,AssociatedGroupId,AssociatedScreenId,AssociatedImageId,AssociatedRecycleId,MerchantNumber,ProductDescription,AiPartNumber,ManufactureNumber,ManufactureName,MfgUrl,MfgManualUrl,AssociatedPrimaryVendorId,AssociatedSecondaryVendorId,AssociatedTertiaryVendorId,Retail,Cost,AdditionalCost,DefaultPriority,IsTaxable,IsRecycleFee,ItemsAssociated,IsExcludedDesAinumOverrwrite,CostVerificationBy")] Product product)
        {
            if (id != product.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductExists(product.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }