Exemplo n.º 1
0
        public SingleRsp UpdateCategory(CategoryReq ts)
        {
            var      res  = new SingleRsp();
            Category cate = new Category();

            cate.CategoryId   = ts.CategoryId;
            cate.CategoryName = ts.CategoryName;
            res      = _rep.UpdateCategory(cate);
            res.Data = cate;
            return(res);
        }
Exemplo n.º 2
0
        public SingleRsp CreateCategory(CategoryReq cate)
        {
            var res     = new SingleRsp();
            var cateNew = new Categories()
            {
                CategoryName = cate.CategoryName,
                Description  = cate.Description
            };

            res = _rep.CreateCategory(cateNew);
            return(res);
        }
Exemplo n.º 3
0
        public SingleRsp UpdateCategory(CategoryReq cate)
        {
            var      res        = new SingleRsp();
            Category categories = new Category();

            categories.Id           = cate.Id;
            categories.CategoryName = cate.CategoryName;
            categories.ParentId     = cate.ParentId;
            res = _rep.UpdateCategory(categories);

            return(res);
        }
Exemplo n.º 4
0
        public SingleRsp UpdateCategory(CategoryReq cate)
        {
            var res        = new SingleRsp();
            var cateUpdate = new Categories()
            {
                CategoryId   = cate.CategoryId,
                CategoryName = cate.CategoryName,
                Description  = cate.Description
            };

            res = _rep.UpdateCategory(cateUpdate);
            return(res);
        }
        public object CreateCategory(CategoryReq req)
        {
            //Khởi tạo giá trị
            Category category = new Category();

            //Gán giá trị
            category.CategoryId  = req.CategoryId;
            category.Name        = req.Name;
            category.Description = req.Description;
            category.CreatedDate = req.CreatedDate;
            category.Note        = req.Note;
            //Tạo giá trị và trả về
            return(_rep.Create(category));
        }
Exemplo n.º 6
0
        public SingleRsp UpdateCategory(CategoryReq req)
        {
            var res = new SingleRsp();

            try
            {
                Category c = new Category();
                c.CategoryId          = req.CategoryId;
                c.CategoryName        = req.CategoryName;
                c.CategoryImage       = req.CategoryImage;
                c.CategoryDescription = req.CategoryDescription;
                //
                res      = base.Update(c);
                res.Data = c;
            }
            catch (Exception ex)
            {
                res.SetError(ex.StackTrace);
            }

            return(res);
        }
Exemplo n.º 7
0
        public IActionResult UpdateCategory([FromBody] CategoryReq req)
        {
            var res = _svc.UpdateCategory(req);

            return(Ok(res));
        }
        public IActionResult UpdateCategoryPatch(String id, CategoryReq req)
        {
            var result = _svc.UpdateCategory(id, req);

            return(Ok(result));
        }
        public IActionResult CreateCategory(CategoryReq req)
        {
            var result = _svc.CreateCategory(req);

            return(Ok(result));
        }
Exemplo n.º 10
0
 public object UpdateCategory(String id, CategoryReq req)
 {
     return(categoryRep.Update(id, req));
 }