Ejemplo n.º 1
0
 /// <summary>
 /// 更新用户列表
 /// </summary>
 /// <returns></returns>
 public bool upDateUserList(IMUserModel userlist, bool isAdd)
 {
     if (isAdd)//增加用户信息
     {
         if (UserStorage.userAllList.ContainsKey(userlist.UserId))
         {
             IMUserModel one = UserStorage.userAllList[userlist.UserId];
             UserStorage.userAllList.Remove(userlist.UserId);
             userlist.UserOnLine = one.UserOnLine;
             UserStorage.userAllList.Add(userlist.UserId, userlist);
         }
         else
         {
             UserStorage.userAllList.Add(userlist.UserId, userlist);
         }
         SendUserListToOthers();
     }
     else//删除用户
     {
         if (UserStorage.userAllList.ContainsKey(userlist.UserId))
         {
             UserStorage.userAllList.Remove(userlist.UserId);
             SendUserListToOthers();
         }
     }
     return(true);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新实时通信用户列表
        /// </summary>
        private void UpdateIMUserList(string keyValue, bool isAdd, UserEntity userEntity)
        {
            try
            {
                IMUserModel   entity = new IMUserModel();
                OrganizeBLL   bll    = new OrganizeBLL();
                DepartmentBLL dbll   = new DepartmentBLL();
                entity.UserId = keyValue;
                if (userEntity != null)
                {
                    //如果只是修改个人头像,下面只有头像一个数据不为null,其它都为空dbll.GetEntity(userEntity.DepartmentId).FullName;会抛异常
                    if (userEntity.RealName != null)
                    {
                        entity.RealName = userEntity.RealName;
                    }
                    if (userEntity.DepartmentId != null)
                    {
                        entity.DepartmentId = dbll.GetEntity(userEntity.DepartmentId).FullName;
                    }

                    if (userEntity.Gender != null)
                    {
                        entity.Gender = (int)userEntity.Gender;
                    }
                    if (userEntity.HeadIcon != null)
                    {
                        entity.HeadIcon = userEntity.HeadIcon;
                    }

                    if (userEntity.OrganizeId != null)
                    {
                        entity.OrganizeId = bll.GetEntity(userEntity.OrganizeId).FullName;
                    }
                }
                SendHubs.callMethod("upDateUserList", entity, isAdd);
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新实时通信用户列表
 /// </summary>
 private void UpdateIMUserList(string keyValue, bool isAdd, AppUserEntity userEntity)
 {
     try
     {
         IMUserModel      entity = new IMUserModel();
         AppOrganizeBLL   bll    = new AppOrganizeBLL();
         AppDepartmentBLL dbll   = new AppDepartmentBLL();
         entity.UserId = keyValue;
         if (userEntity != null)
         {
             entity.RealName     = userEntity.UserName;
             entity.DepartmentId = "";// dbll.GetEntity(userEntity.DepartmentId).FullName;
             //entity.Gender = (int)userEntity.Gender;
             //entity.HeadIcon = userEntity.HeadIcon;
             //entity.OrganizeId = bll.GetEntity(userEntity.OrganizeId).FullName; ;
         }
         SendHubs.callMethod("upDateUserList", entity, isAdd);
     }
     catch
     {
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新实时通信用户列表
 /// </summary>
 private void UpdateIMUserList(string keyValue, bool isAdd, UserEntity userEntity)
 {
     try
     {
         IMUserModel   entity = new IMUserModel();
         OrganizeBLL   bll    = new OrganizeBLL();
         DepartmentBLL dbll   = new DepartmentBLL();
         entity.F_UserId = keyValue;
         if (userEntity != null)
         {
             entity.F_RealName     = userEntity.F_RealName;
             entity.F_DepartmentId = dbll.GetEntity(userEntity.F_DepartmentId).F_FullName;
             entity.F_Gender       = (int)userEntity.F_Gender;
             entity.F_HeadIcon     = userEntity.F_HeadIcon;
             entity.F_OrganizeId   = bll.GetEntity(userEntity.F_OrganizeId).F_FullName;;
         }
         SendHubs.callMethod("upDateUserList", entity, isAdd);
     }
     catch
     {
     }
 }