Ejemplo n.º 1
0
        /// <summary>增加会议分组</summary>
        public void AddMeetingGroup(MeetingGroupModel.EnumMeetingState meetingState, DispatchPlatform.MeetingGroupModel.EnumMeetingType meetingType, int groupID, int meetingID, string meetingGroupName, List<DB_Talk.Model.m_Member> lstMembers, long dispatchNumber, bool tabVisible)
        {
            foreach (SuperTabItem item in _mainForm.superTabControlMeeting.Tabs)
            {
                MeetingGroupModel model = (MeetingGroupModel)item.Tag;
                if (model.GroupName == meetingGroupName || lstMembers.Count==0)
                {
                    return;
                }
            }


            SuperTabItem tabItem = new SuperTabItem();
            
            tabItem.GlobalItem = false;
            tabItem.SelectedTabFont = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold);
            superTabLinearGradientColorTable1.Colors = new System.Drawing.Color[] {
        System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(41)))), ((int)(((byte)(48))))),
        System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(113)))), ((int)(((byte)(130)))))};
            superTabItemStateColorTable1.Background = superTabLinearGradientColorTable1;
            superTabColorStates1.Selected = superTabItemStateColorTable1;
            superTabItemColorTable1.Bottom = superTabColorStates1;
            tabItem.TabColor = superTabItemColorTable1;
            
            tabItem.Text = meetingGroupName;


            Pub.SetSupperTabColor(tabItem);

            tabItem.Click += new EventHandler(_mainForm.MeetingTabItem_Click);

            MeetingGroupModel mModel = new MeetingGroupModel();
            
            mModel.MeetingState = meetingState;
            mModel.MeetingID = meetingID;
            mModel.GroupID = groupID;
            mModel.GroupName = meetingGroupName;
            mModel.MeetingType = meetingType;
            mModel.DispatchNumber = dispatchNumber;
            tabItem.Tag = mModel;

            _lstGroup.Add(mModel);

           
            _mainForm.superTabControlMeeting.Tabs.Add(tabItem);

            _mainForm.superTabControlMeeting.SelectedTab = tabItem;
            SuperTabControlPanel sp = new SuperTabControlPanel();

            tabItem.Visible = tabVisible;

            _mainForm.superTabControlMeeting.Controls.Add(sp);
            tabItem.AttachedControl = sp;

            //_lstGroup.Add(mModel);
            PageControl pControl = new PageControl();
            mModel.pageControl = pControl;
            pControl.Dock = DockStyle.Fill;
            sp.Controls.Add(pControl);
            
            foreach (DB_Talk.Model.m_Member item in lstMembers)
            {
                if (item.i_Number != Pub.manageModel.LeftDispatchNumber.Value && item.i_Number != Pub.manageModel.RightDispatchNumber.Value)
                {
                    SingleUserControl sc = new SingleUserControl();

                    sc.Number = item.i_Number.Value;
                    sc.MemberName = item.vc_Name;
                    sc.ID = item.ID;
                    if (item.DepartmentID!=null)
                    {
                        sc.DepartmentID = item.DepartmentID.Value;    
                    }

                    if (item.i_TellType != null)
                    {
                        sc.TellType = (CommControl.PublicEnums.EnumTelType)item.i_TellType.Value;
                        if (item.i_TellType.Value==0)
                        {
                            sc.TellType = PublicEnums.EnumTelType.WiFi手机;
                        }
                    }
                    else
                    {
                        sc.TellType = PublicEnums.EnumTelType.WiFi手机;
                    }

                    if (meetingType == MeetingGroupModel.EnumMeetingType.Temp)
                    {
                        sc.PeerNumber = meetingGroupName;
                        sc.UserLineStatus = Pub._memberManage.GetMemberState(item.i_Number.Value);
                    }

                    mModel.lstControl.Add(sc);
                    sc.Click += new EventHandler(_mainForm.single_Click);
                }
            }
            if (meetingType == MeetingGroupModel.EnumMeetingType.Temp)
            {
                mModel.DispatchNumber = dispatchNumber;
                tabItem.RaiseClick();
            }
            pControl.Init(mModel.lstControl);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除正式会议成员
        /// </summary>
        /// <param name="model"></param>
        /// <param name="meetingID"></param>
        /// <param name="number"></param>
        private void DeleteFormlMeetingMember(SuperTabItem sti,MeetingGroupModel model, long number)
        {
            List<DB_Talk.Model.v_GroupMembers> lstGroupMember = new DB_Talk.BLL.v_GroupMembers().GetModelList("groupid=" + model.GroupID);

            DB_Talk.Model.v_GroupMembers member = lstGroupMember.Find(m => m.i_Number == number);

            if (member == null)//说明是邀请过来的
            {
                model.lstControl.Remove(model.lstControl.Find(p => p.Number == number));
            }
            //int tempCount = model.lstControl.Count;
            //for (int j = tempCount - 1; j >= 0; j--)
            //{
            //    bool isFind = false;
            //    foreach (DB_Talk.Model.v_GroupMembers mem in lstGroupMember)
            //    {
            //        if (model.lstControl[j].Number == mem.i_Number.Value)
            //        {
            //            isFind = true;
            //            break;
            //        }
            //    }
            //    if (isFind == false)
            //    {
            //        model.lstControl.Remove(model.lstControl[j]);
            //    }
            //}
            Pub.CanDestroyControl = false;
            model.pageControl.Init(model.lstControl);
            Pub.CanDestroyControl = true;

            List<SingleUserControl> lstControl = model.lstControl.FindAll(p =>
                    p.UserLineStatus == TalkControl.EnumUserLineStatus.Busy
                    || p.UserLineStatus == TalkControl.EnumUserLineStatus.Forbid
                    || p.UserLineStatus == TalkControl.EnumUserLineStatus.Isolate
                    || p.UserLineStatus == TalkControl.EnumUserLineStatus.Ring
                    || p.UserLineStatus == TalkControl.EnumUserLineStatus.Record
                    );

            if (lstControl != null && lstControl.Count > 0)
            {

            }
            else
            {
                model.MeetingState = MeetingGroupModel.EnumMeetingState.Off;
                sti.RaiseClick();
            }

            //bool allIdel = true;//所有都空闲改变会议状态为结束
            ////
            //foreach (SingleUserControl item in model.lstControl)
            //{
            //    if (item.UserLineStatus == TalkControl.EnumUserLineStatus.Busy)
            //    {
            //        allIdel = false;
            //        break;
            //    }
            //}
            //if (allIdel)
            //{
            //    model.MeetingState = MeetingGroupModel.EnumMeetingState.Off;
             //_mainForm.superTabControlMeeting.Tabs[i].RaiseClick();
            //}
        }