Ejemplo n.º 1
0
        public bool UpdateArticle(ArticleModel article, ISystemResponse error)
        {
            bool updated = false;

            try
            {
                string request = WebAPIClient.PutRequest("Articles", "", article, error, new Dictionary <string, string>());

                if (!string.IsNullOrEmpty(request) && !error.Error)
                {
                    JavaScriptSerializer serializer = new JavaScriptSerializer();
                    BasicResponseModel   response   = serializer.Deserialize <BasicResponseModel>(request);

                    if (response != null && !error.Error)
                    {
                        updated = response.success;
                    }
                }
            }
            catch (Exception ex)
            {
                error.Error     = true;
                error.Message   = "No fue posible actualizar el articulo";
                error.Exception = ex;
            }

            return(updated);
        }