public ActionResult Edit([DataSourceRequest] DataSourceRequest request, long id) { var queryManager = new QueryManagementHelper(); var queryToUpdate = queryManager.GetQuery(id); if (TryUpdateModel(queryToUpdate, includeProperties: new string[] { "Name", "Text","Description" })) { queryManager.UpdateQuery(queryToUpdate); } return Json(ModelState.ToDataSourceResult()); }
public QueryMainModel GetBaseModel(long groupId) { var group = new QueryManagementHelper().GetQueryGroup(groupId); var allGroups = ConverGroupList(new QueryManagementHelper().GetAllGroups()); var model = new QueryMainModel() { GroupId = group.Id, GroupName = group.Name, AllGroups = allGroups }; return model; }
public ActionResult ShowGroup([DataSourceRequest] DataSourceRequest request,int groupId) { var queries = new QueryManagementHelper().GetQueryListForGroup(groupId); return Json(queries.ToDataSourceResult(request)); }
public ActionResult Show([DataSourceRequest] DataSourceRequest request) { var queries = new QueryManagementHelper().GetQueryList(); return Json(queries.ToDataSourceResult(request)); }
public ActionResult Delete([DataSourceRequest] DataSourceRequest request, int id) { var deleted = new QueryManagementHelper().DeleteQuery(id); return Json(ModelState.ToDataSourceResult()); }