Exemple #1
0
        public List <T> GenericDataSource <T>(string query)
        {
            DataTable dataTable = GetDataTable(query);

            var objData = (List <T>)GenericListGenerator.GetList <T>(dataTable);

            return(objData);
        }
            public static GridEntity <T> GenericDataSource(GridOptions options, string query, string orderBy,
                                                           string condition)
            {
                var           _connection = new CommonConnection();
                StringBuilder gridQuery;
                StringBuilder totalQuery;

                GetGridPagingQuery(options, query, orderBy, condition, out gridQuery, out totalQuery,
                                   _connection.DatabaseType);
                DataTable dataTable  = _connection.GetDataTable(gridQuery.ToString());
                int       totalCount = _connection.GetScaler(totalQuery.ToString());

                var dataList = (List <T>)GenericListGenerator.GetList <T>(dataTable);
                var result   = new GridResult <T>().Data(dataList, totalCount);

                return(result);
            }