Exemple #1
0
        // POST api/<controller>
        public IHttpActionResult Post(CategoryView c)
        {
            var newCate = new Category {
                ID = c.ID, CateName = c.CateName, ID_root = c.ID_root
            };
            var res = Repositories.CreateCate(newCate);

            if (res == true)
            {
                return(Ok());
            }
            return(InternalServerError());
        }
Exemple #2
0
        public bool CreateCategory(CategoryContract newCate)
        {
            Category cate = new Category
            {
                nameCate = newCate.nameCate
            };

            if (Repositories.CreateCate(cate) == true)
            {
                return(true);
            }
            return(false);
        }