/// <summary>
        /// 按主键获取列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ids">主键数组</param>
        /// <returns>数据表</returns>
        public List <BaseOrganizeEntity> GetListByIds(BaseUserInfo userInfo, string[] ids)
        {
            List <BaseOrganizeEntity> result = new List <BaseOrganizeEntity>();

            var parameter = ServiceInfo.Create(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessUserCenterReadDb(userInfo, parameter, (dbHelper) =>
            {
                var userManager = new BaseOrganizeManager(dbHelper, userInfo);
                result          = userManager.GetList <BaseOrganizeEntity>(BaseOrganizeEntity.FieldId, ids, BaseOrganizeEntity.FieldSortCode);
            });

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 获取管理网点列表
        /// </summary>
        /// <returns>返回序列化</returns>
        public List <BaseOrganizeEntity> GetUserManageCompanes(string userId, string permissionId)
        {
            List <BaseOrganizeEntity> result = null;

            string[] manageCompanyIds = GetUserManageCompanyIds(userId, permissionId);
            if (manageCompanyIds != null && manageCompanyIds.Length < 1)
            {
                List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >();
                parameters.Add(new KeyValuePair <string, object>(BaseOrganizeEntity.FieldId, manageCompanyIds));
                parameters.Add(new KeyValuePair <string, object>(BaseOrganizeEntity.FieldEnabled, 1));
                parameters.Add(new KeyValuePair <string, object>(BaseOrganizeEntity.FieldDeletionStateCode, 0));
                BaseOrganizeManager organizeManager = new BaseOrganizeManager(this.DbHelper, this.UserInfo);
                result = organizeManager.GetList <BaseOrganizeEntity>(parameters);
            }
            return(result);
        }