public async Task <IActionResult> Create([Bind("ModuleId,Title,Coordinator,Semester,Year,Department,Credits,Welsh,Url")] Module @module) { if (ModelState.IsValid) { _context.Add(@module); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(@module)); }
public async Task <IActionResult> Create([Bind("SchemeId,Title,Award,Department,UndergraduateOrPostgraduate,SchemeType,Year,Duration,Url")] Scheme scheme) { if (ModelState.IsValid) { _context.Add(scheme); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(scheme)); }
public async Task <IActionResult> Create([Bind("SchemeModuleId,SchemeId,ModuleId,ModuleType")] SchemeModule schemeModule) { if (ModelState.IsValid) { _context.Add(schemeModule); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ModuleId"] = new SelectList(_context.Modules, "ModuleId", "ModuleId", schemeModule.ModuleId); ViewData["SchemeId"] = new SelectList(_context.Schemes, "SchemeId", "SchemeId", schemeModule.SchemeId); return(View(schemeModule)); }