public IHttpActionResult AddPermission(PermissionEntity permission) { bool isAddSuccess = false; ResultEntity result = new ResultEntity(); try { isAddSuccess = dal.AddPermission(permission.ToPERMISSION()); result.Data = permission; } catch (Exception e) { result.Message = e.Message; NtripProxyLogger.LogExceptionIntoFile("调用接口api/Permission/AddPermission异常,异常信息为:" + e.Message); } result.IsSuccess = isAddSuccess; return(Json <ResultEntity>(result)); }
/// <summary> /// 添加权限 /// </summary> public void AddPermission(Permission permission) { permission.Path = string.Format("{0}{1}/", permission.Path, permission.Code); dal.AddPermission(permission); }