public void Edit(int entityId, [FromBody] MixERP.Net.Entities.Core.Entity entity)
        {
            if (entity == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed));
            }

            try
            {
                this.EntityRepository.Update(entity, entityId);
            }
            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));
            }
        }
Exemple #2
0
 public void Previous()
 {
     MixERP.Net.Entities.Core.Entity entity = Fixture().GetPrevious(0);
     Assert.NotNull(entity);
 }
Exemple #3
0
 public void Next()
 {
     MixERP.Net.Entities.Core.Entity entity = Fixture().GetNext(0);
     Assert.NotNull(entity);
 }
Exemple #4
0
 public void First()
 {
     MixERP.Net.Entities.Core.Entity entity = Fixture().GetFirst();
     Assert.NotNull(entity);
 }