public IActionResult Course(Dbbc model) { var teacher = _usersService.GetUserById(model.TeacherId); model.Teacher = teacher; return(View(model)); }
public bool AddDBBC(Dbbc dbbc) { try { _context.Dbbc.Add(dbbc); return(true); } catch (Exception) { return(false); } }
public async Task <IActionResult> AddDbbc(DvvsModel model) { Dbbc dbbc = new Dbbc() { TeacherId = model.TeacherId, Description = model.Description, StartDate = model.StartDate, EndDate = model.EndDate, NumberOfSeats = model.NumberOfSeats, NumberSetsUsed = 0 }; _dBBCService.AddDBBC(dbbc); await _dBBCService.Save(); return(RedirectToAction("CourseList", "Course")); }