Esempio n. 1
0
        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>实体</returns>
        public BaseUserContactEntity GetUserContactObjectByCache(BaseUserInfo userInfo, int id)
        {
            BaseUserContactEntity entity = null;

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

            ServiceUtil.ProcessUserCenterReadDb(userInfo, parameter, (dbHelper) =>
            {
                entity = BaseUserContactManager.GetEntityByCache(id);
            });

            return(entity);
        }
        /// <summary>
        /// 离职处理
        /// </summary>
        /// <param name="userEntity"></param>
        /// <param name="userLogonEntity"></param>
        /// <param name="comment"></param>
        /// <returns>影响行数</returns>
        public int Leave(BaseUserEntity userEntity, BaseUserLogonEntity userLogonEntity, string comment)
        {
            var result = 0;

            if (userEntity != null)
            {
                // 更新用户实体
                UpdateEntity(userEntity);
            }

            // 更新登录信息
            if (userLogonEntity != null)
            {
                var userLogonManager = new BaseUserLogonManager(UserInfo);
                userLogonManager.UpdateEntity(userLogonEntity);
            }

            // 2016-03-17 吉日嘎拉 停止吉信的号码
            if (userEntity != null && !string.IsNullOrEmpty(userEntity.NickName))
            {
                //AfterLeaveStopIm(userEntity);
            }

            // 2016-03-17 吉日嘎拉 停止吉信的号码
            if (userEntity != null && userEntity.Id > 0)
            {
                BaseUserContactEntity userContactEntity = null;
                // 2015-12-08 吉日嘎拉 提高效率、从缓存获取数据
                userContactEntity = BaseUserContactManager.GetEntityByCache(userEntity.Id);

                if (userContactEntity != null && !string.IsNullOrEmpty(userContactEntity.CompanyEmail))
                {
                    ChangeUserMailStatus(userContactEntity.CompanyEmail, true);
                }
            }

            return(result);
        }