Пример #1
0
        public void Edit(long accessId, [FromBody] MixERP.Net.Entities.Policy.MenuAccess menuAccess)
        {
            if (menuAccess == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed));
            }

            try
            {
                this.MenuAccessRepository.Update(menuAccess, accessId);
            }
            catch (UnauthorizedException)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Forbidden));
            }
            catch (MixERPException ex)
            {
                throw new HttpResponseException(new HttpResponseMessage
                {
                    Content    = new StringContent(ex.Message),
                    StatusCode = HttpStatusCode.InternalServerError
                });
            }
            catch
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
        }
Пример #2
0
 public void Get()
 {
     MixERP.Net.Entities.Policy.MenuAccess menuAccess = Fixture().Get(0);
     Assert.NotNull(menuAccess);
 }