Beispiel #1
0
        private void btnEnter_Click(object sender, System.EventArgs e)
        {
            if (SysParams.LoginUser != null)
            {
                try
                {
                    string result = meetingAdd();
                    if (result == "1")
                    {

                        //创建会议室
                        if (this.meeting.Emcee == SysParams.LoginUser.UID && MessageBox.Show("会议室创建完毕,是否进入会议室?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            //进入会议室
                            meeting.MeetingStatus = (int)MeetingStatus.opening;
                            //ml.creatMeeting(meeting.MeetingGuid);
                            MeetingForm mf = new MeetingForm(meeting.MeetingGuid, true);
                            mf.Show();
                        }
                        else {
                            MessageBox.Show("会议室创建完毕,等待主持人进入。", "提示");
                        }
                        this.Close();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("会议室添加失败");
                    //throw;
                }
            }
            else
            {
                MessageBox.Show("用户还未登录,无法注册!");
            }
        }
Beispiel #2
0
        //进入会议室
        public void enterMeeting(DataRow dr)
        {
            int    ispublic = Convert.ToInt32(dr["ispublic"]);
            string roomName = dr["roomname"] != DBNull.Value ? dr["roomname"].ToString() : string.Empty;
            bool   isCommit = true;
            bool   isEmcee  = false;
            int    limit    = 0;

            try
            {
                limit = Convert.ToInt32(dr["memberlimit"]);
            }
            catch (Exception ex)
            {
            }

            string meetingGuid = dr["meetingGuid"].ToString();

            if (limit > 0)//
            {
                bool isAttend = meetingbll.AttendMeeting(meetingGuid, SysParams.LoginUser.UID.ToString(), limit.ToString());
                if (!isAttend)
                {
                    MessageBox.Show("会议室人员已满,无法进入。", "提示");
                    return;
                }
                //int currentMemberCount = Convert.ToInt32(dr["memberCount"]);
                //if(
            }
            if (Convert.ToInt32(dr["meetingStatus"]) == 0)                     //准备中
            {
                if (Convert.ToInt32(dr["emceeid"]) == SysParams.LoginUser.UID) //主持人
                {
                    ispublic = 1;
                    isEmcee  = true;
                    //meetingbll.creatMeeting(Convert.ToString(dr["meetingGuid"]));//创建会议室
                }
                else
                {
                    MessageBox.Show("会议正在准备中,无法进入。", "提示");
                    return;
                }
            }
            else if (Convert.ToInt32(dr["meetingStatus"]) == 1) //进行中
            {
                switch (ispublic)                               //会议室 是否公开
                {
                case 0:                                         //加密型 判断密码
                    MeetingPWD mp = new MeetingPWD(roomName);
                    mp.ShowDialog();
                    if (!string.IsNullOrEmpty(mp.pwd))
                    {
                        string pwd_tmp = dr["pwd"] != DBNull.Value ? dr["pwd"].ToString() : string.Empty;
                        if (pwd_tmp != mp.pwd)
                        {
                            isCommit = false;
                        }
                    }
                    else
                    {
                        isCommit = false;
                    }
                    break;
                }
            }
            else
            {
                MessageBox.Show("会议已结束,无法进入。", "提示");
                return;
            }


            if (isCommit)//公开 根据 MeetingGuid 直接进入
            {
                //Dictionary<string,string> dict=  meetingbll.retMeetingInfoByGuid(meetingGuid);
                MeetingForm mf = new MeetingForm(meetingGuid, isEmcee);
                mf.ShowDialog();
                this.Close();
            }
        }