コード例 #1
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);
        }
コード例 #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);
            }
        }