//修改标签 public void EditTag_Click(TagBean bean) { TagWindow window = new TagWindow("修改标签", bean); bool? result = window.ShowDialog(); if (result == true) { TagMapper.UpdataOne(bean); RefreshAll(); } }
//新建标签 public void NewTag_Click(ListBox sender) { int plies = GetPliesByName(sender.Name); if (nodeParentId[plies] == -1) { MessageBox.Show("未选择父级标签", "提示", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } uint patentId = Convert.ToUInt32(nodeParentId[plies]); TagWindow window = new TagWindow("新建标签"); bool? result = window.ShowDialog(); if (result == true) { TagBean bean = window.DataContext as TagBean; bean.ParentId = patentId; TagMapper.AddOne(bean); RefreshAll(); } }