public async Task <IActionResult> Edit(long id, [Bind("Id,Nomi,ProfessionId,Grade")] Group @group) { if (id != @group.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(@group); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GroupExists(@group.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ProfessionId"] = new SelectList(_context.Professions, "Id", "Nomi", @group.ProfessionId); return(View(@group)); }
public async Task <IActionResult> Edit(long id, [Bind("Id,StudentId,S1,S2,S3,S4,Q1,Q2,Q3,Q4,Olimpiada,Tanlov")] Mark mark) { if (id != mark.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mark); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MarkExists(mark.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["StudentId"] = new SelectList(_context.Students, "Id", "Nomi", mark.StudentId); return(View(mark)); }
public async Task <IActionResult> Edit(long id, [Bind("Id,Nomi,Surname,Sharif,Manzil,GroupId")] Student student) { if (id != student.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(student); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentExists(student.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Nomi", student.GroupId); return(View(student)); }
public async Task <IActionResult> Edit(long id, [Bind("Id,Nomi")] Subject subject) { if (id != subject.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(subject); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SubjectExists(subject.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(subject)); }
public async Task <IActionResult> Edit(long id, [Bind("Id,GroupId,SubjectId")] GroupSubject groupSubject) { if (id != groupSubject.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(groupSubject); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GroupSubjectExists(groupSubject.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Nomi", groupSubject.GroupId); ViewData["SubjectId"] = new SelectList(_context.Subjects, "Id", "Nomi", groupSubject.SubjectId); return(View(groupSubject)); }