コード例 #1
0
ファイル: FrmMain.cs プロジェクト: cslgwanglei/Ctalk
        private void FrmMain_Load(object sender, EventArgs e)
        {
            this.timeSystemn.Enabled = true;
            BLL.userInfo          bllUserInfo = new BLL.userInfo();
            List <Model.userInfo> muer        = bllUserInfo.GetModelList("");

            foreach (Model.userInfo m in muer)
            {
                if (m.userState != 2)
                {
                    loginno++;
                }
            }
            this.notifyIcon1.Visible = true;
            this.Top  = 0;
            this.Left = Screen.PrimaryScreen.Bounds.Width - this.Width;
            showMyinfo();
            this.txtshuoshuo.Visible = false;
            getFriendList();
            this.tmPicker.Enabled   = true;
            this.pictureBox22.Image = this.imageList2.Images[this._user.userState - 1];
            getGroupList();
            getrecentfriend();
            BLL.groupu          bll    = new BLL.groupu();
            List <Model.groupu> mgroup = bll.GetModelList("groupuserID =" + this._user.userID);

            if (mgroup.Count() < 1)
            {
                this.btnAddmember.Visible = false;
                this.button2.Visible      = false;
            }
        }
コード例 #2
0
        private void FrmAddUser_Load(object sender, EventArgs e)
        {
            BLL.userInfo blluser = new BLL.userInfo();

            List <Model.userInfo> mu = blluser.GetModelList("");
            int userid = 0;

            userid    = 10001 + mu.Count;
            this.Text = "您的ID为" + userid.ToString();
        }
コード例 #3
0
ファイル: FrmLogin.cs プロジェクト: cslgwanglei/Ctalk
        public void ShowList()
        {
            BLL.userInfo          bllUserInfo = new BLL.userInfo();
            List <Model.userInfo> users       = bllUserInfo.GetModelList("1=1");

            this.cmbUser.Items.Clear();
            foreach (Model.userInfo u in users)
            {
                this.cmbUser.Items.Add(u.userID);
            }
        }
コード例 #4
0
ファイル: FrmMain.cs プロジェクト: cslgwanglei/Ctalk
        private void RefreshList()
        {
            int mn = 0;

            BLL.userInfo          bllUserInfo = new BLL.userInfo();
            List <Model.userInfo> muer        = bllUserInfo.GetModelList("");

            foreach (Model.userInfo m in muer)
            {
                if (m.userState != 2 && m.userState != 3)
                {
                    mn++;
                }
            }
            if (mn != loginno)
            {
                loginno = mn;
                this.panel1.Controls.Clear();
                getFriendList();
            }
        }
コード例 #5
0
        private void GetFriend()
        {
            int     i   = 0;
            FrmMain frm = new FrmMain();

            this.panel1.Controls.Clear();
            BLL.userInfo          bll   = new BLL.userInfo();
            List <Model.userInfo> muser = bll.GetModelList("userID like'%" + this.txtsearch.Text + "%'");
            int indext = 0;

            foreach (Model.userInfo m in muser)
            {
                foreach (Model.groupu mg in groupfriend)
                {
                    if (m.userID == mg.groupfriendID)
                    {
                        i++;
                    }
                }

                if (i != 0)
                {
                    UCGroup ucg = new UCGroup();
                    ucg.Top               = ucg.Height * indext;
                    ucg.Id1               = m.userID;
                    ucg.Username          = m.userName;
                    ucg.IsChouse          = false;
                    ucg.HeadImage         = frm.imageList1.Images[Convert.ToInt32(m.userHeadImage)];
                    ucg.Headimageindex    = Convert.ToInt32(m.userHeadImage);
                    ucg.MouseDoubleClick += new MouseEventHandler(ucg_MouseDoubleClick);
                    indext++;
                    uc.Add(ucg);
                    this.panel1.Controls.Add(ucg);
                }
                i = 0;
            }
        }
コード例 #6
0
        private void btnSearch_Click_1(object sender, EventArgs e)
        {
            this.panFriend.Controls.Clear();

            if (cmbFriend.Text == "按用户ID查询")
            {
                BLL.userInfo          blluser = new BLL.userInfo();
                List <Model.userInfo> alluser = blluser.GetModelList("userID like'%" + this.txtID.Text + "%'");
                int index = 0;


                for (int j = 0; j < alluser.Count; j++)
                {
                    int                     i          = 0;
                    BLL.friendInfo          bll        = new BLL.friendInfo();
                    List <Model.friendInfo> userfriend = bll.GetModelList(" userID= " + this._user.userID);
                    List <Model.friendInfo> friend     = bll.GetModelList(" userID= " + alluser[j].userID);
                    foreach (Model.friendInfo uf in userfriend)
                    {
                        foreach (Model.friendInfo f in friend)
                        {
                            if (uf.friendID == f.friendID)
                            {
                                i++;
                            }
                        }
                    }

                    UCFriendSearchList uc = new UCFriendSearchList();
                    uc.MouseEnter   += new EventHandler(uc_MouseEnter);
                    uc.Top           = j / 3 * uc.Height;
                    uc.Left          = j % 3 * uc.Width;
                    uc.HeadImage     = this._frm.imageList1.Images[Convert.ToInt16(alluser[j].userHeadImage)];
                    uc.UserID        = alluser[j].userID;
                    uc.UserName      = alluser[j].userName;
                    uc.Iname         = this._user.userName;
                    uc.Id            = this._user.userID;
                    uc.SameFriend    = i;
                    uc.Iimage        = this._frm.imageList1.Images[Convert.ToInt16(this._user.userHeadImage)];
                    uc.FrmtalkIsOpen = false;
                    ucflFriend.Add(uc);
                    ;
                    this.panFriend.Controls.Add(uc);
                    index++;
                }
            }
            if (cmbFriend.Text == "按用户NAME查询")
            {
                BLL.userInfo          blluser = new BLL.userInfo();
                List <Model.userInfo> alluser = blluser.GetModelList("userName like'%" + this.txtID.Text + "%'");
                int index = 0;

                for (int j = 0; j < alluser.Count; j++)
                {
                    int                     i          = 0;
                    BLL.friendInfo          bll        = new BLL.friendInfo();
                    List <Model.friendInfo> userfriend = bll.GetModelList(" userID= " + this._user.userID);
                    List <Model.friendInfo> friend     = bll.GetModelList(" userID= " + alluser[j].userID);
                    foreach (Model.friendInfo uf in userfriend)
                    {
                        foreach (Model.friendInfo f in friend)
                        {
                            if (uf.friendID == f.friendID)
                            {
                                i++;
                            }
                        }
                    }

                    UCFriendSearchList uc = new UCFriendSearchList();
                    uc.MouseEnter   += new EventHandler(uc_MouseEnter);
                    uc.Top           = j / 3 * uc.Height;
                    uc.Left          = j % 3 * uc.Width;
                    uc.HeadImage     = this._frm.imageList1.Images[Convert.ToInt16(alluser[j].userHeadImage)];
                    uc.UserID        = alluser[j].userID;
                    uc.UserName      = alluser[j].userName;
                    uc.Id            = this._user.userID;
                    uc.Iname         = this._user.userName;
                    uc.SameFriend    = i;
                    uc.Iimage        = this._frm.imageList1.Images[Convert.ToInt16(this._user.userHeadImage)];
                    uc.FrmtalkIsOpen = false;
                    ucflFriend.Add(uc);
                    this.panFriend.Controls.Add(uc);
                    index++;
                }
            }
        }