Example #1
0
        public async Task <ActionResult <int> > AddOrUpdateTimeTable([FromBody] TimeTableInputModel inputModel)
        {
            TimeTable timeTable = TimeTableMapper.ToDataModel(inputModel);

            if (timeTable == null)
            {
                return(BadRequest("Model is empty"));
            }
            return(await lessonStorage.AddOrUpdateTimeTable(timeTable));
        }
Example #2
0
        private void TestUpdate()
        {
            listTimetable[0].RoomNumber = 555;
            listTimetable[0].Day        = new DateTime(2017, 1, 1);
            listTimetable[0].TimeStart  = new TimeSpan(11, 11, 11);
            listTimetable[0].TimeEnd    = new TimeSpan(22, 22, 22);
            listTimetable[0].GroupId    = (int)GroupMock.groupMocks[0].Id;

            lessonStorage.AddOrUpdateTimeTable(listTimetable[0]);

            //    TimeTable actual = lessonStorage.GetTimeTableById((int)listTimetable[0].Id);
            //   Assert.AreEqual(listTimetable[0], actual);
        }