public async Task <IActionResult> Edit(int id, [Bind("ProjectId,ProScholType,Title,Description,FkFacultyProject")] ProjectScholarship projectScholarship) { if (id != projectScholarship.ProjectId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(projectScholarship); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectScholarshipExists(projectScholarship.ProjectId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FkFacultyProject"] = new SelectList(_context.Faculty, "FacultyId", "FacultyId", projectScholarship.FkFacultyProject); return(View(projectScholarship)); }
public async Task <IActionResult> Create([Bind("ProjectId,ProScholType,Title,Description,FkFacultyProject")] ProjectScholarship projectScholarship) { if (ModelState.IsValid) { _context.Add(projectScholarship); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FkFacultyProject"] = new SelectList(_context.Faculty, "FacultyId", "FacultyId", projectScholarship.FkFacultyProject); return(View(projectScholarship)); }