private void RemoveTreeNode(ProductParameter model) { if (ModelTrees.Any(x => x.id == model.id)) { var node = ModelTrees.FirstOrDefault(x => x.id == model.id); ModelTrees.Remove(node);//删除左侧树形 } }
private void UpdateTreeNode(ProductParameter model) { if (ModelTrees.Any(x => x.id == model.id)) { var node = ModelTrees.FirstOrDefault(x => x.id == model.id); node.Name = model.product_name; node.DisplayName = model.product_name; } }
private void AddTreeNode(ProductParameter model) { TreeNodeData n = new TreeNodeData() { id = model.id, Name = model.product_name, DisplayName = model.product_name }; ModelTrees.Add(n); }
public void LoadAllInfos() { ModelTrees.Clear(); ModelList.Clear(); var list = _productParameterService.QueryableToList(x => x.id > 0).OrderBy(x => x.product_name).ToList(); if (list != null && list.Count > 0) { foreach (var item in list) { ModelList.Add(item); AddTreeNode(item); } EditModel = list[0]; } else { EditModel = new ProductParameter(); } }