protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { btnClose.OnClientClick = ActiveWindow.GetHideReference(); int id = int.Parse(Request["id"]); FineOffice.Modules.HD_Folder model = folderBll.GetModel(d => d.ID == id); hiddenID.Text = id.ToString(); txtFolder.Text = model.FolderName; } }
protected void btnSave_Click(object sender, EventArgs e) { try { int id = int.Parse(hiddenID.Text); FineOffice.Modules.HD_Folder model = folderBll.GetModel(d => d.ID == id); model.FolderName = txtFolder.Text.Trim(); folderBll.Update(model); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("folder_close")); } catch (Exception ex) { Alert.ShowInParent(ex.Message); } }
/// <summary> /// 创建树第一级节点 /// </summary> private void CreateXElement(XElement root, FineOffice.Modules.HD_Folder model) { List <FineOffice.Modules.HD_Folder> tempList = folderList.Where(d => d.ParentID == model.ID).ToList(); foreach (FineOffice.Modules.HD_Folder temp in tempList) { XElement xe = new XElement("TreeNode", new object[] { new XAttribute("Text", temp.FolderName), new XAttribute("EnablePostBack", true), new XAttribute("NodeID", temp.ID), }); root.Add(xe); CreateXElement(xe, temp); } }
protected void btnEnter_Click(object sender, EventArgs e) { if (tvwFolder.SelectedNode != null) { try { int id = int.Parse(hiddenID.Text); FineOffice.Modules.HD_Folder model = folderBll.GetModel(d => d.ID == id); model.ParentID = int.Parse(tvwFolder.SelectedNodeID); folderBll.Update(model); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("folder_close")); } catch (Exception ex) { Alert.Show(ex.Message); } } }
protected void btnSave_Click(object sender, EventArgs e) { try { FineOffice.Modules.HD_Folder model = new FineOffice.Modules.HD_Folder(); model.ParentID = int.Parse(hiddenParentID.Text); model.IsPublic = false; if (hiddenIsPublic.Text.Length > 0) { model.IsPublic = true; } model.PersonnelID = CookiePersonnel.ID; model.FolderName = txtFolder.Text.Trim(); folderBll.Add(model); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("folder_close")); } catch (Exception ex) { Alert.ShowInParent(ex.Message); } }