Ejemplo n.º 1
0
        /// <summary>
        /// Creazione di un nuovo oggetto SchedaDocumento
        /// </summary>
        /// <returns></returns>
        public void CreaNuovoDocumento(string tipoProto)
        {
            SAAdminTool.DocsPaWR.SchedaDocumento retValue = new SAAdminTool.DocsPaWR.SchedaDocumento();

            retValue.predisponiProtocollazione = true;

            // Tipologia protocollo in "Arrivo"
            //retValue.tipoProto="A"; // OLD

            ProtocollazioneIngresso.Login.LoginMng loginMng = new ProtocollazioneIngresso.Login.LoginMng(this._page);

            SAAdminTool.DocsPaWR.Utente utente = loginMng.GetUtente();
            SAAdminTool.DocsPaWR.Ruolo  ruolo  = loginMng.GetRuolo();

            retValue.systemId = null;
            retValue.oggetto  = new SAAdminTool.DocsPaWR.Oggetto();

            // campi obbligatori per DocsFusion
            retValue.idPeople = utente.idPeople;
            retValue.userId   = utente.userId;


            retValue.typeId  = SAAdminTool.DocumentManager.getTypeId();
            retValue.appId   = "ACROBAT";
            retValue.privato = "0";              // doc non privato

            //this.SetDocumentoCorrente(retValue); // OLD
            if (tipoProto.Equals("A"))
            {
                setDatiProtocolloIngresso(retValue);
            }
            else
            {
                if (tipoProto.Equals("P"))
                {
                    setDatiProtocolloUscita(retValue);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Setta le proprietà del protocollo in ingresso e mette la SchedaDocumento in sessione
 /// </summary>
 /// <param name="schedaDoc"></param>
 public void setDatiProtocolloIngresso(SAAdminTool.DocsPaWR.SchedaDocumento schedaDoc)
 {
     // Tipologia protocollo in "Arrivo"
     schedaDoc.tipoProto = "A";
     this.SetDocumentoCorrente(schedaDoc);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Setta le proprietà del protocollo in uscita e mette la SchedaDocumento in sessione
 /// </summary>
 /// <param name="schedaDoc"></param>
 public void setDatiProtocolloUscita(SAAdminTool.DocsPaWR.SchedaDocumento schedaDoc)
 {
     // Tipologia protocollo in "Uscita"
     schedaDoc.tipoProto = "P";
     this.SetDocumentoCorrente(schedaDoc);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Impostazione del protocollo corrente
 /// </summary>
 /// <param name="schedaDocumento"></param>
 private void SetDocumentoCorrente(SAAdminTool.DocsPaWR.SchedaDocumento schedaDocumento)
 {
     this._page.Session["ProtocollazioneIngresso.ProtocolloCorrente"] = schedaDocumento;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Protocollazione del documento corrente
        /// </summary>
        /// <returns></returns>
        public bool ProtocollaDocumentoCorrente(out string errorMessage)
        {
            bool retValue = false;

            errorMessage = string.Empty;

            SAAdminTool.DocsPaWR.SchedaDocumento documentoCorrente = GetDocumentoCorrente();

            SAAdminTool.DocsPaWR.ResultProtocollazione esitoProtocollazione;
            documentoCorrente = SAAdminTool.DocumentManager.protocolla(this._page, documentoCorrente, out esitoProtocollazione);

            switch (esitoProtocollazione)
            {
            case SAAdminTool.DocsPaWR.ResultProtocollazione.OK:
                // Impostazione in sessione del nuovo documento
                this.SetDocumentoCorrente(documentoCorrente);
                retValue = true;
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.AMMINISTRAZIONE_MANCANTE:
                errorMessage = "Identificativo dell'amministrazione non trovata.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.DESTINATARIO_MANCANTE:
                errorMessage = "Il destinatario è obbligatorio.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.MITTENTE_MANCANTE:
                errorMessage = "Il mittente è obbligatorio.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.OGGETTO_MANCANTE:
                errorMessage = "L'oggetto è obbligatorio.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.REGISTRO_MANCANTE:
                errorMessage = "Il registro è obbligatorio.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.REGISTRO_CHIUSO:
                errorMessage = "Il registro non è aperto.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.STATO_REGISTRO_ERRATO:
                errorMessage = "Lo stato del registro non è corretto.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.DATA_SUCCESSIVA_ATTUALE:
                errorMessage = "La data di protocollazione è successiva a quella attuale.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.DATA_ERRATA:
                errorMessage = "La data di protocollazione non è valida.";
                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.FORMATO_SEGNATURA_MANCANTE:
                errorMessage = "Formato della segnatura non impostato. Contattare l\\'Amministratore";

                break;

            case SAAdminTool.DocsPaWR.ResultProtocollazione.APPLICATION_ERROR:
                errorMessage = "In questo momento non è stato possibile protocollare il documento. Si prega di ripetere  l'operazione.";
                break;
            }

            try
            {
                // Scrittura log
                if (retValue)
                {
                    string numProtocollo = documentoCorrente.protocollo.numero.ToString();

                    ProtocollazioneIngressoLog.WriteLogEntry(
                        string.Format("Protocollazione (Esito: {0} - NumeroProtocollo: {1})",
                                      retValue.ToString(),
                                      numProtocollo));
                }
                else
                {
                    ProtocollazioneIngressoLog.WriteLogEntry(
                        string.Format("Protocollazione (Esito: {0} )", errorMessage));
                }
            }
            catch
            {
            }

            return(retValue);
        }
Ejemplo n.º 6
0
 private void CreateInfoDocumento(SAAdminTool.DocsPaWR.SchedaDocumento schedaDocumento)
 {
     this._infoDocumento = SAAdminTool.DocumentManager.getInfoDocumento(schedaDocumento);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Caricamento dei dati utilizzabili per la stampa dell'etichetta
        /// in un'insieme di campi testo nascosti
        /// </summary>
        /// <param name="schedaDocumento"></param>
        private void FillCampiEtichetta(SAAdminTool.DocsPaWR.SchedaDocumento schedaDocumento, string txt_num_stampe)
        {
            string abilita_multi_stampa_etichetta = SAAdminTool.utils.InitConfigurationKeys.GetValue("0", "FE_MULTI_STAMPA_ETICHETTA");

            #region parametro Dispositivo Di Stampa

            //if(ConfigSettings.getKey(ConfigSettings.KeysENUM.DISPOSITIVO_STAMPA)!=null)
            //{
            //    this.hd_dispositivo.Value=ConfigSettings.getKey(ConfigSettings.KeysENUM.DISPOSITIVO_STAMPA);
            //}
            //else
            //{
            //    this.hd_dispositivo.Value="Penna";
            //}

            //this.hd_modello_dispositivo.Value = ConfigSettings.getKey(ConfigSettings.KeysENUM.MODELLO_DISPOSITIVO_STAMPA);


            AmmUtils.WebServiceLink ws  = new AmmUtils.WebServiceLink();
            var dispositivoStampaUtente = ws.AmmGetDispositivoStampaUtente(UserManager.getInfoUtente().idPeople);
            if (dispositivoStampaUtente != null)
            {
                this.hd_dispositivo.Value         = "Etichette";
                this.hd_modello_dispositivo.Value = dispositivoStampaUtente.ToString();
            }
            else
            {
                this.hd_dispositivo.Value = "Penna";
            }
            #endregion parametro Dispositivo Di Stampa

            #region parametro Descrizione Amministrazione

            string descAmm = getDescAmministrazione(this.GetLoginManager().GetUtente().idAmministrazione);

            #endregion parametro Descrizione Amministrazione

            #region parametro Classifica Primaria

            string classificaPrimaria = String.Empty;

            string classificazioneInEtichetta = System.Configuration.ConfigurationManager.AppSettings["StampaClassificazioneInEtichetta"];
            if (classificazioneInEtichetta != null)
            {
                switch (classificazioneInEtichetta)
                {
                case "1":                         // stampa il codice classifica In Etichetta
                    classificaPrimaria = getClassificaPrimaria();
                    break;

                default:
                    //massimo digregorio, non necessario se l'assegnazione avviene in dichiarazione. old: classificaPrimaria = String.Empty;
                    break;
                }
            }
            this.hd_classifica.Value = classificaPrimaria;

            #endregion parametro Classifica Primaria

            #region parametro Fascicolo primario

            string fascicoloInEtichetta = System.Configuration.ConfigurationManager.AppSettings["StampaFascicoloInEtichetta"];
            if (fascicoloInEtichetta != null)
            {
                switch (fascicoloInEtichetta)
                {
                case "1":                         // stampa il codice fascicolo In Etichetta
                    this.hd_fascicolo.Value = this.GetCodiceFascicolo();
                    break;

                default:
                    this.hd_fascicolo.Value = String.Empty;
                    break;
                }
            }

            #endregion parametro Fascicolo primario

            #region patch per cuneo

            string descAmministrInEtichetta = System.Configuration.ConfigurationManager.AppSettings["StampaDescrizioneAmministrazioneInEtichetta"];
            if (descAmministrInEtichetta != null)
            {
                switch (descAmministrInEtichetta)
                {
                case "1":                         // Stampa Descrizione Amministrazione In Etichetta
                    this.hd_amministrazioneEtichetta.Value = descAmm;
                    break;

                default:
                    this.hd_amministrazioneEtichetta.Value = String.Empty;
                    break;
                }
            }

            //aggiuto tag Hidden "hd_desAmministrazione" per ActiveX di stampa

            /* se parametro esiste ed a 0, a hd_desAmministrazione viene assegnata la classifica
             * se parametro non esiste o esiste <> 0, a hd_desAmministrazione viene assegnata la descrizione dell'amministrazione
             */
            bool BarCodeConAmministrazione = true;
            SAAdminTool.DocsPaWR.Configurazione visualizzaClassificaSopraBarCode = UserManager.getParametroConfigurazione(this.Page);

            if (visualizzaClassificaSopraBarCode != null)
            {
                if (visualizzaClassificaSopraBarCode.valore.Equals("0"))
                {
                    BarCodeConAmministrazione = false;
                }
            }

            if (BarCodeConAmministrazione)
            {
                this.hd_descrizioneAmministrazione.Value = descAmm;
            }
            else
            {
                this.hd_descrizioneAmministrazione.Value = classificaPrimaria;
            }

            #endregion patch per cuneo

            #region parametro URL File di configurazione Dispositivo di Stampa

            this.hd_UrlIniFileDispositivo.Value = ConfigSettings.getKey(ConfigSettings.KeysENUM.URL_INIFILE_DISPOSITIVO_STAMPA);

            #endregion parametro URL File di configurazione Dispositivo di Stampa

            #region parametri scheda Documento

            this.hd_signature.Value        = schedaDocumento.protocollo.segnatura;
            this.hd_num_doc.Value          = schedaDocumento.docNumber;
            this.hd_dataCreazione.Value    = schedaDocumento.dataCreazione;
            this.hd_codiceUoCreatore.Value = schedaDocumento.creatoreDocumento.uo_codiceCorrGlobali;

            //CAMBIA l'ETICHETTA PER LA STAMPA A SECONDA DEL VALORE SETTATO IN AMMINISTRAZIONE
            SAAdminTool.DocsPaWR.InfoUtente       infoUser = new SAAdminTool.DocsPaWR.InfoUtente();
            SAAdminTool.DocsPaWR.Utente           utente   = SAAdminTool.UserManager.getUtente();
            SAAdminTool.DocsPaWR.DocsPaWebService wws      = new SAAdminTool.DocsPaWR.DocsPaWebService();
            SAAdminTool.DocsPaWR.EtichettaInfo[]  eti      = wws.getEtichetteDocumenti(infoUser, utente.idAmministrazione);

            if (schedaDocumento.tipoProto.Equals("A"))
            {
                this.hd_tipo_proto.Value = eti[0].Descrizione;
            }
            else
            {
                if (schedaDocumento.tipoProto.Equals("P"))
                {
                    this.hd_tipo_proto.Value = this.hd_tipo_proto.Value = eti[1].Descrizione;
                }
                else
                {
                    this.hd_tipo_proto.Value = this.hd_tipo_proto.Value = eti[2].Descrizione;
                }
            }
            //this.hd_tipo_proto.Value = schedaDocumento.tipoProto;

            this.hd_coduo_proto.Value = String.Empty;            //è gestito sul db e sull'oggetto ruolo utente attuale, ma non nell'oggetto schedaDocumento;

            if (schedaDocumento.registro != null)
            {
                this.hd_codreg_proto.Value  = schedaDocumento.registro.codRegistro;
                this.hd_descreg_proto.Value = schedaDocumento.registro.descrizione;
            }

            if (schedaDocumento.protocollo != null)
            {
                //Celeste
                //this.hd_num_proto.Value = schedaDocumento.protocollo.numero;
                this.hd_num_proto.Value = Utils.formatProtocollo(schedaDocumento.protocollo.numero);
                //Fine Celeste
                this.hd_anno_proto.Value = schedaDocumento.protocollo.anno;

                if (abilita_multi_stampa_etichetta.Equals("1"))
                {
                    this.hd_data_proto.Value = Utils.dateLength(schedaDocumento.protocollo.dataProtocollazione);
                }
                else if (schedaDocumento.oraCreazione != null && schedaDocumento.oraCreazione != "")
                {
                    this.hd_data_proto.Value = Utils.dateLength(schedaDocumento.protocollo.dataProtocollazione) + " " + Utils.timeLength(schedaDocumento.oraCreazione);
                }
                else
                {
                    this.hd_data_proto.Value = Utils.dateLength(schedaDocumento.protocollo.dataProtocollazione);
                }

                //massimo digregorio new:
                if (schedaDocumento.protocollatore != null)
                {
                    this.hd_coduo_proto.Value = schedaDocumento.protocollatore.uo_codiceCorrGlobali;
                }
            }

            if (!string.IsNullOrEmpty(schedaDocumento.oraCreazione))
            {
                this.hd_ora_creazione.Value = Utils.timeLength(schedaDocumento.oraCreazione);
                this.hd_ora_creazione.Value = this.hd_ora_creazione.Value.Substring(0, 5);
            }
            #endregion parametri scheda Documento

            #region stampa multipla etichetta
            //preparo gli attributi per il numero di stampe effettuate finora e da effettuare ora
            if (abilita_multi_stampa_etichetta.Equals("1"))
            {
                if (!string.IsNullOrEmpty(txt_num_stampe))
                {
                    this.hd_num_stampe.Value = txt_num_stampe;
                }
                else
                {
                    this.hd_num_stampe.Value = "1";
                }
                // recupero il valore di stampa corrente da inserire nella  successiva etichetta da stampare
                int num_stampe_eff;
                if (!String.IsNullOrEmpty(schedaDocumento.protocollo.stampeEffettuate))
                {
                    num_stampe_eff = Convert.ToInt32(schedaDocumento.protocollo.stampeEffettuate) + 1;
                    this.hd_num_stampe_effettuate.Value = num_stampe_eff.ToString();
                }
                else
                {
                    this.hd_num_stampe_effettuate.Value = "1";
                }
            }
            else
            {
                this.hd_num_stampe.Value            = "1";
                this.hd_num_stampe_effettuate.Value = "1";
            }
            #endregion stampa multipla etichetta

            #region parametri Allegati (a partire dalla versione 3.5.0)

            this.hd_numeroAllegati.Value = schedaDocumento.allegati.Length.ToString();

            #endregion
        }
Ejemplo n.º 8
0
        protected void btn_adl_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (btn_adl.CommandName.Equals("inserisciAdl"))
                {
                    SAAdminTool.DocsPaWR.SchedaDocumento schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, this.DOC_NUMBER);

                    //se ho attiva la nuova ADL devo invertire la funzionalità
                    if (Request.QueryString["ricADL"] != string.Empty && Request.QueryString["ricADL"] != null)
                    {
                        DocumentManager.eliminaDaAreaLavoro(Page, schedaSel.systemId, null);
                        //riavvio la ricerca
                        string fromPage = Request.QueryString["from"].ToString();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "LanciaRic", "top.principale.document.location = 'gestioneRicDoc.aspx?tab=" + fromPage + "&ricADL=1&from=" + fromPage + "';", true);
                    }
                    else //normale comportamento
                    {
                        DocumentManager.addAreaLavoro(Page, schedaSel);

                        this.IN_ADL = "1";

                        if (Session["listInArea"] != null)
                        {
                            SAAdminTool.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                            System.Collections.Hashtable       listInArea = (Hashtable)Session["listInArea"];
                            if (listInArea != null && listInArea.ContainsKey(this.DOC_NUMBER) == false)
                            {
                                listInArea.Add(this.DOC_NUMBER, infoDoc);
                            }

                            Session["listInArea"] = listInArea;
                        }
                        else
                        {
                            SAAdminTool.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                            System.Collections.Hashtable       listInArea = new Hashtable();
                            listInArea.Add(infoDoc.numProt + infoDoc.dataApertura, infoDoc);
                            Session["listInArea"] = listInArea;
                        }
                    }
                }//se elimino dall'area di lavoro
                else
                {
                    SAAdminTool.DocsPaWR.SchedaDocumento schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, this.DOC_NUMBER);
                    DocumentManager.eliminaDaAreaLavoro(Page, schedaSel.systemId, null);

                    //se ho attiva la nuova ADL devo invertire la funzionalità
                    if (Request.QueryString["ricADL"] != string.Empty && Request.QueryString["ricADL"] != null)
                    {
                        //string fromPage = Request.QueryString["from"].ToString();
                        SiteNavigation.CallContext currentContext = SiteNavigation.CallContextStack.CurrentContext;
                        string fromPage = (string)currentContext.QueryStringParameters["from"];
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "LanciaRic", "top.principale.document.location = 'gestioneRicDoc.aspx?tab=" + fromPage + "&ricADL=1&from=" + fromPage + "';", true);
                    }
                    this.IN_ADL = "0";
                    if (Session["listInArea"] != null)
                    {
                        SAAdminTool.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                        System.Collections.Hashtable       listInArea = (Hashtable)Session["listInArea"];
                        if (listInArea.ContainsKey(this.DOC_NUMBER) == false)
                        {
                            listInArea.Add(this.DOC_NUMBER, infoDoc);
                        }

                        Session["listInArea"] = listInArea;
                    }
                    else
                    {
                        SAAdminTool.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                        System.Collections.Hashtable       listInArea = new Hashtable();
                        listInArea.Add(infoDoc.numProt + infoDoc.dataApertura, infoDoc);
                        Session["listInArea"] = listInArea;
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager.redirectToErrorPage(Page, ex);
            }
        }
Ejemplo n.º 9
0
        protected void btn_conservazione_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (btn_conservazione.CommandName.Equals("AreaConservazione"))
                {
                    SAAdminTool.DocsPaWR.SchedaDocumento schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, this.DOC_NUMBER);

                    if (Convert.ToInt32(schedaSel.documenti[0].fileSize) > 0)
                    {
                        int isPrimaIstanza = DocumentManager.isPrimaConservazione(Page, UserManager.getInfoUtente(Page).idPeople, UserManager.getInfoUtente(Page).idGruppo);
                        if (isPrimaIstanza == 1)
                        {
                            string popup = "<script> alert('Si sta per creare una nuova istanza di conservazione')</script>";
                            Page.RegisterClientScriptBlock("popUp", popup);
                        }
                        DocsPaWR.Fascicolo fasc  = FascicoliManager.getFascicoloSelezionato();
                        string             sysId = string.Empty;
                        //se sto inserendo un documento dall'interno di un fascicolo (da tabFascListaDoc.aspx)
                        if (fasc != null && this.PAGINA_CHIAMANTE == "NewDocListInProject")
                        {
                            sysId = DocumentManager.addAreaConservazione(Page, this.ID_PROFILE, fasc.systemID, this.DOC_NUMBER, UserManager.getInfoUtente(Page), "D");
                        }
                        else
                        {
                            sysId = DocumentManager.addAreaConservazione(Page, this.ID_PROFILE, "", this.DOC_NUMBER, UserManager.getInfoUtente(Page), "D");
                        }

                        if (sysId != "-1")
                        {
                            int size_xml = DocumentManager.getItemSize(Page, schedaSel, sysId);
                            int doc_size = Convert.ToInt32(schedaSel.documenti[0].fileSize);

                            int    numeroAllegati = schedaSel.allegati.Length;
                            string fileName       = schedaSel.documenti[0].fileName;
                            string tipoFile       = System.IO.Path.GetExtension(fileName);

                            int size_allegati = 0;
                            for (int i = 0; i < schedaSel.allegati.Length; i++)
                            {
                                size_allegati = size_allegati + Convert.ToInt32(schedaSel.allegati[i].fileSize);
                            }
                            int total_size = size_allegati + doc_size + size_xml;

                            DocumentManager.insertSizeInItemCons(Page, sysId, total_size);

                            DocumentManager.updateItemsConservazione(Page, tipoFile, Convert.ToString(numeroAllegati), sysId);


                            this.IN_CONSERVAZIONE = "1";
                        }
                    }
                    else
                    {
                        string popup = "<script> alert('Il documento principale non ha alcun file associato, impossibile inserirlo in area conservazione')</script>";
                        Page.RegisterClientScriptBlock("popUp", popup);
                    }
                }//se elimino dall'area di conservazione
                else
                {
                    SAAdminTool.DocsPaWR.SchedaDocumento schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, this.DOC_NUMBER);

                    if (DocumentManager.canDeleteAreaConservazione(Page, schedaSel.systemId, UserManager.getInfoUtente(Page).idPeople, UserManager.getInfoUtente(Page).idGruppo) == 0)
                    {
                        string popup = "<script> alert('Impossibile eliminare il documento da Area di conservazione')</script>";
                        Page.RegisterClientScriptBlock("alert", popup);
                    }
                    else
                    {
                        //DocsPaWR.Fascicolo fasc = FascicoliManager.getFascicoloSelezionato();
                        if (this.PAGINA_CHIAMANTE == "tabRisultatiRicDoc")
                        {
                            DocumentManager.eliminaDaAreaConservazione(Page, schedaSel.systemId, null, null, false, "");
                        }
                        else
                        {
                            DocsPaWR.Fascicolo fasc = FascicoliManager.getFascicoloSelezionato();
                            DocumentManager.eliminaDaAreaConservazione(Page, schedaSel.systemId, fasc, null, false, "");
                        }
                        this.IN_CONSERVAZIONE = "0";
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager.redirectToErrorPage(Page, ex);
            }
        }