示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] UserType userType)
        {
            if (id != userType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserTypeExists(userType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(userType));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description")] Category category)
        {
            if (id != category.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(category);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CategoryExists(category.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(category));
        }
示例#3
0
 public void Update(Category category)
 {
     _capstoneContext.Update(category);
 }
示例#4
0
 public void Update(Store store)
 {
     _capstoneContext.Update(store);
 }
示例#5
0
 public void Update(Products products)
 {
     _capstoneContext.Update(products);
 }