Esempio n. 1
0
 public bool Close()
 {
     System.Windows.MessageBoxResult result = System.Windows.MessageBoxResult.Yes;
     if (Modified)
     {
         if (MessageBoxService != null)
         {
             result = MessageBoxService.Show("Do you want to save changes?", "Mail Merge",
                                             System.Windows.MessageBoxButton.YesNoCancel,
                                             System.Windows.MessageBoxImage.Question,
                                             System.Windows.MessageBoxResult.Yes);
             if (result == System.Windows.MessageBoxResult.Yes)
             {
                 RaiseSave();
             }
         }
     }
     if (result != System.Windows.MessageBoxResult.Cancel && DocumentManagerService != null)
     {
         IDocument document = DocumentManagerService.FindDocument(this);
         if (document != null)
         {
             document.Close();
         }
     }
     return(result != System.Windows.MessageBoxResult.Cancel);
 }
Esempio n. 2
0
        public void CreateDocument(object arg)
        {
            IDocument doc = DocumentManagerService.FindDocument(DocumentManagerService, arg);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("NewCBFView", arg);
                doc.Id = DocumentManagerService.Documents.Count <IDocument>();
            }
            doc.Show();
        }
Esempio n. 3
0
        /// <summary>
        /// 新建承包方编辑窗口
        /// </summary>
        /// <param name="model"></param>
        public void OnCreateEditCBFWindow(CBFModels model)
        {
            IDocument doc = DocumentManagerService.FindDocument(DocumentManagerService, model);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("EditCBFView", model);
                doc.Id = DocumentManagerService.Documents.Count <IDocument>();
            }
            doc.Show();
        }
Esempio n. 4
0
        public void CreateDocument(object viewModel)
        {
            var doc = DocumentManagerService.FindDocument(viewModel);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("DetailedView", viewModel);
                doc.Id = DocumentManagerService.Documents.Count();
            }
            doc.Show();
        }
Esempio n. 5
0
        public void CreateDocument(object arg)
        {
            var doc = DocumentManagerService.FindDocument(arg);

            if (doc == null)
            {
                doc    = DocumentManagerService.CreateDocument("LicenseDetailsView", arg);
                doc.Id = DocumentManagerService.Documents.Count();
            }

            doc.Show();
        }
Esempio n. 6
0
        protected void CreateDocument(int arg)
        {
            IDocument doc = DocumentManagerService.FindDocument(arg, this);

            if (doc == null)
            {
                doc       = DocumentManagerService.CreateDocument("EditCustomerView", arg, this);
                doc.Id    = string.Format("DocId_{0}", DocumentManagerService.Documents.Count());
                doc.Title = string.Format("Edit Customer {0}", arg);
            }
            doc.Show();
        }
Esempio n. 7
0
        public void Close()
        {
            if (DocumentManagerService == null)
            {
                return;
            }
            IDocument document = DocumentManagerService.FindDocument(this);

            if (document != null)
            {
                document.Close();
            }
        }