예제 #1
0
        public QueryGeneratorResult CreateQueryList <T>(List <SearchField> searchFieldList) where T : class
        {
            QueryGeneratorResult result       = new QueryGeneratorResult();
            string querybody                  = this.CreateQueryList <T>();
            string queryWhereParameterized    = DBCommandListGet.GetInstance.GetWhereParameterizedQuery <T>(searchFieldList);
            List <SqlParameter> sqlParameters = DBCommandListGet.GetInstance.GetWhereParameterCollection <T>(searchFieldList);

            result.SelectQuery    = select + querybody + queryWhereParameterized;
            result.ListParameters = sqlParameters;
            return(result);
        }
예제 #2
0
        public QueryGeneratorResult CreateQueryList <T>(List <SearchField> searchFieldList, string sortColumn, bool isAscending, int topTake) where T : class
        {
            QueryGeneratorResult result    = new QueryGeneratorResult();
            string querybody               = this.CreateQueryList <T>();
            string queryWhereParameterized = DBCommandListGet.GetInstance.GetWhereParameterizedQuery <T>(searchFieldList);
            string queryOrderBy            = DBCommandListGet.GetInstance.GetOrderBy <T>(sortColumn, isAscending);
            string queryTop = DBCommandListGet.GetInstance.GetTopQuery(topTake);
            List <SqlParameter> sqlParameters = DBCommandListGet.GetInstance.GetWhereParameterCollection <T>(searchFieldList);

            result.SelectQuery    = select + queryTop + querybody + queryWhereParameterized + queryOrderBy;
            result.ListParameters = sqlParameters;
            return(result);
        }