public async Task<IActionResult> Create([Bind("Id,Name")] Classroom classroom) { if (ModelState.IsValid) { _context.Add(classroom); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } return View(classroom); }
public async Task <IActionResult> Create([Bind("Id,Name,Description,CreatedAt,UpdateAt")] Subject subject) { if (ModelState.IsValid) { _context.Add(subject); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(subject)); }
public async Task <IActionResult> Create([Bind("Id,Email,Password,ConfirmPassword,StudentInformation")] Account account) { if (ModelState.IsValid) { _context.Add(account); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ClassId"] = new SelectList(_context.Classroom, "Id", "Id", account.StudentInformation.ClassId); return(View(account)); }
public async Task <IActionResult> Create([Bind("Id,Theory,Practice,Assignment,CreatedAt,UpdateAt")] Mark mark) { if (ModelState.IsValid) { _context.Add(mark); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.Set <Subject>(), "Id", "Id", mark.Id); return(View(mark)); }
public async Task <IActionResult> Create([Bind("AccountId,ClassId,FirstName,LastName,Phone,Address,BirthDay")] StudentInformation studentInformation) { if (ModelState.IsValid) { _context.Add(studentInformation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AccountId"] = new SelectList(_context.Account, "Id", "Id", studentInformation.AccountId); ViewData["ClassId"] = new SelectList(_context.Classroom, "Id", "Id", studentInformation.ClassId); return(View(studentInformation)); }