/// <summary> /// 本地添加附件 /// </summary> /// <param name="sender">命令参数</param> protected void OnAddLocalAttach(object sender) { var openFileDialog = new OpenFileDialog {Filter = "可用文档|*.docx;*.pdf"}; if (openFileDialog.ShowDialog() != true) return; listDocuments = ServiceLocator.Current.GetInstance<ListDocuments>(); listDocuments.Close(); docViewer.ShowDialog(); docViewerVM.InitDocument(openFileDialog.File, windowClosed, DocTypeIds); }
private void OnAddWord(object obj) { var openFileDialog = new OpenFileDialog {Filter = "WORD文档|*.docx"}; if (openFileDialog.ShowDialog() != true) return; listDocuments = ServiceLocator.Current.GetInstance<ListDocuments>(); listDocuments.Close(); docViewer.ShowDialog(); docViewerVM.InitDocument(openFileDialog.File, windowClosed, DocTypeIds); }
/// <summary> /// 服务器添加附件 /// </summary> /// <param name="sender">命令参数</param> protected void OnAddAttach(object sender) { listDocuments = ServiceLocator.Current.GetInstance<ListDocuments>(); if ((sender is Guid) && (Guid) sender != Guid.Empty) { MessageConfirm("附件已存在,继续操作将有可能替换当前附件。是否继续?", (o, e) => { if (e.DialogResult == null || e.DialogResult != true) return; listDocuments.ViewModel.InitData(d => WindowClosed(d, sender), DocTypeIds); listDocuments.ShowDialog(); }); } else { listDocuments.ViewModel.InitData(d => WindowClosed(d, sender), DocTypeIds); listDocuments.ShowDialog(); } }