private async void UpdateManagersTree() { btnUpdate.Enabled = false; treeView1.Nodes.Clear(); cbbDepartments.Items.Clear(); var r = new Dictionary <string, object>(); r["if-self"] = false; var p = await CrmInvestor.GetAllRelations(r); if (p.IsOk) { var dl = JArray.Parse(p.AsString).ToList(); var treeList = new List <Tuple <string, string> >(); foreach (var d in dl) { var uName = d["uName"].ToStdString(); var pName = d["pName"].ToStdString(); var department = d["department"].ToStdString(); treeList.Add(Tuple.Create(uName, pName)); m_Managers[uName] = department == "" ? "无" : department; } CrmCommons.GetTreeView(treeView1, treeList, "", (int)CrmCommons.ExtraItem.AddSelf); GetAllNodes(); SetCbbDepartments(); SetDepartment(); } else { Commons.ShowResultErrorBox(this, p); } btnUpdate.Enabled = true; }
private async void UpdateTable() { var r = new Dictionary <string, object>(); r["if-self"] = false; var p = await CrmInvestor.GetAllRelations(r); if (p.IsOk) { var dl = JArray.Parse(p.AsString).ToList(); var treeList = new List <Tuple <string, string> >(); foreach (var d in dl) { treeList.Add(Tuple.Create(d["uName"].ToStdString(), d["pName"].ToStdString())); } CrmCommons.GetTreeView(treeView1, treeList, "", m_extraItems); var f = treeView1.Nodes.Find(CrmCommons.TextFromValue(SelManager), true); if (f.Length != 0) { treeView1.SelectedNode = f[0]; } } else { Commons.ShowResultErrorBox(this, p); } }
private async void UpdateTable1() { treeView1.Nodes.Clear(); listView1.Items.Clear(); setButton(false); btnUpdateInfo.Enabled = false; var r = new Dictionary <string, object>(); r["if-self"] = false; var p = await CrmInvestor.GetAllRelations(r); if (p.IsOk) { var dl = JArray.Parse(p.AsString).ToList(); var treeList = new List <Tuple <string, string> >(); foreach (var d in dl) { treeList.Add(Tuple.Create(d["uName"].ToStdString(), d["pName"].ToStdString())); m_viewData[d["uName"].ToStdString()] = Tuple.Create(d["department"].ToStdString(), d["position"].ToStdString(), d["enabled"].ToBoolean() ? "已启用" : "未启用", d["rCode"].ToStdString()); } CrmCommons.GetTreeView(treeView1, treeList, "", (int)CrmCommons.ExtraItem.NoExtra); } else { Commons.ShowResultErrorBox(this, p); } btnUpdateInfo.Enabled = true; }
private async void UpdateTable() { var r = new Dictionary <string, object>(); r["if-self"] = true; var p = await CrmInvestor.GetAllRelations(r); if (p.IsOk) { var dl = JArray.Parse(p.AsString).ToList(); var treeList = new List <Tuple <string, string> >(); foreach (var d in dl) { treeList.Add(Tuple.Create(d["uName"].ToStdString(), d["pName"].ToStdString())); } CrmCommons.GetTreeView(treeView1, treeList, "", (int)CrmCommons.ExtraItem.NoExtra); } else { Commons.ShowResultErrorBox(this, p); } }