Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,FunctionName,FunctionExample,AlternateExample,ImagePath,FunctionDescription,ExampleExaplanation,AlternateExamplesExplanation,TableOfContentHeading")] TemplateVersion templateVersion)
        {
            if (id != templateVersion.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(templateVersion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TemplateVersionExists(templateVersion.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(templateVersion));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,VersionNumber,VersionMessage,VersionDate")] Versions versions)
        {
            if (id != versions.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(versions);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VersionsExists(versions.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(versions));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Heading,Templateid")] Tableofcontent tableofcontent)
        {
            if (id != tableofcontent.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tableofcontent);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TableofcontentExists(tableofcontent.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Templateid"] = new SelectList(_context.TemplateVersion, "Id", "FunctionName", tableofcontent.Templateid);
            return(View(tableofcontent));
        }