Пример #1
0
        public void Edit(int classShiftId, [FromBody] Extems.Academic.Entities.ClassShift classShift)
        {
            if (classShift == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed));
            }

            try
            {
                this.ClassShiftRepository.Update(classShift, classShiftId);
            }
            catch (UnauthorizedException)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Forbidden));
            }
            catch (DataAccessException ex)
            {
                throw new HttpResponseException(new HttpResponseMessage
                {
                    Content    = new StringContent(ex.Message),
                    StatusCode = HttpStatusCode.InternalServerError
                });
            }
#if !DEBUG
            catch
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
#endif
        }
Пример #2
0
 public void Last()
 {
     Extems.Academic.Entities.ClassShift classShift = Fixture().GetLast();
     Assert.NotNull(classShift);
 }
Пример #3
0
 public void Previous()
 {
     Extems.Academic.Entities.ClassShift classShift = Fixture().GetPrevious(0);
     Assert.NotNull(classShift);
 }