protected virtual DataTable DataTableByParameters(string queryName, object parameters, bool absoluteColumnNames)
        {
            DataTable dtResult = null;

            try
            {
                IList lstResult = GetGenericListByParameters(queryName, parameters);
                dtResult = CollectionsUtil.ConvertToDataTable(lstResult.Cast <object>().ToList(), null);
            }
            catch { }

            return(dtResult);
        }
        protected virtual DataTable DataTableByParameters <T>(string queryName, object parameters, bool absoluteColumnNames)
        {
            DataTable dtResult = null;

            try
            {
                IList <T> lstResult = this.GetListByParameters <T>(queryName, parameters);
                dtResult = CollectionsUtil.ConvertToDataTable <T>(lstResult, absoluteColumnNames);
            }
            catch
            {
                return(this.DataTableByParameters(queryName, parameters, absoluteColumnNames));
            }

            return(dtResult);
        }
        protected virtual DataTable DataTableByParameters(string queryName, Tpmt parameters, bool absoluteColumnNames)
        {
            DataTable dtResult = null;

            try
            {
                IList <T> lstResult = this.GetListByParameters(queryName, parameters);
                dtResult = CollectionsUtil.ConvertToDataTable <T>(lstResult, absoluteColumnNames);
            }
            catch
            {
                try
                {
                    IList lstResult = GetGenericListByParameters(queryName, parameters);
                    dtResult = CollectionsUtil.ConvertToDataTable(lstResult.Cast <object>().ToList(), typeof(T).Name);
                }
                catch { }
            }

            return(dtResult);
        }
Esempio n. 4
0
        public DataTable DataTableByParameters(string queryName, Tpmt parameters, bool absoluteColumnNames)
        {
            DataTable dtResult = null;

            IList lstResult = GetGenericListByParameters(queryName, parameters);

            try
            {
                IList <T> lstTemp = lstTemp = lstResult.Cast <T>().ToList();
                dtResult = CollectionsUtil.ConvertToDataTable <T>(lstTemp, absoluteColumnNames);
            }
            catch
            {
                try
                {
                    dtResult = CollectionsUtil.ConvertToDataTable(lstResult);
                }
                catch { }
            }

            return(dtResult);
        }