public ActionResult Create(AppModel model) { if (_appService.List().Count(m => m.Name == model.Name) > 0) { _result = "failed"; return Content(_result); } var app = model.ToEntity(); model.AddTime = DateTime.Now; _appService.Add(app); _roleAppService.Add(new RoleApp { AppId = app.Id, RoleId = GetUserRole(), DisplayOrder = 0 }); _result = "success"; return Content(_result); }
public ActionResult Edit(AppModel model) { var app = this._appService.Get(model.Id); app = model.ToEntity(app); this._appService.Update(app); ; _result = "success"; return Content(_result); }