コード例 #1
0
        public JsonResult UserData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string reportType)// string reportType
        {
            var defaultSortBy      = Constants.SortField.Username;
            var pagingParameter    = MVCExtensionMethods.GetPagingParametersII(requestModel, defaultSortBy, Constants.SortOrder.Ascending.ToLower());
            AllUserListModel model = new AllUserListModel();

            if (reportType.ToLower() == ReportTypeEnum.DormantUser.ToString().ToLower())
            {
                model.ReportTypeEnum = ReportTypeEnum.DormantUser;
            }
            else if (reportType.ToLower() == ReportTypeEnum.NewUser.ToString().ToLower())
            {
                model.ReportTypeEnum = ReportTypeEnum.NewUser;
            }
            else if (reportType.ToLower() == ReportTypeEnum.DisabledUser.ToString().ToLower())
            {
                model.ReportTypeEnum = ReportTypeEnum.DisabledUser;
            }
            else if (reportType.ToLower() == ReportTypeEnum.ExpiredAccount.ToString().ToLower())
            {
                model.ReportTypeEnum = ReportTypeEnum.ExpiredAccount;
            }
            UserListingReportsList userListingReportsList = _reportService.GetUsersList(model, pagingParameter);
            var data = userListingReportsList.UserLstResult;

            return(Json(new DataTablesResponse((int)requestModel.Draw, data, userListingReportsList.PagerResource.ResultCount, userListingReportsList.PagerResource.ResultCount), JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public JsonResult ListExceptionData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            var defaultSortBy   = Constants.SortField.Username;
            var pagingParameter = MVCExtensionMethods.GetPagingParametersII(requestModel, defaultSortBy, Constants.SortOrder.Ascending.ToLower());

            ReportsExceptionListingResponse exceptionList = _reportService.GetExceptionList(pagingParameter);
            var data = exceptionList.UserListingResult;

            return(Json(new DataTablesResponse((int)requestModel.Draw, data, exceptionList.PagerResource.ResultCount, exceptionList.PagerResource.ResultCount), JsonRequestBehavior.AllowGet));
        }