コード例 #1
0
ファイル: FrmMain.cs プロジェクト: cslgwanglei/Ctalk
        public void getGroupList()
        {
            RelFriendToFrmTalk ft = new RelFriendToFrmTalk();

            BLL.groupu          bll       = new BLL.groupu();
            List <Model.groupu> grouplist = bll.GetModelList("groupfriendID=" + this._user.userID.ToString());
            int index = 0;

            foreach (Model.groupu mg in grouplist)
            {
                UCGroupList ucl = new UCGroupList();
                ucl.GroupID           = mg.groupID;
                ucl.Groupname         = mg.groupName;
                ucl.Top               = ucl.Height * index;
                ucl.HeadImage         = this.imageList1.Images[Convert.ToInt32(mg.groupImage)];
                ucl.MouseDoubleClick += new MouseEventHandler(ucl_MouseDoubleClick);
                ucl.Groupannouncement = mg.groupAnnouncement;
                ucl.FriendID          = this._user.userID;
                this.panel2.Controls.Add(ucl);
                index++;

                ft.FriendId       = mg.groupID;
                ft.IsOpenTalkForm = false;
                ft.Frm            = null;
                tbFriendTalkInfo.Add(ft);
                ucgroupe.Add(ucl);
            }
        }
コード例 #2
0
ファイル: FrmGroupTalk.cs プロジェクト: cslgwanglei/Ctalk
        private void SendMsg()
        {
            string comment = this.txtmessge.Text;

            if (comment == "")
            {
                return;
            }
            BLL.groupu          bllgroup = new BLL.groupu();
            List <Model.groupu> mgroup   = bllgroup.GetModelList("groupID=" + this._uc.GroupID);

            BLL.groupMessage   BllMsgInfo = new BLL.groupMessage();
            Model.groupMessage msg        = new Model.groupMessage();
            foreach (Model.groupu mgo in mgroup)
            {
                if (mgo.groupfriendID != this._me.userID)
                {
                    msg.messageContent = comment;
                    msg.senderID       = this._me.userID;
                    msg.receiverID     = mgo.groupfriendID;
                    msg.messageState   = 31;
                    msg.sendTime       = BLL.NormalOperation.getServerTime();
                    msg.groupID        = mgo.groupID;
                    int res = BllMsgInfo.Add(msg);
                    if (res <= 0)
                    {
                        MessageBox.Show("消息发送失败或检查网络连接!!");
                    }
                }
            }
            ShowMsg(msg, false);
            this.txtmessge.Text = "";
        }
コード例 #3
0
 private void FrmDeleteMember_Load_1(object sender, EventArgs e)
 {
     BLL.groupu bll = new BLL.groupu();
     groupfriend = bll.GetModelList("groupuserID=" + this._user.userID);
     this.Text   = this._user.userID + "从群删除联系人" + groupfriend[1].groupID;
     GetFriend();
 }
コード例 #4
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;
            }
        }
コード例 #5
0
 private void FrmAddGroupMember_Load(object sender, EventArgs e)
 {
     BLL.groupu bll = new BLL.groupu();
     groupfriend = bll.GetModelList("groupuserID=" + this._user.userID);
     this.Text   = this._user.userID + "添加群联系人到群" + groupfriend[1].groupID;
     GetFriend();
 }
コード例 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            BLL.groupu          bll    = new BLL.groupu();
            List <Model.groupu> mgroup = bll.GetModelList("groupfriendID='" + this.FriendID + "' and groupID='" + this.GroupID + "'");

            if (mgroup.Count == 0)
            {
                FRMGoupCheck frm = new FRMGoupCheck(FriendID, GroupImage, GroupID, GroupuserID, GroupName);
                frm.Show();
            }
        }
コード例 #7
0
ファイル: FrmMain.cs プロジェクト: cslgwanglei/Ctalk
        private void button2_Click(object sender, EventArgs e)
        {
            BLL.groupu          bll    = new BLL.groupu();
            List <Model.groupu> mgroup = bll.GetModelList("groupuserID =" + this._user.userID);

            if (mgroup.Count() < 1)
            {
                MessageBox.Show("您未创建了群,不能删除群成员!");
            }
            else
            {
                FrmDeleteMember frm = new FrmDeleteMember(this._user, this);
                frm.Show();
            }
        }
