public async Task <ActionResult <TimeTableWithCourseNameOutputModel> > GetTimeTableConflicts([FromBody] TimeTableWithWeekDaysInputModel model) { if (model == null) { return(BadRequest("Model is empty")); } List <TimeTable> newTimeTable = TimeTableWithWeekDaysMapper.ToDataModels(model); List <TimeTable> result = await lessonStorage.GetTimeTableConflicts(newTimeTable); if (result.Count != 0) { return(Ok(TimeTableWithCourseNameMapper.ToOutputModels(result))); } foreach (var timetable in newTimeTable) { await lessonStorage.AddOrUpdateTimeTable(timetable); } return(Ok()); }
public async Task <List <TimeTableWithCourseNameOutputModel> > GetTimetableForStudent(int teacherId) { return(TimeTableWithCourseNameMapper.ToOutputModels(await lessonStorage.GetTeacherTimetable(teacherId))); }
public async Task <ActionResult <List <TimeTableWithCourseNameOutputModel> > > GetTeacherTimetable(int userId) { List <TimeTable> timeTables = await lessonStorage.GetTeacherTimetable(userId); return(Ok(TimeTableWithCourseNameMapper.ToOutputModels(timeTables))); }