try
{
RestService service = new RestService();
List categories = service.SelectGoodsCategory(this.Login.Storeguid);
if (categories != null)
{
TreeNode root = new TreeNode(this.Login.StoreName);
foreach (UMS_BASE_出品类别表 item in categories)
{
if (categories.Contains(item) && item.父GUID == this.Login.Storeguid)
{
TreeNode node1 = new TreeNode(item.类别);
node1.Value = item.GUID.ToString();
root.ChildNodes.Add(node1);
foreach (UMS_BASE_出品类别表 item2 in categories)
{
if (categories.Contains(item2) && item2.父GUID == item.GUID)
{
TreeNode node2 = new TreeNode(item2.类别);
node2.Value = item2.GUID.ToString();
node1.ChildNodes.Add(node2);
}
}
}
}
this.tvwCategory.Nodes.Clear();
this.tvwCategory.Nodes.Add(root);
this.tvwCategory.ExpandAll();
}
}
catch (Exception ex)
{
AjaxalertMessage.AjaxAlert(UpdatePanel1, ex.Message);
}