Exemple #1
0
 protected void RegisterRepertoriesBtnPrint_Click(object sender, EventArgs e)
 {
     try {
         int index = GrdRegisterRepertories.SelectedIndex + this.GrdRegisterRepertories.PageIndex * this.GrdRegisterRepertories.PageSize;
         if (ListRegRepertoriesSingleSetting[index].RegistroRepertorioSingleSettings.CounterState.ToString().Equals("O"))
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('WarningPrintRegisterRepertories', 'warning', '');} else {parent.ajaxDialogModal('WarningPrintRegisterRepertories', 'warning', '');}", true);
             return;
         }
         try
         {
             SchedaDocumento sch = UIManager.RegisterRepertories.GeneratePrintRepertorio(RoleManager.GetRoleInSession(),
                                                                                         UserManager.GetInfoUser(),
                                                                                         ListRegRepertoriesSingleSetting[index].RegistroRepertorioSingleSettings.RFId,
                                                                                         ListRegRepertoriesSingleSetting[index].RegistroRepertorioSingleSettings.RegistryId,
                                                                                         ListRegRepertoriesSingleSetting[index].RegistroRepertorio.CounterId);
             ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('SuccessPrintRegisterRepertories', 'check', '');} else {parent.ajaxDialogModal('SuccessPrintRegisterRepertories', 'check', '');}", true);
             return;
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('ErrorPrintRegisterRepertories', 'error', '', '" + Utils.utils.FormatJs(ex.Message) + "');} else {parent.ajaxDialogModal('ErrorPrintRegisterRepertories', 'error', '', '" + Utils.utils.FormatJs(ex.Message) + "');}", true);
         }
     }
     catch (System.Exception ex)
     {
         UIManager.AdministrationManager.DiagnosticError(ex);
         return;
     }
 }
Exemple #2
0
        /// <summary>
        /// Caricamento dati campi comuni ai protocolli e documenti grigi
        /// </summary>
        private void FetchCommonFields()
        {
            SchedaDocumento schedaDocumento = this.GetSchedaDocumento();

            //popolamento campo data creazione
            if (schedaDocumento.dataCreazione != null)
            {
                this.txtDtaCreazioneExtra.Text = schedaDocumento.dataCreazione.ToString();
                this.txtDtaCreazioneBase.Text  = schedaDocumento.dataCreazione.ToString();
            }
            //popolamento campo oggetto
            if (schedaDocumento.oggetto != null && schedaDocumento.oggetto.descrizione != null)
            {
                this.txtOggetto.Text = schedaDocumento.oggetto.descrizione.ToString();
            }
            //popolamento campo id documento
            if (schedaDocumento.systemId != null)
            {
                this.txtIdDocumentoExtra.Text = schedaDocumento.systemId;
                this.txtIdDocumentoBase.Text  = schedaDocumento.systemId;
            }

            if (this.IsReadOnlyMode())
            {
                this.txtTipologiaDocumento.Text = TipiDocumento.GetDescrizione(schedaDocumento.tipoProto);
            }
            else
            {
                this.cboTipologiaDocumento.SelectedValue = schedaDocumento.tipoProto;
            }
        }
Exemple #3
0
        private string SaveDocument(InfoUtente infoUtente, Ruolo role, SchedaDocumento schedaDoc, FileDocumento fileDoc)
        {
            //Salvataggio del documento
            DocsPaDocumentale.Documentale.DocumentManager docManager = new DocsPaDocumentale.Documentale.DocumentManager(infoUtente);

            //Salvataggio dell'oggetto
            schedaDoc = ProtoManager.addOggettoLocked(infoUtente.idAmministrazione, schedaDoc);

            Ruolo[] ruoliSuperiori;

            if (docManager.CreateDocumentoGrigio(schedaDoc, role, out ruoliSuperiori))
            {
                //Salvataggio del file associato al documento
                DocsPaVO.documento.FileRequest fileRequest = (DocsPaVO.documento.FileRequest)schedaDoc.documenti[0];

                fileRequest = BusinessLogic.Documenti.FileManager.putFile(fileRequest, fileDoc, infoUtente);
                if (fileRequest == null)
                {
                    throw new ApplicationException("Si è verificato un errore nell'upload del documento di certificazione");
                }
            }

            /*
             * superiori = ruoliSuperiori;
             * if (superiori == null)
             *  superiori = new Ruolo[] { };
             * */

            //restituzione numero documento
            return(schedaDoc.docNumber);
        }
