public TreeNode AddNode(TreeNode node) { System.Collections.Generic.List <FileInfoModel> listArray = this.fileInfoBll.GetListArray(" where ParentId='" + node.Value + "' and id != parentId and FileType!=0 and IsValid='false' order by CreateTime desc"); foreach (FileInfoModel current in listArray) { TreeNode treeNode = new TreeNode(); treeNode.ImageUrl = FileInfoManager_FileInfoList.imageUrl(current, base.UserCode); treeNode.Value = current.Id; treeNode.Text = current.FileName; node.ChildNodes.Add(treeNode); if (this.ViewState["findDirectoryId"] == null) { string text = base.Request["prjId"]; if (!string.IsNullOrEmpty(text)) { System.Collections.Generic.List <string> annexAddress = CompletedAnnex.GetAnnexAddress(text, base.Request["prjComId"]); if (annexAddress.Contains(treeNode.Value)) { treeNode.Select(); this.ExpandSelectNode(node); this.ViewState["findDirectoryId"] = node.Value; } } } this.AddNode(treeNode); } return(node); }
protected void BindGv() { string text = base.Request["id"]; if (!string.IsNullOrEmpty(text)) { System.Collections.Generic.List <string> directoryId; if (text.IndexOf(",") != -1) { directoryId = new System.Collections.Generic.List <string>(text.Split(new char[] { ',' })); } else { directoryId = new System.Collections.Generic.List <string> { text }; } this.gvFilesInfo.DataSource = CompletedAnnex.GetFilesInfo(directoryId); } else { this.gvFilesInfo.DataSource = null; } this.gvFilesInfo.DataBind(); }
protected TreeNode AddNode(TreeNode node) { System.Collections.Generic.List <FileInfoModel> listArray = this.fileInfoBll.GetListArray(" where ParentId='" + node.Value + "' and id != parentId and FileType!=0 and IsValid='false' order by CreateTime desc"); foreach (FileInfoModel current in listArray) { TreeNode treeNode = new TreeNode(); treeNode.ImageUrl = this.imageUrl(current, base.UserCode); treeNode.Value = current.Id; if (current.UserCodes.Contains(base.UserCode)) { treeNode.Text = current.FileName; treeNode.NavigateUrl = "#" + treeNode.Value + "#"; treeNode.SelectAction = TreeNodeSelectAction.Select; } else { treeNode.Text = "<font color='#808080'>" + current.FileName + "</font>"; treeNode.SelectAction = TreeNodeSelectAction.None; treeNode.ToolTip = "无权限"; } node.ChildNodes.Add(treeNode); System.Collections.Generic.List <string> annexAddress = CompletedAnnex.GetAnnexAddress(base.Request["prjId"], base.Request["prjComId"]); if (annexAddress.Contains(treeNode.Value)) { treeNode.Checked = true; this.ExpandSelectNode(treeNode); HiddenField expr_11F = this.hfldSelDriectoryId; expr_11F.Value = expr_11F.Value + treeNode.Value + ","; treeNode.Parent.Expand(); } this.AddNode(treeNode); } return(node); }
public string FilesBind(string id) { string str = ConfigurationManager.AppSettings["FileInfo"].ToString(); string result; try { DataTable filesName = CompletedAnnex.GetFilesName(base.Request["ic"].ToString(), id); System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); for (int i = 0; i < filesName.Rows.Count; i++) { string value = string.Empty; string str2 = str + "/" + filesName.Rows[i]["FileNewName"].ToString(); value = string.Concat(new string[] { "<a class=\"link\" style=\"white-space:nowrap; color:black;\" target=_blank href=\"../../Common/DownLoad.aspx?path=", HttpUtility.UrlEncode(str2), "\" >", filesName.Rows[i]["FileName"].ToString(), "</a> <br/>" }); stringBuilder.Append(value); } result = stringBuilder.ToString(); } catch { result = ""; } return(result); }
protected void gvComplete_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string prjCompletedId = this.gvComplete.DataKeys[e.Row.RowIndex]["Id"].ToString(); e.Row.Attributes["id"] = this.gvComplete.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Attributes["isAnnex"] = CompletedAnnex.ExistAnnexAddress(this.PrjGuid, prjCompletedId).ToString(); } }
protected void btnSave_Click(object sender, System.EventArgs e) { try { TreeNodeCollection checkedNodes = this.tvFile.CheckedNodes; System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); foreach (TreeNode treeNode in checkedNodes) { list.Add(treeNode.Value); } string text = base.Request["prjId"]; string text2 = base.Request["prjComId"]; string type = base.Request["type"]; CompletedAnnex.SetAnnex(text, text2, list, type); int num = 0; bool flag = CompletedAnnex.ExistAnnexAddress(text, text2); if (flag) { num = CompletedAnnex.GetFilesCount(text, text2); } base.RegisterScript(string.Concat(new object[] { "setParentAdunct('", text2, "','", text, "','", num, "','", flag, "');" })); } catch (System.Exception) { base.RegisterScript("alert('系统提示:\\n\\n设置失败!');"); } }