/// <summary> /// 获取树上某节点完整路径 /// </summary> /// <param name="FullPathString"></param> /// <returns></returns> public static string GetTreeViewFullPath(string FullPathString) { string delimStr = "/"; char[] delimiter = delimStr.ToCharArray(); string FullPathName; if (FullPathString != "" && FullPathString != null) { string[] FullPathArr = FullPathString.Split(delimiter); int i; FullPathName = ""; DocumentDirectoryBFL DDBFL = new DocumentDirectoryBFL(); for (i = 0; i < FullPathArr.Length; i++) { if (FullPathArr[i] != "" && FullPathArr[i] != null) { string tempFullPathName = DDBFL.GetDocumentDirectory(int.Parse(FullPathArr[i])).DirectoryName; if (tempFullPathName != "") { FullPathName += (FullPathName == "") ? "" : "-->"; FullPathName += tempFullPathName; } } } } else { FullPathName = ""; } return(FullPathName); }
protected void SelectButton_Click(object sender, EventArgs e) { if (this.ParentCode != "" && this.ParentCode != null) { DocumentDirectoryBFL objBFL = new DocumentDirectoryBFL(); DocumentDirectoryModel ObjModel = new DocumentDirectoryModel(); string DepartmentCode = objBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DepartmentCode; string DirectoryNodeCode = objBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DirectoryNodeCode; string FullID = objBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).FullID; int Deep = objBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).Deep; foreach (GridViewRow gvr in GridView1.Rows) { CheckBox chk = (CheckBox)gvr.Cells[3].Controls[1]; if (chk.Checked) { Label labFileTemplateName = (Label)gvr.Cells[1].Controls[1]; ObjModel.DirectoryName = labFileTemplateName.Text; ObjModel.ParentCode = int.Parse(ParentCode); ObjModel.DepartmentCode = DepartmentCode; ObjModel.DirectoryNodeCode = DirectoryNodeCode; ObjModel.CreateDate = System.DateTime.Now; ObjModel.Deep = Deep + 1; Label labCode = (Label)gvr.Cells[0].Controls[1]; ObjModel.FileTemplateCode = int.Parse(labCode.Text); ObjModel.FullID = FullID + "/" + ParentCode; objBFL.Insert(ObjModel); } } Response.Write("<script>window.parent.opener.location.reload();</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { string tempStr = ""; if (this.TreeView1.CheckedNodes.Count > 0) { foreach (TreeNode tn in this.TreeView1.CheckedNodes) { if (tn.Value != "0") { tempStr += tn.Value + ","; } } tempStr = tempStr.Remove(tempStr.Length - 1, 1); } if (tempStr == "") { Response.Write("<script>alert('请选择模板类型');</script>"); } else { FileTemplateTypeBFL BFL = new FileTemplateTypeBFL(); XmlDocument doc = BFL.GetFileTemplateTypeDataSourcePart(tempStr, 0, "部分模板管理"); if (this.ParentCode != "" && this.ParentCode != null) { DocumentDirectoryBFL DDBFL = new DocumentDirectoryBFL(); string DepartmentCode = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DepartmentCode; string DirectoryNodeCode = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DirectoryNodeCode; string FullID = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).FullID; int Deep = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).Deep; DDBFL.Insert(doc, int.Parse(this.ParentCode), doc.DocumentElement.ChildNodes, DepartmentCode, FullID, Deep, DirectoryNodeCode); Response.Write("<script>opener.parent.location.reload();window.close();</script>"); } } }
protected void FormView1_DataBound(object sender, EventArgs e) { Label PCLabel = (Label)this.FormView1.Row.FindControl("ParentCodeLabel"); HiddenField PCHiddenField = (HiddenField)this.FormView1.Row.FindControl("ParentCodeHiddenField"); HtmlInputControl UnitNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtUnitName"); HtmlInputControl UnitHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtUnit"); switch (this.FormView1.CurrentMode) { case FormViewMode.Edit: PCLabel.Text = WebFunctionRule.GetTreeViewFullPath(PCHiddenField.Value + "/" + this.DocDirCode); UnitNameHIC.Value = RmsPM.BLL.SystemRule.GetUnitName(UnitHIC.Value); HtmlInputControl TemplateNameHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateName"); HtmlInputControl TemplateHIC = (HtmlInputControl)this.FormView1.Row.FindControl("txtTemplateCode"); TemplateNameHIC.Value = FileTemplateBFL.GetTemplateName(TemplateHIC.Value); if (TemplateNameHIC.Value != "") { LinkButton lb = (LinkButton)this.FormView1.Row.FindControl("LinkButton1"); lb.Visible = true; } break; case FormViewMode.Insert: if (this.ParentCode != "" && this.ParentCode != null) { PCLabel.Text = WebFunctionRule.GetTreeViewFullPath(this.FullPath); PCHiddenField.Value = this.ParentCode; DocumentDirectoryBFL DDBFL = new DocumentDirectoryBFL(); UnitHIC.Value = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DepartmentCode; UnitNameHIC.Value = RmsPM.BLL.SystemRule.GetUnitName(UnitHIC.Value); } else { PCLabel.Text = "此目录为一级目录!"; PCHiddenField.Value = "0"; } break; case FormViewMode.ReadOnly: if (!user.HasRight("3602")) { this.FormView1.Row.FindControl("EditButton").Visible = false; } break; } }