Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("TabcaId,TabcaName,Pic,Del,Description")] Tbltablecategory tbltablecategory)
        {
            if (id != tbltablecategory.TabcaId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tbltablecategory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TbltablecategoryExists(tbltablecategory.TabcaId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbltablecategory));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("TabcaId,TabcaName,Pic,Del,Description")] Tbltablecategory tbltablecategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tbltablecategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tbltablecategory));
        }