Example #1
0
        /// <summary>
        /// Erstellt ein neues Dokument
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void neuesDokumentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if(tvMain.SelectedNode==null) return;
            TreeNode tnNode=tvMain.SelectedNode;
            if(tnNode.Tag==null) return;

            CustomTreeNodeData ctnData=(CustomTreeNodeData)tnNode.Tag;

            //Bild ermitteln und anzeigen
            switch(ctnData.Function)
            {
                case CustomTreeNodeData.enFunction.None:
                    {
                        break;
                    }
                case CustomTreeNodeData.enFunction.Root:
                case CustomTreeNodeData.enFunction.Category:
                    {

                        FormDocument InstFormDocument=new FormDocument();
                        InstFormDocument.CategoryID=ctnData.ID;

                        if(InstFormDocument.ShowDialog(DialogCreateMode.New)==DialogResult.OK)
                        {
                            RefreshDocumentChilds(tnNode);
                        }

                        break;
                    }
                case CustomTreeNodeData.enFunction.Document:
                    {
                        MessageBox.Show("Nur einer Kategorie kann ein Dokument hinzugefĆ¼gt werden!");
                        break;
                    }
            }
        }
Example #2
0
        private void dokumentBearbeitenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if(tvMain.SelectedNode==null) return;
            TreeNode tnNode=tvMain.SelectedNode;
            if(tnNode.Tag==null) return;

            CustomTreeNodeData ctnData=(CustomTreeNodeData)tnNode.Tag;

            //Bild ermitteln und anzeigen
            switch(ctnData.Function)
            {
                case CustomTreeNodeData.enFunction.None:
                    {
                        break;
                    }
                case CustomTreeNodeData.enFunction.Root:
                case CustomTreeNodeData.enFunction.Category:
                    {
                        MessageBox.Show("Dies ist kein Dokument!");

                        break;
                    }
                case CustomTreeNodeData.enFunction.Document:
                    {
                        FormDocument InstFormDocument=new FormDocument();
                        InstFormDocument.DocumentID=ctnData.ID;

                        if(InstFormDocument.ShowDialog(DialogCreateMode.Edit)==DialogResult.OK)
                        {
                            RefreshDocumentChilds(tnNode.Parent);
                        }

                        break;
                    }
            }
        }