public async Task <GridOutcome> GetDataAsync(string GridConfigId, GridDataRequest gridDataRequest)
        {
            GridOutcome outcome = null;

            if (GridConfigId.IsNotNullOrEmpty())
            {
                outcome = await GetDataQueryAsync(GridConfigId, gridDataRequest);
            }
            return(outcome);
        }
예제 #2
0
        public GridOutcome GetData(string GridConfigId, GridDataRequest gridDataRequest)
        {
            GridOutcome outcome = null;

            if (GridConfigId.IsNotNullOrEmpty())
            {
                outcome = new GridOutcome();
                object param = new object();
                string sql   = GetDataQuery(GridConfigId, gridDataRequest);
                if (gridDataRequest.Parameters.IsNotNullOrEmpty())
                {
                    param = gridDataRequest.Parameters.ToDynamicObject();
                }
                GridReader reader = Connection.QueryMultiple(sql, param);
                outcome.ResultSet    = reader.Read <dynamic>().ToList();
                outcome.PageNo       = gridDataRequest.PageNo;
                outcome.TotalRecords = reader.Read <int>().Single();
            }
            return(outcome);
        }