Exemple #4
0
        public static void salvaModificaStato(string docNumber, string idStato, DiagrammaStato diagramma, string idUtente, InfoUtente user, string dataScadenza, Page page)
        {
            try
            {
                docsPaWS.salvaModificaStato(docNumber, idStato, diagramma, idUtente, user, dataScadenza);

                SchedaDocumento docSel = DocumentManager.getSelectedRecord();

                //Controllo che lo stato sia uno stato di conversione pdf lato server
                //In caso affermativo faccio partire la conversione
                if (utils.isEnableConversionePdfLatoServer() == "true" &&
                    docSel != null && docSel.documenti != null && !String.IsNullOrEmpty(docSel.documenti[0].fileName))
                {
                    DocsPaWR.Stato statoAttuale = DiagrammiManager.GetStateDocument(docNumber);
                    if (statoAttuale != null && statoAttuale.CONVERSIONE_PDF)
                    {
                        FileManager            fileManager   = new FileManager();
                        DocsPaWR.FileDocumento fileDocumento = fileManager.getFile(page);
                        if (fileDocumento != null && fileDocumento.content != null && fileDocumento.name != null && fileDocumento.name != "")
                        {
                            FileManager.EnqueueServerPdfConversion(UserManager.GetInfoUser(), fileDocumento.content, fileDocumento.name, DocumentManager.getSelectedRecord());
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
            }
        }
Exemple #5
0
        protected void VerifyEnableEdit()
        {
            SchedaDocumento doc = UIManager.DocumentManager.getSelectedRecord();

            if (doc != null && doc.tipoProto != null && doc.protocollo != null && doc.protocollo.protocolloAnnullato != null)
            {
                this.TxtViewObject.ReadOnly  = true;
                this.ViewObjectBtnOk.Enabled = false;
            }

            if (doc != null && !string.IsNullOrEmpty(doc.systemId) && !string.IsNullOrEmpty(doc.accessRights) && Convert.ToInt32(doc.accessRights) < Convert.ToInt32(HMdiritti.HMdiritti_Write))
            {
                this.TxtViewObject.ReadOnly  = true;
                this.ViewObjectBtnOk.Enabled = false;
            }

            //Se consolidato disabilito l'edit
            if (doc != null && !string.IsNullOrEmpty(doc.systemId) && doc.ConsolidationState != null)
            {
                if (doc.ConsolidationState.State == DocumentConsolidationStateEnum.Step2)
                {
                    this.TxtViewObject.ReadOnly  = true;
                    this.ViewObjectBtnOk.Enabled = false;
                }
            }
        }
Exemple #6
0
        private static void AcquireFileAndAllegato(AttestatoVO att, SchedaDocumento sd, InfoUtente userInfo)
        {
            Templates temp = ProfilazioneDocumenti.getTemplateById(att.IdTemplate);
            string    path = temp.PATH_MODELLO_1;

            byte[] content = GetFileContent(path);
            // Creazione dell'oggetto fileDocumento
            FileDocumento fileDocumento = new FileDocumento();

            fileDocumento.name           = Path.GetFileName(sd.systemId + ".rtf");
            fileDocumento.fullName       = sd.systemId + ".rtf";
            fileDocumento.estensioneFile = "rtf";
            fileDocumento.length         = content.Length;
            fileDocumento.content        = content;
            FileRequest fileRequest = (FileRequest)sd.documenti[0];

            try
            {
                FileManager.putFile(fileRequest, fileDocumento, userInfo);
            }
            catch (Exception e)
            {
                throw new Exception("Errore durante l'upload del file.");
            }
            FileDocumento fileAll = new FileDocumento();

            fileAll.name           = Path.GetFileName(att.FileName);
            fileAll.fullName       = att.FileName;
            fileAll.estensioneFile = att.FileName.Substring(att.FileName.LastIndexOf(".") + 1);
            fileAll.length         = content.Length;
            fileAll.content        = att.Content;
            FileRequest allRequest = (FileRequest)sd.allegati[0];

            FileManager.putFile(allRequest, fileAll, userInfo);
        }
        private void ManageSendReceipt()
        {
            this.DocumentImgSendReceipt.Enabled = false;

            SchedaDocumento doc = DocumentManager.getSelectedRecord();

            if (doc != null && !string.IsNullOrEmpty(doc.systemId))
            {
                //Andrea De Marco - Gestione Eccezioni PEC
                //In eseguiSenzaSegnatura prima del save della scheda documento, imposto sd.interop = E
                //Se schedaDoc.interop = E si è verificata un'eccezione nella gestione del file Segnatura.xml, pertanto il tasto di invio Conferma.xml deve essere disabilitato
                //Per ripristino, commentare De Marco e decommentare il codice immediatamente sottostante
                if (!string.IsNullOrEmpty(doc.interop) && doc.interop.ToUpper().Equals("E"))
                {
                    this.DocumentImgSendReceipt.Enabled = false;
                }
                else
                {
                    if (
                        doc.protocollo != null &&
                        !string.IsNullOrEmpty(doc.protocollo.segnatura) &&
                        (doc.typeId == "MAIL" || doc.typeId == "INTEROPERABILITA") &&
                        UserManager.IsAuthorizedFunctions("DO_INVIO_RICEVUTE")
                        )
                    {
                        this.DocumentImgSendReceipt.Enabled = true;
                    }
                }
                //End Andrea De Marco
            }
        }
Exemple #8
0
        /// <summary>
        /// Operazione per l'inserimento di un file in una versione / allegato di un documento
        ///
        /// PreCondizione:
        ///     la versione / allegato deve essere gi� stato creato come entit� persistente
        ///
        ///     Attributi dell'oggetto FileRequest gi� valorizzati in ingresso
        ///         VersionId:      ID della versione / allegato in docspa
        ///         Version:        0 se allegato, > 0 se versione
        ///         SubVersion:     ! se allegato, stringa vuota se versione
        ///         VersionLabel:   A# se allegato (dove # � il num. dell'allegato, fino a 99)
        ///                         (es. A01, A02, A03, ecc.)
        ///                         1, 2, 3, 4, ecc. se versione
        /// PostCondizioni:
        ///     il file deve essere stato associato alla versione / allegato
        ///
        /// </summary>
        /// <param name="fileRequest"></param>
        /// <param name="fileDocumento"></param>
        /// <param name="estensione"></param>
        /// <param name="objSicurezza"></param>
        /// <returns></returns>

        public bool PutFile(DocsPaVO.documento.FileRequest fileRequest, DocsPaVO.documento.FileDocumento fileDocumento, string estensione)
        {
            logger.Info("BEGIN");
            bool retValue = false;

            try
            {
                //CHIAMATA AL DOCUMENTALE ETDOCS
                retValue = this.DocumentManagerETDOCS.PutFile(fileRequest, fileDocumento, estensione);

                DocsPaDB.Query_DocsPAWS.Documenti documenti = new DocsPaDB.Query_DocsPAWS.Documenti();
                SchedaDocumento scheda = documenti.GetDettaglioNoSecurity(
                    this._infoUtente,
                    fileRequest.docNumber,
                    fileRequest.docNumber);

                //if (retValue && (scheda.interop == null || scheda.interop.ToUpper() != "I" ))
                //    retValue = this.DocumentManagerWSPIA.PutFile(fileRequest, fileDocumento, estensione);

                if (retValue && scheda.interop == null)
                {
                    retValue = this.DocumentManagerWSPIA.PutFile(fileRequest, fileDocumento, estensione);
                }
            }
            catch (Exception ex)
            {
                logger.Debug(string.Format("Errore nel metodo PutFile: {0}", ex.Message));
                logger.Debug(string.Format("Errore durante la scrittura del documento: {0}, non è stato possibile invocare il WebService di INPS", ex.Message));
            }
            logger.Info("END");
            return(retValue);
        }
        private void EnableDocumentButtons()
        {
            this.DocumentImgPrintLabel.Enabled   = true;
            this.DocumentImgPreservation.Enabled = true;
            this.DocumentImgRecupero.Enabled     = true;
            this.DocumentImgSendReceipt.Enabled  = true;
            this.DocumentImgPrintA4.Enabled      = true;
            this.TxtPrintLabel.Enabled           = true;
            this.TxtPrintLabel.Text = "1";
            SchedaDocumento doc = DocumentManager.getSelectedRecord();

            if (doc != null && !string.IsNullOrEmpty(doc.systemId))
            {
                if (doc.tipoProto.Equals("A") || doc.tipoProto.Equals("P") || doc.tipoProto.Equals("I"))
                {
                    if (!UIManager.UserManager.IsAuthorizedFunctions("DO_PROT_SE_STAMPA"))
                    {
                        this.PlcDocumentPrintLabel.Visible = false;
                    }
                }

                if (doc.tipoProto.Equals("G"))
                {
                    if (!UIManager.UserManager.IsAuthorizedFunctions("DO_DOC_SE_GRIGIO"))
                    {
                        this.PlcDocumentPrintLabel.Visible = false;
                    }
                }
            }

            this.VisibiltyRoleFunctions();
        }
Exemple #10
0
        public static bool InserimentoInLibroFirma(System.Web.UI.Page page, Trasmissione trasm, string idTrasmSingola)
        {
            try
            {
                SchedaDocumento     sch          = DocumentManager.getDocumentDetailsNoSecurity(page, trasm.infoDocumento.docNumber, trasm.infoDocumento.docNumber);
                TrasmissioneSingola trasmSingola = (from n in trasm.trasmissioniSingole where n.systemId.Equals(idTrasmSingola) select n).FirstOrDefault();
                string noteNoteSing           = trasmSingola.noteSingole;
                string note                   = !string.IsNullOrEmpty(trasm.noteGenerali) ? (string.IsNullOrEmpty(noteNoteSing) ? trasm.noteGenerali : trasm.noteGenerali + " - " + noteNoteSing) : noteNoteSing;
                ElementoInLibroFirma elemento = new ElementoInLibroFirma()
                {
                    InfoDocumento = new InfoDocLibroFirma()
                    {
                        Docnumber = sch.docNumber, VersionId = sch.documenti[0].versionId, NumVersione = Convert.ToInt32(sch.documenti[0].version)
                    },
                    DataAccettazione = DateTime.Now.ToString(),
                    Modalita         = LibroFirmaManager.Modalita.MANUALE,
                    TipoFirma        = trasmSingola.ragione.azioneRichiesta.ToString(),
                    StatoFirma       = TipoStatoElemento.DA_FIRMARE,
                    RuoloProponente  = trasm.ruolo,
                    UtenteProponente = trasm.utente,
                    IdRuoloTitolare  = RoleManager.GetRoleInSession().idGruppo,
                    IdUtenteTitolare = UserManager.GetUserInSession().idPeople,
                    IdUtenteLocker   = UserManager.GetUserInSession().idPeople,
                    IdTrasmSingola   = idTrasmSingola,
                    Note             = note
                };

                return(docsPaWS.InserimentoInLibroFirma(elemento, UserManager.GetInfoUser()));
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return(false);
            }
        }
 /// <summary>
 /// Funzione per lo spostamento dei documenti nell'area di lavoro
 /// </summary>
 /// <param name="documentsInfo">L'elenco dei documenti da spostare</param>
 /// <param name="report">Report del''esecuzione</param>
 private void MoveDocumentsInWorkingArea(List <InfoDocumento> documentsInfo, MassiveOperationReport report)
 {
     // Per ogni documento...
     foreach (InfoDocumento docInfo in documentsInfo)
     {
         string id = MassiveOperationUtils.getItem(docInfo.idProfile).Codice;
         // ...spostamento del documento nell'area di lavoro
         try
         {
             if (DocumentManager.isDocInADL(docInfo.idProfile, this.Page) == 0 && DocumentManager.isDocInADLRole(docInfo.idProfile, this.Page) == 0)
             {
                 SchedaDocumento sd = DocumentManager.getDocumentDetails(this, docInfo.docNumber, docInfo.docNumber);
                 DocumentManager.addAreaLavoro(this, sd);
                 report.AddReportRow(
                     id,
                     MassiveOperationReport.MassiveOperationResultEnum.OK,
                     "Documento inserito correttamente nell'area di lavoro.");
             }
             else
             {
                 report.AddReportRow(
                     id,
                     MassiveOperationReport.MassiveOperationResultEnum.KO,
                     "Documento già inserito nell'area di lavoro.");
             }
         }
         catch (Exception e)
         {
             report.AddReportRow(
                 id,
                 MassiveOperationReport.MassiveOperationResultEnum.KO,
                 "Errore durante lo spostamento del documento nell'area di lavoro. Dettagli: " + e.Message);
         }
     }
 }
Exemple #12
0
        private void SetParameters()
        {
            this.schedaCorrente = CheckInOutServices.CurrentSchedaDocumento; // CurrentSchedaDocumento();
            if (this.schedaCorrente != null)
            {
                if (IsAllegato())
                {
                    DocumentId = DocumentNumber = UIManager.DocumentManager.GetSelectedAttachment().docNumber;
                }
                else
                {
                    DocumentId     = this.schedaCorrente.systemId;
                    DocumentNumber = this.schedaCorrente.docNumber;
                }

                FileExtention = LastAcquiredDocumentExtension(this.schedaCorrente);
                CreateNewFile = (string.IsNullOrEmpty(FileExtention) ? "true" : "false");
                if (this.schedaCorrente.tipoProto == "G")
                {
                    TipoDocumento = "G";
                }
                else
                {
                    TipoDocumento = "P";
                }

                this.Fetch();
                this.FetchFileTypes();
            }
        }
Exemple #13
0
        /// <summary>
        /// Metodo per la creazione delle informazioni sul mittente della spedizione
        /// </summary>
        /// <param name="schedaDocumento">Documento da cui estrarre le informazioni</param>
        /// <param name="infoUtente">Informazioni sull'utente richiedente</param>
        /// <param name="destinatari">Lista dei destinatari della spedizione</param>
        /// <returns>Informazioni sul mittente della spedizione</returns>
        private SenderInfo CreateSendersInfo(SchedaDocumento schedaDocumento, InfoUtente infoUtente, Corrispondente[] destinatari)
        {
            // Recupero del codice del mittente
            String senderCode = InteroperabilitaSemplificataManager.LoadSenderInfoFromUoId(((ProtocolloUscita)schedaDocumento.protocollo).mittente.systemId);

            // Se il mittente non è interoperante o se non è presente in RC, non si può procedere con la spedizione
            if (!InteroperabilitaSemplificataManager.IsCorrEnabledToInterop(
                    ((ProtocolloUscita)schedaDocumento.protocollo).mittente.systemId) ||
                RubricaComune.RubricaServices.GetElementoRubricaComune(infoUtente, senderCode, false) == null)
            {
                throw new SenderNotInteroperableException();
            }

            SenderInfo senderInfo = new SenderInfo()
            {
                AdministrationId = infoUtente.idAmministrazione,
                //Code = String.Format("{0}-{1}",
                //    ((ProtocolloUscita)schedaDocumento.protocollo).mittente.codiceAmm,
                //    ((ProtocolloUscita)schedaDocumento.protocollo).mittente.descrizione),
                Code           = senderCode,
                Url            = InteroperabilitaSemplificataManager.GetUrl(infoUtente.idAmministrazione),
                UserId         = infoUtente.userId,
                FileManagerUrl = InteroperabilitaSemplificataManager.GetFileManagerUrl(schedaDocumento.registro.idAmministrazione)
            };

            return(senderInfo);
        }
Exemple #14
0
        /// <summary>
        /// Metodo per la creazione delle informazioni sugli allegati del documento
        /// </summary>
        /// <param name="schedaDocumento">Documento da cui estrarre le informazioni</param>
        /// <param name="infoUtente">Informazioni sul richiedente</param>
        /// <returns>Lista delle informazioni sugli allegati</returns>
        private List <DocumentInfo> CreateAttachmentsInfo(SchedaDocumento schedaDocumento, InfoUtente infoUtente)
        {
            List <DocumentInfo> attachmentsInfo = new List <DocumentInfo>();

            foreach (Allegato allegato in ((Allegato[])schedaDocumento.allegati.ToArray(typeof(Allegato))).Where(
                         a => AllegatiManager.getIsAllegatoIS(a.versionId) == "0" && AllegatiManager.getIsAllegatoPEC(a.versionId) == "0")
                     )
            {
                string originalFileName = BusinessLogic.Documenti.FileManager.getOriginalFileName(null, allegato);
                if (String.IsNullOrEmpty(originalFileName))
                {
                    originalFileName = allegato.fileName;
                }

                attachmentsInfo.Add(new DocumentInfo()
                {
                    DocumentNumber         = allegato.docNumber,
                    DocumentServerLocation = allegato.docServerLoc,
                    FileName      = originalFileName,
                    FilePath      = allegato.path,
                    Name          = allegato.descrizione,
                    NumberOfPages = allegato.numeroPagine,
                    VersionId     = allegato.versionId,
                    VersionLabel  = allegato.versionLabel,
                    Version       = allegato.version
                });
            }

            return(attachmentsInfo);
        }
        private void SetParameters()
        {
            SchedaDocumento selDoc = CheckInOutServices.CurrentSchedaDocumento; // CurrentSchedaDocumento();

            if (selDoc != null)
            {
                DocumentId = selDoc.systemId;

                if (UIManager.DocumentManager.getSelectedAttachId() != null)
                {
                    DocumentNumber = UIManager.DocumentManager.GetSelectedAttachment().docNumber;
                }
                else
                {
                    DocumentNumber = selDoc.docNumber;
                }

                FileExtention = LastAcquiredDocumentExtension(selDoc);
                CreateNewFile = (string.IsNullOrEmpty(FileExtention)?"true":"false");
                if (selDoc.tipoProto == "G")
                {
                    TipoDocumento = "G";
                }
                else
                {
                    TipoDocumento = "P";
                }

                this.Fetch();
                this.FetchFileTypes();
            }
        }
Exemple #16
0
        /// <summary>
        /// CheckOut di un documento senza estrarre il contenuto del file
        /// </summary>
        /// <param name="documentLocation"></param>
        /// <param name="machineName"></param>
        /// <param name="checkOutStatus"></param>
        /// <returns></returns>
        public static ValidationResultInfo CheckOutDocument(string documentLocation, string machineName, out CheckOutStatus checkOutStatus)
        {
            ValidationResultInfo retValue = null;

            checkOutStatus = null;

            SchedaDocumento schedaDocumento = CheckInOutServices.CurrentSchedaDocumento;

            if (schedaDocumento != null)
            {
                string docnum = schedaDocumento.docNumber;
                string docid  = schedaDocumento.systemId;
                if (IsSelectedTabAllegati())
                {
                    docnum = UIManager.DocumentManager.GetSelectedAttachment().docNumber;
                    docid  = UIManager.DocumentManager.GetSelectedAttachment().docNumber;
                }

                retValue = _webServices.CheckOutDocument(docid, docnum, documentLocation, machineName, GetInfoUtente(), out checkOutStatus);

                if (retValue.Value && !IsSelectedTabAllegati())
                {
                    schedaDocumento.checkOutStatus = checkOutStatus;

                    CheckOutAppletContext.Current = new CheckOutAppletContext(schedaDocumento);
                }
            }

            return(retValue);
        }
Exemple #17
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                // Reperimento parametri query string
                this.idProfile  = this.GetQueryStringParameter("iddoc");
                this.docNum     = this.GetQueryStringParameter("docnum");
                this.activeMenu = this.GetQueryStringParameter("activemenu");

                if (idProfile != string.Empty && docNum != string.Empty)
                {
                    DocumentoHandler handler = new DocumentoHandler();
                    this._schedaDocumento = handler.GetDocumento(this.idProfile, this.docNum);

                    this.Fetch();
                }
                else
                {
                    throw new ApplicationException("Parametri mancanti");
                }
            }
            catch (Exception ex)
            {
                ErrorManager.redirect(this, ex);
            }
        }
Exemple #18
0
        protected void LnkViewDocument_Click(object sender, EventArgs e)
        {
            Session["IsInvokingFromProjectStructure"] = null;
            SchedaDocumento schedaDocumento = UIManager.DocumentManager.getSelectedRecord();
            Fascicolo       fascicolo       = UIManager.ProjectManager.getProjectInSession();
            //Session["isZoom"] = null;
            List <Navigation.NavigationObject> navigationList = Navigation.NavigationUtils.GetNavigationList();

            Navigation.NavigationObject obj    = navigationList.Last();
            Navigation.NavigationObject newObj = Navigation.NavigationUtils.CloneObject(obj);

            newObj.NamePage         = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.PROJECT_STRUCTURE.ToString(), string.Empty);
            newObj.Link             = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.PROJECT_STRUCTURE.ToString(), true, this.Page);
            newObj.CodePage         = Navigation.NavigationUtils.NamePage.PROJECT_STRUCTURE.ToString();
            newObj.Page             = "STRUCTURE.ASPX";
            newObj.IdObject         = schedaDocumento.systemId;
            newObj.OriginalObjectId = schedaDocumento.systemId;
            newObj.folder           = fascicolo.folderSelezionato;
            newObj.idProject        = fascicolo.systemID;
            //int indexElement = ((rowIndex + 1) / 2) + this.PageSize * (this.SelectedPage - 1);
            //newObj.DxPositionElement = indexElement.ToString();

            if (obj.NamePage.Equals(Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.PROJECT_STRUCTURE.ToString(), string.Empty)) && !string.IsNullOrEmpty(obj.IdObject) && obj.IdObject.Equals(newObj.idProject))
            {
                navigationList.Remove(obj);
            }
            navigationList.Add(newObj);
            Navigation.NavigationUtils.SetNavigationList(navigationList);

            Response.Redirect("../Document/document.aspx");
        }
