Exemple #1
0
        public HttpResponseMessage Create(Domain.Establishment mEstablishment)
        {
            HttpResponseMessage response = null;

            try
            {
                if (IsAdminPermission())
                {
                    mEstablishment = establishmentService.SaveEstablishment(mEstablishment);
                    response       = Request.CreateResponse(HttpStatusCode.OK, mEstablishment);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.Unauthorized);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message);
            }
            return(response);
        }