예제 #1
0
        public void AddWeakEventListenerTest2()
        {
            // Add a weak event listener and check if the eventhandler is called
            DocumentManager documentManager = new DocumentManager();
            ShellViewModel viewModel = new ShellViewModel(new MockView(), documentManager);
            Assert.IsFalse(viewModel.DocumentsHasChanged);
            Assert.IsFalse(viewModel.ActiveDocumentHasChanged);
            documentManager.Open();
            Assert.IsTrue(viewModel.DocumentsHasChanged);
            Assert.IsTrue(viewModel.ActiveDocumentHasChanged);

            // Remove the weak event listener and check that the eventhandler is not anymore called
            viewModel.RemoveWeakEventListeners();
            viewModel.DocumentsHasChanged = false;
            viewModel.ActiveDocumentHasChanged = false;
            documentManager.Open();
            Assert.IsFalse(viewModel.DocumentsHasChanged);
            Assert.IsFalse(viewModel.ActiveDocumentHasChanged);

            // Remove again the same weak event listeners although they are not anymore registered
            viewModel.RemoveWeakEventListeners();

            // Check that the garbage collector is able to collect the controller although the service lives longer
            viewModel.AddWeakEventListeners();
            documentManager.Open();
            Assert.IsTrue(viewModel.DocumentsHasChanged);
            Assert.IsTrue(viewModel.ActiveDocumentHasChanged);
            WeakReference weakController = new WeakReference(viewModel);
            viewModel = null;
            GC.Collect();

            Assert.IsFalse(weakController.IsAlive);
        }
예제 #2
0
파일: Solution.cs 프로젝트: derigel23/Nitra
    public void Open(Lifetime lifetime, IShellLocks shellLocks, ChangeManager changeManager, ISolution solution, DocumentManager documentManager, IActionManager actionManager, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, JetPopupMenus jetPopupMenus)
    {
      Debug.Assert(!IsOpened);

      _solution = solution;
      DocumentManager = documentManager;
      _jetPopupMenus = jetPopupMenus;
      changeManager.Changed2.Advise(lifetime, Handler);
      lifetime.AddAction(Close);
      var expandAction = actionManager.Defs.TryGetActionDefById(GotoDeclarationAction.ACTION_ID);
      if (expandAction != null)
      {
        var postfixHandler = new GotoDeclarationHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

        lifetime.AddBracket(
          FOpening: () => actionManager.Handlers.AddHandler(expandAction, postfixHandler),
          FClosing: () => actionManager.Handlers.RemoveHandler(expandAction, postfixHandler));
      }
      
      var findUsagesAction = actionManager.Defs.GetActionDef<FindUsagesAction>();
      var findUsagesHandler = new FindUsagesHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

      lifetime.AddBracket(
        FOpening: () => actionManager.Handlers.AddHandler(findUsagesAction, findUsagesHandler),
        FClosing: () => actionManager.Handlers.RemoveHandler(findUsagesAction, findUsagesHandler));
    }
 public T4OutsideSolutionSourceFile(IProjectFileExtensions projectFileExtensions,
     PsiProjectFileTypeCoordinator projectFileTypeCoordinator, IPsiModule module, FileSystemPath path,
     Func<PsiSourceFileFromPath, bool> validityCheck, Func<PsiSourceFileFromPath, IPsiSourceFileProperties> propertiesFactory,
     DocumentManager documentManager, IModuleReferenceResolveContext resolveContext)
     : base(projectFileExtensions, projectFileTypeCoordinator, module, path, validityCheck, propertiesFactory, documentManager, resolveContext)
 {
 }
		public T4OutsideSolutionSourceFileManager([NotNull] Lifetime lifetime, [NotNull] IProjectFileExtensions projectFileExtensions,
			[NotNull] PsiProjectFileTypeCoordinator psiProjectFileTypeCoordinator, [NotNull] DocumentManager documentManager,
			[NotNull] ISolution solution) {
			_projectFileExtensions = projectFileExtensions;
			_psiProjectFileTypeCoordinator = psiProjectFileTypeCoordinator;
			_documentManager = documentManager;
			_psiModule = new PsiModuleOnFileSystemPaths(solution, "T4OutsideSolution", TargetFrameworkId.Default);
			lifetime.AddDispose(_sourceFiles);
		}
 public FindTextSearchRequest(ISolution solution, string searchString, bool caseSensitive,
                              FindTextSearchFlags searchFlags, DocumentManager documentManager)
 {
   mySolution = solution;
   mySearchFlags = searchFlags;
   myDocumentManager = documentManager;
   mySearchString = searchString;
   myCaseSensitive = caseSensitive;
 }
예제 #6
0
 void ActivateContainer(DocumentManager manager)
 {
     WindowsUIView view = manager.View as WindowsUIView;
     if (view != null)
     {
         pageGroupCore.Parent = this.Tag as IContentContainer;
         pageGroupCore.SetSelected(pageGroupCore.Items[indexCore]);
         view.ActivateContainer(pageGroupCore);
     }
 }
 public UnityEventFunctionQuickDocProvider(ISolution solution, UnityApi unityApi,
                                           DocumentManager documentManager, QuickDocTypeMemberProvider quickDocTypeMemberProvider,
                                           HelpSystem helpSystem, ITheming theming)
 {
     mySolution = solution;
     myUnityApi = unityApi;
     myDocumentManager = documentManager;
     myQuickDocTypeMemberProvider = quickDocTypeMemberProvider;
     myHelpSystem = helpSystem;
     myTheming = theming;
 }
예제 #8
0
        protected FlowChartManager flowChartManager; // 流程图管理器实例

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="data">当前对象</param>
        /// <param name="description">命令的描述</param>
        public FlowChartBaseCommand(object data, string description):
            base(data, description)
        {
            graphManager = data as GraphManager;
            flowChartManager = graphManager.CurrentFlowChartManager;
            dataManager = flowChartManager.CurrentDataManager;
            documentManager = DocumentManager.GetDocumentManager();

            dataBeforeExecute = new SerialMemento();
            dataAfterExecute = new SerialMemento();
        }
예제 #9
0
 public static ExplorerBase LoadForm(string type, DocumentManager manager)
 {
     var p = typeof(ExplorerBase).Assembly.GetType(type)
         .GetProperty("Instance", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
     if (p != null)
     {
         var e = (ExplorerBase)p.GetValue(null, null);
         e.DockForm = manager.DockForm;
         return e;
     }
     return null;
 }
예제 #10
0
 public static IDocument LoadForm(string id, DocumentManager manager)
 {
     foreach (var p in manager.DockForm.Workspace.Projects)
     {
         IProjectDocument item = p.FindItem(id.ConvertTo<Guid>());
         if (item != null && item is IDiagram)
         {
             return new DiagramDocument((IDiagram)item, manager.DockForm);
         }
     }
     return (IDocument)null;
 }
예제 #11
0
파일: Program.cs 프로젝트: CSharpDev/Csharp
        static void Main()
        {
            var dm = new DocumentManager<Document>();
            dm.AddDocument(new Document("Title A", "Sample A"));
            dm.AddDocument(new Document("Title B", "Sample B"));

            dm.DisplayAllDocuments();

            if (dm.IsDocumentAvailable)
            {
                Document d = dm.GetDocument();
                Console.WriteLine(d.Content);
            }
        }
예제 #12
0
파일: Program.cs 프로젝트: ianheyi/CSharp
        static void Main()
        {
            var dm = new DocumentManager<Document>(); //The DocumentManager now works with any class that implements the interface IDocument.
              dm.AddDocument(new Document("Title A", "Sample A"));
              dm.AddDocument(new Document("Title B", "Sample B"));

              dm.DisplayAllDocuments();

              if (dm.IsDocumentAvailable)
              {
            Document d = dm.GetDocument();
            Console.WriteLine(d.Content);
              }
        }
        public PreviewTabEditorManager(Lifetime lifetime, ProjectModelSynchronizer projectModelSynchronizer,
                                   IVsUIShellOpenDocument vsUiShellOpenDocument,
                                   VsDocumentManagerSynchronization vsDocumentManagerSynchronization,
                                   ITextControlManager textControlManager, IFrameFocusHelper frameFocusHelper,
                                   DocumentManager documentManager,
                                   DocumentTransactionManager documentTransactionManager,
                                   IThreading threading)
            : base(lifetime, projectModelSynchronizer, vsUiShellOpenDocument, vsDocumentManagerSynchronization,
             textControlManager, frameFocusHelper, documentManager)
        {
            this.documentTransactionManager = documentTransactionManager;
              this.threading = threading;

              previewTabRequests = 0;
        }
예제 #14
0
 private void format_control()
 {
     //Cursor fails
     this.Cursor = Cursors.Arrow;
     this.UseWaitCursor = false;
     //tabbed view for child form
     DocumentManager manager = new DocumentManager();
     manager.MdiParent = this;
     manager.View = new TabbedView();
     //control's font formatting
     m_grp_lich.AppearanceCaption.Font = new Font("Comic Sans", 12, FontStyle.Bold);
     //
     m_lbl_thu.Font = new Font("Comic Sans", 18, FontStyle.Bold);
     //
     m_lbl_ngay.Font = new Font("Comic Sans", 14, FontStyle.Regular);
 }
예제 #15
0
        public DomainApplication(DomainObjectInquiry inquiry, IDbCommonConnection connection, DomainObjectFactory objFactory)
        {
            if (inquiry == null)
                throw new ArgumentNullException("inquiry");

            m_inquiry = inquiry;

            if (connection == null)
                throw new ArgumentNullException("connection");

            m_connection = connection;

            m_documentManager = new DocumentManager(m_inquiry);
            m_objManager = new DomainObjectManager(m_inquiry, connection, objFactory);

            DbManager = new DbCommonManager(m_connection);
        }
 public ExternalCodeFilesProvider(
     IProjectFileExtensions projectFileExtensions,
     PsiProjectFileTypeCoordinator projectFileTypeCoordinator,
     ChangeManager changeManager,
     IFileSystemTracker fileSystemTracker,
     IShellLocks shellLocks,
     DocumentManager documentManager,
     ISettingsStore settingsStore)
 {
     _projectFileExtensions = projectFileExtensions;
     _projectFileTypeCoordinator = projectFileTypeCoordinator;
     _changeManager = changeManager;
     _fileSystemTracker = fileSystemTracker;
     _shellLocks = shellLocks;
     _documentManager = documentManager;
     _settingsStore = settingsStore;
 }
예제 #17
0
 public new static Generator LoadForm(string ids, DocumentManager manager)
 {
     Instance.DockForm = manager.DockForm;
     var types = new List<TypeBase>();
     foreach (var id in ids.Split(','))
     {
         foreach (var p in manager.DockForm.Workspace.Projects)
         {
             IProjectDocument item = p.FindItem(id.ConvertTo<Guid>());
             if (item != null && item is TypeBase)
                 types.Add((TypeBase)item);
         }
     }
     Instance.types = types;
     Instance.UpdateTypes();
     Instance.UpdateButton();
     return Instance;
 }
예제 #18
0
        public NitraSolutionComponent(Lifetime lifetime, ISolution solution, ChangeManager changeManager, DocumentManager documentManager,
            IShellLocks locks, IPsiConfiguration psiConfiguration, IPersistentIndexManager persistentIndexManager)
        {
            _persistentIndexManager = persistentIndexManager;
              _psiConfiguration = psiConfiguration;
              _locks = locks;
              _solution = solution;
              _documentManager = documentManager;
              //changeManager.Changed2.Advise(lifetime, OnChangeManagerChanged);

              changeManager.RegisterChangeProvider(lifetime, this);
              changeManager.AddDependency(lifetime, this, documentManager.ChangeProvider);
              changeManager.AddDependency(lifetime, this, solution);

              foreach (var project in solution.GetAllProjects())
              {
            Debug.WriteLine(project.Name);
            //var projectItem = project as JetBrains.Proj
            foreach (var file in project.GetAllProjectFiles())
            {
              var ext = System.IO.Path.GetExtension(file.Name);
              if (string.Equals(ext, ".dll", StringComparison.InvariantCultureIgnoreCase))
            continue;

              if (file.LanguageType.Name == "MSBuild")
            continue;

              if (string.Equals(ext, ".dsl", StringComparison.InvariantCultureIgnoreCase))
              {
            var stream = file.CreateReadStream();
            string content = "";
            using (var streamReader = new StreamReader(stream))
              content = streamReader.ReadToEnd();
            Debug.WriteLine(content);
              }

              Debug.WriteLine(file.Name);
            }

              }
        }
예제 #19
0
 public ModelUI_Main()
 {
     InitializeComponent();
     _DocManager = new DocumentManager();
     ((ISupportInitialize)(this._DocManager)).BeginInit();
     _MetroUI = new MetroUIView();
     _DocManager.ContainerControl = this;
     _DocManager.View = _MetroUI;
     _DocManager.ViewCollection.Add(_MetroUI);
     ((ISupportInitialize)(this._DocManager)).EndInit();
     //string s = dt.Connection.ConnectionString.ToString();
     Form lg = new HPA.MAINFRAME.frmLogin();
     lg.ShowDialog();
     if (HPA.Common.StaticVars.UserName != null)
     {
         LoadModelMenu();
         _MetroUI.QueryControl += _MetroUI_QueryControl;
     }
     else
     {
         Application.Exit();
     }
 }
예제 #20
0
        internal T4PsiModule([NotNull] Lifetime lifetime, [NotNull] PsiModuleManager psiModuleManager, [NotNull] DocumentManager documentManager,
            [NotNull] ChangeManager changeManager, [NotNull] IAssemblyFactory assemblyFactory, [NotNull] IShellLocks shellLocks,
            [NotNull] IProjectFile projectFile, [NotNull] T4FileDataCache fileDataCache, [NotNull] T4Environment t4Environment,
            [NotNull] OutputAssembliesCache outputAssembliesCache)
        {
            _lifetime = lifetime;
            lifetime.AddAction(Dispose);

            _psiModuleManager = psiModuleManager;
            _documentManager = documentManager;
            _assemblyFactory = assemblyFactory;

            _changeManager = changeManager;
            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, psiModuleManager, this);

            _shellLocks = shellLocks;
            _projectFile = projectFile;
            _project = projectFile.GetProject();
            Assertion.AssertNotNull(_project, "_project != null");
            _solution = _project.GetSolution();

            _t4Environment = t4Environment;
            _outputAssembliesCache = outputAssembliesCache;
            _resolveProject = new T4ResolveProject(_solution, _shellLocks, t4Environment.PlatformID, _project);

            _sourceFile = new PsiProjectFile(
                this,
                _projectFile,
                (pf, sf) => new DefaultPsiProjectFileProperties(pf, sf),
                JetFunc<IProjectFile, IPsiSourceFile>.True,
                _documentManager);

            _isValid = true;
            fileDataCache.FileDataChanged.Advise(lifetime, OnDataFileChanged);
            AddBaseReferences();
        }
 /// <summary>
 /// Event that is called when a close button is pressed
 /// </summary>
 /// <param name="sender"> The object sender.</param>
 /// <param name="e"> The EventArgs.</param>
 private void dmDocuments_CloseButtonPressed(object sender, DocumentManager.CloseButtonPressedEventArgs e)
 {
     switch ( e.TabStrip.SelectedDocument.Text.ToLower() )
     {
         case "html browser":
             break;
         case "web browser":
             break;
         default:
             BasePluginForm pluginForm = (BasePluginForm)e.TabStrip.SelectedDocument.Control;
             pluginForm.Close();
             e.TabStrip.Documents.Remove(e.TabStrip.SelectedDocument);
             break;
     }
 }
