Beispiel #1
0
        public KendoResponse GetAllUsers([FromBody] KendoRequest req)
        {
            List <User> users = new List <User> {
            };

            var order = "UserId";

            KendoHelper.getSortOrder(req, ref order);
            var parameters  = new List <object>();
            var whereClause = KendoHelper.getWhereClause <Subscriber>(req, parameters);

            users = _dbhelper.GetUsers();

            var query = users.OrderBy(p => p.UserId).AsQueryable();

            if (req != null && req.sort != null && req.sort.Any())
            {
                var sort = req.sort.First();
                if (sort.dir != "asc")
                {
                }
            }

            var data = query
                       .Skip(req.skip)
                       .Take(req.take)
                       .ToArray();

            return(new KendoResponse(data, query.Count()));
        }
Beispiel #2
0
        public KendoResponse RequesterHistory([FromBody] KendoRequest req, string msisdn)
        {
            List <Request> swaprequests = new List <Request>();

            var order = "DateSubmitted";

            KendoHelper.getSortOrder(req, ref order);
            var parameters  = new List <object>();
            var whereClause = KendoHelper.getWhereClause <Subscriber>(req, parameters);

            swaprequests = _dbhelper.GetRequesterHistory(msisdn);

            var query = swaprequests.OrderBy(p => p.Id).AsQueryable();

            if (req != null && req.sort != null && req.sort.Any())
            {
                var sort = req.sort.First();
                if (sort.dir != "asc")
                {
                }
            }

            var data = query
                       .Skip(req.skip)
                       .Take(req.take)
                       .ToArray();

            return(new KendoResponse(data, query.Count()));
        }
Beispiel #3
0
        public KendoResponse GetSimSwapRequestsByUser([FromBody] KendoRequest req, int userid)
        {
            List <SimSwapRequests> swaprequests = new List <SimSwapRequests>();

            var order = "Id";

            KendoHelper.getSortOrder(req, ref order);
            var parameters  = new List <object>();
            var whereClause = KendoHelper.getWhereClause <Subscriber>(req, parameters);

            swaprequests = _dbhelper.GetSimSwapRequestByUser(userid);

            var query = swaprequests.OrderBy(p => p.Id).AsQueryable();

            if (req != null && req.sort != null && req.sort.Any())
            {
                var sort = req.sort.First();
                if (sort.dir != "asc")
                {
                }
            }

            var data = query
                       .Skip(req.skip)
                       .Take(req.take)
                       .ToArray();

            return(new KendoResponse(data, query.Count()));
        }