protected void tree_NodeSelected(object sender, EventArgs e) { switch (Type) { case eTreeType.CategoryProduct: case eTreeType.CategoryMultiSelect: var args = new TreeNodeSelectedArgs(); foreach (TreeNode node in tree.CheckedNodes) { args.SelectedTexts.Add(node.Text); args.SelectedValues.Add(node.Value); } TreeNodeSelected(this, args); break; default: TreeNodeSelected(this, new TreeNodeSelectedArgs { SelectedValues = new List <string> { tree.SelectedValue }, SelectedTexts = new List <string> { tree.SelectedNode.Text } }); break; } Hide(); }
protected void tree_NodeSelected(object sender, EventArgs e) { //Added By Evgeni to insert products only by ArtNo if (txtArtNo.Text.Length > 0) { try { var args = new TreeNodeSelectedArgs(); foreach (var node in txtArtNo.Text.Split('\n')) { int prId = ProductService.GetProductId(node.ToString()); if (prId != 0)//product founded { args.SelectedTexts.Add(node.ToString()); args.SelectedValues.Add(prId.ToString()); } } TreeNodeSelected(this, args); // int prId = ProductService.GetProductId("0.603.127.023"); Hide(); return; } catch { Hide(); return; } } /// switch (Type) { case eTreeType.CategoryProduct: case eTreeType.CategoryMultiSelect: var args = new TreeNodeSelectedArgs(); foreach (TreeNode node in tree.CheckedNodes) { args.SelectedTexts.Add(node.Text); args.SelectedValues.Add(node.Value); } TreeNodeSelected(this, args); break; default: TreeNodeSelected(this, new TreeNodeSelectedArgs { SelectedValues = new List <string> { tree.SelectedValue }, SelectedTexts = new List <string> { tree.SelectedNode.Text } }); break; } Hide(); }
protected void tree_NodeSelected(object sender, EventArgs e) { switch (Type) { case eTreeType.CategoryProduct: case eTreeType.CategoryMultiSelect: var args = new TreeNodeSelectedArgs(); foreach (TreeNode node in tree.CheckedNodes) { args.SelectedTexts.Add(node.Text); args.SelectedValues.Add(node.Value); } TreeNodeSelected(this, args); break; default: TreeNodeSelected(this, new TreeNodeSelectedArgs { SelectedValues = new List<string> { tree.SelectedValue }, SelectedTexts = new List<string> { tree.SelectedNode.Text } }); break; } Hide(); }