public async Task <IActionResult> Create([Bind("Id,FullName,Adress,Login,Password,CardNumber,Language,Grade,Level")] Tutors tutors) { if (ModelState.IsValid) { _context.Add(tutors); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tutors)); }
public async Task <IActionResult> Create([Bind("Id,Name,Number,Capacity,Description")] Rooms rooms) { if (ModelState.IsValid) { _context.Add(rooms); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rooms)); }
public async Task <IActionResult> Create([Bind("Id,Name,TutorId,Language,Level,NumberOfStudents")] Groups groups) { if (ModelState.IsValid) { _context.Add(groups); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TutorId"] = new SelectList(_context.Tutors, "Id", "FullName", groups.TutorId); return(View(groups)); }
public async Task <IActionResult> Create([Bind("Id,StudentId,GroupId")] GroupsStudents groupsStudents) { if (ModelState.IsValid) { _context.Add(groupsStudents); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Name", groupsStudents.GroupId); ViewData["StudentId"] = new SelectList(_context.Students, "Id", "FullName", groupsStudents.StudentId); return(View(groupsStudents)); }
public async Task <IActionResult> Create([Bind("Id,Topic,GroupId,RoomId,BeginningTime,СompletionTime")] Classes classes) { if (ModelState.IsValid) { _context.Add(classes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["GroupId"] = new SelectList(_context.Groups, "Id", "Name", classes.GroupId); ViewData["RoomId"] = new SelectList(_context.Rooms, "Id", "Number", classes.RoomId); return(View(classes)); }