Пример #1
0
 public ActionResult Edit(AppCategoryModel model)
 {
     var app = this._appCategoryService.Get(model.Id);
     app = model.ToEntity(app);
     this._appCategoryService.Update(app); ;
     _result = "success";
     return Content(_result);
 }
Пример #2
0
 public ActionResult Create(AppCategoryModel model)
 {
     if (_appCategoryService.List().Count(m => m.Name == model.Name) > 0)
     {
         _result = "failed";
         return Content(_result);
     }
     var app = model.ToEntity();
     model.AddTime = DateTime.Now;
     _appCategoryService.Add(app);
     _result = "success";
     return Content(_result);
 }