示例#1
0
        public async Task <IActionResult> EditItemGroup(int id, ItemGroupData itemGroupData)
        {
            var itemGroup = await _context.itemGroup.SingleOrDefaultAsync(i => i.Id == id);

            if (id != itemGroup.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    itemGroup.name = itemGroupData.name;
                    //_context.Update(itemGroup);



                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ItemGroupExists(itemGroup.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(itemGroup));
        }
 public ItemData(DRItem dRItem, DRAssetsPath dRAssetsPath, ItemGroupData itemGroupData)
 {
     this.dRItem        = dRItem;
     this.dRAssetsPath  = dRAssetsPath;
     this.itemGroupData = itemGroupData;
 }