public ActionResult SelectRecordsCount(Param[] _params) { var qb = QueryBuilderStore.Get(instanceId); var qt = QueryTransformerStore.Get(instanceId); var qtForSelectRecordsCount = QueryTransformerStore.Create(instanceId + "_for_records_count"); qtForSelectRecordsCount.QueryProvider = qb.SQLQuery; qtForSelectRecordsCount.Assign(qt); qtForSelectRecordsCount.Skip(""); qtForSelectRecordsCount.Take(""); qtForSelectRecordsCount.SelectRecordsCount("recCount"); try { var data = Execute(qtForSelectRecordsCount, _params); return(Json(data.First().Values.First(), JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new ErrorOutput { Error = e.Message }, JsonRequestBehavior.AllowGet)); } finally { QueryTransformerStore.Remove(instanceId + "_for_records_count"); } }
private void UpdateRecordCount(QueryTransformer qt) { var qtForSelectRecordsCount = QueryTransformerStore.Create("QueryResults_for_select_records_count"); qtForSelectRecordsCount.QueryProvider = qt.QueryProvider; qtForSelectRecordsCount.Assign(qt); qtForSelectRecordsCount.Skip(""); qtForSelectRecordsCount.Take(""); qtForSelectRecordsCount.SelectRecordsCount("recCount"); try { var data = SelectRecordsCount.GetData(qtForSelectRecordsCount, new Param[0]); _recordsCount = int.Parse(data.First().Values.First().ToString()); recordsCount.Text = "Records count: " + _recordsCount; } finally { QueryTransformerStore.Remove("QueryResults_for_select_records_count"); } }
public override object GetDataForModel(Param[] _params) { var qb = QueryBuilderStore.Get("QueryResults"); var qt = QueryTransformerStore.Get("QueryResults"); var qtForSelectRecordsCount = QueryTransformerStore.Create("QueryResults_for_select_records_count"); qtForSelectRecordsCount.QueryProvider = qb.SQLQuery; qtForSelectRecordsCount.Assign(qt); qtForSelectRecordsCount.Skip(""); qtForSelectRecordsCount.Take(""); qtForSelectRecordsCount.SelectRecordsCount("recCount"); try { var data = GetData(qtForSelectRecordsCount, _params); return(data.First().Values.First()); } finally { QueryTransformerStore.Remove("QueryResults_for_select_records_count"); } }
//CUT:PRO{{ public void DisposeStates() { QueryBuilderStore.Remove(); QueryTransformerStore.Remove(); }
private void OnPreLoad(object sender, EventArgs eventArgs) { QueryBuilderStore.Remove(); QueryTransformerStore.Remove(); }