日期:2014-05-17 浏览次数:20374 次
if (u == null) u = new User(Session["userid"].ToString()); Model.DepartMent dm = new DepartMent(Session["memberid"].ToString()); DataTable dt = new DataTable(); int year = int.Parse(Session["Year"].ToString()); int month = int.Parse(Session["Month"].ToString()); //根节点 tvDep.Nodes[0].Text = dm.Name; tvDep.Nodes[0].Target = "right"; tvDep.Nodes[0].NavigateUrl = "QuerryDepData.aspx?DepID=" + dm.ID + "&DepName=" + dm.Name + "&IsEN=0"; tvDep.Nodes[0].ToolTip = "查看" + dm.Name + "的数据汇总"; tvDep.Nodes[0].Expanded = true; //下属单位的上报状态集合 dt = StateOperator.GetStatesInDepart(Session["memberid"].ToString(), year * 13 + month, year * 13 + month); #region 单位节点 if (dt.Select("LayerID<>'EN'").Length == 0 && tvDep.Nodes[0].ChildNodes.Count>1) { //没有单位 tvDep.Nodes[0].ChildNodes.RemoveAt(0); } else { //单位根节点 TreeNode tnDepRoot = tvDep.Nodes[0].ChildNodes[0]; tnDepRoot.Target = "right"; tnDepRoot.Expanded = false; tnDepRoot.ToolTip = "查看单位的数据汇总"; tnDepRoot.NavigateUrl = "QuerryDepData.aspx?DepID=AllDep&DepName=所有下级行政单位&IsEN=0"; //单位子节点 tnDepRoot.ChildNodes.Clear(); foreach (DataRow dr in dt.Select("LayerID<>'EN'")) { string st = dr["state"].ToString(); if (string.IsNullOrEmpty(st)) continue; if (st == "填报") { TreeNode tndep = new TreeNode(dr["Name"].ToString()); tndep.ImageUrl = GetImg(st); tndep.SelectAction = TreeNodeSelectAction.None; tnDepRoot.ChildNodes.Add(tndep); } else { tnDepRoot.ChildNodes.Add(MakeNodes(dr["Name"].ToString(), dr["ID"].ToString(), GetImg(st), "CheckDepData.aspx?DepID=" + dr["ID"].ToString() + "&State=" + st + "&DepName=" + dr["name"].ToString() + "&IsEN=0")); } }