Beispiel #1
0
        private void btnQueryAll_Click(object sender, EventArgs e)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }
            var lst = query(txtConference.Text, txtAddress.Text, txtPort.Text);
            var sb  = new StringBuilder();

            for (var i = 0; i < lst.Length; i++)
            {
                var arr      = lst[i].Split('\t');
                var userCode = arr[0];
                var userId   = arr[1];
                var isMuted  = arr[2] == "Mute" ? "静音" : "正常";
                int speakerVolume;
                crm.GetSpeakerVolume(Convert.ToInt32(userCode), out speakerVolume);
                int micPhoneVolume;
                crm.GetMicPhoneVolume(Convert.ToInt32(userCode), out micPhoneVolume);
                sb.Append($"会议室ID={txtConference.Text},用户代码={userCode},用户ID={userId},是否静音={isMuted},输入={micPhoneVolume},输出={speakerVolume}{System.Environment.NewLine}");
            }
            MessageBox.Show(sb.ToString());
        }
Beispiel #2
0
        private string[] query(string conference, string address, string port)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(conference, address, port);

            var lst = crm.GetConferenceRoomUserList().Select(x => $"{x.UserCode}\t{x.UserId}\t{x.AudioStatus}\t{x.IsPrimarySpeaker}");

            return(lst.ToArray());
        }
Beispiel #3
0
        private void btnMute_Click(object sender, EventArgs e)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }
            crm.MuteConferenceUser(txtUserCode.Text, out string errorMessage);
        }
Beispiel #4
0
        private void btnSetSpeaker_Click(object sender, EventArgs e)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }
            crm.SetSpeakerVolume(Convert.ToInt32(txtUserCode.Text), (int)numericUpDown1.Value);
        }
Beispiel #5
0
        /// <summary>
        /// 查询会议室全体成员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();

            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }
            listBox1.Items.AddRange(query(txtConference.Text, txtAddress.Text, txtPort.Text));
        }
Beispiel #6
0
        private void btnGetSpeakerVolume_Click(object sender, EventArgs e)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }
            int volume;

            crm.GetSpeakerVolume(Convert.ToInt32(txtUserCode.Text), out volume);
            txtRtnVolume.Text = volume.ToString();
        }
Beispiel #7
0
        /// <summary>
        /// 全部静音::包括主播在内都不能说。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMuteAll_Click(object sender, EventArgs e)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }

            if (!crm.SetConferenceMute(out string errorMessage))
            {
                MessageBox.Show("设置失败!");
            }
        }
Beispiel #8
0
        /// <summary>
        /// 会议室
        /// </summary>
        /// <returns></returns>
        public List <ConferenceRoomManagement> getRooms()
        {
            string sql   = string.Format("select * from MS_Conference_Room_Management");
            var    table = DBHelper.Select(sql);
            List <ConferenceRoomManagement> list = new List <ConferenceRoomManagement>();

            foreach (DataRow item in table.Rows)
            {
                ConferenceRoomManagement room = new ConferenceRoomManagement
                {
                    ConferenceRoomID   = Convert.ToInt32(item["Conference_RoomID"]),
                    ConferenceRoomName = item["Conference_Room_Name"].ToString()
                };
                list.Add(room);
            }
            return(list);
        }
Beispiel #9
0
        /// <summary>
        /// 全部成员允许说话
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCancelMuteAll_Click(object sender, EventArgs e)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }
            foreach (var usr in crm.GetConferenceRoomUserList())
            {
                if (!crm.UnmuteConferenceUser(usr.UserCode, out string errorMessage))
                {
                    //MessageBox.Show("设置失败!");
                }
            }
        }
Beispiel #10
0
        private void btnCancelMute_Click(object sender, EventArgs e)
        {
            ConferenceRoomManagement crm = new ConferenceRoomManagement(txtConference.Text, txtAddress.Text, txtPort.Text);

            if (!crm.IsExistConferenceRoom())
            {
                MessageBox.Show("会议室不存在!");
                return;
            }

            var oldList = crm.GetConferenceRoomUserList();

            var item = oldList.FirstOrDefault(x => x.UserCode == txtUserCode.Text);

            if (item != null && item.AudioStatus == EnumAudioStatus.Mute)
            {
                if (!crm.UnmuteConferenceUser(item.UserCode, out string errorMessage))
                {
                    MessageBox.Show("设置失败!");
                }
            }
        }