コード例 #8
0
ファイル: FrmMain.cs プロジェクト: cslgwanglei/Ctalk
        private void button1_Click(object sender, EventArgs e)
        {
            BLL.groupu          bll    = new BLL.groupu();
            List <Model.groupu> mgroup = bll.GetModelList("groupuserID =" + this._user.userID);

            if (mgroup.Count() < 1)
            {
                FrmAddGroup frm = new FrmAddGroup(this._user, this);
                frm.Show();
            }
            else
            {
                MessageBox.Show("您已创建了群,不能继续添加!");
            }
        }
コード例 #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            BLL.groupu          bll = new BLL.groupu();
            Model.groupu        m   = new Model.groupu();
            List <Model.groupu> m1  = bll.GetModelList("groupID=" + this._friendrequest.receiveID);

            m.groupID           = this._friendrequest.receiveID;
            m.groupfriendID     = this._friendrequest.senderID;
            m.groupAnnouncement = m1[0].groupAnnouncement;
            m.groupImage        = m1[0].groupImage;
            m.groupName         = m1[0].groupName;
            m.groupuserID       = m1[0].groupuserID;
            bll.Add(m);
            MessageBox.Show("添加成功!");
            this.Close();
        }
コード例 #10
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            BLL.groupu   bll    = new BLL.groupu();
            Model.groupu mgroup = new Model.groupu();
            foreach (UCGroup f in uc)
            {
                if (f.IsChouse == true)
                {
                    List <Model.groupu> groupid = bll.GetModelList("groupID='" + groupfriend[0].groupID + "'and groupfriendID='" + f.Id1 + "'");

                    foreach (Model.groupu m in groupid)
                    {
                        bll.Delete(m.ID);
                    }
                }
            }
            MessageBox.Show("删除成功!");
            this.Close();
            this._frm.getGroupList();
        }
コード例 #11
0
ファイル: FrmGroupTalk.cs プロジェクト: cslgwanglei/Ctalk
        private void FrmGroupTalk_Load(object sender, EventArgs e)
        {
            this.textBox2.Text = this._uc.Groupannouncement;
            FrmMain frm = new FrmMain();

            BLL.groupu          bll    = new BLL.groupu();
            List <Model.groupu> mylist = bll.GetModelList("groupID=" + this._uc.GroupID);
            int index = 0;

            foreach (Model.groupu mg in mylist)
            {
                BLL.userInfo   bu   = new BLL.userInfo();
                Model.userInfo mu   = bu.GetModel(mg.groupfriendID);
                UCGroup        ucg1 = new UCGroup();
                ucg1.Top       = ucg1.Height * index;
                ucg1.Id1       = mg.groupfriendID;
                ucg1.HeadImage = frm.imageList1.Images[Convert.ToInt32(mu.userHeadImage)];
                ucg1.Username  = mu.userName;
                luc.Add(ucg1);
                this.panel1.Controls.Add(ucg1);
                index++;
            }
        }
