private void btnUpdateRoot_Click(object sender, EventArgs e) { CommonCustomClassifyManageTabPage _ClassifyTabPage = this.tabClassify.SelectedTab as CommonCustomClassifyManageTabPage; CommonCustomClassify _Classify = _ClassifyTabPage.Classify; CommonCustomClassifyManageForm _CommonCustomClassifyManageForm = new CommonCustomClassifyManageForm(_Classify, true); if (_CommonCustomClassifyManageForm.ShowDialog(this) == DialogResult.OK) { try { _CommonCustomClassifyManageForm.Classify.Save(); _ClassifyTabPage.Text = _CommonCustomClassifyManageForm.Classify.Name; } catch (Exception ex) { MessageBox.Show(ex.Message, "公共分类", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnAddRoot_Click(object sender, EventArgs e) { CommonCustomClassify _Classify = this.m_Application.ClassifyTypes.GetClassifyType(typeof(CommonCustomClassify)).CreateClassify() as CommonCustomClassify; CommonCustomClassifyManageForm _CommonCustomClassifyManageForm = new CommonCustomClassifyManageForm(_Classify, false); if (_CommonCustomClassifyManageForm.ShowDialog(this) == DialogResult.OK) { try { _CommonCustomClassifyManageForm.Classify.Save(); this.tabClassify.TabPages.Add(new CommonCustomClassifyManageTabPage(_CommonCustomClassifyManageForm.Classify)); this.tabClassify.SelectedIndex = this.tabClassify.TabPages.Count - 1; } catch (Exception ex) { MessageBox.Show(ex.Message, "公共分类", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void tsbUpdate_Click(object sender, EventArgs e) { CommonCustomClassify _Classify = this.tvClassify.SelectedNode.Tag as CommonCustomClassify; CommonCustomClassifyManageForm _CommonCustomClassifyManageForm = new CommonCustomClassifyManageForm(_Classify, true); if (_CommonCustomClassifyManageForm.ShowDialog(this) == DialogResult.OK) { try { _CommonCustomClassifyManageForm.Classify.Save(); this.FillClassifyNode(_CommonCustomClassifyManageForm.Classify, this.tvClassify.SelectedNode); } catch (Exception ex) { MessageBox.Show(ex.Message, "公共分类", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void tsbAdd_Click(object sender, EventArgs e) { CommonCustomClassify _Classify = this.Classify.Application.ClassifyTypes.GetClassifyType(typeof(CommonCustomClassify)).CreateClassify(this.Classify) as CommonCustomClassify; CommonCustomClassifyManageForm _CommonCustomClassifyManageForm = new CommonCustomClassifyManageForm(_Classify, false); if (_CommonCustomClassifyManageForm.ShowDialog(this) == DialogResult.OK) { try { _CommonCustomClassifyManageForm.Classify.Save(); TreeNode tn = new TreeNode(); this.FillClassifyNode(_CommonCustomClassifyManageForm.Classify, tn); this.tvClassify.Nodes.Add(tn); } catch (Exception ex) { MessageBox.Show(ex.Message, "公共分类", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }