コード例 #1
0
        private void documentsDataGridView_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string errorMsg      = null;
            int?   selectedDocId = GetCurrentSelectedDocId(out errorMsg);

            if (selectedDocId.HasValue == false)
            {
                MessageBox.Show(errorMsg);
                return;
            }

            var selectedDoc = _mapperDocuments.FirstOrDefault(x => x.Id.Equals(selectedDocId.Value));

            if (selectedDoc == null)
            {
                MessageBox.Show($"Error. No Doc found with id '{selectedDocId}'. Restart Encompass please!");
                return;
            }

            using (var editDocForm = new DocumentMapperSingleDocForm(selectedDoc, WcmSettings, _encompassCustomFields, _encompassStandardFields))
            {
                if (editDocForm.ShowDialog((IWin32Window)this.ParentForm) != DialogResult.OK)
                {
                    return;
                }

                this.UpdateDocumentInGridview(editDocForm.TheDocument);
            }
        }
コード例 #2
0
        private void addNewDocument_Click(object sender, EventArgs e)
        {
            var sourceSelected = GetExternalSourceSelected();

            if (sourceSelected == null)
            {
                MessageBox.Show("You must select an external source before creating a Document!");
                return;
            }

            using (var editDocForm = new DocumentMapperSingleDocForm(
                       sourceSelected.Id,
                       WcmSettings,
                       _encompassCustomFields,
                       _encompassStandardFields))
            {
                if (editDocForm.ShowDialog((IWin32Window)this.ParentForm) != DialogResult.OK)
                {
                    return;
                }

                this.UpdateDocumentInGridview(editDocForm.TheDocument);
            }
        }