예제 #1
0
 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);//删除左侧树形
     }
 }
예제 #2
0
 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;
     }
 }
예제 #3
0
        private void AddTreeNode(ProductParameter model)
        {
            TreeNodeData n = new TreeNodeData()
            {
                id = model.id, Name = model.product_name, DisplayName = model.product_name
            };

            ModelTrees.Add(n);
        }
예제 #4
0
        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();
            }
        }