Esempio n. 1
0
        public async Task <IActionResult> BackHouseInventory(List <WildeRoverItem> bhivm)
        {
            if (bhivm == null)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    foreach (var item in bhivm)
                    {
                        _context.Update(item);
                        await _context.SaveChangesAsync();
                    }
                }
                catch (DbUpdateConcurrencyException)
                {
                    throw;
                }

                return(RedirectToAction("Index"));
            }

            return(View(bhivm));
        }
        public async Task <IActionResult> Edit(int id, [Bind("VendorId,Name,Phone,EMail,PointOfContact")] Vendor vendor)
        {
            if (id != vendor.VendorId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vendor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VendorExists(vendor.VendorId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(vendor));
        }
        public async Task <IActionResult> Edit(int id, [Bind("WildeRoverItemId,Name,Par,Have,Type,SubType")] WildeRoverItem wildeRoverItem)
        {
            if (id != wildeRoverItem.WildeRoverItemId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(wildeRoverItem);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WildeRoverItemExists(wildeRoverItem.WildeRoverItemId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(wildeRoverItem));
        }