Exemple #1
0
 public ResultInfo UpdateCategory(Category category)
 {
     if (category.CategoryId <= 0)
         return new ResultInfo(0, "未找到相应的分类!");
     var config = _utils.Get();
     var item = config.Categories.FirstOrDefault(t => t.CategoryId == category.CategoryId);
     if (item == null)
         return new ResultInfo(0, "未找到相应的分类!");
     var index = config.Categories.IndexOf(item);
     config.Categories[index] = category;
     _utils.Set(config);
     return new ResultInfo(1);
 }
Exemple #2
0
 public JsonResult UpdateCategory(Category info, int id)
 {
     info.CategoryId = id;
     return Json(_busi.UpdateCategory(info));
 }