Exemple #1
0
        public ActionResult SelectRecordsCount(Param[] _params)
        {
            var qb = _aqbs.Get(instanceId);
            var qt = _qts.Get(instanceId);
            var qtForSelectRecordsCount = new QueryTransformer {
                QueryProvider = qb.SQLQuery
            };

            try
            {
                qtForSelectRecordsCount.Assign(qt);
                qtForSelectRecordsCount.Skip("");
                qtForSelectRecordsCount.Take("");
                qtForSelectRecordsCount.SelectRecordsCount("recCount");

                try
                {
                    var data = Execute(qtForSelectRecordsCount, _params);
                    return(Json(data.First().Values.First()));
                }
                catch (Exception e)
                {
                    return(Json(new ErrorOutput {
                        Error = e.Message
                    }));
                }
            }
            finally
            {
                qtForSelectRecordsCount.Dispose();
            }
        }
        private void UpdateRecordCount(QueryTransformer qt)
        {
            var qtForSelectRecordsCount = new QueryTransformer {
                QueryProvider = qt.QueryProvider
            };

            try
            {
                qtForSelectRecordsCount.Assign(qt);
                qtForSelectRecordsCount.Skip("");
                qtForSelectRecordsCount.Take("");
                qtForSelectRecordsCount.SelectRecordsCount("recCount");

                var data = SelectRecordsCount.GetData(qtForSelectRecordsCount, new Param[0]);
                _recordsCount     = int.Parse(data.First().Values.First().ToString());
                recordsCount.Text = "Records count: " + _recordsCount;
            }
            finally
            {
                qtForSelectRecordsCount.Dispose();
            }
        }
        public ActionResult SelectRecordsCount([FromBody] Param[] _params)
        {
            var qb = _aqbs.Get(instanceId);
            var qt = _qts.Get(instanceId);
            var qtForSelectRecordsCount = new QueryTransformer {
                QueryProvider = qb.SQLQuery
            };

            try
            {
                qtForSelectRecordsCount.Assign(qt);
                qtForSelectRecordsCount.Skip("");
                qtForSelectRecordsCount.Take("");
                qtForSelectRecordsCount.SelectRecordsCount("recCount");

                return(GetData(qtForSelectRecordsCount, _params));
            }
            finally
            {
                qtForSelectRecordsCount.Dispose();
            }
        }
Exemple #4
0
        public override object GetDataForModel(Param[] _params)
        {
            var qb = QueryBuilderStore.Get("QueryResults");
            var qt = QueryTransformerStore.Get("QueryResults");
            var qtForSelectRecordsCount = new QueryTransformer {
                QueryProvider = qt.QueryProvider
            };

            try
            {
                qtForSelectRecordsCount.Assign(qt);
                qtForSelectRecordsCount.Skip("");
                qtForSelectRecordsCount.Take("");
                qtForSelectRecordsCount.SelectRecordsCount("recCount");

                var data = GetData(qtForSelectRecordsCount, _params);
                return(data.First().Values.First());
            }
            finally
            {
                qtForSelectRecordsCount.Dispose();
            }
        }