Exemplo n.º 1
0
        /// <summary>
        ///     取得列表数据
        /// </summary>
        protected override void GetListData()
        {
            var filter = new LambdaItem <UserJobData>();

            if (LoginUser.Id > 1)
            {
                filter.Root = p => p.ToUserId == LoginUser.Id && p.DataState == DataStateType.None;
            }
            else
            {
                filter.Root = p => p.DataState == DataStateType.None;
            }
            SetArg("order", "desc");
            SetArg("order", "Id");
            var size = LoginUser.Id > 1?GetIntArg("size", 6):9999;
            var type = GetArg("type");
            List <UserJobData> datas;

            switch (type)
            {
            case "msg":
                filter.AddAnd(p => p.JobType == UserJobType.Message);
                break;

            case "audit":
                filter.AddAnd(p => p.JobType == UserJobType.Audit);
                if (LoginUser.Id > 1)
                {
                    filter.AddAnd(p => p.JobStatus < JobStatusType.Succeed);
                }
                break;

            case "edit":
                filter.AddAnd(p => p.JobType == UserJobType.Edit);
                if (LoginUser.Id > 1)
                {
                    filter.AddAnd(p => p.JobStatus < JobStatusType.Succeed);
                }
                break;

            default:
                datas = Business.Access.PageData(1, 100, p => p.Date, true, filter);
                SetResult(datas);
                return;
            }
            datas = Business.Access.PageData(1, size, p => p.Date, true, filter);
            SetResult(datas);
        }
Exemplo n.º 2
0
 /// <summary>
 ///     关键字查询缺省实现
 /// </summary>
 /// <param name="filter">筛选器</param>
 public void SetKeywordFilter(LambdaItem<UserJobData> filter)
 {
     var keyWord = GetArg("keyWord");
     if (!string.IsNullOrEmpty(keyWord))
     {
         filter.AddAnd(p => p.Title.Contains(keyWord) || p.Message.Contains(keyWord) || p.ToUserName.Contains(keyWord) || p.FromUserName.Contains(keyWord));
     }
 }
        /// <summary>
        ///     关键字查询缺省实现
        /// </summary>
        /// <param name="filter">筛选器</param>
        public void SetKeywordFilter(LambdaItem <PositionPersonnelData> filter)
        {
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.Personnel.Contains(keyWord) || p.Appellation.Contains(keyWord) || p.Position.Contains(keyWord) || p.Role.Contains(keyWord) || p.Tel.Contains(keyWord) || p.Mobile.Contains(keyWord) || p.Organization.Contains(keyWord) || p.Department.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
        }
        /// <summary>
        ///     关键字查询缺省实现
        /// </summary>
        /// <param name="filter">筛选器</param>
        public static void SetKeywordFilger(LambdaItem <PersonnelData> filter)
        {
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.FullName.Contains(keyWord) || p.Tel.Contains(keyWord) || p.Mobile.Contains(keyWord) || p.Memo.Contains(keyWord) || p.Role.Contains(keyWord));
            }
        }
