Exemplo n.º 1
0
        public HttpResponseMessage SaveProduct(ProductModel productModel)
        {
            var isAdminUser = User.Identity.IsAdminUser();

            productModel.CreatedBy = CurrentContext.CurrentUserId;
            var result = ProductBusiness.CheckIfProdctNameExists(productModel);

            if (!result.Error)
            {
                result = ProductBusiness.SaveProduct(productModel, isAdminUser);
            }
            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }