Пример #1
0
        /// </summary>
        /// <remarks>
        /// Qualora sia attivata la gestione degli allegati profilati, la scheda documento sarà relativa
        /// all'allegato correntemente selezionato da tab allegati
        /// </remarks>
        public static void RefreshCheckOutStatus()
        {
            DocsPaWR.SchedaDocumento schedaDocumento = null;
            DocsPaWR.FileRequest     fileRequest     = FileManager.getSelectedFile();
            if (fileRequest != null)
            {
                if (fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    // Tab "allegati" correntemente selezionato,
                    // reperimento dello stato checkout dell'allegato selezionato.
                    // Solo se attiva la profilazione allegati.
                    if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                    {
                        schedaDocumento = DocumentManager.getDocumentDetails(null, fileRequest.docNumber, fileRequest.docNumber);
                    }
                }
                else
                {
                    schedaDocumento = DocumentManager.getSelectedRecord();
                }

                if (schedaDocumento != null)
                {
                    //Inizializzazione del contesto di checkout del documento
                    CheckInOut.CheckOutContext.Current = new CheckInOut.CheckOutContext(schedaDocumento);
                }
                else
                {
                    CheckInOut.CheckOutContext.Current = null;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Reperimento delle informazioni di stato checkout del documento
        /// </summary>
        /// <returns></returns>
        public static CheckOutStatus GetCheckOutDocumentStatus()
        {
            DocsPaWR.SchedaDocumento schedaDocumento = null;

            if (IsEnabledProfilazioneAllegati && IsSelectedTabAllegati())
            {
                // Tab "allegati" correntemente selezionato,
                // reperimento dello stato checkout dell'allegato selezionato
                DocsPaWR.FileRequest fileRequest = (UIManager.DocumentManager.getSelectedAttachId() != null) ?
                                                   UIManager.FileManager.GetFileRequest(UIManager.DocumentManager.getSelectedAttachId()) :
                                                   UIManager.FileManager.GetFileRequest();

                if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    schedaDocumento = System.Web.HttpContext.Current.Session["schedaAllegatoSelezionato"] as DocsPaWR.SchedaDocumento;
                }
            }
            else
            {
                // Qualsiasi altro tab differente dal tab "allegati",
                // reperimento dello stato checkout del documento principale
                schedaDocumento = CheckInOutServices.CurrentSchedaDocumento;
            }

            if (schedaDocumento != null)
            {
                return(schedaDocumento.checkOutStatus);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        /// <summary>
        /// Reperimento delle informazioni di stato checkout del documento
        /// </summary>
        /// <returns></returns>
        public static CheckOutStatus GetCheckOutDocumentStatus()
        {
            DocsPaWR.SchedaDocumento schedaDocumento = null;

            if (IsEnabledProfilazioneAllegati && IsSelectedTabAllegati())
            {
                // Tab "allegati" correntemente selezionato,
                // reperimento dello stato checkout dell'allegato selezionato
                DocsPaWR.FileRequest fileRequest = FileManager.getSelectedFile();

                if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    SiteNavigation.CallContext context = SiteNavigation.CallContextStack.CurrentContext;

                    schedaDocumento = context.ContextState["schedaAllegatoSelezionato"] as DocsPaWR.SchedaDocumento;
                }
            }
            else
            {
                // Qualsiasi altro tab differente dal tab "allegati",
                // reperimento dello stato checkout del documento principale
                schedaDocumento = CheckInOutServices.CurrentSchedaDocumento;
            }

            if (schedaDocumento != null)
            {
                return(schedaDocumento.checkOutStatus);
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
        /// <summary>
        /// Reperimento dell'url dell'immagine per la versione
        /// </summary>
        /// <param name="fileRequest"></param>
        /// <returns></returns>
        protected string GetVersionImage(DocsPaWR.FileRequest fileRequest)
        {
            bool isAcquired = this.IsAcquired(fileRequest);

            if (fileRequest.GetType() == typeof(DocsPaWR.Allegato))
            {
                if (DocumentManager.AllegatoIsPEC(fileRequest.versionId).Equals("1"))
                {
                    return("../images/allegato_pec.jpg");
                }
                else if (DocumentManager.AllegatoIsIS(fileRequest.versionId).Equals("1"))
                {
                    return("~/images/ico_allegato_PI3.jpg");
                }
                else if (DocumentManager.AllegatoIsEsterno(fileRequest.versionId).Equals("1"))
                {
                    return("~/images/allegato_esterno.jpg");
                }
                else
                {
                    if (isAcquired)
                    {
                        return("../images/ico_allegato_enable.gif");
                    }
                    else
                    {
                        return("../images/ico_allegato_disabled.gif");
                    }
                }
            }
            else
            {
                return("../images/ico_doc_enable.gif");
            }
        }
Пример #5
0
        /// <summary>
        /// Reperimento del tooltip della versione
        /// </summary>
        /// <param name="fileRequest"></param>
        /// <returns></returns>
        protected string GetLabelTooltip(DocsPaWR.FileRequest fileRequest)
        {
            string tooltip = string.Empty;

            if (fileRequest.GetType() == typeof(DocsPaWR.Allegato))
            {
                tooltip = fileRequest.descrizione;
            }
            else
            {
                tooltip = this.CurrentSchedaDocumento.oggetto.descrizione;
            }

            if (tooltip != null)
            {
                if (tooltip.Length > 128)
                {
                    return(tooltip.Substring(0, 125) + "...");
                }
                else
                {
                    return(tooltip.ToString());
                }
            }
            else
            {
                return(string.Empty);
            }
        }
Пример #6
0
        /// <summary>

        /// <summary>
        /// Aggiornamento dello statto di checkout della scheda documento correntemente visualizzata

        /// </summary>
        /// <remarks>
        /// Qualora sia attivata la gestione degli allegati profilati, la scheda documento sarà relativa
        /// all'allegato correntemente selezionato da tab allegati
        /// </remarks>
        public static void RefreshCheckOutStatus()
        {
            NttDataWA.DocsPaWR.SchedaDocumento schedaDocumento = null;

            //if (IsEnabledProfilazioneAllegati && IsSelectedTabAllegati())
            if (IsSelectedTabAllegati())
            {
                // Tab "allegati" correntemente selezionato,
                // reperimento dello stato checkout dell'allegato selezionato.
                // Solo se attiva la profilazione allegati.
                DocsPaWR.FileRequest fileRequest = (UIManager.DocumentManager.getSelectedAttachId() != null) ?
                                                   UIManager.FileManager.GetFileRequest(UIManager.DocumentManager.getSelectedAttachId()) :
                                                   UIManager.FileManager.GetFileRequest();

                if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    schedaDocumento = System.Web.HttpContext.Current.Session["schedaAllegatoSelezionato"] as DocsPaWR.SchedaDocumento;

                    if (schedaDocumento != null)
                    {
                        schedaDocumento = _webServices.DocumentoGetDettaglioDocumento(GetInfoUtente(), schedaDocumento.systemId, schedaDocumento.docNumber);

                        System.Web.HttpContext.Current.Session["schedaAllegatoSelezionato"] = schedaDocumento;
                    }
                }
            }
            else
            {
                schedaDocumento = UIManager.DocumentManager.getSelectedRecord();

                if (schedaDocumento != null)
                {
                    // Reperimento scheda documento per l'allegato
                    schedaDocumento = _webServices.DocumentoGetDettaglioDocumento(GetInfoUtente(), schedaDocumento.systemId, schedaDocumento.docNumber);

                    UIManager.DocumentManager.setSelectedRecord(schedaDocumento);
                }
            }

            if (schedaDocumento != null)
            {
                //Inizializzazione del contesto di checkout del documento
                NttDataWA.CheckInOut.CheckOutContext.Current = new NttDataWA.CheckInOut.CheckOutContext(schedaDocumento);
            }
            else
            {
                NttDataWA.CheckInOut.CheckOutContext.Current = null;
            }
        }
Пример #7
0
        /// <summary>
        /// Aggiornamento dello statto di checkout della scheda documento correntemente visualizzata

        /// </summary>
        /// <remarks>
        /// Qualora sia attivata la gestione degli allegati profilati, la scheda documento sarà relativa
        /// all'allegato correntemente selezionato da tab allegati
        /// </remarks>
        public static void RefreshCheckOutStatus()
        {
            SAAdminTool.DocsPaWR.SchedaDocumento schedaDocumento = null;

            //if (IsEnabledProfilazioneAllegati && IsSelectedTabAllegati())
            if (IsSelectedTabAllegati())
            {
                // Tab "allegati" correntemente selezionato,
                // reperimento dello stato checkout dell'allegato selezionato.
                // Solo se attiva la profilazione allegati.
                DocsPaWR.FileRequest fileRequest = FileManager.getSelectedFile();

                if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    SiteNavigation.CallContext context = SiteNavigation.CallContextStack.CurrentContext;

                    schedaDocumento = context.ContextState["schedaAllegatoSelezionato"] as DocsPaWR.SchedaDocumento;

                    if (schedaDocumento != null)
                    {
                        schedaDocumento = _webServices.DocumentoGetDettaglioDocumento(GetInfoUtente(), schedaDocumento.systemId, schedaDocumento.docNumber);

                        context.ContextState["schedaAllegatoSelezionato"] = schedaDocumento;
                    }
                }
            }
            else
            {
                schedaDocumento = DocumentManager.getDocumentoSelezionato();

                // Reperimento scheda documento per l'allegato
                schedaDocumento = _webServices.DocumentoGetDettaglioDocumento(GetInfoUtente(), schedaDocumento.systemId, schedaDocumento.docNumber);

                DocumentManager.setDocumentoSelezionato(schedaDocumento);
            }

            if (schedaDocumento != null)
            {
                //Inizializzazione del contesto di checkout del documento
                SAAdminTool.CheckInOut.CheckOutContext.Current = new SAAdminTool.CheckInOut.CheckOutContext(schedaDocumento);
            }
            else
            {
                SAAdminTool.CheckInOut.CheckOutContext.Current = null;
            }
        }
Пример #8
0
 /// <summary>
 /// Reperimento della descrizione della versione
 /// </summary>
 /// <param name="fileRequest"></param>
 /// <returns></returns>
 protected string GetLabel(DocsPaWR.FileRequest fileRequest)
 {
     if (fileRequest.GetType() == typeof(DocsPaWR.Allegato))
     {
         return(fileRequest.versionLabel);
     }
     else
     {
         if (Request.QueryString["save"] != null && Request.QueryString["save"].Equals("true"))
         {
             int newId = Convert.ToInt32(fileRequest.version) + 1;
             return(string.Format("V.{0}", newId));
         }
         else
         {
             return(string.Format("V.{0}", fileRequest.version.ToString()));
         }
     }
 }
Пример #9
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            try
            {
                Utils.startUp(this);
                this.ErrorPage = "";
                this.Button1.Attributes.Add("onclick", "window.close();");

                bool useHash = false;

                string signType = this.Request.QueryString["signType"];
                if (!String.IsNullOrEmpty(signType))
                {
                    if (signType == "P" || signType == "C")
                    {
                        useHash = true;
                    }
                }

                bool   coSign    = false;
                string cosignStr = this.Request.QueryString["tipoFirma"];
                if (!String.IsNullOrEmpty(cosignStr))
                {
                    if (cosignStr.ToLower().Equals("cosign"))
                    {
                        coSign = true;
                    }
                }

                if (Request.QueryString["tipofirma"] != null)
                {
                    if (!Request.QueryString["tipofirma"].Equals(""))
                    {
                        tipofirma = Request.QueryString["tipofirma"];
                    }
                }
                if (tipofirma.Equals("cosign"))
                {
                    firmabool = true;
                }
                else
                {
                    firmabool = false;
                }
                byte[] ba = Request.BinaryRead(Request.ContentLength);
                DocsPaWR.DocsPaWebService DocsPaWS = ProxyManager.getWS();
                DocsPaWR.FileDocumento    fd       = new DocsPAWA.DocsPaWR.FileDocumento();
                //fd.content=ba;

                ASCIIEncoding ae            = new ASCIIEncoding();
                string        base64content = ae.GetString(ba);

                if (UserManager.getBoolDocSalva(this) == null)
                {
                    if (!IsPostBack)
                    {
                        //	string prova=base64content.Replace(base64content.Substring(4,2),"Ds");
                        DocsPaWR.FileRequest fr = FileManager.getSelectedFile(this);

                        if (!string.IsNullOrEmpty(Request.QueryString["signedAsPdf"]))
                        {
                            // Se il file è in formato pdf, viene modificato il nome del file
                            bool signedAsPdf;
                            bool.TryParse(Request.QueryString["signedAsPdf"], out signedAsPdf);
                            if (signedAsPdf)
                            {
                                fr.fileName += ".pdf";
                            }
                        }

                        fr.dataInserimento = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");

                        if (fr.GetType().Equals(typeof(DocsPAWA.DocsPaWR.Allegato)))
                        {
                            // Creazione di un nuovo allegato per il file firmato
                            DocsPaWR.Allegato currentAllegato = (DocsPAWA.DocsPaWR.Allegato)fr;

                            DocsPaWR.Allegato newAllegato = new DocsPAWA.DocsPaWR.Allegato();
                            newAllegato.descrizione       = currentAllegato.descrizione;
                            newAllegato.numeroPagine      = currentAllegato.numeroPagine;
                            newAllegato.fileName          = fr.fileName;
                            newAllegato.firmatari         = currentAllegato.firmatari;
                            newAllegato.docNumber         = currentAllegato.docNumber;
                            newAllegato.version           = "0";
                            newAllegato.repositoryContext = DocumentManager.getDocumentoInLavorazione().repositoryContext;

                            fr = newAllegato;
                        }

                        bool retValue = false;
                        if (!useHash)
                        {
                            retValue = DocsPaWS.AppendDocumentoFirmato(base64content, firmabool, ref fr, UserManager.getInfoUtente(this));
                        }
                        else
                        {
                            bool pades = (signType == "P");
                            DocsPaWR.MassSignature msReq = new DocsPaWR.MassSignature {
                                fileRequest = fr, base64Signature = base64content, signPades = pades, cosign = coSign
                            };
                            DocsPaWR.MassSignature msRet = DocsPaWS.signDocument(msReq, UserManager.getInfoUtente(this));
                            retValue = msRet.result;
                        }

                        if (!retValue)
                        {
                            logger.Error("Errore nel Page_Load (docs = NULL)");
                            throw new Exception();
                        }

                        FileManager.setSelectedFile(this, fr);
                        DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getDocumentoSelezionato(this);

                        if (fr.GetType().Equals(typeof(DocsPAWA.DocsPaWR.Allegato)))
                        {
                            schedaDocumento.allegati = DocumentManager.addAllegato(schedaDocumento.allegati, (DocsPAWA.DocsPaWR.Allegato)fr);
                        }
                        else
                        {
                            schedaDocumento.documenti = DocumentManager.addVersione(schedaDocumento.documenti, (DocsPAWA.DocsPaWR.Documento)fr);
                        }

                        DocumentManager.setDocumentoSelezionato(this, schedaDocumento);
                        UserManager.setBoolDocSalva(this, "salvato");
                    }
                }
            }
            catch (Exception es)
            {
                ErrorManager.setError(this, es);
            }
        }