public class SalesData
{
public SalesData(string p, int p_2)
{
this.Product = p;
this.Quantity = p_2;
}
public SalesData()
{
}
public SalesData(string p, int p_2, int p_3, int p_4, int p_5)
{
this.Product = p;
this.Quantity = p_2;
this.Segment = p_3;
this.YtdMax = p_4;
this.YtdMin = p_5;
}
public SalesData(string p, int p_2, int p_3,int p_4,int p_5,string p_6)
{
this.Product = p;
this.Quantity = p_2;
this.Parent = p_6;
this.Segment = p_3;
this.YtdMax = p_4;
this.YtdMin = p_5;
}
public string Product { get; set; }
public int Quantity { get; set; }
public string Parent { get; set; }
public int Segment { get; set; }
public int YtdMax { get; set; }
public int YtdMin { get; set; }
public IList<salesdata> Children { get; set; }
public string ToolTip
{
get
{
StringBuilder outStr = new StringBuilder();
outStr.Append("Product: ").Append(Product);
outStr.Append("\nQuantity: ").Append(Quantity);
outStr.Append("\nYtd: ").Append(Segment);
outStr.Append("\nYtdMax: ").Append(YtdMax);
outStr.Append("\nYtdMin: ").Append(YtdMin);
return outStr.ToString();
}
}
}
SalesData node = new SalesData();
node.Product = "VCN"+name;
node.Quantity = 0;
node.Segment = segmentID;
node.Children = new SalesData[0];
node.Children = new List<salesdata>();
SalesData node1 = new SalesData();
node1.Product = "HCN" + name;
node1.Quantity = Convert.ToInt16(random.Next(30, 300));
node1.Segment = Convert.ToInt16(random.Next(30, 300));
node1.YtdMax = 300;
node1.YtdMin = 30;
node1.Children = new SalesData[0];
node1.Children = new List<salesdata>();
SalesData node2 = new SalesData();
node2.Product = "ABC" + name;
node2.Quantity = Convert.ToInt16(random.Next(30, 300));
node2.Segment = Convert.ToInt16(random.Next(30, 300));
node2.YtdMax = 300;
node2.YtdMin = 30;
node2.Children = new SalesData[0];
node2.Children = new List<salesdata>();
SalesData node3 = new SalesData();
node3.Product = "def" + name;
node3.Quantity = Convert.ToInt16(random.Next(30, 300));
node3.Segment = Convert.ToInt16(random.Next(30, 300));
node3.YtdMax = 300;
node3.YtdMin = 30;
node3.Children = new SalesData[1];
node3.Children = new List<salesdata>();
SalesData node4 = new SalesData();
node4.Product = "ghi" + name;
node4.Quantity = Convert.ToInt16(random.Next(30, 300));
node3.Segment = Convert.ToInt16(random.Next(30, 300));
node3.YtdMax = 300;
node3.YtdMin = 30;
node4.Children = new SalesData[0];
node4.Children = new List<salesdata>();
SalesData node5 = new SalesData();
node5.Product = "jkm" + name;
node5.Quantity = Convert.ToInt16(random.Next(30, 300));
node3.Segment = Convert.ToInt16(random.Next(30, 300));
node3.YtdMax = 300;
node3.YtdMin = 30;
node5.Children = new SalesData[0];
node5.Children = new List<salesdata>();
node3.Children.Add(node5);
node3.Children.Add(node4);
node3.Children.Add(node1);
node3.Children.Add(node2);
node.Children.Add(node3);
SalesData node31 = new SalesData();
node31.Product = "VCN" + name;
node31.Quantity = 0;
node31.Segment = Convert.ToInt16(random.Next(30, 300));
node31.YtdMax= 300;
node31.YtdMin = 30;
node31.Children = new SalesData[0];
node31.Children = new List<salesdata>();
SalesData node11 = new SalesData();
node11.Product = "HCN" + name;
node11.Quantity = Convert.ToInt16(random.Next(30, 300));
node11.Segment = Convert.ToInt16(random.Next(30, 300));
node11.YtdMax = 300;
node11.YtdMin = 30;
node11.Children = new SalesData[0];
node11.Children = new List<salesdata>();
SalesData node12 = new SalesData();
node12.Product = "ABC" + name;
node12.Quantity = Convert.ToInt16(random.Next(30, 300));
node12.Segment = Convert.ToInt16(random.Next(30, 300));
node12.YtdMax = 300;
node12.YtdMin = 30;
node12.Children = new SalesData[0];
node12.Children = new List<salesdata>();
SalesData node13 = new SalesData();
node13.Product = "def" + name;
node13.Quantity = Convert.ToInt16(random.Next(30, 300));
node13.Segment = Convert.ToInt16(random.Next(30, 300));
node13.YtdMax = 300;
node13.YtdMin = 30;
node13.Children = new SalesData[1];
node13.Children = new List<salesdata>();
SalesData node14 = new SalesData();
node14.Product = "ghi" + name;
node14.Quantity = Convert.ToInt16(random.Next(30, 300));
node14.Segment = Convert.ToInt16(random.Next(30, 300));
node14.YtdMax = 300;
node14.YtdMin = 30;
node14.Children = new SalesData[0];
node14.Children = new List<salesdata>();
SalesData node15 = new SalesData();
node15.Product = "jkm" + name;
node15.Quantity = Convert.ToInt16(random.Next(30, 300));
node15.Segment = Convert.ToInt16(random.Next(30, 300));
node15.YtdMax = 300;
node15.YtdMin = 30;
node15.Children = new SalesData[0];
node15.Children = new List<salesdata>();
node13.Children.Add(node15);
node13.Children.Add(node14);
node13.Children.Add(node11);
node13.Children.Add(node12);
node31.Children.Add(node13);
SalesData node21 = new SalesData();
node21.Product = "VCN" + name;
node21.Quantity = 0;
node21.Segment = segmentID;
node21.Children = new SalesData[0];
node21.Children = new List<salesdata>();
node21.Children.Add(node31);
node21.Children.Add(node);
Now what i want
fetch the records having name "VCN" and at any level node how can i access.
[edit]Code block modified to encode HTML characters (get rid of spurious closing tags) - OriginalGriff[/edit]