Exemple #1
0
        public IActionResult Add([FromBody] CategoryView categoryView)
        {
            if (categoryView != null)
            {
                var category = new Category
                {
                    Code   = categoryView.Code,
                    Name   = categoryView.Name,
                    Price  = categoryView.Price,
                    Active = categoryView.Active,
                    Status = true
                };

                if (_CateRepo.CreateCate(category) != null)
                {
                    return(Json("1"));
                }
            }
            return(Json("0"));
        }