//新增模版 private void menuAddTemplate_Click(object sender, EventArgs e) { TemplateEdit edit = new TemplateEdit() { EditMode = WSH.WinForm.Controls.EditMode.Add, ParentID = Convert.ToInt32(GetSelectedID()), TypeName = treeTemplate.SelectedNode.Text }; edit.ShowDialog(); if (edit.SaveCount > 0) { DataBind(); } }
//修改模版 private void menuEditTemplate_Click(object sender, EventArgs e) { TreeNode selectedNode = this.treeTemplate.SelectedNode; string typeName = selectedNode.Parent.Text; // string fileName = TemplateManager.GetTemplateFile(selectedNode.Text, typeName); //if (ExistsTemplate(fileName)) //{ //} TemplateEdit edit = new TemplateEdit() { RecordID = GetSelectedID(), TypeName = typeName, ParentID = Convert.ToInt32(GetSelectedID()), EditMode = WSH.WinForm.Controls.EditMode.Edit }; edit.ShowDialog(); if (edit.SaveCount > 0) { DataBind(); } }