Exemplo n.º 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);
 }
Exemplo n.º 2
0
        public ActionResult GridData(string entityName)
        {
            GridRequest request = new GridRequest(Request);
            var query = (from a in FlowContract.FlowArchives where a.CreatorUserId==Operator.UserId
                         join i in FlowContract.FlowItems on a.FlowItemId equals i.Id
                         join r in FlowContract.FlowRelateForms on i.FlowDesignId equals r.FlowDesignId
                         join f in FlowContract.FlowForms on r.FlowFormId equals f.Id
                         join d in CommonContract.Dictionarys on f.TypeVal equals d.Value
                         select new FlowFormDto
                         {
                             Id = a.Id,
                             FormName = i.EntityName,
                             TypeVal = f.TypeVal,
                             TypeName = d.Name,
                             CreatorUserName = a.CreatorUserName,
                             CreatTime = a.CreatedTime
                         })
                        .WhereIf(c => c.FormName.Contains(entityName), !entityName.IsNullOrEmpty());
            var total = query.Count();
            if (request.PageCondition.SortConditions.Length > 0)
            {
                foreach (var item in request.PageCondition.SortConditions)
                {
                    query = query.OrderBy(item.SortField, item.ListSortDirection);
                }
            }
            else
                query = query.OrderBy("CreatTime", ListSortDirection.Descending);

            var list = query.Skip((request.PageCondition.PageIndex - 1) * request.PageCondition.PageSize).Take(request.PageCondition.PageSize).ToList();
            var data = new GridData<FlowFormDto>(list, total);

            return Json(data, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 3
0
        public ActionResult GridData(int? id)
        {
            GridRequest request = new GridRequest(Request);
            var page = GetPageResult(IdentityContract.Roles, m => new
            {
                m.Id,
                m.Name,
                m.Remark,
                m.IsAdmin,
                m.IsSystem,
                m.IsLocked,
                m.CreatedTime
            }, request);

            return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 4
0
 public ActionResult GridData(string formName)
 {
     GridRequest request = new GridRequest(Request);
     var page = GetPageResult(FlowContract.FlowDesigns,
         m => new
         {
             m.Id,
             m.FlowType,
             m.FlowName,
             m.CreatorUserName,
             m.CreatedTime,
             m.Status
         },
         request);
     return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 5
0
 public ActionResult GridData()
 {
     GridRequest request = new GridRequest(Request);
     request.AddDefaultSortCondition(new SortCondition("CreatedTime", ListSortDirection.Descending));
     var page = GetPageResult(FlowContract.FlowItems,
         m => new
         {
             m.Id,
             m.EntityName,
             m.CreatorUserName,
             m.CreatedTime,
             m.DelayDay,
             m.StepDay,
             m.HandleDay
         },
         request);
     return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 6
0
 public ActionResult GridData()
 {
     GridRequest request = new GridRequest(Request);
     var predicate = ExpressionExtensions.True<WorkFlowTask>();
     predicate = predicate.And(c => c.Status >= 10 && c.ReceiverId == Operator.UserId);
     var page = FlowContract.FlowTasks.ToPage(predicate, request.PageCondition, m => new
     {
         m.Id,
         m.FlowItemId,
         m.FlowItem.FlowDesignId,
         m.FlowItem.EntityId,
         m.FlowItem.EntityName,
         m.StepName,
         m.SenderName,
         m.CreatedTime,
         m.Status,
         m.StepDay,
         m.DelayDay,
         m.DelayReason
     });
     return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 7
0
 public ActionResult GridData()
 {
     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.ToPageCache(predicate,
         request.PageCondition,
         m => new
         {
             m.Id,
             m.Name,
             m.ClassName,
             m.DataLogEnabled
         });
     return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 8
0
 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.OrganizationId,
             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);
 }
Exemplo n.º 9
0
 public ActionResult GridData()
 {
     GridRequest request = new GridRequest(Request);
     request.AddDefaultSortCondition(new SortCondition("CreatedTime", ListSortDirection.Descending));
     request.FilterGroup.Rules.Add(new FilterRule("CreatorUserId", Operator.UserId));
     request.FilterGroup.Operate = FilterOperate.And;
     var page = GetPageResult(FlowContract.FlowDelegations,
         m => new
         {
             m.Id,
             m.FlowDesignId,
             m.TrusteeId,
             FlowName=m.FlowDesign.FlowName,
             m.CreatorUserName,
             m.CreatedTime,
             m.TrusteeName,
             m.StartTime,
             m.EndTime,
             m.Status
         },
         request);
     return Json(page.ToGridData(), JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 10
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);
 }
Exemplo n.º 11
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")
         };
     }
     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,
             m.MenuName,
             m.Type,
             m.IconCls
         });
     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,
         m.MenuName,
         m.Type,
         m.IconCls
     }).ToArray();
     return Json(gridData, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 12
0
        public ActionResult GridData(string formName)
        {
            GridRequest request = new GridRequest(Request);
            var query = (from form in FlowContract.FlowForms
                         join r in FlowContract.FlowRelateForms on form.Id equals r.FlowFormId into fr
                         from r in fr.DefaultIfEmpty()
                         join d in CommonContract.Dictionarys on form.TypeVal equals d.Value into dic
                         from d in dic.DefaultIfEmpty()
                         select new FlowFormDto
                        {
                            Id=form.Id,
                            FormName=form.FormName,
                            TypeVal = form.TypeVal,
                            TypeName=d.Name,
                            CreatorUserName=form.CreatorUserName,
                            CreatTime=form.CreatedTime,
                            FilePath=form.FilePath,
                            ActionPath=form.ActionPath,
                            EnabledFlow=form.EnabledFlow,
                            Status=form.Status,
                            FlowDesignId=r.FlowDesignId
                        })
                        .WhereIf(c=>c.FormName.Contains(formName),!formName.IsNullOrEmpty());
            var total = query.Count();
            if (request.PageCondition.SortConditions.Length > 0  )
            {
                foreach (var item in request.PageCondition.SortConditions)
                {
                    query = query.OrderBy(item.SortField, item.ListSortDirection);
                }
            }
            else
                query=query.OrderBy("CreatTime", ListSortDirection.Descending);

            var list = query.Skip((request.PageCondition.PageIndex - 1) * request.PageCondition.PageSize).Take(request.PageCondition.PageSize).ToList();
            var data = new GridData<FlowFormDto>(list, total);

            return Json(data, JsonRequestBehavior.AllowGet);
        }