16,554
社区成员
发帖
与我相关
我的任务
分享
#region[绑定TV_Product数据]
/// <summary>
/// 绑定TV_Product数据
/// </summary>
public void bindToTV_Product()
{
if (TV_Product.Nodes.Count < 1)
{
mytable = _product.QueryBS_Category();
for (int i = 0; i < mytable.Rows.Count; i++)
{
TreeNode node = new TreeNode(mytable.Rows[i]["CName"].ToString().Trim().ToString(),
mytable.Rows[i]["CNID"].ToString().Trim().ToString(), "Images/4.gif");
TV_Product.Nodes.Add(node);
bindToBra_NID(_product.Query_Brand(TV_Product.Nodes[i].Value), TV_Product.Nodes[i]);
}
}
}
#endregion
#region[根据类别绑定品牌信息]
/// <summary>
/// 根据类别绑定品牌信息
/// </summary>
/// <param name="table">品牌信息</param>
/// <param name="node">树节点</param>
public void bindToBra_NID(DataTable table, TreeNode tvnode)
{
for (int i = 0; i < table.Rows.Count; i++)
{
TreeNode node = new TreeNode(table.Rows[i]["CName"].ToString().Trim().ToString(),
table.Rows[i]["CNid"].ToString().Trim().ToString(), "Images/17.gif");
tvnode.ChildNodes.Add(node);
bindToBreed(_product.Query_Breed(tvnode.ChildNodes[i].Value), tvnode.ChildNodes[i]);
}
tvnode.Collapse();
}
#endregion
#region[根据品牌绑定品名信息]
/// <summary>
/// 根据品牌绑定品名信息
/// </summary>
/// <param name="table">品名信息</param>
/// <param name="node">树节点</param>
public void bindToBreed(DataTable table, TreeNode tvnode)
{
for (int i = 0; i < table.Rows.Count; i++)
{
TreeNode node = new TreeNode(table.Rows[i]["CName"].ToString().Trim().ToString(),
table.Rows[i]["CNid"].ToString().Trim().ToString(), "Images/wi.gif");
tvnode.ChildNodes.Add(node);
}
tvnode.Collapse();
}
#endregion
#Region "[绑定TV_Product数据]"
''' <summary>
''' 绑定TV_Product数据
''' </summary>
Public Sub bindToTV_Product()
If TV_Product.Nodes.Count < 1 Then
mytable = _product.QueryBS_Category()
For i As Integer = 0 To mytable.Rows.Count - 1
Dim node As New TreeNode(mytable.Rows(i)("CName").ToString().Trim().ToString(), mytable.Rows(i)("CNID").ToString().Trim().ToString(), "Images/4.gif")
TV_Product.Nodes.Add(node)
bindToBra_NID(_product.Query_Brand(TV_Product.Nodes(i).Value), TV_Product.Nodes(i))
Next
End If
End Sub
#End Region
#Region "[根据类别绑定品牌信息]"
''' <summary>
''' 根据类别绑定品牌信息
''' </summary>
''' <param name="table">品牌信息</param>
''' <param name="node">树节点</param>
Public Sub bindToBra_NID(ByVal table As DataTable, ByVal tvnode As TreeNode)
For i As Integer = 0 To table.Rows.Count - 1
Dim node As New TreeNode(table.Rows(i)("CName").ToString().Trim().ToString(), table.Rows(i)("CNid").ToString().Trim().ToString(), "Images/17.gif")
tvnode.ChildNodes.Add(node)
bindToBreed(_product.Query_Breed(tvnode.ChildNodes(i).Value), tvnode.ChildNodes(i))
Next
tvnode.Collapse()
End Sub
#End Region
#Region "[根据品牌绑定品名信息]"
''' <summary>
''' 根据品牌绑定品名信息
''' </summary>
''' <param name="table">品名信息</param>
''' <param name="node">树节点</param>
Public Sub bindToBreed(ByVal table As DataTable, ByVal tvnode As TreeNode)
For i As Integer = 0 To table.Rows.Count - 1
Dim node As New TreeNode(table.Rows(i)("CName").ToString().Trim().ToString(), table.Rows(i)("CNid").ToString().Trim().ToString(), "Images/wi.gif")
tvnode.ChildNodes.Add(node)
Next
tvnode.Collapse()
End Sub
#End Region