public async Task <IActionResult> Create([Bind("Id,Name")] CourseType courseType) { if (ModelState.IsValid) { _context.Add(courseType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(courseType)); }
public async Task <IActionResult> Create([Bind("Id,Name,Desc,CourseTypeId,CenterId")] Course course) { if (ModelState.IsValid) { _context.Add(course); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CenterId"] = new SelectList(_context.Center, "Id", "Id", course.CenterId); ViewData["CourseTypeId"] = new SelectList(_context.CourseType, "Id", "Id", course.CourseTypeId); return(View(course)); }
public async Task <IActionResult> Create([Bind("Id,StartTime,EndTime,WeekdayId,CourseId")] CourseTime courseTime) { if (ModelState.IsValid) { _context.Add(courseTime); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CourseId"] = new SelectList(_context.Course, "Id", "Id", courseTime.CourseId); ViewData["WeekdayId"] = new SelectList(_context.Weekday, "Id", "Id", courseTime.WeekdayId); return(View(courseTime)); }
public void Add(CourseTime courseTime) { _context.Add(courseTime); }
public void Add(Weekday weekday) { _context.Add(weekday); }
public void Add(CourseType courseType) { _context.Add(courseType); }
public void Add(Center center) { _context.Add(center); }