public JsonResult Create(FeatureRole featureRole, Int64 UserID) { featureRole.Initialization(ObjectInitType.Insert, "", HttpContext); int result = featureRoleService.Create(featureRole); _hubContext.Clients.All.SendAsync("dataChangeNotification", null); if (result != 0) { return(Json(new { messageType = "success", note = AppGlobal.InsertSuccessMessage })); } else { return(Json(new { messageType = "error", note = AppGlobal.InsertFailMessage })); } }
public JsonResult Update(FeatureRole featureRole) { if (featureRole.Id != 0) { featureRole.Initialization(ObjectInitType.Update, "", HttpContext); int result = featureRoleService.Update(featureRole.Id, featureRole); _hubContext.Clients.All.SendAsync("dataChangeNotification", null); if (result != 0) { return(Json(new { messageType = "success", note = AppGlobal.UpdateSuccessMessage })); } else { return(Json(new { messageType = "error", note = AppGlobal.UpdateFailMessage })); } } return(Json(new { messageType = "info", note = AppGlobal.UpdateLocalMessage })); }