コード例 #1
0
 public ActionResult DataLogGridData(int id)
 {
     GridRequest request = new GridRequest(Request);
     if (id > 0)
     {
         request.FilterGroup.Rules.Add(new FilterRule("OperateLog.Id", id));
     }
     int total;
     var datas = GetQueryData<DataLog, int>(LoggingContract.DataLogs, out total, request).Select(m => new
     {
         m.Id,
         m.EntityKey,
         m.Name,
         m.EntityName,
         m.OperateType,
         LogItems = m.LogItems.Select(n => new
         {
             n.Field,
             n.FieldName,
             n.OriginalValue,
             n.NewValue,
             n.DataType
         })
     }).ToList();
     return Json(new GridData<object>(datas, total), JsonRequestBehavior.AllowGet);
 }
コード例 #2
0
 public ActionResult GridData()
 {
     GridRequest request = new GridRequest(Request);
     if (request.PageCondition.SortConditions.Length == 0)
     {
         request.PageCondition.SortConditions = new[]
         {
             new SortCondition("Area"),
             new SortCondition("Controller"),
             new SortCondition("Name")
         };
     }
     IFunction function = this.GetExecuteFunction();
     Expression<Func<Function, bool>> predicate = FilterHelper.GetExpression<Function>(request.FilterGroup);
     var page = SecurityContract.Functions.ToPage(predicate,
         request.PageCondition,
         m => new
         {
             m.Id,
             m.Name,
             m.Url,
             m.FunctionType,
             m.OperateLogEnabled,
             m.DataLogEnabled,
             m.CacheExpirationSeconds,
             m.IsCacheSliding,
             m.Area,
             m.Controller,
             m.Action,
             m.IsController,
             m.IsAjax,
             m.IsChild,
             m.IsLocked,
             m.IsTypeChanged,
             m.IsCustom
         });
     GridData<object> gridData = new GridData<object>() { Total = page.Total };
     gridData.Rows = page.Data.Select(m => new
     {
         m.Id,
         m.Name,
         m.Url,
         m.FunctionType,
         m.OperateLogEnabled,
         m.DataLogEnabled,
         m.CacheExpirationSeconds,
         m.IsCacheSliding,
         m.Area,
         m.Controller,
         m.Action,
         ModuleName = m.Area + "-" + m.Controller,
         m.IsController,
         m.IsAjax,
         m.IsChild,
         m.IsLocked,
         m.IsTypeChanged,
         m.IsCustom
     }).ToArray();
     return Json(gridData, JsonRequestBehavior.AllowGet);
 }
コード例 #3
0
 public ActionResult GridData()
 {
     int total;
     GridRequest request = new GridRequest(Request);
     if (request.PageCondition.SortConditions.Length == 0)
     {
         request.PageCondition.SortConditions = new[]
         {
             new SortCondition("Area"),
             new SortCondition("Controller"),
             new SortCondition("Name")
         };
     }
     var datas = GetQueryData<Function, Guid>(SecurityContract.Functions, out total, request)
         .Select(m => new
         {
             m.Id,
             m.Name,
             m.Url,
             m.FunctionType,
             m.OperateLogEnabled,
             m.DataLogEnabled,
             m.Area,
             m.Controller,
             m.Action,
             m.IsController,
             m.IsAjax,
             m.IsChild,
             m.IsLocked,
             m.IsTypeChanged,
             m.IsCustom
         }).Select(m => new
         {
             m.Id,
             m.Name,
             m.Url,
             m.FunctionType,
             m.OperateLogEnabled,
             m.DataLogEnabled,
             m.Area,
             m.Controller,
             m.Action,
             ModuleName = m.Area + "-" + m.Controller,
             m.IsController,
             m.IsAjax,
             m.IsChild,
             m.IsLocked,
             m.IsTypeChanged,
             m.IsCustom
         }).ToList();
     return Json(new GridData<object>(datas, total), JsonRequestBehavior.AllowGet);
 }
コード例 #4
0
ファイル: MapsController.cs プロジェクト: rhjv55/Xyun
 public ActionResult GridData(int? id)
 {
     int total;
     GridRequest request = new GridRequest(Request);
     if (id.HasValue && id.Value > 0)
     {
         request.FilterGroup.Rules.Add(new FilterRule("Game.Id", id.Value));
     }
     var datas = GetQueryData<Map, int>(IGameContract.Maps, out total, request).Select(m => new
     {
         m.Id,
         m.Name,
         GameId = m.Game.Id,
         GameName = m.Game.Name,
     });
     return Json(new GridData<object>(datas, total), JsonRequestBehavior.AllowGet);
 }
