示例#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);
        }
示例#3
0
        public ReturnDataToKendo ReturnKendoDataAll <T>(string userName, string source,
                                                        SqlParameter[] procedureParametersList, string storeProcedureName)
        {
            if (string.IsNullOrWhiteSpace(storeProcedureName))
            {
                return(null);
            }
            var newTradeView   = new ReturnDataToKendo(_context);
            var getTableDetail = new GetTableDetail();
            //var tableDetail = getTableDetail.ReturnTableDetailData(source, userName);

            var rep       = new Repository.GenericRepository <ReturnDataToKendo>();
            var linqQuery = rep.ExecuteStoredProcedure(storeProcedureName,
                                                       procedureParametersList);

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

            return(newTradeView);
        }