//更新座席分机数据 void InitOrgAndQA(ObjectItemTask parentItem, string parentID) { List <CtrolOrg> lstCtrolOrgTemp = new List <CtrolOrg>(); lstCtrolOrgTemp = S3103App.ListCtrolOrgInfos.Where(p => p.OrgParentID == parentID).ToList(); foreach (CtrolOrg org in lstCtrolOrgTemp) { ObjectItemTask item = new ObjectItemTask(); item.ObjType = ConstValue.RESOURCE_ORG; item.ObjID = Convert.ToInt64(org.ID); item.Name = org.OrgName; item.Data = org; item.IsChecked = false; if (org.ID == ConstValue.ORG_ROOT.ToString()) { item.Icon = "/Themes/Default/UMPS3103/Images/rootorg.ico"; } else { item.Icon = "/Themes/Default/UMPS3103/Images/org.ico"; } InitOrgAndQA(item, org.ID); InitControlQA(item, org.ID); AddChildObject(parentItem, item); } }
public AssignToQA() { InitializeComponent(); mRootItem = new ObjectItemTask(); mListCtrolQA = new List<CtrolQA>(); Loaded+=AssignToQA_Loaded; }
public ReCheckToQA() { InitializeComponent(); mRootItem = new ObjectItemTask(); mListCtrolQA = new List <CtrolQA>(); this.Loaded += ReCheckToQA_Loaded; }
private void InitControlQA(ObjectItemTask parentItem, string parentID) { try { List <CtrolQA> lstCtrolQATemp = new List <CtrolQA>(); lstCtrolQATemp = S3103App.ListCtrolQA.Where(p => p.OrgID == parentID).ToList(); foreach (CtrolQA qa in lstCtrolQATemp) { ObjectItemTask item = new ObjectItemTask(); bool IsAdd = true; item.ObjType = ConstValue.RESOURCE_USER; item.ObjID = Convert.ToInt64(qa.UserID); item.Name = qa.UserFullName; item.Description = qa.UserName; item.Data = qa; item.IsChecked = false; item.Icon = "/Themes/Default/UMPS3103/Images/agent.ico"; foreach (RecordInfoItem infoItem in ReCheckRecordInfoItem) { if (qa.UserID == infoItem.TaskUserID) { IsAdd = false; } } if (IsAdd) { AddChildObject(parentItem, item); } } } catch (Exception ex) { ShowException(ex.Message); } }
void QueryReCheck_Loaded(object sender, RoutedEventArgs e) { mRootQa = new ObjectItemTask(); ChangeLanguage(); DateStart.Value = DateTime.Now.Date; DateStop.Value = DateTime.Now.Date.AddDays(1).AddMilliseconds(-1); InitControlObjects(); TQAObjects.ItemsSource = mRootQa.Children; }
public KeyWordList() { InitializeComponent(); mRootItem = new ObjectItemTask(); mListSelectedObjects_KeyWords = new List <ObjectItemTask>(); mListKeywordInfos = new List <KeywordInfo>(); Loaded += KeyWordList_Loaded; }
private void InitKeyWords(ObjectItemTask parentItem, string parentID) { try { mListKeywordInfos.Clear(); WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3103Codes.GetKeyWords; // Service31031Client client = new Service31031Client(); Service31031Client client = new Service31031Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress( CurrentApp.Session.AppServerInfo, "Service31031")); WebHelper.SetServiceClient(client); WebReturn webReturn = client.UMPTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException(string.Format("Fail.\tListData is null")); return; } OperationReturn optReturn; for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; optReturn = XMLHelper.DeserializeObject <KeywordInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } KeywordInfo info = optReturn.Data as KeywordInfo; if (info == null) { ShowException(string.Format("KeywordInfo is null.")); return; } mListKeywordInfos.Add(info); } CurrentApp.WriteLog("LoadKeywordInfos", string.Format("End.\t{0}", mListKeywordInfos.Count)); } catch (Exception ex) { ShowException(ex.Message); } }
private void GetQAIsCheck(ObjectItemTask parent, ref List <CtrolQA> lstCtrolQa) { //mRootItem foreach (ObjectItemTask o in parent.Children) { if (o.IsChecked == true && o.ObjType == ConstValue.RESOURCE_USER) { CtrolQA ctrolqa = new CtrolQA(); ctrolqa = (CtrolQA)o.Data; lstCtrolQa.Add(ctrolqa); } if (o.ObjType == ConstValue.RESOURCE_ORG && o.Children.Count > 0) { GetQAIsCheck(o, ref lstCtrolQa); } } }
private void GetCheckedInspector(ObjectItemTask parentItem) { try { for (int i = 0; i < parentItem.Children.Count; i++) { ObjectItemTask item = parentItem.Children[i] as ObjectItemTask; if (item != null) { if (item.IsChecked == true && item.ObjID > 0) { mListSelectedObjects_KeyWords.Add(item); } GetCheckedInspector(item); } } } catch (Exception ex) { ShowException(ex.Message); } }
private void CreateKeywordItems() { try { mRootItem.Children.Clear(); //所有关键词 ObjectItemTask allItem = new ObjectItemTask(); allItem.ObjID = 0; allItem.Name = string.Format("All Keyword"); allItem.Description = string.Format("All Keyword"); mRootItem.AddChild(allItem); var keywords = mListKeywordInfos.GroupBy(k => k.SerialNo); foreach (var keyword in keywords) { ObjectItemTask item = new ObjectItemTask(); long serialNo = 0; string strName = string.Empty; string strDesc = string.Empty; foreach (var content in keyword) { serialNo = content.SerialNo; strName = content.Name; strDesc += string.Format("{0};", content.Content); item.ListKeywordInfos.Add(content); } item.ObjID = serialNo; item.Name = string.Format("{0} ({1}) ", strName, strDesc); item.Description = strName; allItem.AddChild(item); } } catch (Exception ex) { ShowException(ex.Message); } }
private void AddChildObject(ObjectItemTask parentItem, ObjectItemTask item) { Dispatcher.Invoke(new Action(() => parentItem.AddChild(item))); }