private void LoadManager(ObjectItem parentItem, string ParentID)
        {
            DataRow[] DT = S1103App.IDataTable11006.Select(string.Format("C004={0}", ParentID));

            foreach (DataRow drOrg in DT)
            {
                ObjectItem item = new ObjectItem();
                item.ObjType   = ConstValue.RESOURCE_ORG;
                item.ObjID     = Convert.ToInt64(drOrg["C001"].ToString());
                item.Name      = S1103App.DecryptString(drOrg["C002"].ToString());
                item.IsChecked = false;
                if (item.ObjID.ToString() == ConstValue.ORG_ROOT.ToString())
                {
                    item.Icon = "Images/root.ico";
                }
                else
                {
                    item.Icon = "Images/org.ico";
                }
                //加载下面的机构和用户
                LoadManager(item, item.ObjID.ToString());
                LoadUser(item, item.ObjID.ToString());

                Dispatcher.Invoke(new Action(() => parentItem.AddChild(item)));
            }
        }
 private void DisplayCombox()
 {
     ListOrg.Clear();
     foreach (DataRow drOrg in S1103App.IDataTable11006.Rows)
     {
         UserInfo orgInfo = new UserInfo();
         orgInfo.UserID   = Convert.ToInt64(drOrg["C001"].ToString());
         orgInfo.UserName = S1103App.DecryptString(drOrg["C002"].ToString());
         ListOrg.Add(orgInfo);
     }
 }
 private void LoadSkillGroup(ObjectItem mRootItemSG)
 {
     foreach (DataRow drOrg in S1103App.IDataTable11009.Rows)
     {
         ObjectItem item = new ObjectItem();
         item.Icon      = "Images/skillgroup.png";
         item.ObjType   = 906;
         item.ObjID     = Convert.ToInt64(drOrg["C001"].ToString());
         item.Name      = string.Format("{0}({1})", S1103App.DecryptString(drOrg["C006"].ToString()), drOrg["C008"].ToString());
         item.IsChecked = false;
         Dispatcher.Invoke(new Action(() => mRootItemSG.AddChild(item)));
         //mListObjectItem.Add(item);
     }
 }
        private void LoadUser(ObjectItem parentItem, string ParentID)
        {
            DataRow[] DT_User = S1103App.IDataTable11005.Select(string.Format("C006={0}", ParentID));

            foreach (DataRow drOrg in DT_User)
            {
                ObjectItem item = new ObjectItem();
                item.ObjType   = ConstValue.RESOURCE_USER;
                item.ObjID     = Convert.ToInt64(drOrg["C001"].ToString());
                item.Name      = string.Format("{0}({1})", S1103App.DecryptString(drOrg["C002"].ToString()), S1103App.DecryptString(drOrg["C003"].ToString()));
                item.Icon      = "Images/user.ico";
                item.IsChecked = false;
                //加载下面的机构和用户
                LoadManager(item, item.ObjID.ToString());
                Dispatcher.Invoke(new Action(() => parentItem.AddChild(item)));
            }
        }
 private void DisplayControl()
 {
     //if (IStrAgentID == string.Empty) { return; }
     if (ModelID == "E")
     {
         //坐席id、名称、机构
         DataRow[] DR_AgentOrg = S1103App.IDataTable11101.Select(string.Format("C001={0} AND C002=1", IStrAgentID));
         strAgentNameID             = DR_AgentOrg[0]["C017"].ToString();
         this.TextBoxAgentID.Text   = DR_AgentOrg[0]["C017"].ToString();
         this.TextBoxAgentName.Text = S1103App.DecryptString(DR_AgentOrg[0]["C018"].ToString());
         string AgentCondition = DR_AgentOrg[0]["C012"].ToString();
         if (AgentCondition == "1")
         {
             this.ComboBoxStatus.SelectedIndex = 0;
         }
         else
         {
             this.ComboBoxStatus.SelectedIndex = 1;
         }
         string AgentOrg = DR_AgentOrg[0]["C011"].ToString();
         this.ComboBoxOrg.SelectedIndex = ListOrg.FindIndex(p => p.UserID.ToString() == AgentOrg);
         //坐席等级
         DataRow[] DR_AgentTenure = S1103App.IDataTable11101.Select(string.Format("C001={0} AND C002=3", IStrAgentID));
         int       Tenure         = 0;
         if (DR_AgentTenure.Count() != 0)
         {
             if (int.TryParse(DR_AgentTenure[0]["C012"].ToString(), out Tenure))
             {
                 this.ComboBoxTenure.SelectedIndex = Tenure;
             }
         }
         //技能组
         List <string> SkillGroup = new List <string>();
         DataRow[]     DR_AgentSG = S1103App.IDataTable11201SA.Select(string.Format("C004={0}", IStrAgentID));
         foreach (DataRow dr in DR_AgentSG)
         {
             SkillGroup.Add(dr["C003"].ToString());
         }
         CheckTreeItem(mRootItemSG, SkillGroup);
         //管理者
         List <string> Manager         = new List <string>();
         DataRow[]     DR_AgentManager = S1103App.IDataTable11201UA.Select(string.Format("C004={0}", IStrAgentID));
         foreach (DataRow dr in DR_AgentManager)
         {
             Manager.Add(dr["C003"].ToString());
         }
         CheckTreeItem(mRootItem, Manager);
     }
     else
     {
         this.BtnMore.Visibility = Visibility.Collapsed;
         //set org chose
         if (IStrOrgID != string.Empty)
         {
             int indexOrg = -1;
             for (int i = 0; i < ListOrg.Count; i++)
             {
                 UserInfo TempUserInfo = ListOrg[i];
                 if (TempUserInfo != null)
                 {
                     if (IStrOrgID == TempUserInfo.UserID.ToString())
                     {
                         indexOrg = i; break;
                     }
                 }
             }
             this.ComboBoxOrg.SelectedIndex = indexOrg;
         }
     }
 }