Example #1
0
        //��������ÿ�
        private void inviteToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                inviteToolStripButton.Enabled = false;
                VisitorListViewItem v = getSelectedVisitorListViewItem();
                if (v != null && v.VisitSession.Status == VisitSessionStatus.Visiting)
                {
                    if (!operaterServiceAgent.IsVisitorHasActiveChat(v.Visitor.VisitorId))
                    {
                        ChatForm cf = new ChatForm(operaterServiceAgent);
                        Program.ChatForms.Add(cf);
                        cf.Show();
                        cf.Invite(v.Visitor.VisitorId); // should call after show
                    }
                }
                else
                {
                    MessageBox.Show("�÷ÿ��ѱ������ͷ�������ڶԻ���");

                }

            }
            finally
            {
                inviteToolStripButton.Enabled = true;
            }
        }
Example #2
0
        // ���ܷÿ�����
        private void acceptToolStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                acceptToolStripButton.Enabled = false;
                VisitorListViewItem vlvi = getSelectedVisitorListViewItem();
                if (vlvi != null)
                {
                    Chat chat = operaterServiceAgent.GetChatRequest(vlvi.Visitor.VisitorId);
                    if (chat != null && vlvi.VisitSession.Status == VisitSessionStatus.ChatRequesting)
                    {
                        ChatForm cf = new ChatForm(operaterServiceAgent);
                        Program.ChatForms.Add(cf);
                        cf.Show();
                        cf.Accept(chat);
                    }
                    else
                    {
                        MessageBox.Show("�÷ÿ���ʱ��δ����Ի�");
                    }

                }
            }
            finally
            {
                acceptToolStripButton.Enabled = true;
            }
        }