Ejemplo n.º 1
0
        public DataTableResult <CustomUserPlan> SearchUserPlans(DataTableAjaxPostModel model)
        {
            var searchBy = (model.search != null) ? model.search.value : null;
            var take     = model.length;
            var skip     = model.start;

            string sortBy  = "";
            bool   sortDir = true;

            if (model.order != null)
            {
                // in this example we just default sort on the 1st column
                sortBy  = model.columns[model.order[0].column].data;
                sortDir = model.order[0].dir.ToLower() == "asc";
            }

            // search the dbase taking into consideration table sorting and paging
            TittleUserServices _Service             = new TittleUserServices();
            DataTableResult <CustomUserPlan> result = new Models.DataTableResult <CustomUserPlan>();
            int filteredResultsCount = 0;
            int totalResultsCount    = 0;

            result.result = _Service.GetUserPlans(searchBy, model.promoCode, model.plan, model.fromDate, model.toDate, take, skip, sortBy, sortDir, out filteredResultsCount, out totalResultsCount);
            result.filteredResultsCount = filteredResultsCount;
            result.totalResultsCount    = totalResultsCount;
            if (result.result == null)
            {
                // empty collection...
                return(new DataTableResult <CustomUserPlan>());
            }
            return(result);
        }
Ejemplo n.º 2
0
        public DataTableResult <CustomUser> SearchRedeemUsers(DataTableAjaxPostModel model)
        {
            var searchBy = (model.search != null) ? model.search.value : null;
            var take     = model.length;
            var skip     = model.start;

            string sortBy  = "";
            bool   sortDir = true;

            if (model.order != null)
            {
                // in this example we just default sort on the 1st column
                sortBy  = model.columns[model.order[0].column].data;
                sortDir = model.order[0].dir.ToLower() == "asc";
            }

            // search the dbase taking into consideration table sorting and paging
            TittleUserServices           _UserServices = new TittleUserServices();
            DataTableResult <CustomUser> result        = new Models.DataTableResult <CustomUser>();
            int    filteredResultsCount = 0;
            int    totalResultsCount    = 0;
            int    iosCount             = 0;
            int    androidCount         = 0;
            string countryGrouping      = "";

            result.result = _UserServices.GetRedeemUsedUsersList(searchBy, take, skip, sortBy, sortDir, out filteredResultsCount, out totalResultsCount, out iosCount, out androidCount, out countryGrouping);
            result.filteredResultsCount = filteredResultsCount;
            result.totalResultsCount    = totalResultsCount;
            result.iosCount             = iosCount;
            result.androidCount         = androidCount;
            result.countryGrouping      = countryGrouping;
            if (result.result == null)
            {
                // empty collection...
                return(new DataTableResult <CustomUser>());
            }
            return(result);
        }