Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo 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);
        }