Ejemplo n.º 1
0
        public void Search(object sender, EventArgs e)
        {
            if (!IsInt(searchText.Text))
            {
                MessageBox.Show("请输入正确的用户ID!");
                return;
            }
            var groupInfo = UserHome.QueryGroupInfo(Convert.ToInt32(searchText.Text));

            if (groupInfo == null)
            {
                MessageBox.Show("该群不存在");
                return;
            }
            searchInfo.Visible    = true;
            groupNumber.Text      = groupInfo.groupId.ToString();
            groupNumber.Visible   = true;
            groupName.Text        = groupInfo.groupName;
            groupName.Visible     = true;
            groupAdmin.Text       = groupInfo.master.ToString();
            groupAdmin.Visible    = true;
            groupMember.Text      = groupInfo.groupMember.Count.ToString();
            groupMember.Visible   = true;
            groupSynopsis.Text    = groupInfo.groupSynopsis;
            groupSynopsis.Visible = true;
        }
Ejemplo n.º 2
0
 public void NoCloseCheck(object sender, EventArgs e)
 {
     if (noClose.Checked)
     {
         UserHome.NoCloseMain();
         this.Close();
     }
 }
Ejemplo n.º 3
0
 public void WantClose(object ssender, EventArgs e)
 {
     if (close.Checked)
     {
         UserHome.CloseMain(_userId);
         this.Close();
     }
 }
Ejemplo n.º 4
0
        public void UserHomeStart(UserInfo info)
        {
            var userHome = new UserHome();

            userHome._mineInfo = info;
            userHome.InitUserHome(info);
            userHome.MdiParent = this.MdiParent;
            userHome.Show();
            userHome.CheckPopUP();
            this.Hide();
        }
Ejemplo n.º 5
0
        public void InitGroupApply()
        {
            var groupInfo = UserHome.QueryGroupInfo(_groupId);

            if (groupInfo.apply == null)
            {
                groupInfo.apply = new List <int>();
            }
            for (int i = 0; i < groupInfo.apply.Count; i++)
            {
                applyListBox.Font = new Font(this.Font.FontFamily, 18);
                applyListBox.Items.Add("ID:" + groupInfo.apply[i] + " 申请加入群聊");
            }
        }
Ejemplo n.º 6
0
        public void InitGroupInfo()
        {
            var groupInfo = UserHome.QueryGroupInfo(_groupId);

            mineGroup        = groupInfo;
            GroupName.Text   = groupInfo.groupName;
            groupNotice.Text = "群简介:" + groupInfo.groupSynopsis;
            groupNumber.Text = "(" + groupInfo.groupMember.Count + ")";
            for (int i = 0; i < groupInfo.groupMember.Count; i++)
            {
                var user = UserHome.QueryUserInfo(groupInfo.groupMember[i]);
                groupMemberList.Items.Add(user.name);
            }
        }
Ejemplo n.º 7
0
        public void Search(object sender, EventArgs e)
        {
            if (!IsInt(searchText.Text))
            {
                MessageBox.Show("请输入正确的用户ID!");
                return;
            }
            var userInfo = UserHome.QueryUserInfo(Convert.ToInt32(searchText.Text));

            if (userInfo == null)
            {
                MessageBox.Show("该用户不存在!");
                return;
            }
            friendID.Text      = userInfo.userId.ToString();
            friendID.Visible   = true;
            friendName.Text    = userInfo.name;
            friendName.Visible = true;
            if (!string.IsNullOrEmpty(userInfo.signature))
            {
                friendSign.Text    = userInfo.signature;
                friendSign.Visible = true;
            }
            else
            {
                friendSign.Text = "这个人很懒,什么都没写";
            }
            friendSign.Visible = true;
            if (!string.IsNullOrEmpty(userInfo.photo))
            {
                var photoByte = Convert.FromBase64String(userInfo.photo);
                var ts        = new MemoryStream(photoByte);
                ts.Position = 0;
                var img = Image.FromStream(ts);
                friendPhoto.Image = img;
                ts.Close();
                friendPhoto.Visible = true;
            }
        }