Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 4
0
        public string ReturnPassword(string username)
        {
            var returnValue = "";

            var parameters = new[]
            {
                new SqlParameter
                {
                    ParameterName = "@user_name",
                    Value         = username
                }
            };
            var TdmsDataAccess = new Repository.GenericRepository <usp_returnUserbyUserName_Result>();
            var userLogin      = TdmsDataAccess.ExecuteStoredProcedure("usp_returnUserbyUserName",
                                                                       parameters);

            foreach (var item in userLogin)
            {
                returnValue = item.psw;
            }

            return(returnValue);
        }