예제 #1
0
        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());
        }
예제 #2
0
        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;
        }
예제 #3
0
        public ActionResult ShowGroup([DataSourceRequest] DataSourceRequest request,int groupId)
        {
            var queries = new QueryManagementHelper().GetQueryListForGroup(groupId);

            return Json(queries.ToDataSourceResult(request));
        }
예제 #4
0
        public ActionResult Show([DataSourceRequest] DataSourceRequest request)
        {
            var queries = new QueryManagementHelper().GetQueryList();

            return Json(queries.ToDataSourceResult(request));
        }
예제 #5
0
 public ActionResult Delete([DataSourceRequest] DataSourceRequest request, int id)
 {
     var deleted = new QueryManagementHelper().DeleteQuery(id);
     return Json(ModelState.ToDataSourceResult());
 }