コード例 #5
0
 public ActionResult GridData()
 {
     int total;
     GridRequest request = new GridRequest(Request);
     if (request.PageCondition.SortConditions.Length == 0)
     {
         request.PageCondition.SortConditions = new[]
         {
             new SortCondition("ClassName")
         };
     }
     Expression<Func<EntityInfo, bool>> predicate = FilterHelper.GetExpression<EntityInfo>(request.FilterGroup);
     var page = SecurityContract.EntityInfos.ToPage(predicate,
         request.PageCondition,
         m => new { m.Id, m.Name, m.ClassName, m.DataLogEnabled });
     return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
 }
コード例 #6
0
 public ActionResult GridData()
 {
     int total;
     GridRequest request = new GridRequest(Request);
     if (request.PageCondition.SortConditions.Length == 0)
     {
         request.PageCondition.SortConditions = new[]
         {
             new SortCondition("ClassName")
         };
     }
     var datas = GetQueryData<EntityInfo, Guid>(SecurityContract.EntityInfos, out total, request).Select(m => new
     {
         m.Id,
         m.Name,
         m.ClassName,
         m.DataLogEnabled
     }).ToList();
     return Json(new GridData<object>(datas, total), JsonRequestBehavior.AllowGet);
 }
コード例 #7
0
ファイル: DelayTimeController.cs プロジェクト: TGHGH/MesDemo
 public ActionResult GridData(int? id)
 {
     int total;
     GridRequest request = new GridRequest(Request);
     if (id.HasValue && id.Value > 0)
     {
         request.FilterGroup.Rules.Add(new FilterRule("Organization.Id", id.Value));
     }
     var datas = GetQueryData<DelayTime, int>(DelayTimeContract.DelayTimes, out total, request).Select(m => new
     {
         m.Id,
         m.Line,
         m.Duty,
         m.CreatedTime,
         m.Hour,
         m.WorkDate,
         m.IsDeleted
     });
     return Json(new GridData<object>(datas, total), JsonRequestBehavior.AllowGet);
 }
コード例 #8
0
 public ActionResult GridData(int? id)
 {
     int total;
     GridRequest request = new GridRequest(Request);
     if (id.HasValue && id.Value > 0)
     {
         request.FilterGroup.Rules.Add(new FilterRule("Organization.Id", id.Value));
     }
     var datas = GetQueryData<Role, int>(IdentityContract.Roles, out total, request).Select(m => new
     {
         m.Id,
         m.Name,
         m.Remark,
         m.IsAdmin,
         m.IsLocked,
         OrganizationId = m.Organization.Id,
         OrganizationName = m.Organization.Name,
         UserCount = m.Users.Count
     });
     return Json(new GridData<object>(datas, total), JsonRequestBehavior.AllowGet);
 }
コード例 #9
0
ファイル: UsersController.cs プロジェクト: qjw2bqn/osharp
 public ActionResult GridData()
 {
     GridRequest request = new GridRequest(Request);
     request.AddDefaultSortCondition(new SortCondition("CreatedTime", ListSortDirection.Descending));
     var page = GetPageResult(IdentityContract.Users,
         m => new
         {
             m.Id,
             m.UserName,
             m.NickName,
             m.Email,
             m.EmailConfirmed,
             m.PhoneNumber,
             m.PhoneNumberConfirmed,
             m.LockoutEndDateUtc,
             m.AccessFailedCount,
             m.IsLocked,
             m.CreatedTime
         },
         request);
     return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
 }
コード例 #10
0
ファイル: RolesController.cs プロジェクト: qjw2bqn/osharp
        public ActionResult GridData(int? id)
        {
            GridRequest request = new GridRequest(Request);
            if (id.HasValue && id.Value > 0)
            {
                request.FilterGroup.Rules.Add(new FilterRule("Organization.Id", id.Value));
            }
            var page = GetPageResult(IdentityContract.Roles, m => new
            {
                m.Id,
                m.Name,
                m.Remark,
                m.IsAdmin,
                m.IsSystem,
                m.IsLocked,
                m.CreatedTime,
                OrganizationId = m.Organization == null ? 0 : m.Organization.Id,
                OrganizationName = m.Organization.Name
            }, request);

            return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
        }
コード例 #11
0
 public ActionResult OperateLogGridData()
 {
     int total;
     GridRequest request = new GridRequest(Request);
     if (request.PageCondition.SortConditions.Length == 0)
     {
         request.PageCondition.SortConditions = new[] { new SortCondition("CreatedTime", ListSortDirection.Descending) };
     }
     var datas = GetQueryData<OperateLog, int>(LoggingContract.OperateLogs, out total, request).Select(m => new
     {
         m.Id,
         m.FunctionName,
         m.Operator.UserId,
         m.Operator.NickName,
         m.Operator.Ip,
         m.CreatedTime,
         DataLogs = new { m.Id, m.DataLogs.Count }
     }).ToList();
     return Json(new GridData<object>(datas, total), JsonRequestBehavior.AllowGet);
 }