コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Username,Password,ProfilePicture,Contact,Email,Role,Status,Gender,Address,Extras,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate")] Systemusers systemusers)
        {
            if (id != systemusers.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(systemusers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SystemusersExists(systemusers.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(systemusers));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Status,ParentId,Discount,Discountexpiry,MetaTitle,MetaDescription,MetaKeyword,Images,Extras,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate")] Categories categories)
        {
            if (id != categories.Id)
            {
                return(NotFound());
            }

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