Exemplo n.º 1
0
        public static string getValoreCampoDB(DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom, string docNumber)
        {
            string result = string.Empty;

            DocsPaDB.DBProvider dbProvider = new DocsPaDB.DBProvider();
            string commandText             = "select valore_oggetto_db " +
                                             "from dpa_associazione_templates " +
                                             "where " +
                                             "id_oggetto = " + oggettoCustom.SYSTEM_ID.ToString() +
                                             " and doc_number = " + docNumber;

            System.Diagnostics.Debug.WriteLine("SQL - getDataRegistrazioneDB - VerifyAndSetCDC DBManagerCDC.cs - QUERY : " + commandText);
            logger.Debug("SQL - getDataRegistrazioneDB - VerifyAndSetCDC DBManagerCDC.cs - QUERY : " + commandText);

            DataSet ds = new DataSet();

            dbProvider.ExecuteQuery(ds, commandText);

            if (ds.Tables[0].Rows.Count != 0)
            {
                result = ds.Tables[0].Rows[0]["VALORE_OGGETTO_DB"].ToString();
            }

            return(result);
        }
Exemplo n.º 2
0
        private bool IsStampaRepDaConservare(string idContatore)
        {
            bool result = true;

            try
            {
                DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getOggettoById(idContatore);
                if (ogg != null)
                {
                    if (!string.IsNullOrEmpty(ogg.CONS_REPERTORIO) && ogg.CONS_REPERTORIO == "1")
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Debug(ex.Message);
                result = true;
            }

            return(result);
        }
Exemplo n.º 3
0
        private bool popolaValoreTipologiaDropDown(DocsPaVO.ProfilazioneDinamica.Templates t, string nome, string valore)
        {
            if (String.IsNullOrEmpty(valore))
                return false;

            if (valore.Contains('-'))
                valore = valore.Replace('-', '_');

            DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg = trovaOggettoPerNome(t, nome);

            if (ogg == null)
                return false;

            DocsPaVO.ProfilazioneDinamica.ValoreOggetto valoDef = null;
            foreach (DocsPaVO.ProfilazioneDinamica.ValoreOggetto valo in ogg.ELENCO_VALORI)
            {
                if (valo.VALORE.ToLower().Equals(valore.ToLower()) &&
                    valo.ABILITATO == 1
                    )
                {
                    if (valo.VALORE_DI_DEFAULT == "SI")
                        valoDef = valo;
                    ogg.VALORE_DATABASE = valo.VALORE;
                    return true;
                }
            }
            //popolo il default
            ogg.VALORE_DATABASE = valoDef.VALORE;

            return false;
        }
Exemplo n.º 4
0
        private string GetCampiProfilati(string idPolicy, string idTemplate)
        {
            string result = string.Empty;

            if (!string.IsNullOrEmpty(idTemplate) && !idTemplate.Equals("0"))
            {
                DocsPaDB.Query_DocsPAWS.Conservazione   c        = new DocsPaDB.Query_DocsPAWS.Conservazione();
                DocsPaVO.ProfilazioneDinamica.Templates template = c.GetTemplateDocumento(idPolicy, idTemplate);

                for (int i = 0; i < template.ELENCO_OGGETTI.Count; i++)
                {
                    DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg = (DocsPaVO.ProfilazioneDinamica.OggettoCustom)template.ELENCO_OGGETTI[i];
                    if (!string.IsNullOrEmpty(ogg.VALORE_DATABASE) || ogg.TIPO.DESCRIZIONE_TIPO.Equals("CasellaDiSelezione"))
                    {
                        string valore = ogg.VALORE_DATABASE;
                        switch (ogg.TIPO.DESCRIZIONE_TIPO)
                        {
                        case "CasellaDiSelezione":
                            valore = string.Empty;
                            foreach (string v in ogg.VALORI_SELEZIONATI)
                            {
                                if (!string.IsNullOrEmpty(v))
                                {
                                    valore = valore + v + ",";
                                }
                            }
                            if (valore.EndsWith(","))
                            {
                                valore = valore.Remove(valore.Length - 1);
                            }
                            break;

                        case "Contatore":
                        case "Data":
                            valore = ogg.VALORE_DATABASE.Replace("@", "-");
                            break;

                        case "Corrispondente":
                            if (!string.IsNullOrEmpty(ogg.VALORE_DATABASE))
                            {
                                valore = BusinessLogic.Utenti.UserManager.getCorrispondenteBySystemID(ogg.VALORE_DATABASE).descrizione;
                            }
                            break;
                        }
                        if (!string.IsNullOrEmpty(result))
                        {
                            result = result + "; ";
                        }
                        if (!string.IsNullOrEmpty(valore))
                        {
                            result = result + ogg.DESCRIZIONE + "=" + valore;
                        }
                    }
                }
            }
            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="field"></param>
        /// <returns></returns>
        protected virtual Subscriber.Proxy.Property MapProperty(DocsPaVO.ProfilazioneDinamica.OggettoCustom field)
        {
            Subscriber.Proxy.Property p = null;

            if (field.TIPO.DESCRIZIONE_TIPO.ToUpperInvariant() == "CORRISPONDENTE")
            {
                // Id del corrispondente come campo nascosto
                p = new Subscriber.Proxy.Property
                {
                    Name = string.Format("ID:{0}", field.DESCRIZIONE),
                    Type = this.GetType(field),
                    IsTemplateProperty = true,
                    Hidden             = true,
                    Value = field.VALORE_DATABASE
                };

                // Reperimento dei metadati del corrispondente
                DocsPaVO.utente.Corrispondente corrispondente = BusinessLogic.Utenti.UserManager.getCorrispondenteBySystemID(field.VALORE_DATABASE);

                if (corrispondente != null)
                {
                    // Descrizione del corrispondente
                    p = new Subscriber.Proxy.Property
                    {
                        Name = field.DESCRIZIONE,
                        Type = this.GetType(field),
                        IsTemplateProperty = true,
                        Value = string.Format("{0} - {1}", corrispondente.codiceRubrica, corrispondente.descrizione)
                    };

                    // Mail del corrispondente
                    p = new Subscriber.Proxy.Property
                    {
                        Name = string.Format("MAIL:{0}", field.DESCRIZIONE),
                        Type = this.GetType(field),
                        IsTemplateProperty = true,
                        Hidden             = true,
                        //Value = "*****@*****.**"
                        Value = corrispondente.email
                    };
                }
            }
            else
            {
                p = new Subscriber.Proxy.Property
                {
                    Name = field.DESCRIZIONE,
                    Type = this.GetType(field),
                    IsTemplateProperty = true,
                    Value = field.VALORE_DATABASE
                };
            }

            return(p);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Reperimento oggetto custom
        /// </summary>
        /// <param name="oggettiCustom"></param>
        /// <param name="codiceOggetto"></param>
        /// <returns></returns>
        public static DocsPaVO.ProfilazioneDinamica.OggettoCustom GetOggettoCustom(List <DocsPaVO.ProfilazioneDinamica.OggettoCustom> oggettiCustom, string codiceOggetto)
        {
            DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom = (from c in oggettiCustom
                                                                         where c.DESCRIZIONE == codiceOggetto
                                                                         select c).FirstOrDefault <DocsPaVO.ProfilazioneDinamica.OggettoCustom>();

            if (oggettoCustom == null)
            {
                throw new ApplicationException(string.Format("Previsto campo {0} per la tipologia specificata", codiceOggetto));
            }

            return(oggettoCustom);
        }
Exemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="field"></param>
 /// <returns></returns>
 private Subscriber.Proxy.PropertyTypesEnum GetType(DocsPaVO.ProfilazioneDinamica.OggettoCustom field)
 {
     if (field.TIPO.DESCRIZIONE_TIPO.ToUpperInvariant() == "DATA")
     {
         return(Subscriber.Proxy.PropertyTypesEnum.Date);
     }
     else if (field.TIPO.DESCRIZIONE_TIPO.ToUpperInvariant() == "CONTATORE")
     {
         return(Subscriber.Proxy.PropertyTypesEnum.Numeric);
     }
     else
     {
         return(Subscriber.Proxy.PropertyTypesEnum.String);
     }
 }
Exemplo n.º 8
0
 private static void inserisciData(DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom, XmlDocument xmlDoc)
 {
     try
     {
         if (xmlDoc.SelectSingleNode("//" + oggettoCustom.DESCRIZIONE) != null)
         {
             oggettoCustom.VALORE_DATABASE = xmlDoc.SelectSingleNode("//" + oggettoCustom.DESCRIZIONE).InnerText;
         }
     }
     catch (Exception e)
     {
         logger.Debug("Errore in LiveCycle  - DocumentiManager - metodo: inserisciData()", e);
         throw new Exception(e.Message);
     }
 }
Exemplo n.º 9
0
        private string getValoreOggettoGenerico(DocsPaVO.ProfilazioneDinamica.Templates t, string nome)
        {
            string retval = string.Empty;
            DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg = trovaOggettoPerNome(t, nome);
            if (ogg.TIPO.DESCRIZIONE_TIPO.Equals("MenuATendina"))
            {
                retval = ogg.VALORE_DATABASE;
                if (retval.Contains('_'))
                    retval= retval.Replace('_', '-');

            } else

                retval = ogg.VALORE_DATABASE;

            return retval;
        }
Exemplo n.º 10
0
        private bool popolaValoreTipologiaCampoTestuale(DocsPaVO.ProfilazioneDinamica.Templates t, string nome, string valore)
        {

            if (String.IsNullOrEmpty(valore))
                return false;

            DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg = trovaOggettoPerNome(t, nome);
            if (ogg == null)
                return false;

            if (ogg != null)
            {
                ogg.VALORE_DATABASE = valore;
                return true;
            }
            return false;
        }
Exemplo n.º 11
0
        private bool popolaValoreTipologiaGenerico(DocsPaVO.ProfilazioneDinamica.Templates t, string nome, string valore)
        {
            if (String.IsNullOrEmpty(valore))
                return false;

            DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg = trovaOggettoPerNome(t, nome);

            if (ogg == null)
                return false;

            if (ogg.TIPO.DESCRIZIONE_TIPO.Equals("MenuATendina"))
                return popolaValoreTipologiaDropDown(t, nome, valore);

            if (ogg.TIPO.DESCRIZIONE_TIPO.Equals("CampoDiTesto"))
                return popolaValoreTipologiaCampoTestuale(t, nome, valore);

            return false;
        }
Exemplo n.º 12
0
 private static void inserisciSelezioneEsclusiva(DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom, XmlDocument xmlDoc)
 {
     try
     {
         if (xmlDoc.SelectSingleNode("//" + oggettoCustom.DESCRIZIONE) != null && !string.IsNullOrEmpty(xmlDoc.SelectSingleNode("//" + oggettoCustom.DESCRIZIONE).InnerText))
         {
             int valoreSelezionato = Convert.ToInt32(xmlDoc.SelectSingleNode("//" + oggettoCustom.DESCRIZIONE).InnerText);
             if (valoreSelezionato <= oggettoCustom.ELENCO_VALORI.Count)
             {
                 oggettoCustom.VALORE_DATABASE = ((DocsPaVO.ProfilazioneDinamica.ValoreOggetto)oggettoCustom.ELENCO_VALORI[valoreSelezionato - 1]).VALORE;
                 oggettoCustom.VALORI_SELEZIONATI[valoreSelezionato - 1] = ((DocsPaVO.ProfilazioneDinamica.ValoreOggetto)oggettoCustom.ELENCO_VALORI[valoreSelezionato - 1]).VALORE;
             }
         }
     }
     catch (Exception e)
     {
         logger.Debug("Errore in LiveCycle  - DocumentiManager - metodo: inserisciSelezioneEsclusiva()", e);
         throw new Exception(e.Message);
     }
 }
Exemplo n.º 13
0
        private ArrayList GetOggettiProfilazione(string docNumber, string idAmministrazione, string tipoAtto)
        {
            DocsPaVO.ProfilazioneDinamica.Templates template = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getTemplateDettagli(docNumber);
            ArrayList listaChiaviValori = new ArrayList();

            if (template != null && template.ELENCO_OGGETTI != null)
            {
                for (int i = 0; i < template.ELENCO_OGGETTI.Count; i++)
                {
                    DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom = (DocsPaVO.ProfilazioneDinamica.OggettoCustom)template.ELENCO_OGGETTI[i];

                    if (oggettoCustom != null)
                    {
                        string[] itemToAdd = null;

                        switch (oggettoCustom.TIPO.DESCRIZIONE_TIPO)
                        {
                        case "Corrispondente":
                            DocsPaVO.utente.Corrispondente corr = BusinessLogic.Utenti.UserManager.getCorrispondenteBySystemID(oggettoCustom.VALORE_DATABASE);


                            itemToAdd = new string[8] {
                                "", "", "", "", "", "", "", ""
                            };
                            itemToAdd[0] = oggettoCustom.DESCRIZIONE;
                            if (corr != null)
                            {
                                itemToAdd[1] = corr.descrizione;
                                DocsPaVO.utente.Corrispondente corrIndirizzo = BusinessLogic.Utenti.UserManager.getDettagliIndirizzoCorrispondente(oggettoCustom.VALORE_DATABASE);
                                if (corrIndirizzo != null)
                                {
                                    //
                                    oggettoCustom.INDIRIZZO += corr.descrizione + Environment.NewLine + corrIndirizzo.indirizzo + Environment.NewLine +
                                                               corrIndirizzo.cap + '-' + corrIndirizzo.citta + '-' + corrIndirizzo.localita;
                                    itemToAdd[3]                      = oggettoCustom.INDIRIZZO;
                                    oggettoCustom.TELEFONO           += corr.descrizione + Environment.NewLine + corrIndirizzo.telefono1 + '-' + corrIndirizzo.telefono2;
                                    itemToAdd[6]                      = oggettoCustom.TELEFONO;
                                    oggettoCustom.INDIRIZZO_TELEFONO += oggettoCustom.INDIRIZZO + Environment.NewLine + corrIndirizzo.telefono1 +
                                                                        '-' + corrIndirizzo.telefono2;
                                    itemToAdd[7] = oggettoCustom.INDIRIZZO_TELEFONO;
                                }
                            }


                            itemToAdd[2] = oggettoCustom.TIPO.DESCRIZIONE_TIPO;
                            //itemToAdd[3] =
                            itemToAdd[4] = oggettoCustom.ANNO;
                            itemToAdd[5] = oggettoCustom.ID_AOO_RF;
                            listaChiaviValori.Add(itemToAdd);

                            break;

                        case "Contatore":
                            string formato = oggettoCustom.FORMATO_CONTATORE;
                            formato = formato.Replace("ANNO", oggettoCustom.ANNO);

                            DocsPaVO.utente.Registro reg = BusinessLogic.Utenti.RegistriManager.getRegistro(oggettoCustom.ID_AOO_RF);
                            if (reg != null && !string.IsNullOrEmpty(reg.codRegistro))
                            {
                                formato = formato.Replace("AOO", reg.codRegistro);
                            }

                            DocsPaVO.utente.Registro rf = BusinessLogic.Utenti.RegistriManager.getRegistro(oggettoCustom.ID_AOO_RF);
                            if (rf != null && !string.IsNullOrEmpty(rf.codRegistro))
                            {
                                formato = formato.Replace("RF", rf.codRegistro);
                            }

                            formato = formato.Replace("CONTATORE", oggettoCustom.VALORE_DATABASE);

                            itemToAdd = new string[6] {
                                "", "", "", "", "", ""
                            };
                            itemToAdd[0] = oggettoCustom.DESCRIZIONE;
                            itemToAdd[1] = formato;
                            itemToAdd[2] = oggettoCustom.TIPO.DESCRIZIONE_TIPO;
                            itemToAdd[3] = oggettoCustom.FORMATO_CONTATORE;
                            itemToAdd[4] = oggettoCustom.ANNO;
                            //itemToAdd[5] =
                            listaChiaviValori.Add(itemToAdd);

                            break;

                        case "CasellaDiSelezione":
                            string valore = string.Empty;
                            foreach (string val in oggettoCustom.VALORI_SELEZIONATI)
                            {
                                if (val != null && val != "")
                                {
                                    valore += val + "-";
                                }
                            }
                            if (valore.Length > 1)
                            {
                                valore = valore.Substring(0, valore.Length - 1);
                            }

                            itemToAdd = new string[6] {
                                "", "", "", "", "", ""
                            };
                            itemToAdd[0] = oggettoCustom.DESCRIZIONE;
                            itemToAdd[1] = valore;
                            itemToAdd[2] = oggettoCustom.TIPO.DESCRIZIONE_TIPO;
                            //itemToAdd[3] =
                            itemToAdd[4] = oggettoCustom.ANNO;
                            //itemToAdd[5] =
                            listaChiaviValori.Add(itemToAdd);
                            break;

                        default:
                            itemToAdd = new string[6] {
                                "", "", "", "", "", ""
                            };
                            itemToAdd[0] = oggettoCustom.DESCRIZIONE;
                            itemToAdd[1] = oggettoCustom.VALORE_DATABASE;
                            itemToAdd[2] = oggettoCustom.TIPO.DESCRIZIONE_TIPO;
                            //itemToAdd[3] =
                            itemToAdd[4] = oggettoCustom.ANNO;
                            //itemToAdd[5] =
                            listaChiaviValori.Add(itemToAdd);
                            break;
                        }
                    }
                }
            }

            return(listaChiaviValori);
        }
Exemplo n.º 14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="field"></param>
        /// <param name="properties"></param>
        /// <returns></returns>
        protected virtual void AddProperty(DocsPaVO.ProfilazioneDinamica.OggettoCustom field, List <Subscriber.Proxy.Property> properties)
        {
            if (field.TIPO.DESCRIZIONE_TIPO.ToUpperInvariant() == "CORRISPONDENTE")
            {
                // Id del corrispondente come campo nascosto
                properties.Add(new Subscriber.Proxy.Property
                {
                    Name = string.Format("ID:{0}", field.DESCRIZIONE),
                    Type = this.GetType(field),
                    IsTemplateProperty = true,
                    Hidden             = true,
                    Value = field.VALORE_DATABASE
                });

                // Reperimento dei metadati del corrispondente
                DocsPaVO.utente.Corrispondente corrispondente = BusinessLogic.Utenti.UserManager.getCorrispondenteBySystemID(field.VALORE_DATABASE);

                if (corrispondente != null)
                {
                    // Descrizione del corrispondente
                    properties.Add(new Subscriber.Proxy.Property
                    {
                        Name = field.DESCRIZIONE,
                        Type = this.GetType(field),
                        IsTemplateProperty = true,
                        Value = string.Format("{0} - {1}", corrispondente.codiceRubrica, corrispondente.descrizione)
                    });

                    // Mail del corrispondente
                    properties.Add(new Subscriber.Proxy.Property
                    {
                        Name = string.Format("MAIL:{0}", field.DESCRIZIONE),
                        Type = this.GetType(field),
                        IsTemplateProperty = true,
                        Hidden             = true,
                        Value = corrispondente.email
                    });
                }
            }
            else
            {
                string value = string.Empty;

                Subscriber.Proxy.Property p = new Subscriber.Proxy.Property
                {
                    Name = field.DESCRIZIONE,
                    Type = this.GetType(field),
                    IsTemplateProperty = true
                };

                if (field.TIPO.DESCRIZIONE_TIPO == "CasellaDiSelezione")
                {
                    if (field.VALORI_SELEZIONATI != null && field.VALORI_SELEZIONATI.Count > 0)
                    {
                        foreach (string val in field.VALORI_SELEZIONATI)
                        {
                            if (!string.IsNullOrEmpty(value))
                            {
                                value += "|";
                            }

                            value += val;
                        }
                    }
                }
                else if (field.TIPO.DESCRIZIONE_TIPO == "Contatore")
                {
                    value = field.FORMATO_CONTATORE;

                    if (!string.IsNullOrEmpty(field.VALORE_DATABASE))
                    {
                        value = value.Replace("ANNO", field.ANNO);
                        value = value.Replace("CONTATORE", field.VALORE_DATABASE);

                        value = value.Replace("COD_AMM", BusinessLogic.Amministrazione.AmministraManager.AmmGetInfoAmmCorrente(this._infoUtente.idAmministrazione).Codice);
                        value = value.Replace("COD_UO", field.CODICE_DB);

                        if (!string.IsNullOrEmpty(field.DATA_INSERIMENTO))
                        {
                            int fine = field.DATA_INSERIMENTO.LastIndexOf(".");

                            if (fine > -1)
                            {
                                value = value.Replace("gg/mm/aaaa hh:mm", field.DATA_INSERIMENTO.Substring(0, fine));
                            }

                            value = value.Replace("gg/mm/aaaa", field.DATA_INSERIMENTO.Substring(0, 10));
                        }

                        if (!string.IsNullOrEmpty(field.ID_AOO_RF) && field.ID_AOO_RF != "0")
                        {
                            DocsPaVO.utente.Registro registro = BusinessLogic.Utenti.RegistriManager.getRegistro(field.ID_AOO_RF);

                            if (registro != null)
                            {
                                value = value.Replace("RF", registro.codRegistro);
                                value = value.Replace("AOO", registro.codRegistro);
                            }
                        }
                    }
                }
                else
                {
                    value = field.VALORE_DATABASE;
                }

                p.Value = value;

                properties.Add(p);
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// </summary>
        /// <param name="schedaDoc"></param>
        /// <param name="objSicurezza"></param>
        /// <param name="debug"></param>
        /// <returns></returns>
        public static DocsPaVO.documento.SchedaDocumento save(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.documento.SchedaDocumento schedaDoc, bool enableUffRef, out bool daAggiornareUffRef, DocsPaVO.utente.Ruolo ruolo)
        {
            logger.Info("BEGIN");

            //SOSTITUISCO IL CARATTERE SPECIALE
            if (schedaDoc.oggetto.descrizione.Contains("–"))
            {
                schedaDoc.oggetto.descrizione = schedaDoc.oggetto.descrizione.Replace("–", "-");
            }

            // Controllo su stato congelato del documento
            DocumentConsolidation.CanChangeMetadata(infoUtente, schedaDoc, true);

            DocsPaVO.documento.SchedaDocumento savedDocument = null;

            daAggiornareUffRef = false;
            string incestino = string.Empty;

            //controllo se doc in cestino
            incestino = BusinessLogic.Documenti.DocManager.checkdocInCestino(schedaDoc.docNumber);

            if (incestino != "" &&
                incestino == "1")
            {
                throw new Exception("Il documento è stato rimosso, non è più possibile modificarlo");
            }

            //Verifico se il documento è in libro firma e se è prevista la repertoriazione del documento
            #region CHECK_LIBRO_FIRMA
            if (LibroFirma.LibroFirmaManager.IsDocInLibroFirma(schedaDoc.docNumber))
            {
                bool daRepertoriare = false;
                if (schedaDoc.template != null && !string.IsNullOrEmpty(schedaDoc.template.ID_TIPO_ATTO) && schedaDoc.template.ELENCO_OGGETTI != null && schedaDoc.template.ELENCO_OGGETTI.Count > 0)
                {
                    DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg = (from o in schedaDoc.template.ELENCO_OGGETTI.Cast <DocsPaVO.ProfilazioneDinamica.OggettoCustom>()
                                                                       where o.TIPO.DESCRIZIONE_TIPO.Equals("Contatore") && o.REPERTORIO.Equals("1") &&
                                                                       o.CONTATORE_DA_FAR_SCATTARE && string.IsNullOrEmpty(o.VALORE_DATABASE)
                                                                       select o).FirstOrDefault();
                    if (ogg != null && !LibroFirma.LibroFirmaManager.IsTitolarePassoInAttesa(schedaDoc.docNumber, infoUtente, DocsPaVO.LibroFirma.Azione.DOCUMENTO_REPERTORIATO))
                    {
                        throw new Exception("Non è possibile procedere con la repertoriazione poichè il documento è in Libro Firma");
                    }
                }
            }
            #endregion

            // Contesto transazionale
            using (DocsPaDB.TransactionContext transactionContext = new DocsPaDB.TransactionContext())
            {
                if (schedaDoc.repositoryContext != null)
                {
                    // Cerazione del documento grigio se è stata fornita una scheda documento in repository context
                    schedaDoc = addDocGrigia(schedaDoc, infoUtente, ruolo);
                }

                if (schedaDoc.systemId != null && !schedaDoc.systemId.Equals(""))
                {
                    if (schedaDoc.predisponiProtocollazione || (schedaDoc.protocollo != null && (schedaDoc.protocollo.segnatura == null || (schedaDoc.protocollo.segnatura != null && schedaDoc.protocollo.segnatura == "")) && schedaDoc.protocollo.ModUffRef == true && enableUffRef))
                    {
                        savedDocument = predisponiAllaProtocollazione(infoUtente, schedaDoc);
                    }
                    else
                    {
                        savedDocument = salvaModifiche(infoUtente, schedaDoc, enableUffRef, out daAggiornareUffRef);
                    }
                }
                else
                {
                    savedDocument = schedaDoc;
                }

                //Richiamo il metodo per il calcolo della atipicità del documento
                DocsPaDB.Query_DocsPAWS.Documentale documentale = new DocsPaDB.Query_DocsPAWS.Documentale();
                schedaDoc.InfoAtipicita = documentale.CalcolaAtipicita(infoUtente, schedaDoc.docNumber, DocsPaVO.Security.InfoAtipicita.TipoOggettoAtipico.DOCUMENTO);

                if (savedDocument != null)
                {
                    // La transazione viene completata, se le modifiche sono state effettuate correttamente
                    transactionContext.Complete();
                }
            }
            logger.Info("END");
            return(savedDocument);
        }
Exemplo n.º 16
0
        /// <summary>
        /// AS400 CONSRER ogni protocollo fascicolato o modificato in oggetto deve finire anhce in
        /// delle tabelle di collegamento presenti solo sulla versione etdocs sql di consrer che servono da tramite per
        /// aggiornare il sistema as400 presente dal cliente. in controlli se il protocollo è fascicolato oppure ha oggetto modificato sono fatti all'interno della progetto DocspaAS400
        /// </summary>
        /// <param name="schedaDoc"></param>
        public static void setAs400InFolder(string idProfile, DocsPaVO.utente.InfoUtente infoUtente, string idFolder, string constAs400)
        {
            DocsPaVO.documento.SchedaDocumento schedaDoc = null;


            //AS400
            string AS400 = System.Configuration.ConfigurationSettings.AppSettings["AS400"];

            DocsPaDB.DBProvider db = null;


            sem.WaitOne();
            try
            {
                if (AS400 != null && AS400.Equals("1"))
                {
                    logger.Debug("In AS400");
                    //					string[] checkValues= {"","",""} ; //inizializzazione valori, per essere lanciato l'as400 almeno uno dei valori deve esistere e deve esseere diverso da vuoto.
                    //ricerca scheda.
                    schedaDoc = BusinessLogic.Documenti.DocManager.getDettaglioPerNotificaAllegati(infoUtente, idProfile, "");
                    if (schedaDoc != null && schedaDoc.tipoProto != null &&
                        schedaDoc.tipoProto != "G" &&
                        schedaDoc.tipoProto != "R" &&
                        schedaDoc.tipologiaAtto != null &&
                        (schedaDoc.tipologiaAtto.descrizione != null &&
                         schedaDoc.tipologiaAtto.descrizione != "")
                        )                                              //SOLO PROTOCOLLI
                    {
                        DocsPaDB.Query_DocsPAWS.Model           model   = new DocsPaDB.Query_DocsPAWS.Model();
                        DocsPaVO.ProfilazioneDinamica.Templates schTmpl = model.getTemplateDettagli(schedaDoc.docNumber);

                        if (schTmpl != null)
                        {
                            for (int i = 0; i < schTmpl.ELENCO_OGGETTI.Count; i++)
                            {
                                DocsPaVO.ProfilazioneDinamica.OggettoCustom objc = (DocsPaVO.ProfilazioneDinamica.OggettoCustom)schTmpl.ELENCO_OGGETTI[i];
                                if (objc.DESCRIZIONE.ToLower().Trim().Equals("tipo atto"))
                                {
                                    //sostituisco il valore perchè il codice dell'AS400 in docspa30 in realtà la tipologia
                                    //è nella profilazione dinamica, mentre il tipo atto in docspa è solo una categoria di tipi_atto_profilati_dinamicamente
                                    schedaDoc.tipologiaAtto.descrizione = objc.VALORE_DATABASE.Trim();
                                    //									checkValues[0]=objc.VALORE_DATABASE.Trim();
                                }
                                if (objc.DESCRIZIONE.ToLower().Trim().Equals("commissione referente"))
                                {
                                    //sostituisco il valore perchè il codice dell'AS400 in docspa30
                                    schedaDoc.commissioneRef = objc.VALORE_DATABASE.Trim();
                                    //									checkValues[1]=objc.VALORE_DATABASE.Trim();
                                }
                                if (objc.DESCRIZIONE.ToLower().Trim().Equals("numero"))
                                {
                                    //sostituisco il valore perchè il codice dell'AS400 in docspa30
                                    schedaDoc.numOggetto = objc.VALORE_DATABASE.Trim();
                                    //									checkValues[2]=objc.VALORE_DATABASE.Trim();
                                }
                            }
                        }
                    }


                    DocsPaAS400.InsertAgent ia = new DocsPaAS400.InsertAgent();
                    //per essere lanciato l'as400 almeno
                    //uno dei valori deve esistere e deve esseere diverso da vuoto.
                    //					if(checkValues[0]!="" ||
                    //						checkValues[1]!=""||
                    //						checkValues[2]!="")
                    ia.addDocFolder(schedaDoc, schedaDoc.systemId, idFolder);
                }
                //FINE AS400
            }
            catch (Exception e)
            {
                logger.Debug(e);
            }
            finally
            {
                if (db != null)
                {
                    db.Dispose();
                }
                sem.ReleaseMutex();
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// AS400 CONSRER ogni protocollo fascicolato o modificato in oggetto deve finire anhce in
        /// delle tabelle di collegamento presenti solo sulla versione etdocs sql di consrer che servono da tramite per
        /// aggiornare il sistema as400 presente dal cliente. in controlli se il protocollo è fascicolato oppure ha oggetto modificato sono fatti all'interno della progetto DocspaAS400
        /// </summary>
        /// <param name="schedaDoc"></param>
        public static void setAs400(DocsPaVO.documento.SchedaDocumento schedaDoc, string constAs400)
        {
            //AS400
            string AS400 = System.Configuration.ConfigurationSettings.AppSettings["AS400"];

            DocsPaDB.DBProvider db = null;
            sem.WaitOne();
            try
            {
                if (AS400 != null && AS400.Equals("1"))
                {
                    //					string[] checkValues= {"","",""} ; //inizializzazione valori, per essere lanciato l'as400 almeno uno dei valori deve esistere e deve esseere diverso da vuoto.

                    logger.Debug("In AS400");
                    DocsPaDB.Query_DocsPAWS.Documenti doc = new DocsPaDB.Query_DocsPAWS.Documenti();
                    //schedaDoc=BusinessLogic.Documenti.DocManager.getDettaglioPerNotificaAllegati(idGruppo,idPeople,idProfile,docnumber);
                    if (schedaDoc != null && schedaDoc.tipoProto != null &&
                        schedaDoc.tipoProto != "G" &&
                        schedaDoc.tipoProto != "R" &&
                        schedaDoc.tipologiaAtto != null &&
                        (schedaDoc.tipologiaAtto.descrizione != null &&
                         schedaDoc.tipologiaAtto.descrizione != ""))   //SOLO PROTOCOLLI
                    {
                        DocsPaDB.Query_DocsPAWS.Model           model   = new DocsPaDB.Query_DocsPAWS.Model();
                        DocsPaVO.ProfilazioneDinamica.Templates schTmpl = model.getTemplateDettagli(schedaDoc.docNumber);

                        if (schTmpl != null)
                        {
                            for (int i = 0; i < schTmpl.ELENCO_OGGETTI.Count; i++)
                            {
                                DocsPaVO.ProfilazioneDinamica.OggettoCustom objc = (DocsPaVO.ProfilazioneDinamica.OggettoCustom)schTmpl.ELENCO_OGGETTI[i];
                                if (objc.DESCRIZIONE.ToLower().Trim().Equals("tipo atto"))
                                {
                                    //sostituisco il valore perchè il codice dell'AS400 in docspa30 in realtà la tipologia
                                    //è nella profilazione dinamica, mentre il tipo atto in docspa è solo una categoria di tipi_atto_profilati_dinamicamente
                                    schedaDoc.tipologiaAtto.descrizione = objc.VALORE_DATABASE.Trim();
                                    //									checkValues[0]=objc.VALORE_DATABASE.Trim();
                                }
                                if (objc.DESCRIZIONE.ToLower().Trim().Equals("commissione referente"))
                                {
                                    //sostituisco il valore perchè il codice dell'AS400 in docspa30 in realtà la tipologia
                                    //è nella profilazione dinamica, mentre il tipo atto in docspa è solo una categoria di tipi_atto_profilati_dinamicamente
                                    schedaDoc.commissioneRef = objc.VALORE_DATABASE.Trim();
                                    //									checkValues[1]=objc.VALORE_DATABASE.Trim();
                                }
                                if (objc.DESCRIZIONE.ToLower().Trim().Equals("numero"))
                                {
                                    //sostituisco il valore perchè il codice dell'AS400 in docspa30 in realtà la tipologia
                                    //è nella profilazione dinamica, mentre il tipo atto in docspa è solo una categoria di tipi_atto_profilati_dinamicamente
                                    schedaDoc.numOggetto = objc.VALORE_DATABASE.Trim();
                                    //checkValues[2]=objc.VALORE_DATABASE.Trim();
                                }
                            }
                        }
                    }



                    DocsPaAS400.InsertAgent ia = new DocsPaAS400.InsertAgent();
                    //					if(checkValues[0]!="" ||
                    //						checkValues[1]!=""||
                    //						checkValues[2]!="")
                    //					{
                    db = new DocsPaDB.DBProvider();
                    db.BeginTransaction();
                    ArrayList queries = ia.getInsertQueries(constAs400, schedaDoc, db);
                    for (int i = 0; i < queries.Count; i++)
                    {
                        if (!db.ExecuteLockedNonQuery((string)queries[i]))
                        {
                            throw new Exception("Errore nell'inserimento dei dati in AS400");
                        }
                    }
                    db.CommitTransaction();
                }
                //				}
                //FINE AS400
            }
            catch (Exception e)
            {
                db.RollbackTransaction();
                logger.Debug(e);
            }
            finally
            {
                if (db != null)
                {
                    db.Dispose();
                }
                sem.ReleaseMutex();
            }
        }
Exemplo n.º 18
0
 /// <summary>
 /// Impostazione valore per un campo custom di profilazione
 /// </summary>
 /// <param name="oggettiCustom"></param>
 /// <param name="codiceOggetto"></param>
 /// <param name="valore"></param>
 /// <returns></returns>
 public static void SetValoreOggettoCustom(List <DocsPaVO.ProfilazioneDinamica.OggettoCustom> oggettiCustom, string codiceOggetto, string valore)
 {
     DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustomBene = GetOggettoCustom(oggettiCustom, codiceOggetto);
     oggettoCustomBene.VALORE_DATABASE = valore;
 }