Exemple #19
0
        /// <summary>
        /// Funzione per la validazione dei dati sul documento e l'avvio dell'inserimento
        /// nell'area di conservazione
        /// </summary>
        /// <param name="documentDetails">Dettagli del documento da inserire nell'area di conservazione</param>
        /// <param name="report">Report dello spostamento</param>
        private void CheckDataValidityAndInsertInSA(SchedaDocumento documentDetails, MassiveOperationReport report)
        {
            // Identificativo dell'istanza di certificazione
            String conservationAreaId;

            // Se il documento ha un file acquisito
            if (Convert.ToInt32(documentDetails.documenti[0].fileSize) > 0 && (string.IsNullOrEmpty(documentDetails.inConservazione) || !(documentDetails.inConservazione).Equals("1")))
            {
                // Inserimento del documento in area di conservazione
                this.InsertInSA(documentDetails, report);
            }

            else
            {
                string codice = MassiveOperationUtils.getItem(documentDetails.systemId).Codice;
                if (!string.IsNullOrEmpty(documentDetails.inConservazione) && (documentDetails.inConservazione).Equals("1"))
                {
                    report.AddReportRow(
                        codice,
                        MassiveOperationReport.MassiveOperationResultEnum.KO,
                        "Il documento risulta già inserito in una nuova istanza di conservazione, impossibile inserirlo nuovamente");
                }
                else
                {
                    report.AddReportRow(
                        codice,
                        MassiveOperationReport.MassiveOperationResultEnum.KO,
                        "Il documento principale non ha alcun file associato, impossibile inserirlo in area conservazione");
                }
            }
        }
Exemple #20
0
        private void CreateAndTrasmDoc(SchedaDocumento scheda, InfoUtente userInfo, Ruolo ruolo)
        {
            //creo la trasmissione
            Trasmissione        trasm  = new Trasmissione();
            TrasmissioneSingola trasmS = new TrasmissioneSingola();
            TrasmissioneUtente  trasmU = new TrasmissioneUtente();

            //trasm.dataInvio = DateTime.Now.ToShortDateString();
            trasm.DataDocFasc   = scheda.dataCreazione;
            trasm.infoDocumento = DocsPAWA.DocumentManager.getInfoDocumento(scheda);
            trasm.ruolo         = ruolo;
            trasm.tipoOggetto   = TrasmissioneTipoOggetto.DOCUMENTO;
            trasm.utente        = DocsPAWA.UserManager.getUtente();

            trasmS.ragione               = TrasmManager.GetRagioneNotifica(userInfo.idAmministrazione);
            trasmS.tipoDest              = TrasmissioneTipoDestinatario.RUOLO;
            trasmS.tipoTrasm             = "S";
            trasmS.corrispondenteInterno = UserManager.getCorrispondenteBySystemID(this.Page, ruolo.systemId);
            trasmU.daNotificare          = true;
            trasmU.utente = UserManager.getUtente();

            trasmS.trasmissioneUtente    = new TrasmissioneUtente[1];
            trasmS.trasmissioneUtente[0] = trasmU;
            trasm.trasmissioniSingole    = new TrasmissioneSingola[1];
            trasm.trasmissioniSingole[0] = trasmS;
            Trasmissione trasmRes = TrasmManager.saveExecuteTrasm(this.Page, trasm, userInfo);
        }
