Пример #1
0
 private void tileDocument_DragDrop(object sender, DragEventArgs e)
 {
     try
     {
         string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
         Model.Internal.Document.Document document = new Model.Internal.Document.Document(Uow);
         foreach (string file in FileList)
         {
             if (!System.IO.Directory.Exists(file))
             {
                 document.ReadFile(file);
                 document.Name           = file.Substring(file.LastIndexOf('\\') + 1);
                 document.DocTypeDisplay = Enumeration.Document.DocumentType.Document;
                 TIS.Model.Internal.Document.DocNode newNode = new TIS.Model.Internal.Document.DocNode(Uow);
                 newNode.Document      = document;
                 newNode.ParentDocNode = _selectedNode;
                 newNode.Name          = document.Name;
                 //newNode.DocTreeDisplay = _docTree;
                 newNode.ImageIndex = -1;
                 DocumentFile df = new DocumentFile(iclExtraLarge, document.Name);
                 df.ShowDialog(this);
                 if (df.DialogResult == DialogResult.OK)
                 {
                     newNode.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                     newNode.Name       = df.DocName;
                     Uow.CommitChanges();
                 }
                 //this.Uow = new UnitOfWork();
             }
         }
         SelectNode(_selectedNode);
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
Пример #2
0
 private void tileDocument_RightItemClick(object sender, TileItemEventArgs e)
 {
     try
     {
         Model.Internal.Document.DocNode node = (TIS.Model.Internal.Document.DocNode)(e.Item.Tag);
         if (node.Document == null)
         {
             DocumentFile df = new DocumentFile(iclExtraLarge, node.Name, node.ImageIndex, "Map");
             df.ShowDialog(this);
             if (df.DialogResult == DialogResult.OK)
             {
                 if (df.isDeleted)
                 {
                     if (node.childDocNode.Count == 0)
                     {
                         Uow.Delete(node);
                     }
                     else
                     {
                         DevExpress.XtraEditors.XtraMessageBox.Show("Onmogelijk om te verwijderen terwijl de map niet leeg is", "Verwijderen mislukt", MessageBoxButtons.OK,
                                                                    MessageBoxIcon.Exclamation);
                     }
                 }
                 else
                 {
                     node.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                     node.Name       = df.DocName;
                 }
                 Uow.CommitChanges();
                 SelectNode(_selectedNode);
             }
             //this.Uow = new UnitOfWork();
         }
         else
         {
             if (node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Link)
             {
                 DocumentLink dl = new DocumentLink(iclExtraLarge, node.Name, node.ImageIndex, node.Document.Name);
                 dl.ShowDialog();
                 if (dl.DialogResult == DialogResult.OK)
                 {
                     if (dl.isDeleted)
                     {
                         Uow.Delete(node.Document);
                         Uow.Delete(node);
                     }
                     else
                     {
                         node.Name          = dl.NodeName;
                         node.ImageIndex    = dl.Index >= iclExtraLarge.Images.Count ? -1 : dl.Index;
                         node.Document.Name = dl.Url;
                     }
                     Uow.CommitChanges();
                     SelectNode(_selectedNode);
                 }
             }
             else
             //if (node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Document)
             {
                 DocumentFile df = new DocumentFile(iclExtraLarge, node.Name, node.ImageIndex,
                                                    node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Document ? "Document" :
                                                    node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Application ? "Programma" : "");
                 df.ShowDialog(this);
                 if (df.DialogResult == DialogResult.OK)
                 {
                     if (df.isDeleted)
                     {
                         if (node.childDocNode.Count == 0)
                         {
                             Uow.Delete(node);
                         }
                         else
                         {
                             DevExpress.XtraEditors.XtraMessageBox.Show("Onmogelijk om te verwijderen terwijl de map niet leeg is", "Verwijderen mislukt", MessageBoxButtons.OK,
                                                                        MessageBoxIcon.Exclamation);
                         }
                     }
                     else
                     {
                         node.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                         node.Name       = df.DocName;
                     }
                     Uow.CommitChanges();
                     SelectNode(_selectedNode);
                 }
                 //this.Uow = new UnitOfWork();
             }
         }
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
Пример #3
0
 private void tileDocument_RightItemClick(object sender, TileItemEventArgs e)
 {
     try
     {
         Model.Internal.Document.DocNode node = (TIS.Model.Internal.Document.DocNode)(e.Item.Tag);
         if (node.Document == null)
         {
             DocumentFile df = new DocumentFile(iclExtraLarge, node.Name, node.ImageIndex, "Map");
             df.ShowDialog(this);
             if (df.DialogResult == DialogResult.OK)
             {
                 if (df.isDeleted)
                 {
                     if (node.childDocNode.Count == 0)
                         Uow.Delete(node);
                     else
                     {
                         DevExpress.XtraEditors.XtraMessageBox.Show("Onmogelijk om te verwijderen terwijl de map niet leeg is", "Verwijderen mislukt", MessageBoxButtons.OK,
                                         MessageBoxIcon.Exclamation);
                     }
                 }
                 else
                 {
                     node.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                     node.Name = df.DocName;
                 }
                 Uow.CommitChanges();
                 SelectNode(_selectedNode);
             }
             //this.Uow = new UnitOfWork();
         }
         else
         {
             if (node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Link)
             {
                 DocumentLink dl = new DocumentLink(iclExtraLarge, node.Name, node.ImageIndex, node.Document.Name);
                 dl.ShowDialog();
                 if (dl.DialogResult == DialogResult.OK)
                 {
                     if (dl.isDeleted)
                     {
                         Uow.Delete(node.Document);
                         Uow.Delete(node);
                     }
                     else
                     {
                         node.Name = dl.NodeName;
                         node.ImageIndex = dl.Index >= iclExtraLarge.Images.Count ? -1 : dl.Index;
                         node.Document.Name = dl.Url;
                     }
                     Uow.CommitChanges();
                     SelectNode(_selectedNode);
                 }
             }
             else
             //if (node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Document)
             {
                 DocumentFile df = new DocumentFile(iclExtraLarge, node.Name, node.ImageIndex,
                     node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Document ? "Document" :
             node.Document.DocTypeDisplay == Enumeration.Document.DocumentType.Application ? "Programma" : "");
                 df.ShowDialog(this);
                 if (df.DialogResult == DialogResult.OK)
                 {
                     if (df.isDeleted)
                     {
                         if (node.childDocNode.Count == 0)
                             Uow.Delete(node);
                         else
                         {
                             DevExpress.XtraEditors.XtraMessageBox.Show("Onmogelijk om te verwijderen terwijl de map niet leeg is", "Verwijderen mislukt", MessageBoxButtons.OK,
                                             MessageBoxIcon.Exclamation);
                         }
                     }
                     else
                     {
                         node.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                         node.Name = df.DocName;
                     }
                     Uow.CommitChanges();
                     SelectNode(_selectedNode);
                 }
                 //this.Uow = new UnitOfWork();
             }
         }
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }
Пример #4
0
 private void tileDocument_DragDrop(object sender, DragEventArgs e)
 {
     try
     {
         string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
         Model.Internal.Document.Document document = new Model.Internal.Document.Document(Uow);
         foreach (string file in FileList)
         {
             if (!System.IO.Directory.Exists(file))
             {
                 document.ReadFile(file);
                 document.Name = file.Substring(file.LastIndexOf('\\') + 1);
                 document.DocTypeDisplay = Enumeration.Document.DocumentType.Document;
                 TIS.Model.Internal.Document.DocNode newNode = new TIS.Model.Internal.Document.DocNode(Uow);
                 newNode.Document = document;
                 newNode.ParentDocNode = _selectedNode;
                 newNode.Name = document.Name;
                 //newNode.DocTreeDisplay = _docTree;
                 newNode.ImageIndex = -1;
                 DocumentFile df = new DocumentFile(iclExtraLarge, document.Name);
                 df.ShowDialog(this);
                 if (df.DialogResult == DialogResult.OK)
                 {
                     newNode.ImageIndex = df.Index >= iclExtraLarge.Images.Count ? -1 : df.Index;
                     newNode.Name = df.DocName;
                     Uow.CommitChanges();
                 }
                 //this.Uow = new UnitOfWork();
             }
         }
         SelectNode(_selectedNode);
     }
     catch (Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }