public void AddPageControl(PageControl pc)
 {
     this.panelMain.Controls.Add(pc);
     pc.Width = panelMain.Width;
     pc.Height = panelMain.Height;
     pc.Dock = DockStyle.Fill;
 }
Пример #2
0
        /// <summary>加载分组用户</summary>
        private void LoadGroupMember()
        {
            List<DB_Talk.Model.m_Group> lstGroup = new DB_Talk.BLL.m_Group().GetModelList(string.Format("i_Flag=0 and groupTypeID={0} and BoxID={1}", PublicEnums.EnumGroupType.Normal.GetHashCode(),Pub.manageModel.BoxID.Value));
            int index = 1;//因为前面已加过两个了
            foreach (DB_Talk.Model.m_Group item in lstGroup)
            {
                index++;
                 NormalGroupModel gModel = new NormalGroupModel();
                 _lstGroup.Add(gModel);
                SuperTabItem a = new SuperTabItem();
                a.Text = item.vc_Name;
                a.SelectedTabFont = new System.Drawing.Font("宋体", 16F, 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;
                a.TabColor = superTabItemColorTable1;
                a.Tag = index;
                a.Click += new EventHandler(_mainForm.MemberTabItem_Click);

                Pub.SetSupperTabColor(a);

                _mainForm.superTabControlDispatch.Tabs.Add(a);


                SuperTabControlPanel sp = new SuperTabControlPanel();
                _mainForm.superTabControlDispatch.Controls.Add(sp);
                a.AttachedControl = sp;
                

                PageControl fp = new PageControl();
                sp.Controls.Add(fp);
                fp.Dock = DockStyle.Fill;

                gModel.PageControl = fp;
                List<DB_Talk.Model.v_GroupMembers> lstGroupMember = new DB_Talk.BLL.v_GroupMembers().GetModelList("groupid=" + item.ID);
                foreach (DB_Talk.Model.v_GroupMembers gItem in lstGroupMember)
                {
                    if (gItem.i_Number.Value != Pub.manageModel.LeftDispatchNumber.Value && gItem.i_Number.Value != Pub.manageModel.RightDispatchNumber.Value )
                    {
                        SingleUserControl sc = new SingleUserControl();
                        sc.MemberName = gItem.vc_Name;
                        sc.Number = gItem.i_Number.Value;
                        sc.ID = gItem.MemberID.Value;
                        if (gItem.DepartmentID!=null)
                        {
                            sc.DepartmentID = gItem.DepartmentID.Value;    
                        }

                        if (gItem.i_TellType != null)
                        {
                            sc.TellType = (CommControl.PublicEnums.EnumTelType)gItem.i_TellType.Value;
                        }

                        gModel.lstControl.Add(sc);
                        sc.Click += new EventHandler(_mainForm.single_Click);
                    }
                }
                fp.Init(gModel.lstControl);
            }
        }
Пример #3
0
        /// <summary>加载用户</summary>
        /// <param name="frm"></param>
        private void LoadMember()
        {
            //2014-11-11修改i_Dispatch=0,只显示正常号码,调度号和视频调度号不显示
            List<DB_Talk.Model.m_Member> lstMember = new DB_Talk.BLL.m_Member().GetModelList(string.Format("i_Flag=0 and i_IsDispatch=0 and BoxID={0} order by id",Pub.manageModel.BoxID.Value));

            //if (lstMember.Count == 0)
            //{
            //    CommControl.MessageBoxEx.MessageBoxEx.Show("请先到网管软件增加用户","提示");
            //    Application.Exit();
            //}

            PageControl pControl = new PageControl();
            _mainForm.superTabControlPanel5.Controls.Add(pControl);
            
            NormalGroupModel gModel = new NormalGroupModel();
            _lstGroup.Add(gModel);
            foreach (DB_Talk.Model.m_Member item in lstMember)
            {
                SingleUserControl s = new SingleUserControl();
                if (item.vc_Name!=null)
                {
                    s.MemberName = item.vc_Name.ToString();    
                }
                
                s.Number = item.i_Number.Value;
                s.ID = item.ID;
                if (item.LevelID!=null)
                {
                    s.MemberLevel = item.LevelID.Value;    
                }
                if (item.DepartmentID!=null)
                {
                    s.DepartmentID = item.DepartmentID.Value;
                }

                if (item.i_TellType != null )
                {
                    s.TellType = (CommControl.PublicEnums.EnumTelType)item.i_TellType.Value;
                }

                s.BackColor = Color.BlueViolet;
                if (s.Number != Pub.manageModel.LeftDispatchNumber.Value && s.Number != Pub.manageModel.RightDispatchNumber.Value)
                {
                    gModel.lstControl.Add(s);
                    s.Click += new EventHandler(_mainForm.single_Click);
                }
                else
                {

                }
            }

            gModel.PageControl = pControl;
            pControl.Init(gModel.lstControl);
            pControl.Dock = DockStyle.Fill;

            NormalGroupModel dispatchsModel = new NormalGroupModel();
            _lstGroup.Add(dispatchsModel);
            if (Pub.manageModel.LeftDispatchNumber!=null)
            {
                _mainForm.cLeft.Number = Pub.manageModel.LeftDispatchNumber.Value;
                _mainForm.cLeft.UserLineStatus = TalkControl.EnumUserLineStatus.Offline;
            }
            
            //_mainForm.cLeft.Name = "左席";
            _mainForm.cLeft.MemberName = Pub.manageModel.LeftDispatchName;
            _mainForm.cLeft.IsDispatch = true;

            dispatchsModel.lstControl.Add(_mainForm.cLeft);

            if (Pub.manageModel.RightDispatchNumber!=null)
            {
                _mainForm.cRight.Number = Pub.manageModel.RightDispatchNumber.Value;
                _mainForm.cRight.UserLineStatus = TalkControl.EnumUserLineStatus.Offline;
            }
            
            //_mainForm.cRight.Name = "右席";
            _mainForm.cRight.MemberName = Pub.manageModel.RightDispatchName;
            _mainForm.cRight.IsDispatch = true;
            dispatchsModel.lstControl.Add(_mainForm.cRight);
            Pub.SetSupperTabColor(_mainForm.stiAllMember);
        }
Пример #4
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);
        }