Exemple #21
0
 protected void RegistersBtnPrint_Click(object sender, EventArgs e)
 {
     DocsPaWR.InfoUtente    infoUser = UserManager.GetInfoUser();
     DocsPaWR.InfoDocumento infoDoc  = new InfoDocumento();
     DocsPaWR.Ruolo         role     = RoleManager.GetRoleInSession();
     try
     {
         DocsPaWR.StampaRegistroResult StpRegRS = GestManager.StampaRegistro(this, infoUser, role, SelectedRegister);
         if (StpRegRS != null && StpRegRS.errore != null && StpRegRS.errore != "")
         {
             string error = StpRegRS.errore;
             error = error.Replace("'", "\\'");
             ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('WarningRegisterPrint', 'warning', '','" + error + "');} else {parent.ajaxDialogModa('ErrorRegisterPrint', 'error', '','" + error + "');}", true);
             return;
         }
         else
         {
             infoDoc.docNumber = StpRegRS.docNumber;
             DocsPaWR.SchedaDocumento schedaDoc = new SchedaDocumento();
             schedaDoc            = DocumentManager.getDocumentDetails(this, infoDoc.idProfile, infoDoc.docNumber);
             FileDocPrintRegister = FileManager.getInstance(schedaDoc.systemId).GetFile(this.Page, schedaDoc.documenti[0], false);
             ScriptManager.RegisterStartupScript(this, this.GetType(), "viewPrintRegister", "ajaxModalPopupViewPrintRegister();", true);
             return;
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('ErrorRegisterPrint', 'error', '');} else {parent.ajaxDialogModa('ErrorRegisterPrint', 'error', '');}", true);
     }
 }
