Ejemplo n.º 1
0
        /// <summary>
        /// Import Item data from another Document
        /// </summary>
        internal void Item_Import_Click(object sender, EventArgs e)
        {
            if (Document == null)
            {
                return;
            }

            if (OpenDocumentDialog.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            // ...

            //Document.SaveUndo("Import Stuff", string.Empty));
            Document.Refresh();
        }
Ejemplo n.º 2
0
        private void BrowseButton_Click(object sender, EventArgs e)
        {
            DataRowView drv          = DocumentTypeComboBox.SelectedItem as DataRowView;
            string      documentType = (drv != null) ? drv.Row["Document Type Name"] as string : "";

            documentType = documentType.Trim();

            OpenDocumentDialog.InitialDirectory = app.GetDirectory(0, documentType); //Initial Directory
            OpenDocumentDialog.Title            = "File Upload";
            OpenDocumentDialog.Filter           = "(*.pdf; *.doc; *.xlsx)|*.pdf; *.docx; *.xlsx";
            OpenDocumentDialog.FilterIndex      = 1;

            if (OpenDocumentDialog.ShowDialog() == DialogResult.OK)
            {
                if (OpenDocumentDialog.CheckFileExists)
                {
                    string path = Path.GetFullPath(OpenDocumentDialog.FileName);
                    PathTextBox.Text = path;
                }
            }
        }