SelectGoodsForm.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Collections.Generic;
  12. public partial class SelectForm_SelectGoodsForm : System.Web.UI.Page
  13. {
  14.     /// <summary>
  15.     /// 业务(物品类别)
  16.     /// </summary>
  17.     BLL.UseThingsType BUT = new BLL.UseThingsType();
  18.     /// <summary>
  19.     /// 业务(物品)
  20.     /// </summary>
  21.     BLL.UseThings BU = new BLL.UseThings();
  22.     protected void Page_Load(object sender, EventArgs e)
  23.     {
  24.         if (!IsPostBack)
  25.         {
  26.             TreeLoadSet();
  27.         }
  28.     }
  29.     protected void TreeLoadSet()
  30.     {
  31.         string url = "SelectGoodsFormData.aspx?id=";
  32.         TreeView1.Nodes.Clear();
  33.         if (BUT.GetCount("") > 0)
  34.         {
  35.             List<Model.UseThingsType> list_type = BUT.GetList();
  36.             foreach (Model.UseThingsType MUT in list_type)
  37.             {
  38.                 TreeNode tn_type = new TreeNode();
  39.                 tn_type.Text = MUT.LBMC;
  40.                 tn_type.ImageUrl = "~/images/node_dept.gif";
  41.                 List<Model.UseThings> list_name = BU.GetPageList(1, 1, "Id", false, "YPLB = '" + MUT.ID.ToString() + "'");
  42.                 foreach (Model.UseThings MU in list_name)
  43.                 {
  44.                     TreeNode tn_name = new TreeNode();
  45.                     tn_name.Text = MU.YPMC;
  46.                     tn_name.Value = MU.YPBM;
  47.                     tn_name.Target = "content3";
  48.                     tn_name.NavigateUrl = url + MU.ID.ToString();
  49.                     tn_name.ImageUrl = "~/images/node_dept.gif";
  50.                     tn_type.ChildNodes.Add(tn_name);
  51.                 }               
  52.                 TreeView1.Nodes.Add(tn_type);              
  53.             }
  54.         }
  55.     }
  56. }