Exemple #22
0
        /// <summary>
        /// Logica di business per determinare se è necessario avvisare
        /// l'utente prima della spedizione che non è stato acquisito alcun documento
        /// </summary>
        /// <param name="documento"></param>
        public static bool AvvisaSuSpedizioneDocumento(SchedaDocumento documento)
        {
            DocsPaWR.ConfigSpedizioneDocumento config = GetConfigSpedizioneDocumento();

            return(config.AvvisaSuSpedizioneDocumento &&
                   documento.documenti != null && documento.documenti[0].fileSize != "0");
        }
Exemple #23
0
        private string SaveDocument(InfoUtente userInfo, Ruolo role, SchedaDocumento document, FileDocumento fileDoc, out Ruolo[] superiori)
        {

            //Salvataggio del documento
            DocsPaDocumentale.Documentale.DocumentManager docManager = new DocsPaDocumentale.Documentale.DocumentManager(userInfo);

            //Salvataggio dell'oggetto
            document = ProtoManager.addOggettoLocked(userInfo.idAmministrazione, document);

            Ruolo[] ruoliSuperiori;
            //if (docManager.CreateDocumentoStampaRegistro(document, role, out ruoliSuperiori))
            if (docManager.CreateDocumentoGrigio(document, role, out ruoliSuperiori))
            //if(docManager.CreateDocumentoGrigio(document, role))
            {
                //Notifica evento documento creato
                //DocsPaDocumentale.Interfaces.IAclEventListener eventsNotification = new DocsPaDocumentale.Documentale.AclEventListener(userInfo);
                //eventsNotification.DocumentoCreatoEventHandler(document, role, ruoliSuperiori);
                
                //Salvataggio del file associato al documento
                DocsPaVO.documento.FileRequest fileRequest = (DocsPaVO.documento.FileRequest)document.documenti[0];

                fileRequest = BusinessLogic.Documenti.FileManager.putFile(fileRequest, fileDoc, userInfo);
                if(fileRequest == null)
                    throw new ApplicationException("Si è verificato un errore nell'upload del documento per la stampa del registro di conservazione");

            }

            superiori = ruoliSuperiori;
            if (superiori == null)
                superiori = new Ruolo[] { };

            //Restituzione del numero documento            
            return document.docNumber;
        }