예제 #22
0
        private void MoveDocuments(string docsId, Folder fromFolder, Folder toFolder)
        {
            try
            {
                string   messaggio = string.Empty;
                string[] docId     = new string[1] {
                    docsId
                };
                if (docsId.IndexOf(",") > 0)
                {
                    docId = docsId.Split(',');
                }
                InfoUtente infoUtente = UserManager.GetInfoUser();

                foreach (string docNumber in docId)
                {
                    string          idProfile = docNumber.Replace("doc", "");
                    SchedaDocumento doc       = DocumentManager.getDocumentDetails(this, idProfile, idProfile);

                    if (fromFolder.systemID != toFolder.systemID)
                    {
                        if (doc.protocollo != null && doc.protocollo.protocolloAnnullato != null)
                        {
                            // alert documento annullato
                            this.html_data.Text += "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('AlertProjectMoveDocNoAllowedProtCanceled', 'warning', '');} else {parent.ajaxDialogModal('AlertProjectMoveDocNoAllowedProtCanceled', 'warning', '');}\n";
                        }
                        //else if (Convert.ToInt32(doc.accessRights) < Convert.ToInt32(HMdiritti.HMdiritti_Write))
                        //{
                        //    // alert no diritti in scrittura
                        //    this.html_data.Text += "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('AlertProjectMoveDocNoAllowedNoWrite', 'warning', '');} else {parent.ajaxDialogModal('AlertProjectMoveDocNoAllowedNoWrite', 'warning', '');}\n";
                        //}
                        else
                        {
                            // add new
                            UIManager.AddDocInProjectManager.addDocumentoInFolder(idProfile, toFolder.systemID, infoUtente);

                            // delete old
                            ValidationResultInfo risultato = UIManager.ProjectManager.deleteDocFromFolder(fromFolder, infoUtente, idProfile, RapidClassificationRequired.ToString(), out messaggio);
                            if (risultato != null && risultato.BrokenRules.Length > 0)
                            {
                                this.html_data.Text += "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('AlertProjectRemoveDoc', 'error', '');} else {parent.ajaxDialogModal('AlertProjectRemoveDoc', 'error', '');}\n";
                            }
                            else
                            if (!string.IsNullOrEmpty(messaggio) && messaggio != "")
                            {
                                this.html_data.Text += "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('ErrorProjectRemoveDoc', 'error', '');} else {parent.ajaxDialogModal('ErrorProjectRemoveDoc', 'error', '');}\n";
                            }
                        }
                    }
                }

                this.html_data.Text = "<" + "script type=\"\">\n"
                                      + this.html_data.Text
                                      + "$('#BtnRebindGrid').click();\n"
                                      + "<" + "/script>\n";
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
예제 #23
0
 protected override void InvalidateFolders()
 {
     DocumentManager.InvalidateFolder(typeof(Folders.Performing.ScheduledFolder));
     DocumentManager.InvalidateFolder(typeof(Folders.Performing.CancelledFolder));
 }
예제 #24
0
 protected override void OnPreRender(EventArgs e)
 {
     base.OnPreRender(e);
     if (this.IsPostBack && hf_Reset.Value.Equals("1"))
     {
         this.hf_Id.Value      = "";
         this.txt_NomeObj.Text = "";
         hf_Reset.Value        = "0";
     }
     if (this.IsPostBack && hf_SelectedObject.Value.Equals("1"))
     {
         if (IsFascicolo)
         {
             Fascicolo fasc = FascicoliManager.getFascicoloSelezionatoRicerca();
             if (fasc != null)
             {
                 this.hf_Id.Value       = fasc.systemID;
                 this.txt_NomeObj.Text  = fasc.descrizione;
                 this.txt_Maschera.Text = fasc.codice + " " + CutValue(fasc.descrizione);
             }
         }
         else
         {
             InfoDocumento infoDoc = DocumentManager.getInfoDocumentoRicerca(this.Page);
             if (infoDoc != null)
             {
                 this.hf_Id.Value      = infoDoc.idProfile;
                 this.txt_NomeObj.Text = infoDoc.oggetto;
                 if (!string.IsNullOrEmpty(infoDoc.segnatura))
                 {
                     this.txt_Maschera.Text = infoDoc.segnatura + " " + CutValue(infoDoc.oggetto);
                 }
                 else
                 {
                     this.txt_Maschera.Text = infoDoc.idProfile + " " + CutValue(infoDoc.oggetto);
                 }
             }
         }
         this.hf_SelectedObject.Value = "0";
     }
     this.txt_NomeObj.CssClass    = TextCssClass;
     this.txt_Link.CssClass       = this.TextCssClass;
     this.txt_Maschera.CssClass   = TextCssClass;
     this.hpl_Link.Text           = this.LinkText;
     this.btn_Reset.OnClientClick = "_" + ClientID + "_reset();return false;";
     if (IsFascicolo)
     {
         this.lbl_oggetto.Text        = "Fascicolo: ";
         this.btn_Cerca.OnClientClick = "_" + ClientID + "_apriRicercaFascicoli()";
     }
     else
     {
         this.lbl_oggetto.Text        = "Documento: ";
         this.btn_Cerca.OnClientClick = "_" + ClientID + "_apriRicercaDocumenti()";
     }
     if (IsEsterno)
     {
         this.hpl_Link.OnClientClick = "_" + ClientID + "_apriLinkEsterno()";
     }
     this.pnlLink_Link.Visible = !HideLink;
     if (IsInsertModify)
     {
         this.pnlLink_InsertModify.Visible = true;
         if (IsAnteprima)
         {
             this.btn_Cerca.Enabled = false;
             this.btn_Reset.Enabled = false;
             this.hpl_Link.Enabled  = false;
         }
         if (IsEsterno)
         {
             this.tr_interno.Visible = false;
             this.tr_esterno.Visible = true;
         }
         else
         {
             this.tr_interno.Visible = true;
             this.tr_esterno.Visible = false;
         }
     }
     else
     {
         this.pnlLink_InsertModify.Visible = false;
     }
 }
예제 #25
0
        private void btn_ok_Click(object sender, System.EventArgs e)
        {
            string idCorr   = string.Empty;
            string idCanale = string.Empty;
            bool   acceptCanaleTutti;

            DocsPaWR.Canale           canale = new DocsPAWA.DocsPaWR.Canale();
            DocsPaWR.DocsPaWebService ws     = new DocsPAWA.DocsPaWR.DocsPaWebService();
            schedaDoc = DocumentManager.getDocumentoInLavorazione(this);
            DocsPaWR.Corrispondente[] dest   = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatari;
            DocsPaWR.Corrispondente[] destCc = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatariConoscenza;

            if (dataGridMezzi != null)
            {
                Canale canaleTutti = null;
                if (!ddlTutti.SelectedValue.Equals("0"))
                {
                    canaleTutti = ws.getCanaleBySystemId(ddlTutti.SelectedValue);
                }
                DataGridItemCollection items = dataGridMezzi.Items;
                if (items != null)
                {
                    //itero sui singoli item della griglia
                    foreach (DataGridItem item in items)
                    {
                        string tipoDest           = string.Empty;
                        TableCellCollection cells = item.Cells;
                        foreach (TableCell cell in cells)
                        {
                            ControlCollection controls = cell.Controls;
                            foreach (Control control in controls)
                            {
                                if (control.GetType() == typeof(Label))
                                {
                                    idCorr = ((Label)control).Text;
                                    break;
                                }

                                if (control.GetType() == typeof(DropDownList))
                                {
                                    idCanale = ((DropDownList)control).SelectedValue;
                                    break;
                                }
                            }
                        }

                        if (dest != null && dest.Length > 0)
                        {
                            acceptCanaleTutti = false;
                            foreach (DocsPaWR.Corrispondente corr in dest)
                            {
                                // se è impostato il canale tutti ed il corrispondente corrente ha visibilità del mezzo di spedizione tutti allora lo imposto
                                if (corr.systemId.Equals(idCorr) && canaleTutti != null)
                                {
                                    System.Collections.Generic.List <Mezzi> listMezziVisCorr = GetMeansDeliveryFiltered(UserManager.getCorrispondenteBySystemID(this.Page, idCorr).canalePref, idCorr);
                                    foreach (Mezzi m in listMezziVisCorr)
                                    {
                                        if (m.Descrizione.Equals(canaleTutti.descrizione) && m.Valore.Equals(canaleTutti.systemId))
                                        {
                                            acceptCanaleTutti = true;
                                            corr.canalePref   = canaleTutti;
                                            tipoDest          = "d";
                                            break;
                                        }
                                    }
                                }

                                //l'utente a selezionata blank quindi reimposto il canale di default
                                if (!acceptCanaleTutti && corr.systemId.Equals(idCorr) && (idCanale.Equals("0")))
                                {
                                    if (corr.canalePref != null && corr.canalePref.systemId != null)
                                    {
                                        canale          = UserManager.getCorrispondenteBySystemID(this.Page, idCorr).canalePref;
                                        corr.canalePref = canale;
                                        tipoDest        = "d";
                                        break;
                                    }
                                }
                                //imposto il canale selezionato dall'utente
                                else if (!acceptCanaleTutti && corr.systemId.Equals(idCorr))
                                {
                                    canale          = ws.getCanaleBySystemId(idCanale);
                                    corr.canalePref = canale;
                                    tipoDest        = "d";
                                    break;
                                }
                            }
                        }
                        if (destCc != null && destCc.Length > 0 && (!tipoDest.Equals("d")))
                        {
                            acceptCanaleTutti = false;
                            foreach (DocsPaWR.Corrispondente corr in destCc)
                            {
                                // se è impostato il canale tutti ed il corrispondente corrente ha visibilità del mezzo di spedizione tutti allora lo imposto
                                if (corr.systemId.Equals(idCorr) && canaleTutti != null)
                                {
                                    System.Collections.Generic.List <Mezzi> listMezziVisCorr = GetMeansDeliveryFiltered(UserManager.getCorrispondenteBySystemID(this.Page, idCorr).canalePref, idCorr);
                                    foreach (Mezzi m in listMezziVisCorr)
                                    {
                                        if (m.Descrizione.Equals(canaleTutti.descrizione) && m.Valore.Equals(canaleTutti.systemId))
                                        {
                                            acceptCanaleTutti = true;
                                            corr.canalePref   = canaleTutti;
                                            tipoDest          = "d";
                                            break;
                                        }
                                    }
                                }

                                //l'utente a selezionata blank quindi reimposto il canale di default
                                if (!acceptCanaleTutti && corr.systemId.Equals(idCorr) && (idCanale.Equals("0")))
                                {
                                    if (corr.canalePref != null && corr.canalePref.systemId != null)
                                    {
                                        canale          = UserManager.getCorrispondenteBySystemID(this.Page, idCorr).canalePref;
                                        corr.canalePref = canale;
                                        break;
                                    }
                                }
                                //imposto il canale selezionato dall'utente
                                else if (!acceptCanaleTutti && corr.systemId.Equals(idCorr))
                                {
                                    canale          = ws.getCanaleBySystemId(idCanale);
                                    corr.canalePref = canale;
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            //Salvo le informazioni aggiornate nella sessione
            ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatari           = dest;
            ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatariConoscenza = destCc;
            DocumentManager.setDocumentoInLavorazione(this, schedaDoc);
            DocumentManager.setDocumentoSelezionato(this, schedaDoc);

            //richiama la funzione javascript che aggiorna il form chiamante
            string funct = " window.open('../documento/docProtocollo.aspx?editMode=true','IframeTabs'); ";

            funct = funct + " window.close(); ";
            Response.Write("<script> " + funct + "</script>");
        }
예제 #26
0
        /// <summary>
        /// Reperimento contenuto del file
        /// </summary>
        /// <param name="versionId"></param>
        /// <returns></returns>
        public static byte[] GetFileContent()
        {
            String selectedVersionId = null;

            if (DocumentManager.getSelectedNumberVersion() != null && DocumentManager.ListDocVersions != null)
            {
                selectedVersionId = (from v in DocumentManager.ListDocVersions where v.version.Equals(DocumentManager.getSelectedNumberVersion()) select v.versionId).FirstOrDefault();
            }

            DocsPaWR.FileRequest fileInfo = (DocumentManager.getSelectedAttachId() != null) ?
                                            UIManager.FileManager.GetFileRequest(DocumentManager.getSelectedAttachId()) :
                                            UIManager.FileManager.GetFileRequest(selectedVersionId);

            DocsPaWR.FileDocumento fileDocumento = WsInstance.DocumentoGetFile(fileInfo, UIManager.UserManager.GetInfoUser());

            if (fileDocumento != null)
            {
                return(fileDocumento.content);
            }
            else
            {
                if (HttpContext.Current.Session["CheckOutPage.Content"] != null)
                {
                    return((byte[])HttpContext.Current.Session["CheckOutPage.Content"]);
                }
                else
                {
                    return(null);
                }
            }
        }
예제 #27
0
 public PatternSearcher(DocumentManager documentManager)
 {
     this.documentManager = documentManager;
 }
예제 #28
0
 /// <summary>
 /// Saves node, ensures workflow.
 /// </summary>
 protected void SaveNode()
 {
     // Save content
     DocumentManager.SaveDocument();
 }
예제 #29
0
        /// <summary>
        /// Reperimento contenuto del file firmato
        /// </summary>
        /// <returns></returns>
        public static byte[] GetSignedFileContent()
        {
            String selectedVersionId = null;

            if (DocumentManager.getSelectedNumberVersion() != null && DocumentManager.ListDocVersions != null)
            {
                selectedVersionId = (from v in DocumentManager.ListDocVersions where v.version.Equals(DocumentManager.getSelectedNumberVersion()) select v.versionId).FirstOrDefault();
            }

            DocsPaWR.FileRequest fileInfo = (UIManager.DocumentManager.getSelectedAttachId() != null) ?
                                            UIManager.FileManager.GetFileRequest(UIManager.DocumentManager.getSelectedAttachId()) :
                                            UIManager.FileManager.GetFileRequest(selectedVersionId);

            DocsPaWR.FileDocumento fileDocumento = WsInstance.DocumentoGetFileFirmato(fileInfo, UIManager.UserManager.GetInfoUser());

            if (fileDocumento != null)
            {
                return(fileDocumento.content);
            }
            else
            {
                return(null);
            }
        }
 private void CustomerList_Load(object sender, System.EventArgs e)
 {
     TransactionalChangeHandler.Hookup <Customer>(
         DocumentManager.FromControl(ParentForm).View, unitOfWork, saveChangesItem,
         discardChangesItem, customerCollection);
 }
예제 #31
0
 //------------------------------------------------------------------------------------------------------------------------
 private static void AppendNavigateToMenuItems(Lifetime lifetime, ISolution solution, List <IClrDeclaredElement> clrDeclaredElements,
                                               List <SimpleMenuItem> menuItems)
 {
     foreach (var declaredElement in clrDeclaredElements)
     {
         var simpleMenuItems = DescribeFilesAssociatedWithDeclaredElement(lifetime, DocumentManager.GetInstance(solution),
                                                                          declaredElement
                                                                          ,
                                                                          p =>
                                                                          () =>
                                                                          EditorManager.GetInstance(solution).
                                                                          OpenProjectFile(p, new OpenFileOptions(true))
                                                                          );
         menuItems.AddRange(simpleMenuItems);
     }
 }
예제 #32
0
        //------------------------------------------------------------------------------------------------------------------------
        private static IList <SimpleMenuItem> DescribeFilesAssociatedWithDeclaredElement(Lifetime lifetime, DocumentManager documentManager, IClrDeclaredElement declaredElement, Func <IProjectFile, Action> clickAction)
        {
            IList <SimpleMenuItem> menuItems = new List <SimpleMenuItem>();

            var projectFiles = GetProjectFiles(documentManager, declaredElement);

            foreach (var projectFile in projectFiles)
            {
                IProjectFile currentProjectFile = projectFile;
                var          np = new ProjectFileNavigationPoint(currentProjectFile);

                var result = new SimpleMenuItemForProjectItem(np.GetPresentationText()
                                                              , np.GetPresentationImage()
                                                              , ResharperHelper.ProtectActionFromReEntry(lifetime, "TestingMenuNavigation", clickAction.Invoke(projectFile))
                                                              , projectFile, declaredElement
                                                              );

                result.ShortcutText = np.GetSecondaryPresentationText();
                result.Style        = MenuItemStyle.Enabled;
                result.Tag          = projectFile.Location.FullPath;

                menuItems.Add(result);
            }
            return(menuItems);
        }
예제 #33
0
 protected override void InvalidateFolders()
 {
     DocumentManager.InvalidateFolder(typeof(Folders.Registration.ScheduledFolder));
     DocumentManager.InvalidateFolder(typeof(Folders.Registration.CancelledFolder));
 }
예제 #34
0
        private void MoveRefactoredFiles()
        {
            MessageBar.Locked = true;
            AssociatedDocumentHelper.CloseTemporarilyOpenedDocuments();
            foreach (var target in targets)
            {
                File.Delete(target.OldFilePath);

                if (target.OwnerPath == null)
                {
                    OldPathToNewPath.Remove(target.OldFilePath);
                }

                // Casing changes, we cannot move directly here, there may be conflicts, better leave it to the next step
                if (target.TmpFilePath != null)
                {
                    RefactoringHelper.Move(target.TmpFilePath, target.NewFilePath);
                }
            }
            // Move non-source files and whole folders
            foreach (KeyValuePair <string, string> item in OldPathToNewPath)
            {
                string oldPath = item.Key;
                string newPath = item.Value;
                if (File.Exists(oldPath))
                {
                    newPath = Path.Combine(newPath, Path.GetFileName(oldPath));
                    if (!Path.IsPathRooted(newPath))
                    {
                        newPath = Path.Combine(Path.GetDirectoryName(oldPath), newPath);
                    }
                    RefactoringHelper.Move(oldPath, newPath, true);
                }
                else if (Directory.Exists(oldPath))
                {
                    newPath = renaming ? Path.Combine(Path.GetDirectoryName(oldPath), newPath) : Path.Combine(newPath, Path.GetFileName(oldPath));

                    // Look for document class changes
                    // Do not use RefactoringHelper to avoid possible dialogs that we don't want
                    Project project          = (Project)PluginBase.CurrentProject;
                    string  newDocumentClass = null;
                    string  searchPattern    = project.DefaultSearchFilter;
                    foreach (string pattern in searchPattern.Split(';'))
                    {
                        foreach (string file in Directory.GetFiles(oldPath, pattern, SearchOption.AllDirectories))
                        {
                            if (project.IsDocumentClass(file))
                            {
                                newDocumentClass = file.Replace(oldPath, newPath);
                                break;
                            }
                        }
                        if (newDocumentClass != null)
                        {
                            break;
                        }
                    }

                    // Check if this is a name casing change
                    if (oldPath.Equals(newPath, StringComparison.OrdinalIgnoreCase))
                    {
                        string tmpPath = oldPath + "$renaming$";
                        FileHelper.ForceMoveDirectory(oldPath, tmpPath);
                        DocumentManager.MoveDocuments(oldPath, tmpPath);
                        oldPath = tmpPath;
                    }

                    // Move directory contents to final location
                    FileHelper.ForceMoveDirectory(oldPath, newPath);
                    DocumentManager.MoveDocuments(oldPath, newPath);

                    if (!string.IsNullOrEmpty(newDocumentClass))
                    {
                        project.SetDocumentClass(newDocumentClass, true);
                        project.Save();
                    }
                }
            }

            MessageBar.Locked = false;
        }
 private void dmPanels_CloseButtonPressed(object sender, DocumentManager.CloseButtonPressedEventArgs e)
 {
     // e.TabStrip.Documents.Remove(e.TabStrip.SelectedDocument);
 }
예제 #36
0
        /// <summary>
        /// 编辑图元
        /// </summary>
        /// <param name="flowChartManager">绘图管理器</param>
        /// <param name="logicData">逻辑数据</param>
        /// <returns>是否操作成功</returns>
        protected override bool LogicEdit(FlowChartManager flowChartManager, object logicData)
        {
            bool executeResult = true;

            GraphManager    graphManager    = flowChartManager.CurrentGraphManager;
            DataManager     dataManager     = flowChartManager.CurrentDataManager;
            DocumentManager documentManager = DocumentManager.GetDocumentManager();
            GraphElement    graphElement    = logicData as GraphElement;
            DataElement     dataElement     = dataManager.GetDataElement(graphElement);

            if (CheckGraphElementEditable(graphElement)) // 检查图元是否能够编辑
            {
                object    data        = dataManager.GetData(graphElement);
                Hashtable information = new Hashtable();

                information["data"]           = data;
                information["prev_data"]      = dataManager.GetPreviousData(graphElement);
                information["next_data"]      = dataManager.GetNextData(graphElement);
                information["neighbor_data"]  = dataManager.GetNeighborData(graphElement);
                information["globe_args"]     = dataManager.GlobeArgs;
                information["flowchart_name"] = flowChartManager.Name;
                information["map_name"]       = flowChartManager.MapName;
                information["client_dir"]     = Helper.GetHelper().OutputDir;

                if (graphElement is SlotContainer)
                {
                    SlotContainer slotContainer = graphElement as SlotContainer;

                    // 刷新当前事件结点
                    information["event_data"] = dataManager.GetEventData(slotContainer);
                }

                dataElement.PrintInformation = new DataElement.PrintInfo(documentManager.PrintText);

                try
                {
                    executeResult = dataElement.EditData(information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("当前图元由于以下原因无法编辑:\n\n" + ex.Message, "图元编辑",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                if (executeResult) // 保存图元数据
                {
                    Hashtable    previousDataTable = information["prev_data"] as Hashtable;
                    Hashtable    nextDataTable     = information["next_data"] as Hashtable;
                    GraphElement currentGraphElement;
                    DataElement  editDataElement;

                    // 检查是否需要更新图元和数据元的数据
                    foreach (string id in previousDataTable.Keys)
                    {
                        editDataElement = previousDataTable[id] as DataElement;

                        if (editDataElement != null && editDataElement.Data == null)
                        {
                            currentGraphElement             = dataManager.FindGraphElementByID(int.Parse(id));
                            currentGraphElement.Text        = editDataElement.Text;
                            currentGraphElement.TooltipText = editDataElement.TooltipText;
                            currentGraphElement.ShowText    = false;
                        }
                    }

                    foreach (string id in nextDataTable.Keys)
                    {
                        editDataElement = nextDataTable[id] as DataElement;

                        if (editDataElement != null && editDataElement.Data == null)
                        {
                            currentGraphElement             = dataManager.FindGraphElementByID(int.Parse(id));
                            currentGraphElement.Text        = editDataElement.Text;
                            currentGraphElement.TooltipText = editDataElement.TooltipText;
                            currentGraphElement.ShowText    = false;
                        }
                    }

                    graphElement.TooltipText = dataElement.TooltipText;
                    graphElement.Text        = dataElement.Text;
                    if (dataElement.Text == "")
                    {
                        graphElement.ShowText = false;
                    }
                    else
                    {
                        graphElement.ShowText = true;
                    }

                    // 调整文本
                    if (graphElement is SlotContainer)
                    {
                        SlotContainer slotContainer = graphElement as SlotContainer;
                        slotContainer.AdjustText();

                        // 根据文本内容调整插槽容器的大小
                        slotContainer.AdjustElementSize();
                    }
                    else if (graphElement is ConnectorContainer)
                    {
                        ConnectorContainer line = graphElement as ConnectorContainer;
                        line.AdjustText();
                    }
                }
            }

            return(executeResult);
        }
예제 #37
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptHelper.RegisterDialogScript(Page);

        btnOk.OnClientClick = DocumentManager.GetAllowSubmitScript();

        EditedObject = DocumentAlias;

        if (IsDialog)
        {
            PageTitle.TitleText = GetString("content.ui.urlsaliases");
        }
        else
        {
            HeaderActions.AddAction(new HeaderAction
            {
                Text        = GetString("doc.urls.addnewalias"),
                RedirectUrl = ResolveUrl("Alias_Edit.aspx?nodeid=" + NodeID),
                ButtonStyle = ButtonStyle.Default
            });

            HeaderActions.AddAction(new HeaderAction
            {
                Text          = GetString("doc.urls.viewallalias"),
                OnClientClick = "modalDialog('" + ResolveUrl(PROPERTIES_FOLDER + "Alias_AliasList.aspx") + "?nodeid=" + NodeID + "&dialog=1" + "','AliasManagement','90%','85%');",
                ButtonStyle   = ButtonStyle.Default
            });
        }

        if (Node != null)
        {
            lblUrlInfoText.Text = Node.NodeAliasPath;

            // Check modify permissions
            if (!DocumentUIHelper.CheckDocumentPermissions(Node, PermissionsEnum.Modify))
            {
                ShowInformation(String.Format(GetString("cmsdesk.notauthorizedtoeditdocument"), Node.NodeAliasPath));

                txtURLExtensions.Enabled = false;

                ctrlURL.Enabled = false;

                cultureSelector.Enabled = false;
            }

            if (!RequestHelper.IsPostBack() && QueryHelper.GetInteger("saved", 0) == 1)
            {
                ShowChangesSaved();
            }

            lblDocumentCulture.Text = GetString("general.culture") + ResHelper.Colon;
            lblURLExtensions.Text   = GetString("doc.urls.urlextensions") + ResHelper.Colon;

            // Show path of document alias only if dialog mode edit
            pnlUrlInfo.Visible = IsDialog;

            // For dialog mode use DefaultNodeID
            defaultNodeID = (IsDialog) ? QueryHelper.GetInteger("defaultNodeID", 0) : NodeID;

            CreateBreadcrumbs();

            cultureSelector.AllowDefault = false;
            cultureSelector.UniSelector.SpecialFields.Add(new SpecialField
            {
                Text  = GetString("general.selectall"),
                Value = String.Empty
            });


            if (!RequestHelper.IsPostBack())
            {
                cultureSelector.Value = Node.DocumentCulture;

                // Edit existing alias
                if (DocumentAlias != null && DocumentAlias.AliasID > 0)
                {
                    txtURLExtensions.Text = DocumentAlias.AliasExtensions;
                    ctrlURL.URLPath       = DocumentAlias.AliasURLPath;

                    cultureSelector.Value         = DocumentAlias.AliasCulture;
                    PageBreadcrumbs.Items[1].Text = TreePathUtils.GetUrlPathDisplayName(DocumentAlias.AliasURLPath);

                    drpAction.SelectedValue = DocumentAlias.AliasActionMode.ToStringRepresentation();
                }
            }

            // Register js synchronization script for split mode
            if (QueryHelper.GetBoolean("refresh", false) && UIContext.DisplaySplitMode)
            {
                RegisterSplitModeSync(true, false, true);
            }
        }
    }
예제 #38
0
        public string CreateResultPage()
        {
            if (null == user)
            {
                throw new Exception("user info is missing");
            }


            var exeBaseDir = AppDomain.CurrentDomain.BaseDirectory;

            var tempDocDir = OSHelper.DocumentDefaultDirectory;

            var resultTempFullPath  = System.IO.Path.Combine(exeBaseDir, OSHelper.ResultTemplatePage);
            var previewTempFullPath = System.IO.Path.Combine(exeBaseDir, OSHelper.PreviewTemplatePage);

            var timestamp          = System.DateTime.Now.ToString("yyyyMMddHHmmssffff");
            var resultHtmlFileName = string.Format("{0}.html", timestamp);
            var resultPdfFileName  = string.Format("{0}.pdf", timestamp);
            var previewFileName    = string.Format("{0}_pre.html", timestamp);

            var resultHtmlFullPath = System.IO.Path.Combine(tempDocDir, OSHelper.ReportDictory, resultHtmlFileName);
            var resultPdfFullPath  = System.IO.Path.Combine(tempDocDir, OSHelper.ReportDictory, resultPdfFileName);
            var previewFullPath    = System.IO.Path.Combine(tempDocDir, OSHelper.ReportDictory, previewFileName);

            var tempDir = System.IO.Path.Combine(exeBaseDir, OSHelper.ReportDictory);

            var tempResultDir = System.IO.Path.Combine(tempDocDir, OSHelper.ReportDictory);

            //set ace user
            var ds  = new DirectorySecurity();
            var sid = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
            var ace = new FileSystemAccessRule(sid,
                                               FileSystemRights.FullControl,
                                               AccessControlType.Allow);

            ds.AddAccessRule(ace);



            if (!Directory.Exists(tempResultDir))
            {
                Directory.CreateDirectory(tempResultDir, ds);
            }

            var fullResult = result;

            if (null != assesses && !string.IsNullOrEmpty(resultCode))
            {
                try
                {
                    AssessResult ar = (assesses.FirstOrDefault(o => o.QuestionnaireID == questionnaire.QuestionnaireID)).Results.FirstOrDefault(f => f.Code.Equals(resultCode));

                    if (null != ar)
                    {
                        fullResult += "<br>" + ar.Text;
                    }
                }
                catch (Exception ex)
                {
                    //todo
                }
            }


            var hasHtmlResult = DotNetToHtm.CreateHtml(resultTempFullPath
                                                       , resultHtmlFullPath
                                                       , new string[] { "$basePath$", "$CenterName$", "$reportPhysician$", "$no$", "$QuestionnaireName$", "$name$", "$gender$", "$age$", "$reportDate$", "$result$" }
                                                       , new string[] { exeBaseDir, report.CenterName, report.PhysicianName, string.Format("{0}{1}{2}{3}", System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day, reportCounter), Questionnaire.Name, user.Name, user.Gender, user.Age.ToString(), System.DateTime.Now.ToShortDateString(), fullResult });


            if (hasHtmlResult)
            {
                PdfDocument pdf = new PdfDocument()
                {
                    HtmlUrl = resultHtmlFullPath, PdfSavePath = resultPdfFullPath
                };

                var dm = new DocumentManager();

                try
                {
                    var hasPdfDoc = dm.HTMLtoPDFAsync(pdf, "C").Result;

                    var pdfExisted = System.IO.File.Exists(resultPdfFullPath);

                    if (hasPdfDoc || pdfExisted)
                    {
                        var hasPreviewResult = DotNetToHtm.CreateHtml(previewTempFullPath, previewFullPath, new string[] { "$pdf$" }, new string[] { resultPdfFullPath });

                        if (hasPreviewResult)
                        {
                            printNameFinder = timestamp;

                            return(previewFullPath);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("error in pdf generator " + ex);
                }
            }



            return(string.Empty);
        }
예제 #39
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void DataChanged(object sender, EventArgs e)
        {
            this.IsDirtyControl          = true;
            this.ddl_regRF.Visible       = false;
            this.txtAutoComplete.Visible = false;
            this.newNota = true;
            //pnl_noteRf.Visible = false;
            ListItem item = this.rblTipiVisibilita.Items.FindByValue("RF");

            //Se è presente il bottone di selezione esclusiva "RF" si verifica quanti sono gli
            //RF associati al ruolo dell'utente
            if (item != null && rblTipiVisibilita.SelectedIndex == 2)
            {
                DocsPaWR.Registro[] registriRf;
                if (ViewState["rf"] == null)
                {
                    Ruolo ruoloUtente = UserManager.getRuolo();
                    registriRf = UserManager.getListaRegistriWithRF(ruoloUtente.systemId, "1", "");
                }
                else
                {
                    registriRf = (DocsPaWR.Registro[])ViewState["rf"];
                }
                //Se un ruolo appartiene a più di un RF, allora selezionando dal menù il valore RF
                //l'utente deve selezionare su quale degli RF creare la nota
                if (registriRf != null && registriRf.Length > 0)
                {
                    //Se l'inserimento della nota avviene durante la protocollazione
                    //ed è impostato nella segnatura il codice del RF, la selezione del RF dal quale
                    //prendere il codice sarà mantenuta valida anche per l'eventuale inserimento delle note
                    //in questo caso non si deve presentare la popup di selezione del RF
                    if (this.PAGINA_CHIAMANTE.Equals("docProtocollo"))
                    {
                        DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentoInLavorazione();
                        //if (schedaDoc.protocollo == null || (schedaDoc.protocollo != null && string.IsNullOrEmpty(schedaDoc.protocollo.segnatura)))
                        //{
                        if (ddl_regRF != null && ddl_regRF.SelectedIndex == -1)
                        {
                            CaricaComboRegistri(ddl_regRF, registriRf);
                        }
                        //}
                    }
                    else
                    //if (this.PAGINA_CHIAMANTE.Equals("docProfilo") || this.PAGINA_CHIAMANTE.Equals("fascNewFascicolo") )
                    {
                        if (ddl_regRF != null && ddl_regRF.SelectedIndex == -1)
                        {
                            CaricaComboRegistri(ddl_regRF, registriRf);
                        }
                        if (!this.PAGINA_CHIAMANTE.Equals("docProfilo"))
                        {
                            //Protocollo semplificato
                            // txtAutoComplete.Width = Unit.Pixel(620);
                            DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentoInLavorazione();
                        }
                    }
                    this.txtAutoComplete.Visible = false;
                    //if (this.PAGINA_CHIAMANTE.Equals("docProtocollo") || this.PAGINA_CHIAMANTE.Equals("docProfilo"))
                    //{
                    if (UserManager.ruoloIsAutorized(this, "RICERCA_NOTE_ELENCO"))
                    {
                        this.txtAutoComplete.Visible = true;
                    }
                    //}
                }
            }


            clTesto.Value = (caratteriDisponibili - txtNote.Text.Length).ToString();
        }
 public ShaderContextCache(ISolution solution, InjectedHlslFileLocationTracker locationTracker, DocumentManager manager, ILogger logger)
 {
     mySolution        = solution;
     myLocationTracker = locationTracker;
     myManager         = manager;
     myLogger          = logger;
 }
예제 #41
0
        public void ArgumentNullTest()
        {
            DocumentManager documentManager = new DocumentManager();
            DocumentController controller = new DocumentController(documentManager);
            ShellViewModel shellViewModel = new ShellViewModel(new MockView(), documentManager);
            
            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.AddWeakEventListener((INotifyPropertyChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.AddWeakEventListener(documentManager, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.RemoveWeakEventListener((INotifyPropertyChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.RemoveWeakEventListener(documentManager, null));

            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.AddWeakEventListener((INotifyCollectionChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.AddWeakEventListener((INotifyCollectionChanged)documentManager.Documents, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.RemoveWeakEventListener((INotifyCollectionChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => controller.RemoveWeakEventListener((INotifyCollectionChanged)documentManager.Documents, null));

            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.AddWeakEventListener((INotifyPropertyChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.AddWeakEventListener(documentManager, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.RemoveWeakEventListener((INotifyPropertyChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.RemoveWeakEventListener(documentManager, null));

            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.AddWeakEventListener((INotifyCollectionChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.AddWeakEventListener((INotifyCollectionChanged)documentManager.Documents, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.RemoveWeakEventListener((INotifyCollectionChanged)null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => shellViewModel.RemoveWeakEventListener((INotifyCollectionChanged)documentManager.Documents, null));

            AssertHelper.ExpectedException<ArgumentNullException>(() => new PropertyChangedEventListener(null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => new PropertyChangedEventListener(documentManager, null));

            AssertHelper.ExpectedException<ArgumentNullException>(() => new CollectionChangedEventListener(null, null));
            AssertHelper.ExpectedException<ArgumentNullException>(() => new CollectionChangedEventListener((INotifyCollectionChanged)documentManager.Documents, null));
        }
예제 #42
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object can be used to retrieve data from input parameters and to store data in output parameters.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Variables
            List <string>                names = new List <string>();
            List <RobotJointPosition>    robotJointPositions    = new List <RobotJointPosition>();
            List <ExternalJointPosition> externalJointPositions = new List <ExternalJointPosition>();

            // Catch input data
            if (!DA.GetDataList(0, names))
            {
                return;
            }
            if (!DA.GetDataList(1, robotJointPositions))
            {
                robotJointPositions = new List <RobotJointPosition>()
                {
                    new RobotJointPosition()
                };
            }
            if (!DA.GetDataList(2, externalJointPositions))
            {
                externalJointPositions = new List <ExternalJointPosition>()
                {
                    new ExternalJointPosition()
                };
            }

            // Replace spaces
            names = HelperMethods.ReplaceSpacesAndRemoveNewLines(names);

            // Get longest input List
            int[] sizeValues = new int[3];
            sizeValues[0] = names.Count;
            sizeValues[1] = robotJointPositions.Count;
            sizeValues[2] = externalJointPositions.Count;

            int biggestSize = HelperMethods.GetBiggestValue(sizeValues);

            // Keeps track of used indicies
            int nameCounter   = -1;
            int robPosCounter = -1;
            int extPosCounter = -1;

            // Clear list
            _jointTargets.Clear();

            // Creates the joint targets
            for (int i = 0; i < biggestSize; i++)
            {
                string                name;
                RobotJointPosition    robotJointPosition;
                ExternalJointPosition externalJointPosition;

                // Names counter
                if (i < sizeValues[0])
                {
                    name = names[i];
                    nameCounter++;
                }
                else
                {
                    name = names[nameCounter] + "_" + (i - nameCounter);
                }

                // Robot Joint Position counter
                if (i < sizeValues[1])
                {
                    robotJointPosition = robotJointPositions[i];
                    robPosCounter++;
                }
                else
                {
                    robotJointPosition = robotJointPositions[robPosCounter];
                }

                // External Joint Position counter
                if (i < sizeValues[2])
                {
                    externalJointPosition = externalJointPositions[i];
                    extPosCounter++;
                }
                else
                {
                    externalJointPosition = externalJointPositions[extPosCounter];
                }

                JointTarget jointTarget = new JointTarget(name, robotJointPosition, externalJointPosition);
                _jointTargets.Add(jointTarget);
            }

            // Sets Output
            DA.SetDataList(0, _jointTargets);

            #region Object manager
            // Gets ObjectManager of this document
            _objectManager = DocumentManager.GetDocumentObjectManager(this.OnPingDocument());

            // Clears targetNames
            for (int i = 0; i < _targetNames.Count; i++)
            {
                _objectManager.TargetNames.Remove(_targetNames[i]);
            }
            _targetNames.Clear();

            // Removes lastName from targetNameList
            if (_objectManager.TargetNames.Contains(_lastName))
            {
                _objectManager.TargetNames.Remove(_lastName);
            }

            // Adds Component to TargetByGuid Dictionary
            if (!_objectManager.OldJointTargetsByGuid3.ContainsKey(this.InstanceGuid))
            {
                _objectManager.OldJointTargetsByGuid3.Add(this.InstanceGuid, this);
            }

            // Checks if target name is already in use and counts duplicates
            #region Check name in object manager
            _namesUnique = true;
            for (int i = 0; i < names.Count; i++)
            {
                if (_objectManager.TargetNames.Contains(names[i]))
                {
                    AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Target Name already in use.");
                    _namesUnique = false;
                    _lastName    = "";
                    break;
                }
                else
                {
                    // Adds Target Name to list
                    _targetNames.Add(names[i]);
                    _objectManager.TargetNames.Add(names[i]);

                    // Run SolveInstance on other Targets with no unique Name to check if their name is now available
                    _objectManager.UpdateTargets();

                    _lastName = names[i];
                }

                // Checks if variable name exceeds max character limit for RAPID Code
                if (HelperMethods.VariableExeedsCharacterLimit32(names[i]))
                {
                    AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Target Name exceeds character limit of 32 characters.");
                    break;
                }

                // Checks if variable name starts with a number
                if (HelperMethods.VariableStartsWithNumber(names[i]))
                {
                    AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Target Name starts with a number which is not allowed in RAPID Code.");
                    break;
                }
            }
            #endregion

            // Recognizes if Component is Deleted and removes it from Object Managers target and name list
            GH_Document doc = this.OnPingDocument();
            if (doc != null)
            {
                doc.ObjectsDeleted += DocumentObjectsDeleted;
            }
            #endregion
        }
예제 #43
0
 public void ProtocolPrint(System.Xml.XmlDocument headerDefinition, System.Xml.XmlDocument value, System.Xml.XmlDocument candidates, string docDefinitionPath, string controlSum, bool printToPDF, string obw, string inst, string okr, string candidatesPath, string instJNS)
 {
     Framework.ActivateLicense("4E5A-14CC-D4D2-14C2-F558-B99F-C5F5-5E4B");
     bool isWielopak = false;
     string docErrPath = "";
     int idxCand2 = 0;
     XmlNode jns = headerDefinition.SelectSingleNode("/akcja_wyborcza/jns");
     string jnskod = jns.Attributes.GetNamedItem("jns_kod").Value;
     string organNazwa = "";
     foreach (XmlNode xObwod in jns)
     {
         XmlNode xObwod;
         if (xObwod.Attributes["nr"].InnerText == obw)
         {
             foreach (XmlNode xInst in xObwod)
             {
                 if (xInst.Attributes["kod"].InnerText == inst)
                 {
                     foreach (XmlNode xobw in xInst)
                     {
                         if (xobw.Attributes["nr"].InnerText == okr && System.Convert.ToInt32(xInst.Attributes["inst_jns"].InnerText) == System.Convert.ToInt32(instJNS))
                         {
                             organNazwa = xInst.Attributes["organNazwa"].InnerText;
                             break;
                         }
                     }
                 }
             }
         }
     }
     if (inst == "WBP")
     {
         if (jnskod.Substring(0, 4) == "1465" && jnskod.Length == 6)
         {
             string candidates2 = candidatesPath.Replace(jnskod + "-" + okr + ".xml", "146501-1.xml");
             if (System.IO.File.Exists(candidates2))
             {
                 candidates.Load(candidates2);
             }
         }
         if (this.isOneCandidate(candidates))
         {
             docDefinitionPath = docDefinitionPath.Replace("WBP", "WBP_1");
         }
     }
     if (inst == "RDA")
     {
         if (jnskod.Length < 6)
         {
             while (jnskod.Length < 6)
             {
                 jnskod = "0" + jnskod;
             }
         }
         if (jnskod[2] == '7' || jnskod[2] == '6')
         {
             if (jnskod.Substring(0, 4) == "1465" && organNazwa == "m.st.")
             {
                 docDefinitionPath = docDefinitionPath.Replace("RDA", "RDA_M");
                 string candidates2 = candidatesPath.Replace(jnskod + "-" + okr + ".xml", "146501-" + okr + ".xml");
                 if (System.IO.File.Exists(candidates2))
                 {
                     candidates.Load(candidates2);
                 }
             }
             if (jnskod.Substring(0, 4) != "1465")
             {
                 docDefinitionPath = docDefinitionPath.Replace("RDA", "RDA_M");
             }
         }
         if (jnskod.Substring(0, 4) == "1465" && organNazwa == "Dzielnicy")
         {
             docDefinitionPath = docDefinitionPath.Replace("RDA", "RDA_D");
         }
     }
     XmlNode xmlValues = new System.Xml.XmlDocument();
     XmlNode xmlErr = value.SelectSingleNode("/save/hardError");
     if (xmlErr == null)
     {
         xmlErr = value.SelectSingleNode("/save/hardWarning");
     }
     if (xmlErr == null)
     {
         xmlErr = value.SelectSingleNode("/save/softError");
     }
     if (xmlErr != null)
     {
         docErrPath = docDefinitionPath.Replace(".docx", "_ERR.docx");
         this.newFileErr = docErrPath.Replace(".docx", "TMP.docx");
         System.Xml.XmlDocument xmlWalidacja = new System.Xml.XmlDocument();
         xmlWalidacja.Load(docDefinitionPath.Replace(".docx", "_Walidacja.xml"));
         using (DocX docTemplate = DocX.Load(docErrPath))
         {
             xmlErr = value.SelectSingleNode("/save/report");
             if (xmlErr != null)
             {
                 if (xmlErr != null)
                 {
                     foreach (XmlNode xmlField in xmlErr)
                     {
                         foreach (Novacode.Table table in docTemplate.Tables)
                         {
                             int idxCommMember = 0;
                             foreach (Row row in table.Rows)
                             {
                                 idxCommMember++;
                                 if (row.Cells.Count == 1)
                                 {
                                     if (row.FindAll("<ERROR>").Count > 0)
                                     {
                                         string strErr = "[" + xmlField.Name.Substring(0, xmlField.Name.IndexOf("_")) + "]";
                                         string strErrDesc = "";
                                         Row rowNew = row;
                                         table.InsertRow(rowNew, idxCommMember);
                                         XmlNode xmlErrDesc = xmlWalidacja.SelectSingleNode("/validate_info");
                                         foreach (XmlNode xmlRule in xmlErrDesc)
                                         {
                                             foreach (XmlNode xmlErrField in xmlRule)
                                             {
                                                 if (xmlErrField.Name == "note")
                                                 {
                                                     if (xmlErrField.InnerText.Length >= strErr.Length)
                                                     {
                                                         if (xmlErrField.InnerText.Substring(0, strErr.Length) == strErr)
                                                         {
                                                             strErrDesc = xmlErrField.InnerText;
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                         if (strErrDesc != "")
                                         {
                                             row.ReplaceText("<ERROR>", strErrDesc + System.Environment.NewLine + "Stanowisko komisji: " + xmlField.InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                         else
                                         {
                                             row.ReplaceText("<ERROR>", strErr + System.Environment.NewLine + "Stanowisko komisji: " + xmlField.InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             xmlValues = value.SelectSingleNode("/save/header");
             if (xmlValues != null)
             {
                 foreach (XmlNode xmlField in xmlValues)
                 {
                     System.Collections.Generic.List<int> i = docTemplate.FindAll("<" + xmlField.Name + "*");
                     int iCount = i.Count;
                     int fCount = xmlField.InnerText.Length;
                     int x = 2;
                     if (iCount >= 1)
                     {
                         iCount++;
                         if (fCount > 0)
                         {
                             docTemplate.ReplaceText("<" + xmlField.Name + ">", xmlField.InnerText.Substring(fCount - 1, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         }
                         else
                         {
                             docTemplate.ReplaceText("<" + xmlField.Name + ">", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         }
                         for (int j = fCount - 2; j >= 0; j--)
                         {
                             if (fCount > 0)
                             {
                                 docTemplate.ReplaceText(string.Concat(new object[]
                                 {
                                     "<",
                                     xmlField.Name,
                                     "*",
                                     x,
                                     ">"
                                 }), xmlField.InnerText.Substring(j, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             }
                             else
                             {
                                 docTemplate.ReplaceText(string.Concat(new object[]
                                 {
                                     "<",
                                     xmlField.Name,
                                     "*",
                                     x,
                                     ">"
                                 }), "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             }
                             x++;
                         }
                         if (fCount < iCount)
                         {
                             for (int k = fCount; k <= iCount; k++)
                             {
                                 if (fCount > 0)
                                 {
                                     docTemplate.ReplaceText(string.Concat(new object[]
                                     {
                                         "<",
                                         xmlField.Name,
                                         "*",
                                         k,
                                         ">"
                                     }), "*", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                                 else
                                 {
                                     docTemplate.ReplaceText(string.Concat(new object[]
                                     {
                                         "<",
                                         xmlField.Name,
                                         "*",
                                         k,
                                         ">"
                                     }), "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                             }
                         }
                     }
                     if (iCount == 0)
                     {
                         if (fCount > 0)
                         {
                             docTemplate.ReplaceText("<" + xmlField.Name + ">", xmlField.InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         }
                         else
                         {
                             docTemplate.ReplaceText("<" + xmlField.Name + ">", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         }
                     }
                 }
             }
             xmlValues = value.SelectSingleNode("/save/komisja_sklad");
             if (xmlValues != null)
             {
                 foreach (XmlNode xmlField in xmlValues)
                 {
                     foreach (Novacode.Table table in docTemplate.Tables)
                     {
                         int idxCommMember = 0;
                         foreach (Row row in table.Rows)
                         {
                             idxCommMember++;
                             if (row.Cells.Count > 1)
                             {
                                 if (row.FindAll("<osoba_lp>").Count > 0 && xmlField.Attributes["obecny"].InnerText == "True")
                                 {
                                     Row rowNew = row;
                                     table.InsertRow(rowNew, idxCommMember);
                                     row.ReplaceText("<osoba_lp>", idxCommMember + ".", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     row.ReplaceText("<osoba_ImieNazwisko>", string.Concat(new string[]
                                     {
                                         HttpUtility.UrlDecode(xmlField.Attributes["nazwisko"].InnerText),
                                         " ",
                                         HttpUtility.UrlDecode(xmlField.Attributes["imie"].InnerText),
                                         " ",
                                         HttpUtility.UrlDecode(xmlField.Attributes["imie2"].InnerText),
                                         " - ",
                                         xmlField.Attributes["funkcja"].InnerText
                                     }), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                             }
                         }
                     }
                 }
             }
             if (controlSum != "")
             {
                 this.GenerateBarcode(controlSum);
                 int iLength = controlSum.Length;
                 int iCount = iLength / 4;
                 for (int iSign = iCount - 1; iSign > 0; iSign--)
                 {
                     controlSum = controlSum.Insert(iSign * 4, "-");
                 }
                 docTemplate.ReplaceText("<control_sum>", controlSum, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             }
             else
             {
                 docTemplate.ReplaceText("<control_sum>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             }
             foreach (Novacode.Table table in docTemplate.Tables)
             {
                 int idxCand3 = 0;
                 foreach (Row row in table.Rows)
                 {
                     if (row.FindAll("<osoba_lp>").Count > 0 || row.FindAll("<ERROR>").Count > 0)
                     {
                         row.Remove();
                     }
                     idxCand3++;
                 }
             }
             docTemplate.ReplaceText("<field_3_14>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             docTemplate.ReplaceText("<field_3_15>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             docTemplate.ReplaceText("<field_3_16>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             docTemplate.ReplaceText("<field_3_17>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             docTemplate.ReplaceText("<field_3_18>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             docTemplate.ReplaceText("<field_3_19>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             docTemplate.ReplaceText("<field_3_20>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
             docTemplate.SaveAs(this.newFileErr);
         }
     }
     xmlValues = value.SelectSingleNode("/save/form");
     if (xmlValues == null)
     {
         xmlValues = value.SelectSingleNode("/save/step3");
     }
     if (xmlValues == null)
     {
         xmlValues = value.SelectSingleNode("/save/step2");
     }
     if (xmlValues == null)
     {
         xmlValues = value.SelectSingleNode("/save/step1");
     }
     if (xmlValues == null)
     {
         this.newFile = docDefinitionPath.Replace(".docx", "TMP.docx");
         using (DocX docTemplate = DocX.Load(docDefinitionPath.Replace(".docx", "_EMPTY.docx")))
         {
             xmlValues = headerDefinition.SelectSingleNode("/akcja_wyborcza/jns");
             for (int iStale = 1; iStale < 3; iStale++)
             {
                 string stalaName = "";
                 string stalaValue = "";
                 if (iStale == 1)
                 {
                     stalaName = "nrObwodu";
                     stalaValue = obw;
                 }
                 if (iStale == 2)
                 {
                     stalaName = "nrOkregu";
                     stalaValue = okr;
                 }
                 System.Collections.Generic.List<int> i = docTemplate.FindAll("<" + stalaName);
                 int iCount = i.Count;
                 int fCount = stalaValue.Length;
                 int x = 2;
                 if (iCount > 1)
                 {
                     docTemplate.ReplaceText("<" + stalaName + ">", stalaValue.Substring(fCount - 1, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                     for (int j = fCount - 2; j >= 0; j--)
                     {
                         docTemplate.ReplaceText(string.Concat(new object[]
                         {
                             "<",
                             stalaName,
                             "*",
                             x,
                             ">"
                         }), stalaValue.Substring(j, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         x++;
                     }
                     if (fCount < iCount)
                     {
                         for (int k = fCount; k <= iCount; k++)
                         {
                             docTemplate.ReplaceText(string.Concat(new object[]
                             {
                                 "<",
                                 stalaName,
                                 "*",
                                 k,
                                 ">"
                             }), "*", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         }
                     }
                 }
                 if (iCount == 1)
                 {
                     docTemplate.ReplaceText("<" + stalaName + ">", stalaValue, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                 }
             }
             System.Collections.IEnumerator enumerator;
             if (xmlValues.Attributes.Count > 0)
             {
                 enumerator = xmlValues.Attributes.GetEnumerator();
                 try
                 {
                     while (enumerator.MoveNext())
                     {
                         XmlAttribute xAttr = (XmlAttribute)enumerator.Current;
                         System.Collections.Generic.List<int> i = docTemplate.FindAll("<" + xAttr.Name);
                         int iCount = i.Count;
                         int fCount = xAttr.InnerText.Length;
                         int x = 2;
                         if (iCount > 1)
                         {
                             docTemplate.ReplaceText("<" + xAttr.Name + ">", xAttr.InnerText.Substring(fCount - 1, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             for (int j = fCount - 2; j >= 0; j--)
                             {
                                 docTemplate.ReplaceText(string.Concat(new object[]
                                 {
                                     "<",
                                     xAttr.Name,
                                     "*",
                                     x,
                                     ">"
                                 }), xAttr.InnerText.Substring(j, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 x++;
                             }
                             if (fCount < iCount)
                             {
                                 for (int k = fCount; k <= iCount; k++)
                                 {
                                     docTemplate.ReplaceText(string.Concat(new object[]
                                     {
                                         "<",
                                         xAttr.Name,
                                         "*",
                                         k,
                                         ">"
                                     }), "*", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                             }
                         }
                         if (iCount == 1)
                         {
                             docTemplate.ReplaceText("<" + xAttr.Name + ">", xAttr.Value, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         }
                     }
                 }
                 finally
                 {
                     System.IDisposable disposable = enumerator as System.IDisposable;
                     if (disposable != null)
                     {
                         disposable.Dispose();
                     }
                 }
             }
             enumerator = xmlValues.GetEnumerator();
             try
             {
                 while (enumerator.MoveNext())
                 {
                     XmlNode xObwod = (XmlNode)enumerator.Current;
                     if (xObwod.Name == "obw" && xObwod.Attributes.GetNamedItem("nr") != null && xObwod.Attributes.GetNamedItem("nr").Value == obw)
                     {
                         docTemplate.ReplaceText("<siedziba>", xObwod.Attributes["siedziba"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         foreach (XmlNode xInst in xObwod)
                         {
                             if (xInst.Name == "inst" && xInst.Attributes.GetNamedItem("kod") != null && xInst.Attributes.GetNamedItem("kod").Value == inst && xInst.Attributes.GetNamedItem("inst_jns") != null && xInst.Attributes.GetNamedItem("inst_jns").Value == instJNS)
                             {
                                 foreach (XmlAttribute xAttr in xInst.Attributes)
                                 {
                                     if (xAttr.Name.ToUpper() == "ORGANNAZWA" || xAttr.Name.ToUpper() == "NAZWARADYDOPEL")
                                     {
                                         docTemplate.ReplaceText("<" + xAttr.Name + ">", xAttr.InnerText.ToUpper(), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         docTemplate.ReplaceText("<" + xAttr.Name.ToUpper() + ">", xAttr.InnerText.ToUpper(), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     }
                                     docTemplate.ReplaceText("<" + xAttr.Name + ">", xAttr.InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     docTemplate.ReplaceText("<" + xAttr.Name.ToUpper() + ">", xAttr.InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                                 foreach (XmlNode xOkreg in xInst)
                                 {
                                     if (xOkreg.Name == "okr" && xOkreg.Attributes.GetNamedItem("nr") != null && xOkreg.Attributes.GetNamedItem("nr").Value == okr)
                                     {
                                         docTemplate.ReplaceText("<siedzibaR>", xOkreg.Attributes["siedzibaR"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         docTemplate.ReplaceText("<siedzibaL>", xOkreg.Attributes["siedzibaL"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         docTemplate.ReplaceText("<lmandatow>", xOkreg.Attributes["lmandatow"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             finally
             {
                 System.IDisposable disposable = enumerator as System.IDisposable;
                 if (disposable != null)
                 {
                     disposable.Dispose();
                 }
             }
             XmlNode xmlListy = candidates.SelectSingleNode("/listy");
             int listaId = 0;
             bool listaSkreslona = false;
             enumerator = xmlListy.GetEnumerator();
             try
             {
                 while (enumerator.MoveNext())
                 {
                     XmlNode xmlLista = (XmlNode)enumerator.Current;
                     listaSkreslona = (xmlLista.Attributes["lista_status"].InnerText == "U");
                     listaId++;
                     if (isWielopak)
                     {
                         idxCand2 = 0;
                     }
                     foreach (Novacode.Table table in docTemplate.Tables)
                     {
                         int idxCand3 = 0;
                         foreach (Row row in table.Rows)
                         {
                             if (row.FindAll("<Lista_L" + listaId + ">").Count > 0)
                             {
                                 isWielopak = true;
                                 row.ReplaceText("<Lista_L" + listaId + ">", xmlLista.Attributes["nrlisty"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 row.ReplaceText("<Lista_L" + listaId + "_skrot>", xmlLista.Attributes["oznaczenie_listy"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             }
                             if (row.FindAll("<Kandydtat_L" + listaId + "_liczba>").Count > 0 || row.FindAll("<Kandydtat_L" + listaId + "_razem>").Count > 0)
                             {
                                 if (listaSkreslona && (this.newFile.Contains("RDA") || this.newFile.Contains("RDP") || this.newFile.Contains("RDW")))
                                 {
                                     row.Cells[1].InsertParagraph("X");
                                     row.Cells[2].InsertParagraph("X");
                                     row.Cells[3].InsertParagraph("X");
                                     row.Cells[4].InsertParagraph("X");
                                     row.Cells[5].InsertParagraph("X");
                                 }
                                 if (listaSkreslona && this.newFile.Contains("WBPTMP.docx"))
                                 {
                                     row.Cells[2].InsertParagraph("X");
                                     row.Cells[3].InsertParagraph("X");
                                     row.Cells[4].InsertParagraph("X");
                                     row.Cells[5].InsertParagraph("X");
                                     row.Cells[6].InsertParagraph("X");
                                 }
                                 row.ReplaceText("<Kandydtat_L" + listaId + "_liczba>", "Liczba głosów ważnych oddanych na listę:", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 row.ReplaceText("<Kandydtat_L" + listaId + "_razem>", "Razem", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             }
                             if (row.FindAll("<kandydat_").Count > 0 || row.FindAll("<Kandydtat_L" + listaId + "_nazwisko_imie>").Count > 0)
                             {
                                 idxCand3++;
                                 foreach (XmlNode xmlPerson in xmlLista)
                                 {
                                     if (xmlPerson.Attributes["status"].InnerText == "A" || xmlPerson.Attributes["status"].InnerText == "S")
                                     {
                                         idxCand2++;
                                         int iLP;
                                         if (this.newFile.Contains("RDATMP.docx") || this.newFile.Contains("WBPTMP.docx") || this.newFile.Contains("WBP_1TMP.docx"))
                                         {
                                             iLP = idxCand2;
                                         }
                                         else
                                         {
                                             iLP = idxCand2 + 2;
                                         }
                                         Row rowNew2 = table.InsertRow(row, iLP);
                                         rowNew2.ReplaceText("<kandydat_lp>", idxCand2 + ".", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_lp>", idxCand2 + ".", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_nazwisko_imie>", string.Concat(new string[]
                                         {
                                             xmlPerson.Attributes["nazwisko"].InnerText.ToUpper(),
                                             " ",
                                             xmlPerson.Attributes["imie1"].InnerText,
                                             " ",
                                             xmlPerson.Attributes["imie2"].InnerText
                                         }), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         rowNew2.ReplaceText("<kandydat_nazwisko_imie>", string.Concat(new string[]
                                         {
                                             xmlPerson.Attributes["nazwisko"].InnerText.ToUpper(),
                                             " ",
                                             xmlPerson.Attributes["imie1"].InnerText,
                                             " ",
                                             xmlPerson.Attributes["imie2"].InnerText
                                         }), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         if (xmlPerson.Attributes["kdt_plec"].InnerText == "K")
                                         {
                                             if (this.newFile.Contains("WBP"))
                                             {
                                                 if (this.newFile.Contains("WBP_1"))
                                                 {
                                                     rowNew2.ReplaceText("<kandydat_zgloszony_przez>", xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                 }
                                                 else
                                                 {
                                                     rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszona przez " + xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                 }
                                             }
                                             else
                                             {
                                                 rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszona przez " + xmlLista.Attributes["komitet_skrot"].InnerText + ", Lista nr " + xmlLista.Attributes["nrlisty"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                             }
                                             rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_zgloszony_przez>", "zgłoszona przez " + xmlLista.Attributes["komitet_nazwa"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                         else
                                         {
                                             if (this.newFile.Contains("WBP"))
                                             {
                                                 if (this.newFile.Contains("WBP_1"))
                                                 {
                                                     rowNew2.ReplaceText("<kandydat_zgloszony_przez>", xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                 }
                                                 else
                                                 {
                                                     rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszony przez " + xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                 }
                                             }
                                             else
                                             {
                                                 rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszony przez " + xmlLista.Attributes["komitet_skrot"].InnerText + ", Lista nr " + xmlLista.Attributes["nrlisty"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                             }
                                             rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_zgloszony_przez>", "zgłoszony przez " + xmlLista.Attributes["komitet_nazwa"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                         if ((xmlPerson.Attributes["status"].InnerText == "S" || listaSkreslona) && (this.newFile.Contains("RDA") || this.newFile.Contains("RDP") || this.newFile.Contains("RDW")) && rowNew2.Cells.Count == 7)
                                         {
                                             rowNew2.Cells[2].InsertParagraph("X");
                                             rowNew2.Cells[3].InsertParagraph("X");
                                             rowNew2.Cells[4].InsertParagraph("X");
                                             rowNew2.Cells[5].InsertParagraph("X");
                                             rowNew2.Cells[6].InsertParagraph("X");
                                         }
                                         if ((xmlPerson.Attributes["status"].InnerText == "S" || listaSkreslona) && this.newFile.Contains("WBPTMP.docx") && rowNew2.Cells.Count == 8)
                                         {
                                             rowNew2.Cells[3].InsertParagraph("X");
                                             rowNew2.Cells[4].InsertParagraph("X");
                                             rowNew2.Cells[5].InsertParagraph("X");
                                             rowNew2.Cells[6].InsertParagraph("X");
                                             rowNew2.Cells[7].InsertParagraph("X");
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             finally
             {
                 System.IDisposable disposable = enumerator as System.IDisposable;
                 if (disposable != null)
                 {
                     disposable.Dispose();
                 }
             }
             docTemplate.SaveAs(this.newFile);
         }
     }
     else
     {
         this.newFile = docDefinitionPath;
         using (DocX docTemplate = DocX.Load(this.newFile))
         {
             this.newFile = docDefinitionPath.Replace(".docx", "TMP.docx");
             XmlNode xmlListy = candidates.SelectSingleNode("/listy");
             int listaId = 0;
             bool listaSkreslona = false;
             foreach (XmlNode xmlLista in xmlListy)
             {
                 listaSkreslona = (xmlLista.Attributes["lista_status"].InnerText == "U");
                 listaId++;
                 if (isWielopak)
                 {
                     idxCand2 = 0;
                 }
                 foreach (Novacode.Table table in docTemplate.Tables)
                 {
                     int idxCand3 = 0;
                     foreach (Row row in table.Rows)
                     {
                         if (row.FindAll("<Lista_L" + listaId + ">").Count > 0)
                         {
                             isWielopak = true;
                             row.ReplaceText("<Lista_L" + listaId + ">", xmlLista.Attributes["nrlisty"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             row.ReplaceText("<Lista_L" + listaId + "_skrot>", xmlLista.Attributes["oznaczenie_listy"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                         }
                         if (row.FindAll("<Lista_" + listaId + ">").Count > 0 && listaSkreslona)
                         {
                             string strNazwaListy = "Lista_" + listaId;
                             System.Collections.Generic.List<int> iii = row.FindAll("<" + strNazwaListy);
                             int iiiCount = iii.Count;
                             row.ReplaceText("<" + strNazwaListy + ">", "X", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             for (int kk = 0; kk <= iiiCount; kk++)
                             {
                                 row.ReplaceText(string.Concat(new object[]
                                 {
                                     "<",
                                     strNazwaListy,
                                     "*",
                                     kk,
                                     ">"
                                 }), "X", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             }
                         }
                         if (row.FindAll("<razem_L" + listaId + ">").Count > 0 && listaSkreslona)
                         {
                             string strNazwaListy = "razem_L" + listaId;
                             System.Collections.Generic.List<int> iii = row.FindAll("<" + strNazwaListy);
                             int iiiCount = iii.Count;
                             row.ReplaceText("<" + strNazwaListy + ">", "X", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             for (int kk = 0; kk <= iiiCount; kk++)
                             {
                                 row.ReplaceText(string.Concat(new object[]
                                 {
                                     "<",
                                     strNazwaListy,
                                     "*",
                                     kk,
                                     ">"
                                 }), "X", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                             }
                         }
                         if (row.FindAll("<kandydat_").Count > 0 || row.FindAll("<Kandydtat_L" + listaId + "_nazwisko_imie>").Count > 0)
                         {
                             idxCand3++;
                             foreach (XmlNode xmlPerson in xmlLista)
                             {
                                 if (xmlPerson.Attributes["status"].InnerText == "A" || xmlPerson.Attributes["status"].InnerText == "S")
                                 {
                                     idxCand2++;
                                     int iLP;
                                     if (this.newFile.Contains("RDATMP.docx") || this.newFile.Contains("WBPTMP.docx") || this.newFile.Contains("WBP_1TMP.docx"))
                                     {
                                         iLP = idxCand2;
                                     }
                                     else
                                     {
                                         iLP = idxCand2 + 2;
                                     }
                                     Row rowNew2 = table.InsertRow(row, iLP);
                                     rowNew2.ReplaceText("<kandydat_lp>", idxCand2 + ".", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_lp>", idxCand2 + ".", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_nazwisko_imie>", string.Concat(new string[]
                                     {
                                         xmlPerson.Attributes["nazwisko"].InnerText.ToUpper(),
                                         " ",
                                         xmlPerson.Attributes["imie1"].InnerText,
                                         " ",
                                         xmlPerson.Attributes["imie2"].InnerText
                                     }), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     rowNew2.ReplaceText("<kandydat_nazwisko_imie>", string.Concat(new string[]
                                     {
                                         xmlPerson.Attributes["nazwisko"].InnerText.ToUpper(),
                                         " ",
                                         xmlPerson.Attributes["imie1"].InnerText,
                                         " ",
                                         xmlPerson.Attributes["imie2"].InnerText
                                     }), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     if (xmlPerson.Attributes["kdt_plec"].InnerText == "K")
                                     {
                                         if (this.newFile.Contains("WBP"))
                                         {
                                             if (this.newFile.Contains("WBP_1"))
                                             {
                                                 rowNew2.ReplaceText("<kandydat_zgloszony_przez>", xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                             }
                                             else
                                             {
                                                 rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszona przez " + xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                             }
                                         }
                                         else
                                         {
                                             rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszona przez " + xmlLista.Attributes["komitet_skrot"].InnerText + ", Lista nr " + xmlLista.Attributes["nrlisty"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                         rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_zgloszony_przez>", "zgłoszona przez " + xmlLista.Attributes["komitet_nazwa"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     }
                                     else
                                     {
                                         if (this.newFile.Contains("WBP"))
                                         {
                                             if (this.newFile.Contains("WBP_1"))
                                             {
                                                 rowNew2.ReplaceText("<kandydat_zgloszony_przez>", xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                             }
                                             else
                                             {
                                                 rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszony przez " + xmlLista.Attributes["komitet_skrot"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                             }
                                         }
                                         else
                                         {
                                             rowNew2.ReplaceText("<kandydat_zgloszony_przez>", "zgłoszony przez " + xmlLista.Attributes["komitet_skrot"].InnerText + ", Lista nr " + xmlLista.Attributes["nrlisty"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                         rowNew2.ReplaceText("<Kandydtat_L" + listaId + "_zgloszony_przez>", "zgłoszony przez " + xmlLista.Attributes["komitet_nazwa"].InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     }
                                     if (xmlPerson.Attributes["status"].InnerText == "S" || listaSkreslona)
                                     {
                                         string strKandS;
                                         if (isWielopak)
                                         {
                                             strKandS = "Kandydtat_L" + listaId;
                                         }
                                         else
                                         {
                                             strKandS = "kandydat";
                                         }
                                         System.Collections.Generic.List<int> iii = rowNew2.FindAll("<" + strKandS + "_g");
                                         int iiiCount = iii.Count;
                                         rowNew2.ReplaceText("<" + strKandS + "_g>", "X", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         for (int kk = 0; kk <= iiiCount; kk++)
                                         {
                                             rowNew2.ReplaceText(string.Concat(new object[]
                                             {
                                                 "<",
                                                 strKandS,
                                                 "_g*",
                                                 kk,
                                                 ">"
                                             }), "X", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                     }
                                     else
                                     {
                                         XmlNode xmlSaveValues = value.SelectSingleNode("/save/form");
                                         if (xmlSaveValues == null)
                                         {
                                             xmlSaveValues = value.SelectSingleNode("/save/step3");
                                         }
                                         if (xmlSaveValues == null)
                                         {
                                             xmlSaveValues = value.SelectSingleNode("/save/step2");
                                         }
                                         if (xmlSaveValues == null)
                                         {
                                             xmlSaveValues = value.SelectSingleNode("/save/step1");
                                         }
                                         foreach (XmlNode xmlSaveField in xmlSaveValues)
                                         {
                                             if (xmlSaveField.Attributes.Count > 0)
                                             {
                                                 if (xmlSaveField.Attributes["id_kand"].InnerText == xmlPerson.Attributes["id_kand"].InnerText && xmlPerson.Attributes["status"].InnerText == "A")
                                                 {
                                                     string strKand;
                                                     if (xmlSaveField.Name.Substring(0, 11) == "Kandydtat_L")
                                                     {
                                                         strKand = xmlSaveField.Name.Substring(0, 13);
                                                         if (strKand.Substring(12, 1) == "_")
                                                         {
                                                             strKand = xmlSaveField.Name.Substring(0, 12);
                                                         }
                                                     }
                                                     else
                                                     {
                                                         strKand = "kandydat";
                                                     }
                                                     System.Collections.Generic.List<int> ii = rowNew2.FindAll("<" + strKand + "_g");
                                                     int iiCount = ii.Count;
                                                     int ffCount = xmlSaveField.InnerText.Length;
                                                     int xx = 2;
                                                     if (iiCount > 1)
                                                     {
                                                         if (ffCount > 0)
                                                         {
                                                             rowNew2.ReplaceText("<" + strKand + "_g>", xmlSaveField.InnerText.Substring(ffCount - 1, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                         }
                                                         else
                                                         {
                                                             rowNew2.ReplaceText("<" + strKand + "_g>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                         }
                                                         for (int jj = ffCount - 2; jj >= 0; jj--)
                                                         {
                                                             if (ffCount > 0)
                                                             {
                                                                 rowNew2.ReplaceText(string.Concat(new object[]
                                                                 {
                                                                     "<",
                                                                     strKand,
                                                                     "_g*",
                                                                     xx,
                                                                     ">"
                                                                 }), xmlSaveField.InnerText.Substring(jj, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                             }
                                                             else
                                                             {
                                                                 rowNew2.ReplaceText(string.Concat(new object[]
                                                                 {
                                                                     "<",
                                                                     strKand,
                                                                     "_g*",
                                                                     xx,
                                                                     ">"
                                                                 }), "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                             }
                                                             xx++;
                                                         }
                                                         if (ffCount < iiCount)
                                                         {
                                                             for (int kk = ffCount; kk <= iiCount; kk++)
                                                             {
                                                                 if (ffCount > 0)
                                                                 {
                                                                     rowNew2.ReplaceText(string.Concat(new object[]
                                                                     {
                                                                         "<",
                                                                         strKand,
                                                                         "_g*",
                                                                         kk,
                                                                         ">"
                                                                     }), "*", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                                 }
                                                                 else
                                                                 {
                                                                     rowNew2.ReplaceText(string.Concat(new object[]
                                                                     {
                                                                         "<",
                                                                         strKand,
                                                                         "_g*",
                                                                         kk,
                                                                         ">"
                                                                     }), "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                                 }
                                                             }
                                                         }
                                                     }
                                                     if (iiCount == 1)
                                                     {
                                                         rowNew2.ReplaceText("<" + strKand + "_g>", xmlSaveField.InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             for (int a = 1; a <= 3; a++)
             {
                 xmlValues = value.SelectSingleNode("/save/header");
                 if (a == 2)
                 {
                     xmlValues = value.SelectSingleNode("/save/form");
                     if (xmlValues == null)
                     {
                         xmlValues = value.SelectSingleNode("/save/step4");
                     }
                     if (xmlValues == null)
                     {
                         xmlValues = value.SelectSingleNode("/save/step3");
                     }
                     if (xmlValues == null)
                     {
                         xmlValues = value.SelectSingleNode("/save/step2");
                     }
                     if (xmlValues == null)
                     {
                         xmlValues = value.SelectSingleNode("/save/step1");
                     }
                 }
                 if (a == 3)
                 {
                     xmlValues = value.SelectSingleNode("/save/komisja_sklad");
                 }
                 if (xmlValues != null)
                 {
                     foreach (XmlNode xmlField in xmlValues)
                     {
                         if (a == 3)
                         {
                             foreach (Novacode.Table table in docTemplate.Tables)
                             {
                                 int idxCommMember = 0;
                                 foreach (Row row in table.Rows)
                                 {
                                     idxCommMember++;
                                     if (row.Cells.Count > 1)
                                     {
                                         if (row.FindAll("<osoba_lp>").Count > 0 && xmlField.Attributes["obecny"].InnerText == "True")
                                         {
                                             Row rowNew = row;
                                             table.InsertRow(rowNew, idxCommMember);
                                             row.ReplaceText("<osoba_lp>", idxCommMember + ".", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                             row.ReplaceText("<osoba_ImieNazwisko>", string.Concat(new string[]
                                             {
                                                 HttpUtility.UrlDecode(xmlField.Attributes["nazwisko"].InnerText),
                                                 " ",
                                                 HttpUtility.UrlDecode(xmlField.Attributes["imie"].InnerText),
                                                 " ",
                                                 HttpUtility.UrlDecode(xmlField.Attributes["imie2"].InnerText),
                                                 " - ",
                                                 xmlField.Attributes["funkcja"].InnerText
                                             }), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                     }
                                 }
                             }
                         }
                         else
                         {
                             System.Collections.Generic.List<int> i = docTemplate.FindAll("<" + xmlField.Name + "*");
                             int iCount = i.Count;
                             int fCount = xmlField.InnerText.Length;
                             int x = 2;
                             if (iCount >= 1)
                             {
                                 iCount++;
                                 if (fCount > 0)
                                 {
                                     docTemplate.ReplaceText("<" + xmlField.Name + ">", xmlField.InnerText.Substring(fCount - 1, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                                 else
                                 {
                                     docTemplate.ReplaceText("<" + xmlField.Name + ">", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                                 for (int j = fCount - 2; j >= 0; j--)
                                 {
                                     if (fCount > 0)
                                     {
                                         docTemplate.ReplaceText(string.Concat(new object[]
                                         {
                                             "<",
                                             xmlField.Name,
                                             "*",
                                             x,
                                             ">"
                                         }), xmlField.InnerText.Substring(j, 1), false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     }
                                     else
                                     {
                                         docTemplate.ReplaceText(string.Concat(new object[]
                                         {
                                             "<",
                                             xmlField.Name,
                                             "*",
                                             x,
                                             ">"
                                         }), "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                     }
                                     x++;
                                 }
                                 if (fCount < iCount)
                                 {
                                     for (int k = fCount; k <= iCount; k++)
                                     {
                                         if (fCount > 0)
                                         {
                                             docTemplate.ReplaceText(string.Concat(new object[]
                                             {
                                                 "<",
                                                 xmlField.Name,
                                                 "*",
                                                 k,
                                                 ">"
                                             }), "*", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                         else
                                         {
                                             docTemplate.ReplaceText(string.Concat(new object[]
                                             {
                                                 "<",
                                                 xmlField.Name,
                                                 "*",
                                                 k,
                                                 ">"
                                             }), "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                         }
                                     }
                                 }
                             }
                             if (iCount == 0)
                             {
                                 if (fCount > 0)
                                 {
                                     docTemplate.ReplaceText("<" + xmlField.Name + ">", xmlField.InnerText, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                                 else
                                 {
                                     docTemplate.ReplaceText("<" + xmlField.Name + ">", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
                                 }
                             }
                             if (xmlField.Attributes.Count > 0 && xmlField.Name.Substring(0, 11) == "Kandydtat_L")
                             {
                                 isWielopak = true;
                             }
                         }
                     }
                 }
             }
             docTemplate.SaveAs(this.newFile);
         }
     }
     using (DocX docTemplate = DocX.Load(this.newFile))
     {
         foreach (Novacode.Table table in docTemplate.Tables)
         {
             foreach (Row row in table.Rows)
             {
                 if (row.Cells.Count > 1)
                 {
                     if (row.FindAll("<osoba_lp>").Count > 0 || row.FindAll("<Kandydtat_L").Count > 0 || row.FindAll("<kandydat_").Count > 0)
                     {
                         row.Remove();
                     }
                 }
             }
         }
         docTemplate.ReplaceText("<field_3_14>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         docTemplate.ReplaceText("<field_3_15>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         docTemplate.ReplaceText("<field_3_16>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         docTemplate.ReplaceText("<field_3_17>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         docTemplate.ReplaceText("<field_3_18>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         docTemplate.ReplaceText("<field_3_19>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         docTemplate.ReplaceText("<field_3_20>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         if (controlSum != "")
         {
             this.GenerateBarcode(controlSum);
             int iLength = controlSum.Length;
             int iCount = iLength / 4;
             for (int iSign = iCount - 1; iSign > 0; iSign--)
             {
                 controlSum = controlSum.Insert(iSign * 4, "-");
             }
             docTemplate.ReplaceText("<control_sum>", controlSum, false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         }
         else
         {
             docTemplate.ReplaceText("<control_sum>", "", false, System.Text.RegularExpressions.RegexOptions.None, null, null, MatchFormattingOptions.SubsetMatch);
         }
         docTemplate.Save();
     }
     if (isWielopak)
     {
         for (int iTab = 1; iTab < 20; iTab++)
         {
             this.DocxDeleteTables(this.newFile);
         }
     }
     if (this.imageBarCode != null && this.newFile != "")
     {
         this.DocxInsertBarcode(this.newFile);
     }
     if (this.imageBarCode != null && this.newFileErr != "")
     {
         this.DocxInsertBarcode(this.newFileErr);
     }
     if (!printToPDF)
     {
         if (this.printDialog1.ShowDialog() == DialogResult.OK)
         {
             if (this.newFileErr != "")
             {
                 System.Threading.Thread printThread = new System.Threading.Thread(new System.Threading.ThreadStart(this.PrintWarnings));
                 printThread.Start();
             }
             System.Threading.Thread printThread2 = new System.Threading.Thread(new System.Threading.ThreadStart(this.Print));
             printThread2.Start();
         }
     }
     else
     {
         if (docErrPath != "" && this.newFileErr != "")
         {
             SaveFileDialog sd = new SaveFileDialog();
             sd.Title = "Zapisz raport ostrzeżeń jako PDF...";
             sd.Filter = "Pliki PDF | *.pdf";
             sd.DefaultExt = "pdf";
             sd.AddExtension = true;
             sd.FileName = System.IO.Path.GetFileName(docErrPath).Replace("TMP.docx", ".pdf");
             if (sd.ShowDialog() == DialogResult.OK)
             {
                 PDFEncoderParams pem = new PDFEncoderParams();
                 DocumentManager dm = new DocumentManager();
                 dm.LoadDocument(this.newFileErr, "");
                 if (sd.FileName.Contains("."))
                 {
                     sd.FileName.Remove(sd.FileName.IndexOf("."), sd.FileName.Length - 1 - sd.FileName.IndexOf("."));
                     sd.FileName += ".pdf";
                 }
                 else
                 {
                     sd.FileName += ".pdf";
                 }
                 dm.ConvertDocument(dm.Documents[0], sd.FileName, "pdf", null, pem, "");
                 dm.CloseAllDocuments();
             }
         }
         SaveFileDialog sd2 = new SaveFileDialog();
         sd2.Title = "Zapisz protokół jako PDF...";
         sd2.Filter = "Pliki PDF | *.pdf";
         sd2.DefaultExt = "pdf";
         sd2.AddExtension = true;
         sd2.FileName = System.IO.Path.GetFileName(this.newFile).Replace("TMP.docx", ".pdf");
         if (sd2.ShowDialog() == DialogResult.OK)
         {
             PDFEncoderParams pem2 = new PDFEncoderParams();
             DocumentManager dm2 = new DocumentManager();
             dm2.LoadDocument(this.newFile, "");
             if (sd2.FileName.Contains("."))
             {
                 sd2.FileName.Remove(sd2.FileName.IndexOf("."), sd2.FileName.Length - 1 - sd2.FileName.IndexOf("."));
                 sd2.FileName += ".pdf";
             }
             else
             {
                 sd2.FileName += ".pdf";
             }
             dm2.ConvertDocument(dm2.Documents[0], sd2.FileName, "pdf", null, pem2, "");
             dm2.CloseAllDocuments();
         }
     }
 }
예제 #44
0
 public DockingViewRegion(string regionName, DocumentManager documentManager, DockManager dockManager, ILogMgr logMgr) :
     base(regionName, documentManager, dockManager, logMgr)
 {
     SubscribeToEvent();
 }
예제 #45
0
파일: Solution.cs 프로젝트: derigel23/Nitra
 private void Close()
 {
   IsOpened = false;
   foreach (var project in _projectsMap.Values)
     project.Dispose();
   _projectsMap.Clear();
   _solution = null;
   _fileOpenNotifyRequest.Clear();
   DocumentManager = null;
 }
예제 #46
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object can be used to retrieve data from input parameters and 
        /// to store data in output parameters.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Warning that this component is OBSOLETE
            AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "This component is OBSOLETE and will be removed " +
                "in the future. Remove this component from your canvas and replace it by picking the new component " +
                "from the ribbon.");

            // Input variables
            string name = "default_tool";
            List<Mesh> meshes = new List<Mesh>();
            Plane attachmentPlane = Plane.Unset;
            Plane toolPlane = Plane.Unset;

            // Catch the input data
            if (!DA.GetData(0, ref name)) { return; }
            if (!DA.GetDataList(1, meshes)) { meshes = new List<Mesh>() { new Mesh() }; }
            if (!DA.GetData(2, ref attachmentPlane)) { return; }
            if (!DA.GetData(3, ref toolPlane)) { return; };

            // Create the Robot Tool
            _robotTool = new RobotTool(name, meshes, attachmentPlane, toolPlane);

            // Outputs
            DA.SetData(0, _robotTool);
            DA.SetData(1, _robotTool.ToRAPIDDeclaration());

            #region Object manager
            // Gets ObjectManager of this document
            _objectManager = DocumentManager.GetDocumentObjectManager(this.OnPingDocument());

            // Clears tool name
            _objectManager.ToolNames.Remove(_toolName);
            _toolName = String.Empty;

            // Removes lastName from toolNameList
            if (_objectManager.ToolNames.Contains(_lastName))
            {
                _objectManager.ToolNames.Remove(_lastName);
            }

            // Adds Component to ToolsByGuid Dictionary
            if (!_objectManager.OldRobotToolFromPlanesGuid.ContainsKey(this.InstanceGuid))
            {
                _objectManager.OldRobotToolFromPlanesGuid.Add(this.InstanceGuid, this);
            }

            // Checks if the tool name is already in use and counts duplicates
            #region Check name in object manager
            if (_objectManager.ToolNames.Contains(_robotTool.Name))
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Tool Name already in use.");
                _nameUnique = false;
                _lastName = "";
            }
            else
            {
                // Adds Robot Tool Name to list
                _toolName = _robotTool.Name;
                _objectManager.ToolNames.Add(_robotTool.Name);

                // Run SolveInstance on other Tools with no unique Name to check if their name is now available
                _objectManager.UpdateRobotTools();

                _lastName = _robotTool.Name;
                _nameUnique = true;
            }

            // Checks if variable name exceeds max character limit for RAPID Code
            if (HelperMethods.VariableExeedsCharacterLimit32(name))
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Robot Tool Name exceeds character limit of 32 characters.");
            }

            // Checks if variable name starts with a number
            if (HelperMethods.VariableStartsWithNumber(name))
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Robot Tool Name starts with a number which is not allowed in RAPID Code.");
            }
            #endregion

            // Recognizes if Component is Deleted and removes it from Object Managers tool and name list
            GH_Document doc = this.OnPingDocument();
            if (doc != null)
            {
                doc.ObjectsDeleted += DocumentObjectsDeleted;
            }
            #endregion
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CommonParentForm));
     this.rbnMain = new DevExpress.XtraBars.Ribbon.RibbonControl();
     this.appMenu = new DevExpress.XtraBars.Ribbon.ApplicationMenu(this.components);
     this.bbiSettings = new DevExpress.XtraBars.BarButtonItem();
     this.bbiExitUser = new DevExpress.XtraBars.BarButtonItem();
     this.siVersion = new DevExpress.XtraBars.BarStaticItem();
     this.alignButtonGroup = new DevExpress.XtraBars.BarButtonGroup();
     this.bbiAdd = new DevExpress.XtraBars.BarButtonItem();
     this.bbiRemove = new DevExpress.XtraBars.BarButtonItem();
     this.bbiRefresh = new DevExpress.XtraBars.BarButtonItem();
     this.bbiExel = new DevExpress.XtraBars.BarButtonItem();
     this.bbiAdmin = new DevExpress.XtraBars.BarButtonItem();
     this.bbiSave = new DevExpress.XtraBars.BarButtonItem();
     this.bbiRoleEdit = new DevExpress.XtraBars.BarButtonItem();
     this.brDockMenuItem = new DevExpress.XtraBars.BarDockingMenuItem();
     this.brEdItControlsStates = new DevExpress.XtraBars.BarEditItem();
     this.ripceControlsStates = new DevExpress.XtraEditors.Repository.RepositoryItemPopupContainerEdit();
     this.rpMain = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpgMain = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.rpDictionaries = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpgCommonDictionaries = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.rpReports = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpSettings = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpAdmin = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.rpgAdmin = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.riceStates = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
     this.rsbMain = new DevExpress.XtraBars.Ribbon.RibbonStatusBar();
     this.defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components);
     this.dxErrorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(this.components);
     this.documentMng = new DevExpress.XtraBars.Docking2010.DocumentManager(this.components);
     this.MDIViewNative = new DevExpress.XtraBars.Docking2010.Views.NativeMdi.NativeMdiView(this.components);
     this.MDIViewTabbed = new DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(this.components);
     this.bbiChangeUser = new DevExpress.XtraBars.BarButtonItem();
     ((System.ComponentModel.ISupportInitialize)(this.rbnMain)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.appMenu)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ripceControlsStates)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.riceStates)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.documentMng)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewNative)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewTabbed)).BeginInit();
     this.SuspendLayout();
     //
     // rbnMain
     //
     this.rbnMain.ApplicationButtonDropDownControl = this.appMenu;
     this.rbnMain.ApplicationButtonText = "Меню";
     this.rbnMain.AutoSizeItems = true;
     this.rbnMain.Categories.AddRange(new DevExpress.XtraBars.BarManagerCategory[] {
     new DevExpress.XtraBars.BarManagerCategory("Dictionaries", new System.Guid("bfb17616-73d9-42e6-8028-a10ce19e5160"))});
     this.rbnMain.ExpandCollapseItem.Id = 0;
     this.rbnMain.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
     this.rbnMain.ExpandCollapseItem,
     this.siVersion,
     this.alignButtonGroup,
     this.bbiAdd,
     this.bbiRemove,
     this.bbiRefresh,
     this.bbiExel,
     this.bbiAdmin,
     this.bbiSave,
     this.bbiRoleEdit,
     this.brDockMenuItem,
     this.bbiSettings,
     this.brEdItControlsStates,
     this.bbiExitUser,
     this.bbiChangeUser});
     this.rbnMain.Location = new System.Drawing.Point(0, 0);
     this.rbnMain.MaxItemId = 162;
     this.rbnMain.Name = "rbnMain";
     this.rbnMain.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
     this.rpMain,
     this.rpDictionaries,
     this.rpReports,
     this.rpSettings,
     this.rpAdmin});
     this.rbnMain.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
     this.ripceControlsStates,
     this.riceStates});
     this.rbnMain.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonControlStyle.Office2013;
     this.rbnMain.ShowToolbarCustomizeItem = false;
     this.rbnMain.Size = new System.Drawing.Size(1210, 173);
     this.rbnMain.StatusBar = this.rsbMain;
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiAdd);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiRemove);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiRefresh);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiSave);
     this.rbnMain.Toolbar.ItemLinks.Add(this.bbiExel);
     this.rbnMain.Toolbar.ItemLinks.Add(this.brDockMenuItem);
     this.rbnMain.Toolbar.ShowCustomizeItem = false;
     this.rbnMain.ToolbarLocation = DevExpress.XtraBars.Ribbon.RibbonQuickAccessToolbarLocation.Below;
     this.rbnMain.ShowCustomizationMenu += new DevExpress.XtraBars.Ribbon.RibbonCustomizationMenuEventHandler(this.RibbonShowCustomizationMenu);
     this.rbnMain.Merge += new DevExpress.XtraBars.Ribbon.RibbonMergeEventHandler(this.MainMerge);
     //
     // appMenu
     //
     this.appMenu.ItemLinks.Add(this.bbiSettings, true);
     this.appMenu.ItemLinks.Add(this.bbiChangeUser);
     this.appMenu.ItemLinks.Add(this.bbiExitUser);
     this.appMenu.Name = "appMenu";
     this.appMenu.Ribbon = this.rbnMain;
     //
     // bbiSettings
     //
     this.bbiSettings.Caption = "Настройки";
     this.bbiSettings.Description = "Настройки программы";
     this.bbiSettings.Hint = "Настройки программы";
     this.bbiSettings.Id = 76;
     this.bbiSettings.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiSettings.LargeGlyph")));
     this.bbiSettings.Name = "bbiSettings";
     //
     // bbiExitUser
     //
     this.bbiExitUser.Caption = "Выход";
     this.bbiExitUser.CategoryGuid = new System.Guid("6ffddb2b-9015-4d97-a4c1-91613e0ef537");
     this.bbiExitUser.Id = 160;
     this.bbiExitUser.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiExitUser.LargeGlyph")));
     this.bbiExitUser.Name = "bbiExitUser";
     //
     // siVersion
     //
     this.siVersion.Caption = "Версия:";
     this.siVersion.Id = 31;
     this.siVersion.Name = "siVersion";
     this.siVersion.TextAlignment = System.Drawing.StringAlignment.Near;
     //
     // alignButtonGroup
     //
     this.alignButtonGroup.Caption = "Align Commands";
     this.alignButtonGroup.Id = 52;
     this.alignButtonGroup.Name = "alignButtonGroup";
     //
     // bbiAdd
     //
     this.bbiAdd.Caption = "Добавить данные";
     this.bbiAdd.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiAdd.Glyph")));
     this.bbiAdd.Hint = "Добавить новую запись в текущий элемент интерфейса";
     this.bbiAdd.Id = 62;
     this.bbiAdd.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N));
     this.bbiAdd.Name = "bbiAdd";
     this.bbiAdd.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.AddItemClick);
     //
     // bbiRemove
     //
     this.bbiRemove.Caption = "Удалить данные";
     this.bbiRemove.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiRemove.Glyph")));
     this.bbiRemove.Hint = "Удалить текущие данные";
     this.bbiRemove.Id = 63;
     this.bbiRemove.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete));
     this.bbiRemove.Name = "bbiRemove";
     this.bbiRemove.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.RemoveItemClick);
     //
     // bbiRefresh
     //
     this.bbiRefresh.Caption = "Обновить данные";
     this.bbiRefresh.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiRefresh.Glyph")));
     this.bbiRefresh.Hint = "Обновить записи из базы данных";
     this.bbiRefresh.Id = 65;
     this.bbiRefresh.ItemShortcut = new DevExpress.XtraBars.BarShortcut(System.Windows.Forms.Keys.F5);
     this.bbiRefresh.Name = "bbiRefresh";
     this.bbiRefresh.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.RefreshItemClick);
     //
     // bbiExel
     //
     this.bbiExel.Caption = "Сохранить в Exel";
     this.bbiExel.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiExel.Glyph")));
     this.bbiExel.Hint = "Сохранить данные в виде Excel";
     this.bbiExel.Id = 66;
     this.bbiExel.Name = "bbiExel";
     this.bbiExel.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.ExelItemClick);
     //
     // bbiAdmin
     //
     this.bbiAdmin.Caption = "Настройка интерфейсов";
     this.bbiAdmin.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiAdmin.Glyph")));
     this.bbiAdmin.Hint = "Администрирование внешнего вида форм";
     this.bbiAdmin.Id = 69;
     this.bbiAdmin.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiAdmin.LargeGlyph")));
     this.bbiAdmin.Name = "bbiAdmin";
     this.bbiAdmin.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.AdminItemClick);
     //
     // bbiSave
     //
     this.bbiSave.Caption = "Сохранить в базу";
     this.bbiSave.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiSave.Glyph")));
     this.bbiSave.Hint = "Сохранить изменения текущего элемента на сервер";
     this.bbiSave.Id = 70;
     this.bbiSave.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S));
     this.bbiSave.Name = "bbiSave";
     this.bbiSave.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.CommitItemClick);
     //
     // bbiRoleEdit
     //
     this.bbiRoleEdit.Caption = "Настройка ролей и сотрудников";
     this.bbiRoleEdit.Glyph = ((System.Drawing.Image)(resources.GetObject("bbiRoleEdit.Glyph")));
     this.bbiRoleEdit.Id = 71;
     this.bbiRoleEdit.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiRoleEdit.LargeGlyph")));
     this.bbiRoleEdit.Name = "bbiRoleEdit";
     this.bbiRoleEdit.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.RoleEditItemClick);
     //
     // brDockMenuItem
     //
     this.brDockMenuItem.Caption = "Расположение форм";
     this.brDockMenuItem.Glyph = ((System.Drawing.Image)(resources.GetObject("brDockMenuItem.Glyph")));
     this.brDockMenuItem.Hint = "Настройка расположения форм";
     this.brDockMenuItem.Id = 78;
     this.brDockMenuItem.Name = "brDockMenuItem";
     //
     // brEdItControlsStates
     //
     this.brEdItControlsStates.Edit = this.ripceControlsStates;
     this.brEdItControlsStates.Id = 89;
     this.brEdItControlsStates.Name = "brEdItControlsStates";
     //
     // ripceControlsStates
     //
     this.ripceControlsStates.AutoHeight = false;
     this.ripceControlsStates.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
     this.ripceControlsStates.Name = "ripceControlsStates";
     //
     // rpMain
     //
     this.rpMain.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
     this.rpgMain});
     this.rpMain.Name = "rpMain";
     this.rpMain.Text = "Главная";
     //
     // rpgMain
     //
     this.rpgMain.Name = "rpgMain";
     this.rpgMain.Text = "Главное";
     //
     // rpDictionaries
     //
     this.rpDictionaries.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
     this.rpgCommonDictionaries});
     this.rpDictionaries.Name = "rpDictionaries";
     this.rpDictionaries.Text = "Справочники";
     //
     // rpgCommonDictionaries
     //
     this.rpgCommonDictionaries.Name = "rpgCommonDictionaries";
     this.rpgCommonDictionaries.Text = "Общие";
     //
     // rpReports
     //
     this.rpReports.Name = "rpReports";
     this.rpReports.Text = "Отчёты";
     //
     // rpSettings
     //
     this.rpSettings.Name = "rpSettings";
     this.rpSettings.Text = "Настройки системы";
     //
     // rpAdmin
     //
     this.rpAdmin.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
     this.rpgAdmin});
     this.rpAdmin.Name = "rpAdmin";
     this.rpAdmin.Text = "Администрирование";
     this.rpAdmin.Visible = false;
     //
     // rpgAdmin
     //
     this.rpgAdmin.ItemLinks.Add(this.bbiAdmin);
     this.rpgAdmin.ItemLinks.Add(this.bbiRoleEdit);
     this.rpgAdmin.Name = "rpgAdmin";
     this.rpgAdmin.Text = "Администратор";
     //
     // riceStates
     //
     this.riceStates.Name = "riceStates";
     this.riceStates.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
     //
     // rsbMain
     //
     this.rsbMain.ItemLinks.Add(this.siVersion);
     this.rsbMain.Location = new System.Drawing.Point(0, 669);
     this.rsbMain.Name = "rsbMain";
     this.rsbMain.Ribbon = this.rbnMain;
     this.rsbMain.Size = new System.Drawing.Size(1210, 31);
     //
     // dxErrorProvider
     //
     this.dxErrorProvider.ContainerControl = this;
     //
     // documentMng
     //
     this.documentMng.MdiParent = this;
     this.documentMng.MenuManager = this.rbnMain;
     this.documentMng.ShowThumbnailsInTaskBar = DevExpress.Utils.DefaultBoolean.False;
     this.documentMng.View = this.MDIViewNative;
     this.documentMng.ViewCollection.AddRange(new DevExpress.XtraBars.Docking2010.Views.BaseView[] {
     this.MDIViewNative,
     this.MDIViewTabbed});
     //
     // bbiChangeUser
     //
     this.bbiChangeUser.Caption = "Сменить пользователя";
     this.bbiChangeUser.Id = 161;
     this.bbiChangeUser.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("bbiChangeUser.LargeGlyph")));
     this.bbiChangeUser.Name = "bbiChangeUser";
     //
     // CommonParentForm
     //
     this.AllowFormGlass = DevExpress.Utils.DefaultBoolean.False;
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(1210, 700);
     this.Controls.Add(this.rsbMain);
     this.Controls.Add(this.rbnMain);
     this.IsMdiContainer = true;
     this.Name = "CommonParentForm";
     this.Ribbon = this.rbnMain;
     this.StatusBar = this.rsbMain;
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Activated += new System.EventHandler(this.CommonParentFormActivated);
     this.Load += new System.EventHandler(this.CommonParentFormLoad);
     this.Shown += new System.EventHandler(this.CommonParentFormShown);
     ((System.ComponentModel.ISupportInitialize)(this.rbnMain)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.appMenu)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ripceControlsStates)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.riceStates)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.documentMng)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewNative)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.MDIViewTabbed)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #48
0
 /// <summary>
 /// Loads the index settings document from the store for updating and that should not be cached.
 /// </summary>
 public Task <LuceneIndexSettingsDocument> LoadDocumentAsync() => DocumentManager.GetOrCreateMutableAsync();
        /// <summary>
        /// Returns true if document form is the unique inside the document manager, else false.
        /// </summary>
        /// <param name="document"> The document to find.</param>
        private bool IsDocumentFormUnique(DocumentManager.Document document)
        {
            // Verify that form doesn't belongs to collection
            bool isFound = false;

            foreach (DocumentManager.MdiTabStrip t in dmDocuments.TabStrips)
            {
                foreach (DocumentManager.Document doc in t.Documents)
                {
                    BasePluginForm b=(BasePluginForm)doc.Control;
                    BasePluginForm documentControl = (BasePluginForm)document.Control;
                    // if is unique and is found in collection
                    if ( ( b.IsUnique ) && (b.GetType()==documentControl.GetType()) )
                    {
                        isFound=true;
                        break;
                    }
                }
            }
            return isFound;
        }
예제 #50
0
        protected void btn_cerca_Click(object sender, EventArgs e)
        {
            //cerco idProfile partendo dai dati inseriti
            string idDocProt       = string.Empty;
            int    idProfile       = 0;
            bool   numeroRisultati = true;

            DocsPaWR.InfoDocumento[] ListaDoc = null;
            string inArchivio = "-1";

            switch (rblTipo.SelectedValue.ToString())
            {
            case "P":
                idDocProt = tbx_numProto.Text;
                idProfile = UserManager.getIdProfileByData(UserManager.getInfoUtente(this), idDocProt, tbx_anno.Text, ddl_registri.SelectedValue, out inArchivio);
                break;

            case "NP":
                idDocProt = tbxDoc.Text;
                idProfile = UserManager.getIdProfileByData(UserManager.getInfoUtente(this), idDocProt, null, null, out inArchivio);
                break;

            case "Tipologia":
                // parametri in input:
                //1) tipologia documento 2)tipo contatore 3)AOO o RF 4) Numero contatore
                if (ddl_tipologiaDoc.SelectedIndex == 0)
                {
                    Response.Write("<script>alert('Attenzione selezionare una tipologia documento.')</script>");
                    this.panel_Contenuto.Visible = false;
                    this.pnl_RFAOO.Visible       = false;
                    this.pnlAnno.Visible         = false;
                    this.pnlNumero.Visible       = false;
                    return;
                }
                DropDownList ddl = (DropDownList)panel_Contenuto.FindControl("ddl_Contatori");
                if (ddl != null && ddl.SelectedValue == "")
                {
                    Response.Write("<script>alert('Attenzione selezionare un contatore.')</script>");
                    this.panel_Contenuto.Visible = true;
                    this.pnl_RFAOO.Visible       = false;
                    return;
                }
                if (string.IsNullOrEmpty(this.TxtAnno.Text))
                {
                    Response.Write("<script>alert('Attenzione selezionare un anno.')</script>");
                    this.pnl_RFAOO.Visible = true;
                    this.lblAooRF.Visible  = true;
                    this.ddlAooRF.Visible  = true;
                    return;
                }
                if (string.IsNullOrEmpty(this.TxtNumero.Text))
                {
                    Response.Write("<script>alert('Attenzione selezionare un numero contatore.')</script>");
                    this.pnl_RFAOO.Visible = true;
                    this.lblAooRF.Visible  = true;
                    this.ddlAooRF.Visible  = true;
                    return;
                }

                DocsPAWA.DocsPaWR.Templates template = (DocsPAWA.DocsPaWR.Templates)Session["template"];
                //DocsPAWA.DocsPaWR.Templates template = new DocsPAWA.DocsPaWR.Templates();
                //DocsPAWA.DocsPaWR.OggettoCustom ogg = new DocsPAWA.DocsPaWR.OggettoCustom();
                //ogg.SYSTEM_ID = Convert.ToInt32(ddl.SelectedValue);
                //ogg.VALORE_DATABASE = this.TxtNumero.Text + "@" + this.TxtNumero.Text;
                //ogg.ID_AOO_RF = this.ddl_registri.SelectedValue;
                //template.ELENCO_OGGETTI[0] = ogg;

                for (int i = 0; i < template.ELENCO_OGGETTI.Length; i++)
                {
                    DocsPaWR.OggettoCustom oggettoCustom = (DocsPAWA.DocsPaWR.OggettoCustom)template.ELENCO_OGGETTI[i];
                    if (oggettoCustom.TIPO.DESCRIZIONE_TIPO.Equals("Contatore"))
                    {
                        if (ddl != null && ddl.SelectedIndex != -1)
                        {
                            if (oggettoCustom.SYSTEM_ID == Convert.ToInt32(ddl.SelectedValue))
                            {
                                //oggettoCustom.TIPO_CONTATORE = ddl.SelectedValue;
                                oggettoCustom.VALORE_DATABASE = this.TxtNumero.Text + "@" + this.TxtNumero.Text;
                                oggettoCustom.ID_AOO_RF       = this.ddlAooRF.SelectedValue;
                            }
                        }
                        else
                        {
                            oggettoCustom.VALORE_DATABASE = this.TxtNumero.Text + "@" + this.TxtNumero.Text;
                            oggettoCustom.ID_AOO_RF       = this.ddlAooRF.SelectedValue;
                        }
                    }
                    else
                    {
                        // poichè la ricerca deve essere fatta per un solo contatore, metto a
                        // stringa vuota il valore di tutti gli altri oggetti del template
                        oggettoCustom.VALORE_DATABASE = string.Empty;
                        oggettoCustom.ID_AOO_RF       = string.Empty;
                    }
                    //}
                }

                qV     = new DocsPAWA.DocsPaWR.FiltroRicerca[1][];
                qV[0]  = new DocsPAWA.DocsPaWR.FiltroRicerca[1];
                fVList = new DocsPAWA.DocsPaWR.FiltroRicerca[0];

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriDocumento.ANNO_PROTOCOLLO.ToString();
                fV1.valore    = this.TxtAnno.Text;
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriDocumento.PROT_ARRIVO.ToString();
                fV1.valore    = "true";
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriDocumento.PROT_PARTENZA.ToString();
                fV1.valore    = "true";
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriDocumento.PROT_INTERNO.ToString();
                fV1.valore    = "true";
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriDocumento.GRIGIO.ToString();
                fV1.valore    = "true";
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriDocumento.TIPO_ATTO.ToString();
                fV1.valore    = this.ddl_tipologiaDoc.SelectedItem.Value;
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriDocumento.FROM_RICERCA_VIS.ToString();
                fV1.valore    = "1";
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                fV1           = new DocsPAWA.DocsPaWR.FiltroRicerca();
                fV1.argomento = DocsPaWR.FiltriFascicolazione.PROFILAZIONE_DINAMICA.ToString();
                fV1.template  = template;
                fV1.valore    = "Profilazione Dinamica";
                fVList        = Utils.addToArrayFiltroRicerca(fVList, fV1);

                qV[0] = fVList;

                int numTotPage = 0;
                int nRec       = 0;
                SearchResultInfo[] idProfileList;
                ListaDoc = DocumentManager.getQueryInfoDocumentoPaging(UserManager.getInfoUtente(this).idGruppo, UserManager.getInfoUtente(this).idPeople, this, qV, 1, out numTotPage, out nRec, false, false, false, false, out idProfileList);

                if (ListaDoc.Length > 1)
                {
                    // non dovrebbe succedere ma per errori di inserimento nel DB, potrebbe
                    // accadere che questa query restituisca più di un risultato (se il numero
                    // del contatore è valorizzato)--> in questo caso si restituisce
                    // solo il primo documento trovato.

                    if (!string.IsNullOrEmpty(this.TxtNumero.Text))
                    {
                        idProfile  = Convert.ToInt32(ListaDoc[0].idProfile);
                        inArchivio = ListaDoc[0].inArchivio;
                    }
                    else
                    {
                        numeroRisultati = false;
                    }
                }
                else
                {
                    if (ListaDoc.Length != 0)
                    {
                        idProfile  = Convert.ToInt32(ListaDoc[0].idProfile);
                        inArchivio = ListaDoc[0].inArchivio;
                    }
                    else
                    {
                        idProfile = 0;
                    }
                }
                //this.ddlAooRF.Visible = true;
                break;
            }

            if (numeroRisultati)
            {
                if (idProfile > 0 || inArchivio == "1")
                {
                    IF_VisDoc.NavigateTo = "visibilitaDocumento.aspx?From=ricerca&VisFrame=" + idProfile + "&inArchivio=" + inArchivio;
                }
                //else
                //**********************************************************************************************
                // GIORDANO IACOZZILLI: 16/07/2013
                // Se nel corrente cè ed è abilitata la chiave BE_HAS_ARCHIVE, verifico se l'id cercato
                // è presente anche nel deposito.
                //**********************************************************************************************
                //if (!string.IsNullOrEmpty(utils.InitConfigurationKeys.GetValue("0", "BE_HAS_ARCHIVE"))
                //    && utils.InitConfigurationKeys.GetValue("0", "BE_HAS_ARCHIVE").Equals("1"))
                //{
                //    DocsPaWR.DocsPaWebService docsPaWS = new DocsPaWebService();
                //    Int32 DocInDep = docsPaWS.IsIDdocInArchive(Convert.ToInt32(idDocProt));
                //    if (DocInDep > 0)
                //    {
                //        lblDocInDeposito.Visible = true;
                //        lblDocInDeposito.InnerText = "Il documento ricercato è stato versato in Deposito";
                //    }
                //}
                //else
                //    ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Documento non trovato. \\n Verificare i dati inseriti.')</script>");
                //**********************************************************************************************
                // GIORDANO IACOZZILLI: 16/07/2013
                //**********************************************************************************************
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('I parametri di ricerca inseriti hanno trovato più di un risultato. \\n Verificare i dati inseriti.')</script>");
            }
        }
예제 #51
0
        protected void BtnSaveCorr_Click(object sender, EventArgs e)
        {
            string idCorr   = Request.Form["rbl_pref"];
            bool   standard = false;

            DocsPaWR.Corrispondente[] listaDest;

            if (!string.IsNullOrEmpty(idCorr))
            {
                DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentoSelezionato();
                DocsPaWR.Corrispondente  tempCorr  = UserManager.getCorrispondenteBySystemID(this.Page, idCorr);
                if (tempCorr == null)
                {
                    tempCorr = UserManager.getCorrispondenteByCodRubricaRubricaComune(this.Page, idCorr);
                }

                if (schedaDoc != null && schedaDoc.protocollo != null && !string.IsNullOrEmpty(schedaDoc.tipoProto))
                {
                    if (schedaDoc.tipoProto.Equals("A"))
                    {
                        if (((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittenti != null &&
                            ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittenti.Length > 0 &&
                            UserManager.esisteCorrispondente(
                                ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittenti, tempCorr))
                        {
                            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi",
                                                                "alert('Attenzione! Corrispondente già presente nei mittenti multipli');",
                                                                true);
                        }
                        else
                        {
                            ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittente             = tempCorr;
                            ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).daAggiornareMittente = true;
                        }
                    }

                    if (schedaDoc.tipoProto.Equals("P"))
                    {
                        if (tipo.Equals("M"))
                        {
                            ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).mittente             = tempCorr;
                            ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).daAggiornareMittente = true;
                        }
                        else
                        {
                            if (((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatari != null &&
                                ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatari.Length > 0 &&
                                UserManager.esisteCorrispondente(
                                    ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatari, tempCorr))
                            {
                                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi",
                                                                    "alert('Attenzione! Corrispondente già presente nei destinatari');",
                                                                    true);
                            }
                            else
                            {
                                if (((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatariConoscenza !=
                                    null &&
                                    ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatariConoscenza.
                                    Length > 0 &&
                                    UserManager.esisteCorrispondente(
                                        ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).
                                        destinatariConoscenza, tempCorr))
                                {
                                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi",
                                                                        "alert('Attenzione! Corrispondente già presente nei destinatari in conoscenza');",
                                                                        true);
                                }
                                else
                                {
                                    listaDest = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatari;
                                    ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).destinatari =
                                        UserManager.addCorrispondente(listaDest, tempCorr);
                                }
                            }
                        }
                    }

                    if (schedaDoc.tipoProto.Equals("I"))
                    {
                        if (tipo.Equals("M"))
                        {
                            ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).mittente             = tempCorr;
                            ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).daAggiornareMittente = true;
                        }
                        else
                        {
                            if (((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).destinatari != null &&
                                ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).destinatari.Length > 0 &&
                                UserManager.esisteCorrispondente(
                                    ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).destinatari, tempCorr))
                            {
                                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi",
                                                                    "alert('Attenzione! Corrispondente già presente nei destinatari');",
                                                                    true);
                            }
                            else
                            {
                                if (
                                    ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).destinatariConoscenza !=
                                    null &&
                                    ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).destinatariConoscenza.
                                    Length > 0 &&
                                    UserManager.esisteCorrispondente(
                                        ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).
                                        destinatariConoscenza, tempCorr))
                                {
                                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi",
                                                                        "alert('Attenzione! Corrispondente già presente nei destinatari in conoscenza');",
                                                                        true);
                                }
                                else
                                {
                                    listaDest = ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).destinatari;
                                    ((DocsPAWA.DocsPaWR.ProtocolloInterno)schedaDoc.protocollo).destinatari =
                                        UserManager.addCorrispondente(listaDest, tempCorr);
                                }
                            }
                        }
                    }
                }


                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "window.close();", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alert",
                                                    "alert('Attenzione! Selezionare un corrispondente');", true);
            }
        }
 private void OpenAbout() => DocumentManager.OpenDocument(aboutViewModelCreator());
예제 #53
0
 public static IDocument LoadForm(string id, DocumentManager manager)
 {
     return new TemplateDocument(new TemplateFile(id), manager.DockForm);
 }
예제 #54
0
 /// <summary>
 /// Save new or existing document.
 /// </summary>
 public bool SaveDocument()
 {
     return(DocumentManager.SaveDocument());
 }
        /// <summary>
        /// Checks if a document is in any tab page.
        /// </summary>
        /// <param name="document"> The document to lookup.</param>
        /// <returns> Returns true if found, else false.</returns>
        private bool IsDocumentInTabPage(DocumentManager.Document document)
        {
            // Verify that form doesn't belongs to collection
            bool hasTabForm = false;

            foreach (DocumentManager.MdiTabStrip t in dmPanels.TabStrips)
            {
                //foreach (DocumentManager.Document d in t.Documents)
                //{
                if  ( t.Documents.Contains(document) )
                {
                    hasTabForm = true;
                    break;
                }
                //}
            }
            return hasTabForm;
        }
예제 #56
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            string tipo = string.Empty;

            if (Request.QueryString["tipo"] != null)
            {
                tipo = Request.QueryString["tipo"].Substring(0, 1);
                switch (tipo)
                {
                case "D":
                    dgStoricoStati.DataSource = DocsPAWA.DiagrammiManager.getDiagrammaStoricoDoc(DocumentManager.getDocumentoSelezionato(this).docNumber, this);
                    dgStoricoStati.DataBind();
                    break;

                case "F":
                    dgStoricoStati.DataSource = DocsPAWA.DiagrammiManager.getDiagrammaStoricoFasc(FascicoliManager.getFascicoloSelezionato(this).systemID, this);
                    dgStoricoStati.DataBind();
                    break;
                }
            }
        }
예제 #57
0
        private void butt_ricerca_Click(object sender, EventArgs e)
        {
            try
            {
                //Controllo intervallo date
                if (this.cboFilterTypeDataStampa.SelectedIndex != 0)
                {
                    if (Utils.isDate(this.GetCalendarControl("txtInitDataStampa").txt_Data.Text) && Utils.isDate(this.GetCalendarControl("txtEndDataStampa").txt_Data.Text) && Utils.verificaIntervalloDate(this.GetCalendarControl("txtInitDataStampa").txt_Data.Text, this.GetCalendarControl("txtEndDataStampa").txt_Data.Text))
                    {
                        Response.Write("<script>alert('Verificare intervallo date Data Stampa!');</script>");
                        //string s = "<SCRIPT language='javascript'>document.getElementById('" + this.GetCalendarControl("txtInitDataStampa").txt_Data.ID + "').focus();</SCRIPT>";
                        //RegisterStartupScript("focus", s);

                        //  Response.Write("<script  language='javascript'>top.principale.iFrame_dx.document.location = 'tabRisultatiRicDoc.aspx';</script>");
                        Response.Write("<script>top.principale.document.iFrame_dx.location='../blank_page.htm';</script>");
                        return;
                    }
                }
                //Fine controllo intervallo date

                ArrayList validationItems       = null;
                string    firstInvalidControlID = string.Empty;

                if (this.IsValidData(out validationItems, out firstInvalidControlID))
                {
                    if (Ricerca())
                    {
                        int numCriteri = 0;

                        if (qV[0] == null || qV[0].Length <= numCriteri)
                        {
                            Response.Write("<script>alert('Selezionare un registro');top.principale.document.iFrame_dx.location='../blank_page.htm';</script>");
                            return;
                        }
                        else
                        {
                            //if (!Page.IsStartupScriptRegistered("wait"))
                            //{
                            //	Page.RegisterStartupScript("wait","<script>DocsPa_FuncJS_WaitWindows();</script>");
                            //		}
                        }

                        schedaRicerca.FiltriRicerca = qV;
                        DocumentManager.setFiltroRicDoc(this, qV);
                        DocumentManager.removeDatagridDocumento(this);
                        DocumentManager.removeListaNonDocProt(this);
                        //	Response.Write("<script>parent.parent.iFrame_dx.document.location = 'tabRisultatiRicDocStampe.aspx';</script>");

                        //modifica del 14/05/2009
                        // Response.Write("<script language='javascript'>top.principale.iFrame_dx.document.location = 'tabRisultatiRicDocStampe.aspx';</script>");
                        Response.Write("<script  language='javascript'>top.principale.iFrame_dx.document.location = 'NewTabSearchResult.aspx?tabRes=StampaReg';</script>");
                        //fine modifica del 14/05/2009
                    }
                }
                else
                {
                    string validationMessage = string.Empty;

                    foreach (string item in validationItems)
                    {
                        if (validationMessage != string.Empty)
                        {
                            validationMessage += @"\n";
                        }

                        validationMessage += " - " + item;
                    }

                    if (validationMessage != string.Empty)
                    {
                        validationMessage = "Sono state rilevate le seguenti incongruenze: " +
                                            @"\n" + @"\n" + validationMessage;
                    }

                    this.RegisterClientScript("ValidationMessage", "alert('" + validationMessage + "');");

                    // impostazione del focus sul primo controllo non valido
                    this.SetControlFocus(firstInvalidControlID);

                    Response.Write("<script language='javascript'>top.principale.document.iFrame_dx.location='../blank_page.htm';</script>");
                }
            }
            catch (System.Exception ex)
            {
                ErrorManager.redirect(this, ex);
            }
        }
예제 #58
0
        private void dgStoricoStati_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
        {
            string tipo = string.Empty;

            if (Request.QueryString["tipo"] != null)
            {
                tipo = Request.QueryString["tipo"].Substring(0, 1);

                switch (tipo)
                {
                case "D":
                    dgStoricoStati.CurrentPageIndex = e.NewPageIndex;
                    dgStoricoStati.DataSource       = DocsPAWA.DiagrammiManager.getDiagrammaStoricoDoc(DocumentManager.getDocumentoSelezionato(this).docNumber, this);
                    dgStoricoStati.DataBind();
                    break;

                case "F":
                    dgStoricoStati.CurrentPageIndex = e.NewPageIndex;
                    dgStoricoStati.DataSource       = DocsPAWA.DiagrammiManager.getDiagrammaStoricoFasc(FascicoliManager.getFascicoloSelezionato(this).systemID, this);
                    dgStoricoStati.DataBind();
                    break;
                }
            }
        }
예제 #59
0
 protected void ConsolidateDocument(DocsPaWR.DocumentConsolidationStateEnum toState)
 {
     DocumentManager.ConsolidateDocument(DocumentManager.getSelectedRecord(), toState, UserManager.GetInfoUser());
     ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "UpBtnOk", "parent.closeAjaxModal('Consolidation','up');", true);
 }
예제 #60
0
        //Valorizzo la descrizione oggetto in base al codice se esiste!
        protected void txt_cod_oggetto_TextChanged(object sender, EventArgs e)
        {
            SAAdminTool.DocsPaWR.Registro[] listaRF;
            if (CodOggPostBack)
            {
                //Recupero la scheda corrente
                DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentoInLavorazione(this.Page);
                if (schedaDoc == null)
                {
                    //Valorizzazione della schedaDoc nel caso di protocollazione semplice
                    ProtocollazioneIngresso.Protocollo.ProtocolloMng protoMng = new ProtocollazioneIngresso.Protocollo.ProtocolloMng(this.Page);
                    schedaDoc = protoMng.GetDocumentoCorrente();
                }

                ////Valorizzo il registro corrente
                string[] listaReg = { "" };
                try
                {
                    //recupero la lista di registri per passarli allo user control oggetto ai fini della ricerca
                    if (wnd == "proto")
                    {
                        //registro in sessione
                        listaReg = UserManager.getListaIdRegistri(this.Page);
                    }
                    else
                    {
                        //se vengo dal protocollo Semplificato
                        if (wnd == "protoSempl")
                        {
                            ProtocollazioneIngresso.Registro.RegistroMng regMng = new ProtocollazioneIngresso.Registro.RegistroMng(this.Page);
                            listaReg    = new String[1];
                            listaReg[0] = regMng.GetRegistroCorrente().systemId;
                        }
                        else
                        {
                            listaReg = null; // ricerche e profilo
                        }
                    }

                    ArrayList aL = new ArrayList();
                    if (listaReg != null)
                    {
                        for (int i = 0; i < listaReg.Length; i++)
                        {
                            aL.Add(listaReg[i]);
                            listaRF = UserManager.getListaRegistriWithRF(this.Page, "1", listaReg[i]);
                            for (int j = 0; j < listaRF.Length; j++)
                            {
                                aL.Add(listaRF[j].systemId);
                            }
                        }

                        listaReg = new string[aL.Count];
                        aL.CopyTo(listaReg);
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Registro non settato!");
                }
                DocsPaWR.Oggetto[] listaObj;

                // E' inutile finire nel backend se la casella di testo è vuota (a parte il fatto che
                // la funzione, in questo caso, restituisce tutto l'oggettario)
                if (!String.IsNullOrEmpty(this.txt_cod_oggetto.Text.Trim()))
                {
                    //In questo momento tralascio la descrizione oggetto che metto come stringa vuota
                    listaObj = DocumentManager.getListaOggettiByCod(this.Page, listaReg, "", this.txt_cod_oggetto.Text);
                }
                else
                {
                    listaObj = new DocsPaWR.Oggetto[] {
                        new DocsPaWR.Oggetto()
                        {
                            descrizione = String.Empty,
                            codOggetto  = String.Empty
                        }
                    }
                };

                if (listaObj.Length > 0)
                {
                    this.txt_oggetto.Text = listaObj[0].descrizione;
                    //this.txt_cod_oggetto.Text = listaObj[0].codOggetto;
                    schedaDoc.oggetto.codOggetto   = listaObj[0].codOggetto;
                    schedaDoc.oggetto.descrizione  = listaObj[0].descrizione;
                    schedaDoc.oggetto.daAggiornare = true;
                    DocumentManager.setDocumentoInLavorazione(schedaDoc);
                }
                else
                {
                    RegisterClientScript("Codice_error", "alert('codice oggetto inesistente!');");
                    this.txt_oggetto.Text     = "";
                    this.txt_cod_oggetto.Text = "";
                    //Azzero anche i dati nella scheda corrente in modo che non rimanga in memoria il vecchio
                    //campo e codice oggetto!!!
                    schedaDoc.oggetto.codOggetto  = "";
                    schedaDoc.oggetto.descrizione = "";
                    DocumentManager.setDocumentoInLavorazione(schedaDoc);
                }
            }
        }