예제 #1
0
        public ReturnDataToKendo ReturnKendoData <T>(string userName, string source,
                                                     SqlParameter[] procedureParametersList, string storeProcedureName)
        {
            var newTradeView   = new ReturnDataToKendo(_context);
            var getTableDetail = new GetTableDetail();
            var tableDetail    = getTableDetail.ReturnTableDetailData(source, userName);


            var columnList = "new (" + getTableDetail.ReturnColumnListCommaSeparated(tableDetail.ToList()) + ")";

            if (columnList.Equals("new ()"))
            {
                return(newTradeView);
            }
            var rep = new Repository.GenericRepository <ReturnDataToKendo>();

            var linqQuery =
                rep.ExecuteStoredProcedure(storeProcedureName, procedureParametersList).Select(columnList);

            newTradeView.Total     = linqQuery.Count();
            newTradeView.TradeList = linqQuery;


            return(newTradeView);
        }
예제 #2
0
        public ReturnDataToKendo ReturnKendoData <T>(KendoGridItems item, string userName, string source,
                                                     SqlParameter[] procedureParametersList, string storeProcedureName)
        {
            var newTradeView   = new ReturnDataToKendo(_context);
            var getTableDetail = new GetTableDetail();
            var tableDetail    = getTableDetail.ReturnTableDetailData(source, userName);
            var columnList     = "new (" + getTableDetail.ReturnColumnListCommaSeparated(tableDetail.ToList()) + ")";

            var rep = new Repository.GenericRepository <ReturnDataToKendo>();

            var linqQuery = rep.ExecuteStoredProcedure(storeProcedureName, procedureParametersList).Select(columnList);

            newTradeView.Total     = linqQuery.Count();
            newTradeView.TradeList = item.Sort != null
                ? linqQuery.Skip(item.Skip).Take(item.Take).OrderBy(ReturnOrderByString(item.Sort))
                : linqQuery.Skip(item.Skip).Take(item.Take);

            return(newTradeView);
        }