Exemplo n.º 5
0
        /// <summary>
        ///     关键字查询缺省实现
        /// </summary>
        /// <param name="filter">筛选器</param>
        public void SetKeywordFilter(LambdaItem <OrganizePositionData> filter)
        {
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.Position.Contains(keyWord) || p.Role.Contains(keyWord) || p.Department.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        ///     关键字查询缺省实现
        /// </summary>
        /// <param name="filter">筛选器</param>
        public void SetKeywordFilter(LambdaItem <RoleData> filter)
        {
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.Role.Contains(keyWord) || p.Caption.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
        }
Exemplo n.º 7
0
        /// <summary>
        ///     关键字查询缺省实现
        /// </summary>
        /// <param name="filter">筛选器</param>
        protected void DefaultGetListData(LambdaItem <PositionData> filter)
        {
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.FullName.Contains(keyWord) || p.ShortName.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
        }
Exemplo n.º 8
0
        /// <summary>
        ///     关键字查询缺省实现
        /// </summary>
        /// <param name="filter">筛选器</param>
        public static void SetKeywordFilger(LambdaItem <AreaData> filter)
        {
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.Code.Contains(keyWord) || p.FullName.Contains(keyWord) || p.ShortName.Contains(keyWord) || p.TreeName.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
        }
Exemplo n.º 9
0
        /// <summary>
        ///     关键字查询缺省实现
        /// </summary>
        /// <param name="filter">筛选器</param>
        public void SetKeywordFilter(LambdaItem <UserData> filter)
        {
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.RealName.Contains(keyWord) || p.UserName.Contains(keyWord) || p.PassWord.Contains(keyWord) || p.Role.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
        }
Exemplo n.º 10
0
        /// <summary>
        ///     取得列表数据
        /// </summary>
        protected override void GetListData()
        {
            var root = new LambdaItem <UserData>();
            var name = GetArg("name");

            if (!string.IsNullOrEmpty(name))
            {
                root.AddAnd(p => p.UserName.Contains(name) || p.RealName.Contains(name) || p.Memo.Contains(name));
            }
            base.GetListData(root);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 当前数据筛选器
        /// </summary>
        /// <returns></returns>
        protected override LambdaItem <OrganizationData> GetFilter()
        {
            var filter = new LambdaItem <OrganizationData>
            {
                Root = p => p.DataState <= DataStateType.Discard
            };
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.Code.Contains(keyWord) || p.FullName.Contains(keyWord) || p.ShortName.Contains(keyWord) || p.TreeName.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
            return(filter);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 当前数据筛选器
        /// </summary>
        /// <returns></returns>
        protected override LambdaItem <OrganizePositionData> GetFilter()
        {
            var filter = new LambdaItem <OrganizePositionData>
            {
                Root = p => p.DataState <= DataStateType.Discard
            };
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.Position.Contains(keyWord) || p.Role.Contains(keyWord) || p.Department.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
            return(filter);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 当前数据筛选器
        /// </summary>
        /// <returns></returns>
        protected override LambdaItem <UserData> GetFilter()
        {
            var filter = new LambdaItem <UserData>
            {
                Root = p => p.DataState <= DataStateType.Discard
            };
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.RealName.Contains(keyWord) || p.UserName.Contains(keyWord) || p.PassWord.Contains(keyWord) || p.Role.Contains(keyWord) || p.Memo.Contains(keyWord));
            }
            return(filter);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 当前数据筛选器
        /// </summary>
        /// <returns></returns>
        protected override LambdaItem <UserJobData> GetFilter()
        {
            var filter = new LambdaItem <UserJobData>
            {
                Root = p => p.DataState <= DataStateType.Discard
            };
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                filter.AddAnd(p => p.Title.Contains(keyWord) || p.Message.Contains(keyWord) || p.ToUserName.Contains(keyWord) || p.FromUserName.Contains(keyWord));
            }
            return(filter);
        }
Exemplo n.º 15
0
        /// <summary>
        ///     取得列表数据
        /// </summary>
        protected override void GetListData()
        {
            var root = new LambdaItem <PersonnelData>();
            //if (!CanDoAction("all"))
            //{
            //    root.Expression = p => p.JoinOrgId == BusinessContext.Current.LoginUser.CompanyId;
            //}
            var key = GetArg("keyWord");

            if (!string.IsNullOrWhiteSpace(key))
            {
                root.AddAnd(p => p.FullName.Contains(key) || p.Tel.Contains(key) || p.Mobile.Contains(key));
            }
            base.GetListData(root);
        }
Exemplo n.º 16
0
        /// <summary>
        ///     取得列表数据
        /// </summary>
        protected override void GetListData()
        {
            var root = new LambdaItem <PageItemData>();
            var fid  = GetIntArg("fid");

            if (fid >= 0)
            {
                root.Root = p => p.ParentId == fid;
            }
            else
            {
                root.Root = p => p.ItemType <= PageItemType.Page;
            }
            var keyWord = GetArg("keyWord");

            if (!string.IsNullOrEmpty(keyWord))
            {
                root.AddAnd(p => p.Name.Contains(keyWord) || p.Caption.Contains(keyWord) || p.Url.Contains(keyWord));
            }
            base.GetListData(root);
        }