Ejemplo n.º 1
0
        public void Edit(string fiscalYearCode, [FromBody] MixERP.Net.Entities.Core.FiscalYear fiscalYear)
        {
            if (fiscalYear == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed));
            }

            try
            {
                this.FiscalYearRepository.Update(fiscalYear, fiscalYearCode);
            }
            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));
            }
        }
Ejemplo n.º 2
0
 public void Get()
 {
     MixERP.Net.Entities.Core.FiscalYear fiscalYear = Fixture().Get(string.Empty);
     Assert.NotNull(fiscalYear);
 }
Ejemplo n.º 3
0
 public void First()
 {
     MixERP.Net.Entities.Core.FiscalYear fiscalYear = Fixture().GetFirst();
     Assert.NotNull(fiscalYear);
 }