예제 #1
0
 public List <AppUserDto> Fetch(UserSearchParam param)
 {
     return(_db.Fetch <User>(param.ToSearchUtil()).Select(u => new AppUserDto
     {
         Id = u.Id,
         Name = u.Name
     }).ToList());
 }
        /// <summary>
        /// 获取最近盘点的资产
        /// </summary>
        /// <param name="id"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public JsonResult GetLastCheckItems(int id, int count = 20)
        {
            MySearchUtil util = MySearchUtil.New()
                                .AndNotNullOrEmpty("CheckAt")
                                .OrderByDesc("CheckAt");

            var list = _db.Fetch(util, "Asset_StockItem", "DeptName,AccountName,AssetName,AssetCode,Checkor,CheckAt", count);

            return(Json(list));
        }
예제 #3
0
        public List <AssetCateDto> Fetch()
        {
            var util = MySearchUtil.New().AndEqual("IsDel", false);
            var all  = _db.Fetch <AssetCate>(util);

            return(all.Select(a => new AssetCateDto
            {
                Id = a.Id,
                Name = a.Name,
                ParentId = a.ParentId,
                Sort = a.Sort
            }).ToList());
        }
예제 #4
0
        public List <DeptDto> Fetch(DeptSearchParam input)
        {
            var util = input.ToSearchUtil();
            var all  = _db.Fetch <Dept>(util);

            return(all.Select(a => new DeptDto
            {
                Id = a.Id,
                Name = a.Name,
                Sort = a.Sort,
                ParentId = a.ParentId
            }).ToList());
        }
예제 #5
0
        /// <summary>
        /// 获取用户基本信息
        /// </summary>
        /// <param name="deptId">部门id</param>
        /// <returns></returns>
        public List <AccountBaseDto> GetAccountsBaseInfo(int?deptId, string key = "")
        {
            var param = new AccountSearchParam
            {
                IsStrict = true
            };

            if (deptId.HasValue)
            {
                param.Dept = (int)deptId;
            }
            if (!string.IsNullOrWhiteSpace(key))
            {
                param.Key = key;
            }
            return(_db.Fetch <AccountBaseDto>(param.ToSearchUtil(), "Base_Account", "Id,Name,DeptId").ToList());
        }
예제 #6
0
        public RoleEditDto Load(int id)
        {
            var entity = _db.Load <RoleEntity>(id);

            if (entity == null || entity.IsDel)
            {
                return(null);
            }

            var powerIds = _db.Fetch <RolePowerEntity>(MySearchUtil.New().AndEqual("RoleId", id)).Select(p => p.Id)
                           .ToArray();

            return(new RoleEditDto
            {
                Id = id,
                Name = entity.Name,
                DataPermissionType = entity.DataPermissionType,
                Powers = powerIds,
                Departments = JsonConvert.DeserializeObject <int[]>(entity.DepartmentIdJson)
            });
        }
예제 #7
0
        /// <summary>
        /// 获取符合条件的所有盘点项
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public IEnumerable <StockItemDto> FetchDto(StockItemSearchParam param)
        {
            var util = param.ToSearchUtil();

            return(_db.Fetch <StockItemDto>(util, "StockItemView"));
        }
        public List <ServiceApply> Fetch(ServiceApplySearchParam param)
        {
            var util = param.ToSearchUtil();

            return(_db.Fetch <ServiceApply>(util).ToList());
        }
예제 #9
0
 /// <summary>
 /// 获取所有数据
 /// </summary>
 /// <param name="util">查询参数</param>
 /// <returns></returns>
 public virtual IEnumerable <T> Fetch(MySearchUtil util)
 {
     return(db.Fetch <T>(util));
 }
예제 #10
0
        public List <T> Fetch(BaseSearchParam param = null)
        {
            var util = param?.ToSearchUtil() ?? new MySearchUtil();

            return(Db.Fetch <T>(util));
        }
예제 #11
0
 /// <summary>
 /// 获取所有数据
 /// </summary>
 /// <param name="util">查询参数</param>
 /// <returns></returns>
 public virtual IEnumerable <T> Fetch(ISearchParam param)
 {
     return(db.Fetch <T>(param.ToSearchUtil()));
 }