Example #1
0
 public IHttpActionResult SaveBizCategory(BizCategoryViewModel category)
 {
     try
     {
         _setting.SaveCategory(category);
     }
     catch (Exception err)
     {
         ResMessage.Fail(err.Message);
     }
     return(Ok(ResMessage.Success()));
 }
Example #2
0
        public BizCategory SaveCategory(BizCategoryViewModel cate)
        {
            BizCategory bizCate = new BizCategory();

            if (cate.CateId > 0)
            {
                bizCate = this.GetBizCategory(cate.CateId);
            }
            bizCate.CategoryName = cate.CategoryName;
            bizCate.SortIndex    = cate.SortIndex;

            _context.BizCategories.AddOrUpdate(bizCate);
            _context.SaveChanges();

            return(bizCate);
        }