コード例 #12
0
ファイル: FrmMain.cs プロジェクト: cslgwanglei/Ctalk
        private void timeSystemn_Tick(object sender, EventArgs e)
        {
            BLL.messsageInfo          bmess = new BLL.messsageInfo();
            List <Model.messsageInfo> mmess = bmess.GetModelList("receiverID= '" + this._user.userID + "'and messageState=20 ");

            foreach (Model.messsageInfo m in mmess)
            {
                BLL.messsageInfo   BllMsgInfo = new BLL.messsageInfo();
                Model.messsageInfo msg        = new Model.messsageInfo();
                msg.messageContent = m.messageContent;
                msg.senderID       = m.senderID;
                msg.receiverID     = m.receiverID;
                msg.messageState   = 21;
                msg.sendTime       = m.sendTime;
                msg.messageID      = m.messageID;
                BllMsgInfo.Update(msg);
                BLL.userInfo   bll2     = new BLL.userInfo();
                Model.userInfo mfriend2 = bll2.GetModel(m.senderID);

                FrmimmediatelyMsg frm = new FrmimmediatelyMsg(tbFriendTalkInfo, this, this._user, mfriend2, mfriend2.userName);
                frm.Show();
            }
            BLL.friendRequest          bl     = new BLL.friendRequest();
            List <Model.friendRequest> mfrien = bl.GetModelList("senderID= '" + this._user.userID + "'and Station=2 ");

            foreach (Model.friendRequest m in mfrien)
            {
                FrmOkWarn sw = new FrmOkWarn(m, this);
                sw.Show();
                Model.friendRequest mf = new Model.friendRequest();
                mf.ID              = m.ID;
                mf.NickName        = m.NickName;
                mf.NumOfSameFriend = m.NumOfSameFriend;
                mf.receiveID       = m.receiveID;
                mf.senderID        = m.senderID;
                mf.ValidationInfo  = m.ValidationInfo;
                mf.ValidationTime  = m.ValidationTime;
                mf.Station         = 5;
                bl.Update(mf);
            }

            BLL.friendRequest          bll     = new BLL.friendRequest();
            List <Model.friendRequest> mfriend = bll.GetModelList("receiveID= '" + this._user.userID + "'and Station=1 ");

            foreach (Model.friendRequest m in mfriend)
            {
                SystemWarn sw = new SystemWarn(m, this);
                sw.Show();
                Model.friendRequest mf = new Model.friendRequest();
                mf.ID              = m.ID;
                mf.NickName        = m.NickName;
                mf.NumOfSameFriend = m.NumOfSameFriend;
                mf.receiveID       = m.receiveID;
                mf.senderID        = m.senderID;
                mf.ValidationInfo  = m.ValidationInfo;
                mf.ValidationTime  = m.ValidationTime;
                mf.Station         = 5;
                bll.Update(mf);
            }
            BLL.groupu          bllgroup = new BLL.groupu();
            List <Model.groupu> mgroup   = bllgroup.GetModelList("groupuserID=" + this._user.userID);

            if (mgroup.Count != 0)
            {
                int receiverID = mgroup[0].groupID;
                List <Model.friendRequest> mfriend2 = bll.GetModelList("receiveID= '" + receiverID + "'and Station=1 ");
                foreach (Model.friendRequest m in mfriend2)
                {
                    FrmGroupWarn sw = new FrmGroupWarn(m, this);
                    sw.Show();
                    Model.friendRequest mf = new Model.friendRequest();
                    mf.ID = m.ID;

                    mf.NumOfSameFriend = m.NumOfSameFriend;
                    mf.receiveID       = m.receiveID;
                    mf.senderID        = m.senderID;
                    mf.ValidationInfo  = m.ValidationInfo;
                    mf.ValidationTime  = m.ValidationTime;
                    mf.Station         = 5;
                    bll.Update(mf);
                }
            }
        }
コード例 #13
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.panel1.Controls.Clear();
            int gid = 0;
            int z   = 0;

            if (cmbFriend.Text == "按用户ID查询")
            {
                BLL.groupu          blluser = new BLL.groupu();
                List <Model.groupu> alluser = blluser.GetModelList("groupID like'%" + this.textBox1.Text + "%'");
                for (int i = 0; i < alluser.Count; i++)
                {
                    if (gid != alluser[i].groupID)
                    {
                        UCGroupSearch uc = new UCGroupSearch();
                        uc.Top         = z / 3 * uc.Height;
                        uc.Left        = z % 3 * uc.Width;
                        uc.GroupID     = alluser[i].groupID;
                        uc.GroupImage  = alluser[i].groupImage;
                        uc.GroupName   = alluser[i].groupName;
                        uc.GroupuserID = alluser[i].groupuserID;
                        uc.FriendID    = this._user.userID;
                        this.panel1.Controls.Add(uc);
                        gid = alluser[i].groupID;
                        z++;
                    }
                }
            }
            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++;
                }
            }
        }