public async Task <IActionResult> Create([Bind("Id,Name")] Stage1 stage1)
        {
            if (ModelState.IsValid)
            {
                _context.Add(stage1);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(stage1));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Stage1,Stage2,Stage3,CurrentStage")] Stagedform stagedform)
        {
            if (ModelState.IsValid)
            {
                MultiStageFormWorkflow multiStageFormWorkflow = new MultiStageFormWorkflow(_context);

                _context.Add(stagedform);
                await _context.SaveChangesAsync();

                await multiStageFormWorkflow.OnMultiStageFormCreate(stagedform);

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Stage1"] = new SelectList(_context.Stage1, "Id", "Name", stagedform.Stage1);
            ViewData["Stage2"] = new SelectList(_context.Stage2, "Id", "Description", stagedform.Stage2);
            ViewData["Stage3"] = new SelectList(_context.Stage3, "Id", "Id", stagedform.Stage3);
            return(View(stagedform));
        }