Exemple #24
0
        /// <summary>
        /// Reperimento del contentuto di un file dal repository Documentum
        /// </summary>
        /// <param name="docNumber"></param>
        /// <param name="version"></param>
        /// <param name="versionId"></param>
        /// <param name="versionLabel"></param>
        /// <returns></returns>
        public byte[] GetFile(string docNumber, string version, string versionId, string versionLabel)
        {
            logger.Info("BEGIN");
            byte[] content = null;
            DocsPaDB.Query_DocsPAWS.Documenti documenti = new DocsPaDB.Query_DocsPAWS.Documenti();
            List <BaseInfoDoc> listaSchedeDoc           = documenti.GetBaseInfoForDocument(null, docNumber, null);
            BaseInfoDoc        schedaDocBase            = listaSchedeDoc[0];
            SchedaDocumento    schedaDocumento          = documenti.GetDettaglioNoSecurity(this._infoUtente, schedaDocBase.IdProfile, schedaDocBase.DocNumber);

            try
            {
                if (!string.IsNullOrEmpty(_infoUtente.codWorkingApplication) && _infoUtente.codWorkingApplication == "DOCSPA")
                {
                    content = this.DocumentManagerSP.GetFile(docNumber, version, versionId, versionLabel);
                }
                else
                {
                    // Il reperimento dei file viene dapprima effettuato dal documentale ETNOTEAM
                    content = this.DocumentManagerETDOCS.GetFile(docNumber, version, versionId, versionLabel);
                }
            }
            catch (Exception ex)
            {
                logger.Debug("Errore nel reperimento del file nel documentale ETNOTEAM", ex);

                // Errore nel reperimento del file nel documentale ETNOTEAM
                content = null;
            }

            logger.Info("END");

            return(content);
        }
        /// <summary>
        /// Reperimento dell'estensione del file acquisito
        /// relativamente all'ultima versione del documento
        /// </summary>
        /// <returns></returns>
        protected string LastAcquiredDocumentExtension(SchedaDocumento currentScheda)
        {
            string retValue = string.Empty;

            if (currentScheda != null && currentScheda.documenti != null && currentScheda.documenti.Length > 0)
            {
                if (this.ViewState["LastAcquiredDocumentExtension"] == null || string.IsNullOrEmpty(this.ViewState["LastAcquiredDocumentExtension"].ToString()))
                {
                    if (CheckInOutServices.UserEnabled)
                    {
                        FileRequest lastDocument = new FileRequest();
                        // modifica per reperire le versioni antecedenti l'ultima
                        //if (DocumentManager.ListDocVersions != null)
                        //{
                        //    lastDocument = (from doc in DocumentManager.ListDocVersions where doc.version.Equals(DocumentManager.getSelectedNumberVersion()) select doc).FirstOrDefault();
                        //}
                        //else
                        //{
                        //    lastDocument = currentScheda.documenti[0];
                        //}

                        // provo con l'array già presente
                        lastDocument = (from doc in currentScheda.documenti where doc.version.Equals(DocumentManager.getSelectedNumberVersion()) select doc).FirstOrDefault();

                        // Reperimento ultimo file acquisito dal documento

                        //FileRequest lastDocument = currentScheda.documenti[0];

                        // Verifica se è stato acquisito un file
                        if (this.IsAcquired(lastDocument))
                        {
                            // Reperimento oggetto "FileDocumento" contenente
                            // il nome originale del file, indipendentemente
                            // dal documentale utilizzato correntemente
                            FileManager            fileManager  = new FileManager();
                            DocsPaWR.FileDocumento fileDocument = fileManager.getInfoFile(this.Page, lastDocument);

                            string defaultFileName = fileDocument.name;

                            // In caso di file firmato, viene reperita l'estensione originaria del file
                            while (defaultFileName.ToLower().EndsWith(".p7m"))
                            {
                                defaultFileName = defaultFileName.Substring(0, defaultFileName.Length - 4);
                            }

                            FileInfo fileInfo = new FileInfo(defaultFileName);
                            retValue = fileInfo.Extension.Replace(".", "");
                        }
                    }

                    this.ViewState.Add("LastAcquiredDocumentExtension", retValue);
                }
                else
                {
                    retValue = this.ViewState["LastAcquiredDocumentExtension"].ToString();
                }
            }
            return(retValue);
        }
        /// <summary>
        /// Reperimento estensione del file da firmare
        /// </summary>
        /// <returns></returns>


        protected string GetSelectedConv()
        {
            StringBuilder sb = new StringBuilder();

            List <MassiveOperationTarget> selectedItems = this.GetSelectedDocuments();

            bool reqConPdf = !string.IsNullOrEmpty(Utils.InitConfigurationKeys.GetValue(UIManager.UserManager.GetInfoUser().idAmministrazione, DBKeys.FE_REQ_CONV_PDF.ToString())) && Utils.InitConfigurationKeys.GetValue(UIManager.UserManager.GetInfoUser().idAmministrazione, DBKeys.FE_REQ_CONV_PDF.ToString()).Equals("1");

            if (reqConPdf)
            {
                this.FileTypes = UIManager.FileManager.GetSupportedFileTypes(Int32.Parse(UIManager.UserManager.GetInfoUser().idAmministrazione));
            }

            bool conv = false;

            foreach (MassiveOperationTarget temp in selectedItems)
            {
                if (sb.Length > 0)
                {
                    sb.Append("|");
                }

                if (reqConPdf)
                {
                    string          id  = temp.Id.Replace("C", "").Replace("P", "");
                    SchedaDocumento doc = DocumentManager.getDocumentDetails(this.Page, id, id);

                    bool isPdf = (FileManager.getEstensioneIntoSignedFile(doc.documenti[0].fileName).ToUpper() == "PDF");

                    if (!isPdf)
                    {
                        conv = true;

                        if (UIManager.FileManager.IsEnabledSupportedFileTypes())
                        {
                            bool retVal = true;

                            int count = this.FileTypes.Count(e => e.FileExtension.ToLowerInvariant() == FileManager.getEstensioneIntoSignedFile(doc.documenti[0].fileName).ToLowerInvariant() &&
                                                             e.FileTypeUsed && e.FileTypeSignature);
                            retVal = (count > 0);

                            conv = !retVal;

                            sb.Append(conv.ToString());
                        }
                    }
                    else
                    {
                        sb.Append("False");
                    }
                }
                else
                {
                    sb.Append("True");
                }
            }

            return(sb.ToString());
        }
