public async Task <IActionResult> Edit(int id, [Bind("MetodKomissiyaEduProfileId,MetodKomissiyaId,EduProfileId")] MetodKomissiyaEduProfile metodKomissiyaEduProfile) { if (id != metodKomissiyaEduProfile.MetodKomissiyaEduProfileId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(metodKomissiyaEduProfile); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MetodKomissiyaEduProfileExists(metodKomissiyaEduProfile.MetodKomissiyaEduProfileId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EduProfileId"] = _selectListRepository.GetSelectListEduProfileFullNames(metodKomissiyaEduProfile.EduProfileId); ViewData["MetodKomissiyaId"] = _selectListRepository.GetSelectListMetodKomissiyaNames(metodKomissiyaEduProfile.MetodKomissiyaId); return(View(metodKomissiyaEduProfile)); }
public async Task <IActionResult> Create([Bind("MetodKomissiyaEduProfileId,MetodKomissiyaId,EduProfileId")] MetodKomissiyaEduProfile metodKomissiyaEduProfile) { if (ModelState.IsValid) { _context.Add(metodKomissiyaEduProfile); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EduProfileId"] = _selectListRepository.GetSelectListEduProfileFullNames(metodKomissiyaEduProfile.EduProfileId); ViewData["MetodKomissiyaId"] = _selectListRepository.GetSelectListMetodKomissiyaNames(metodKomissiyaEduProfile.MetodKomissiyaId); return(View(metodKomissiyaEduProfile)); }