Exemple #27
0
        public void BindGrid()
        {
            if (Request.QueryString["tipoObj"].Equals("D"))
            {
                SchedaDocumento doc = UIManager.DocumentManager.getSelectedRecord();
                if (doc == null)
                {
                    //return;
                }

                this.HistoryList = DocumentManager.GetVisibilityHistory(doc.systemId, Request.QueryString["tipoObj"], UserManager.GetInfoUser());
            }

            if (Request.QueryString["tipoObj"].Equals("F"))
            {
                Fascicolo fascicolo = UIManager.ProjectManager.getProjectInSession();

                if (fascicolo == null)
                {
                    //return;
                }

                this.HistoryList = DocumentManager.GetVisibilityHistory(fascicolo.systemID, Request.QueryString["tipoObj"], UserManager.GetInfoUser());
            }

            if (this.HistoryList == null || this.HistoryList.Length == 0)
            {
                this.LblHistory.Visible  = true;
                this.GridHistory.Visible = false;
                //return;
            }
            else
            {
                this.GridHistory.Visible = true;
                //Bind list to grid
                List <StoriaDirittoDocumento> list = new List <StoriaDirittoDocumento>();
                list.AddRange(this.HistoryList);
                this.GridHistory.Visible    = true;
                this.GridHistory.DataSource = list;
                this.GridHistory.DataBind();

                //Dt_elem = new ArrayList();
                //for (int i = 0; i < ListHistory.Length; i++)
                //    Dt_elem.Add(new Cols(ListHistory[i].utente, ListHistory[i].ruolo, ListHistory[i].data.Substring(0, 10), ListHistory[i].codOperazione, ListHistory[i].descrizione));

                //if (ListHistory.Length > 0)
                //{
                //    //DocumentManager.setDataGridAllegati(this,Dt_elem);
                //    this.DGStoria.DataSource = Dt_elem;
                //    this.DGStoria.DataBind();
                //    this.LblDettagli.Visible = false;
                //}
                //else
                //{
                //    this.LblDettagli.Visible = true;
                //}
                //this.DGStoria.Visible = true;
            }
        }
        private void MoveDocument(string docsId, string oldParentId, string parentId)
        {
            try {
                string   messaggio = string.Empty;
                string[] docId     = new string[1] {
                    docsId
                };
                if (docsId.IndexOf(",") > 0)
                {
                    docId = docsId.Split(',');
                }
                InfoUtente infoUtente = UserManager.GetInfoUser();

                DocsPaWR.Folder fromFolder = ProjectManager.getFolder(this, oldParentId);
                fromFolder = ProjectManager.getFolder(this, fromFolder);

                DocsPaWR.Folder toFolder = ProjectManager.getFolder(this, parentId);
                toFolder = ProjectManager.getFolder(this, toFolder);

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

                    if (doc.protocollo != null && doc.protocollo.protocolloAnnullato != null)
                    {
                        // alert documento annullato
                        this.html_data.Text += "<" + "script type=\"text/javascript\">ajaxDialogModal('AlertProjectMoveDocNoAllowedProtCanceled', 'warning', '');<" + "/script>\n";
                    }
                    //else if (Convert.ToInt32(doc.accessRights) < Convert.ToInt32(HMdiritti.HMdiritti_Write))
                    //{
                    //    // alert no diritti in scrittura
                    //    this.html_data.Text += "<" + "script type=\"text/javascript\">ajaxDialogModal('AlertProjectMoveDocNoAllowedNoWrite', 'warning', '');<" + "/script>\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 += "<" + "script type=\"text/javascript\">ajaxDialogModal('AlertProjectRemoveDoc', 'error', '');<" + "/script>\n";
                        }
                        else
                        if (!string.IsNullOrEmpty(messaggio))
                        {
                            this.html_data.Text += "<" + "script type=\"text/javascript\">ajaxDialogModal('ErrorProjectRemoveDoc', 'error', '');<" + "/script>\n";
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
Exemple #29
0
        /// <summary>
        /// Visualizzazione pagina visibilità documento
        /// </summary>
        private void ShowVisibilitaDocumento()
        {
            SchedaDocumento schedaDocumento = this.GetSchedaDocumento();

            string redirectUrl = EnvironmentContext.RootPath + "Documenti/VisibilitaDocumento.aspx?iddoc=" + schedaDocumento.systemId + "&docnum=" + schedaDocumento.docNumber;

            Response.Redirect(redirectUrl);
        }
Exemple #30
0
        /// <summary>
        /// Inizializzazione controllo
        /// </summary>
        /// <param name="schedaDocumento"></param>
        /// <param name="readOnlyMode"></param>
        public virtual void Initialize(SchedaDocumento schedaDocumento, bool readOnlyMode)
        {
            this._schedaDocumento = schedaDocumento;

            this.SetReadOnlyMode(readOnlyMode);

            this._initialized = true;
        }