public static void CheckEventiFirma(string idProfile, string idPeople, string idGruppo, string idAmm) { logger.Debug("BEGIN"); try { DocsPaVO.ProfilazioneDinamica.Templates template = ProfilazioneDinamica.ProfilazioneDocumenti.getTemplate(idProfile); if (template != null) { DocsPaVO.utente.InfoUtente infoUt = new DocsPaVO.utente.InfoUtente(); DocsPaVO.utente.Utente u = Utenti.UserManager.getUtenteById(idPeople); DocsPaVO.utente.Ruolo r = Utenti.UserManager.getRuoloByIdGruppo(idGruppo); infoUt = Utenti.UserManager.GetInfoUtente(u, r); ArrayList listaFascicoli = BusinessLogic.Fascicoli.FascicoloManager.getFascicoliDaDocNoSecurity(infoUt, idProfile); logger.Debug("Analisi fascicoli"); foreach (DocsPaVO.fascicolazione.Fascicolo f in listaFascicoli) { DocsPaVO.ProfilazioneDinamica.Templates templateFasc = ProfilazioneDinamica.ProfilazioneFascicoli.getTemplateFasc(f.systemID); if (templateFasc != null && templateFasc.SYSTEM_ID != 0) { logger.Debug("Fascicolo ID=" + f.systemID + " tipizzato - " + templateFasc.DESCRIZIONE); CambioStatoProcedimento(f.systemID, "FIRMA", template.SYSTEM_ID.ToString(), infoUt); } } } } catch (Exception ex) { logger.Debug("Errore in CheckEventiFirma", ex); } logger.Debug("END"); }
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); }
public DocsPaVO.ProfilazioneDinamica.Templates PopolaTemplateDocumento(string idTemplate) { logger.Debug("BEGIN"); logger.Debug("Ricerca tipologia documento"); DocsPaVO.ProfilazioneDinamica.Templates template = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getTemplateById(idTemplate); if (template != null && !string.IsNullOrEmpty(template.ID_TIPO_ATTO)) { foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg in template.ELENCO_OGGETTI) { if (form.FieldNames.Contains(ogg.DESCRIZIONE)) { string value = string.Empty; switch (form.GetFieldType(ogg.DESCRIZIONE)) { case FieldType.Text: value = form.GetField(ogg.DESCRIZIONE); if (!string.IsNullOrEmpty(value)) { ogg.VALORE_DATABASE = value; } break; case FieldType.ComboBox: value = form.GetField(ogg.DESCRIZIONE); if (!string.IsNullOrEmpty(value)) { ogg.VALORE_DATABASE = value; } break; case FieldType.CheckBox: value = form.GetField(ogg.DESCRIZIONE); break; case FieldType.Radio: value = form.GetButtonOptionCurrentValue(ogg.DESCRIZIONE); var options = form.GetButtonOptionValues(ogg.DESCRIZIONE); break; default: break; } } } } else { logger.Debug("Tipologia documento non trovata"); template = null; } logger.Debug("END"); return(template); }
/// <summary> /// /// </summary> /// <param name="infoUtente"></param> /// <param name="codiceTipoDocumento"></param> /// <returns></returns> public static DocsPaVO.ProfilazioneDinamica.Templates GetTemplateTipoDocumento(DocsPaVO.utente.InfoUtente infoUtente, string codiceTipoDocumento) { DocsPaVO.ProfilazioneDinamica.Templates template = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getTemplatePerRicerca(infoUtente.idAmministrazione, codiceTipoDocumento); if (template == null) { throw new ApplicationException(string.Format("Tipologia documento {0} non trovata", codiceTipoDocumento)); } return(template); }
/// <summary> /// /// </summary> /// <param name="infoUtente"></param> /// <param name="profilazioneDinamicaLite"></param> /// <returns></returns> private static DocsPaVO.ProfilazioneDinamica.Templates getTemplateCompleto(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.RicercaLite.CampiProfilati profilazioneDinamicaLite) { DocsPaVO.ProfilazioneDinamica.Templates templates = null; ArrayList tempTemplas = null; if (profilazioneDinamicaLite != null) { tempTemplas = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getTemplates(infoUtente.idAmministrazione); foreach (DocsPaVO.ProfilazioneDinamica.Templates templates1 in tempTemplas) { if (templates1.DESCRIZIONE.ToUpper().Equals(profilazioneDinamicaLite.nomeDocumento.ToUpper())) { templates = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getTemplateById(templates1.SYSTEM_ID.ToString()); break; } } } if (templates != null) { foreach (DocsPaVO.RicercaLite.CampoProfilatoAvanzata campi in profilazioneDinamicaLite.campiProfilati) { foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom oggetto in templates.ELENCO_OGGETTI) { if (oggetto.DESCRIZIONE.ToUpper().Equals(campi.nomeCampo.ToUpper())) { if (campi.IsIntervalloDa == 1) { oggetto.VALORE_DATABASE = campi.valoreCampo; } else if (campi.IsIntervalloA == 1) { oggetto.VALORE_DATABASE += "@" + campi.valoreCampo; } else { oggetto.VALORE_DATABASE = campi.valoreCampo; } break; } } } } return(templates); }
public static DocsPaVO.filtri.FiltroRicerca[][] ricercaProfilazioneAvanzata( DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.filtri.FiltroRicerca[] filtroRicerca, DocsPaVO.RicercaLite.CampiProfilati CampiProfilati) { DocsPaVO.filtri.FiltroRicerca[][] filtriRicerca = null; DocsPaVO.ProfilazioneDinamica.Templates templates = BusinessLogic.ProfilazioneAvanzata.ProfilazioneAvanzata.getTemplateCompleto(infoUtente, CampiProfilati); DocsPaVO.filtri.FiltroRicerca[] filtriRicercaProfilazioneDinamica = BusinessLogic.ProfilazioneAvanzata.ProfilazioneAvanzata.getFiltriProfilazioneDimanica(templates); filtriRicerca = BusinessLogic.ProfilazioneAvanzata.ProfilazioneAvanzata.getFiltriDocumenti(filtroRicerca, filtriRicercaProfilazioneDinamica); if (CampiProfilati != null && !string.IsNullOrEmpty(CampiProfilati.nomeDocumento) && templates == null) { filtriRicerca = null; } return(filtriRicerca); }
private static DocsPaVO.filtri.FiltroRicerca[] getFiltriProfilazioneDimanica(DocsPaVO.ProfilazioneDinamica.Templates templates) { List <DocsPaVO.filtri.FiltroRicerca> lista = new List <DocsPaVO.filtri.FiltroRicerca>(); if (templates != null) { DocsPaVO.filtri.FiltroRicerca filtro = new DocsPaVO.filtri.FiltroRicerca(); filtro.argomento = DocsPaVO.filtri.ricerca.listaArgomenti.TIPO_ATTO.ToString(); filtro.valore = templates.ID_TIPO_ATTO; lista.Add(filtro); filtro = new DocsPaVO.filtri.FiltroRicerca(); filtro.argomento = DocsPaVO.filtri.ricerca.listaArgomenti.PROFILAZIONE_DINAMICA.ToString(); filtro.template = templates; filtro.valore = "Profilazione Dinamica"; lista.Add(filtro); } return(lista.ToArray()); }
public static void PopolaCampiProcedimento(ref DocsPaVO.ProfilazioneDinamica.Templates template, DocsPaVO.utente.InfoUtente infoUtente) { foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg in template.ELENCO_OGGETTI) { switch (ogg.DESCRIZIONE.ToUpper()) { case "TERMINI": ogg.VALORE_DATABASE = "120"; // CABLATO PER ORA break; case "RESPONSABILE PROCEDIMENTO": DocsPaVO.utente.Corrispondente corr = BusinessLogic.Utenti.UserManager.getCorrispondenteByCodRubrica("renzo.piano", infoUtente); // CABLATO PER ORA if (corr != null) { ogg.VALORE_DATABASE = corr.systemId; } break; } } }
public static CampoTipologia[] getCampiTipologia(DocsPaVO.ProfilazioneDinamica.Templates template) { if (template == null) { return(null); } List <CampoTipologia> ctlist = new List <CampoTipologia>(); foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom in template.ELENCO_OGGETTI) { ExportDatiManager exportDatiManager = new ExportDatiManager(); CampoTipologia ct = new CampoTipologia { NomeCampo = oggettoCustom.DESCRIZIONE, ValoreCampo = exportDatiManager.getValoreOggettoCustom(oggettoCustom) }; ctlist.Add(ct); } return(ctlist.ToArray()); }
private string FillCampiProfilati(string campo, ArrayList documenti) { string result = string.Empty; foreach (DocsPaVO.documento.InfoDocumentoExport documento in documenti) { DocsPaVO.ProfilazioneDinamica.Templates template = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getTemplateDettagli(documento.docNumber); if (template != null && template.ELENCO_OGGETTI.Count != 0) { foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom in template.ELENCO_OGGETTI) { if (campo.Equals(oggettoCustom.DESCRIZIONE)) { ExportDatiManager exportDatiManager = new ExportDatiManager(); result = exportDatiManager.getValoreOggettoCustom(oggettoCustom); return(result); } } } } return(result); }
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); }
/// <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(); } }
private static DocsPaVO.Notification.Notification ExecuteChangeSpecializedItem(InfoUtente infoUtente, TypeOperation[] typeOperation, DocsPaVO.Notification.Notification oldNotification, DocsPaVO.documento.SchedaDocumento schedaDoc, DocsPaVO.fascicolazione.Fascicolo project) { String dataAnnullamento = String.Empty; DocsPaVO.Notification.Notification newNotification = oldNotification; try { if (schedaDoc != null) { foreach (TypeOperation operation in typeOperation) { switch (operation) { case TypeOperation.CHANGE_OBJECT: newNotification.ITEM_SPECIALIZED = UpdateSpecializeItem(oldNotification.ITEM_SPECIALIZED, schedaDoc.oggetto.descrizione, "lblObjectDescription"); break; case TypeOperation.CHANGE_TYPE_DOC: newNotification.ITEM_SPECIALIZED = UpdateSpecializeItem(oldNotification.ITEM_SPECIALIZED, schedaDoc.tipologiaAtto.descrizione, "lblDocType"); break; case TypeOperation.CHANGE_SENDER: string mittente = string.Empty; switch (schedaDoc.tipoProto) { case "P": mittente = (schedaDoc.protocollo as DocsPaVO.documento.ProtocolloUscita).mittente.descrizione; break; case "A": mittente = (schedaDoc.protocollo as DocsPaVO.documento.ProtocolloEntrata).mittente.descrizione; break; case "I": mittente = (schedaDoc.protocollo as DocsPaVO.documento.ProtocolloInterno).mittente.descrizione; break; } newNotification.ITEM_SPECIALIZED = UpdateSpecializeItem(oldNotification.ITEM_SPECIALIZED, mittente, "lblSender"); break; } } } else if (project != null) { foreach (TypeOperation operation in typeOperation) { switch (operation) { case TypeOperation.CHANGE_OBJECT: newNotification.ITEM_SPECIALIZED = UpdateSpecializeItem(oldNotification.ITEM_SPECIALIZED, project.descrizione, "lblObjectDescription"); break; case TypeOperation.CHANGE_TYPE_PROJ: DocsPaVO.ProfilazioneDinamica.Templates templete = ProfilazioneDinamica.ProfilazioneFascicoli.getTemplateFascDettagli(project.systemID); if (templete != null && !string.IsNullOrEmpty(templete.DESCRIZIONE)) { newNotification.ITEM_SPECIALIZED = UpdateSpecializeItem(oldNotification.ITEM_SPECIALIZED, templete.DESCRIZIONE, "lblFascType"); } break; } } } } catch (Exception exc) { logger.Info("Errore in BusinessLogic.ServiceNotifications.Notification - metodo: ExecuteChangeNotifications", exc); throw exc; } return(newNotification); }
public DocsPaVO.documento.SchedaDocumento GetDettaglioMobile(DocsPaVO.utente.InfoUtente infoUtente, string idProfile, string docNumber, bool impostaDataVista) { DocsPaVO.documento.SchedaDocumento schedaDocumento = null; try { DocsPaUtils.Query queryDef = DocsPaUtils.InitQuery.getInstance().getQuery("S_GET_SCHEDA_DOCUMENTO"); queryDef.setParam("creationDate", Functions.ToChar("A.CREATION_DATE", false)); queryDef.setParam("creationTime", Functions.ToChar("A.CREATION_TIME", true)); queryDef.setParam("dtaProtoEme", Functions.ToChar("A.DTA_PROTO_EME", false)); queryDef.setParam("dtaProto", Functions.ToChar("A.DTA_PROTO", true)); queryDef.setParam("dtaProtoIn", Functions.ToChar("A.DTA_PROTO_IN", false)); queryDef.setParam("dtaAnnulla", Functions.ToChar("A.DTA_ANNULLA", false)); queryDef.setParam("idGroup", infoUtente.idGruppo); queryDef.setParam("idPeople", infoUtente.idPeople); string documentoPubblico = string.Empty; string idRuoloPubblico = DocsPaUtils.Configuration.InitConfigurationKeys.GetValue(infoUtente.idAmministrazione, "ENABLE_FASCICOLO_PUBBLICO"); if (string.IsNullOrEmpty(idRuoloPubblico)) { idRuoloPubblico = "0"; } else { if (dbType.Equals("SQL")) { documentoPubblico = getUserDB() + ".checkDocumentoPubblico(A.DOCNUMBER, " + idRuoloPubblico + ") AS CHA_PUBBLICO, "; } else { documentoPubblico = "checkDocumentoPubblico(A.DOCNUMBER, " + idRuoloPubblico + ") AS CHA_PUBBLICO, "; } } queryDef.setParam("documentoPubblico", documentoPubblico); queryDef.setParam("idRuoloPubblico", idRuoloPubblico); string keyParams = string.Empty; if (!string.IsNullOrEmpty(idProfile)) { queryDef.setParam("pk", String.Format("A.SYSTEM_ID = {0}", idProfile)); } else if (!string.IsNullOrEmpty(docNumber)) { queryDef.setParam("pk", String.Format("A.DOCNUMBER = {0}", docNumber)); } queryDef.setParam("dbUser", this.getUserDB()); string commandText = queryDef.getSQL(); logger.Debug(commandText); DataSet dataSet; if (this.ExecuteQuery(out dataSet, "PROFILE", commandText)) { DataRow dataRow = dataSet.Tables["PROFILE"].Rows[0]; schedaDocumento = this.GetSchedaDocumentoMobile(infoUtente, dataRow); dataSet.Dispose(); dataSet = null; if (impostaDataVista) { this.SetDataVistaSP(infoUtente, schedaDocumento.systemId, "D"); } } //Profilazione dinamica if (schedaDocumento.tipologiaAtto != null && schedaDocumento.tipologiaAtto.systemId != null && schedaDocumento.tipologiaAtto.systemId != "") { Model model = new Model(); DocsPaVO.ProfilazioneDinamica.Templates template = model.getTemplateDettagli(schedaDocumento.docNumber); schedaDocumento.template = template; } } catch (Exception e) { string errorMessage = string.Format("Errore nel reperimento del documento con idProfile {0} e con docNumber {1}: {2}", idProfile, docNumber, e.Message); logger.Error(errorMessage); throw new ApplicationException(errorMessage, e); } return(schedaDocumento); }
public DocsPaVO.ProfilazioneDinamica.Templates PopolaTemplateIstanzaProcedimenti(string idTemplate) { logger.Debug("BEGIN"); logger.Debug("Ricerca tipologia fascicolo"); DocsPaVO.ProfilazioneDinamica.Templates template = BusinessLogic.ProfilazioneDinamica.ProfilazioneFascicoli.getTemplateFascById(idTemplate); if (template != null && !string.IsNullOrEmpty(template.ID_TIPO_FASC)) { // Caricamento licenza //DocsPaDB.Query_DocsPAWS.ClientSideModelProcessor csmp = new DocsPaDB.Query_DocsPAWS.ClientSideModelProcessor(); //Aspose.Pdf.License lic = new License(); //byte[] licenseContent = csmp.GetLicense("ASPOSE"); //if (licenseContent != null) //{ // System.IO.MemoryStream licenseStream = new System.IO.MemoryStream(licenseContent, 0, licenseContent.Length); // lic.SetLicense(licenseStream); // licenseStream.Close(); //} // Caricamento file pdf da byte array //MemoryStream ms = new MemoryStream(pdfContent); //Form form = new Form(); //form.BindPdf(ms); // Ricerca e popolamento dei campi profilati foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg in template.ELENCO_OGGETTI) { if (form.FieldNames.Contains(ogg.DESCRIZIONE)) { string value = string.Empty; switch (form.GetFieldType(ogg.DESCRIZIONE)) { case FieldType.Text: value = form.GetField(ogg.DESCRIZIONE); if (!string.IsNullOrEmpty(value)) { ogg.VALORE_DATABASE = value; } break; case FieldType.ComboBox: value = form.GetField(ogg.DESCRIZIONE); if (!string.IsNullOrEmpty(value)) { ogg.VALORE_DATABASE = value; } break; case FieldType.CheckBox: value = form.GetField(ogg.DESCRIZIONE); break; case FieldType.Radio: value = form.GetButtonOptionCurrentValue(ogg.DESCRIZIONE); var options = form.GetButtonOptionValues(ogg.DESCRIZIONE); break; default: break; } } } } else { logger.Debug("Tipologia non trovata"); template = null; } logger.Debug("END"); return(template); }
public static void CambioStatoProcedimento(string idFascicolo, string tipoEvento, string idOggetto, DocsPaVO.utente.InfoUtente utente) { logger.Debug("BEGIN"); DocsPaDB.Query_DocsPAWS.Procedimenti proc = new DocsPaDB.Query_DocsPAWS.Procedimenti(); string idStato = proc.GetIdPerCambioStato(tipoEvento, idOggetto); if (!string.IsNullOrEmpty(idStato)) { logger.Debug("Stato: " + idStato); DocsPaVO.ProfilazioneDinamica.Templates template = BusinessLogic.ProfilazioneDinamica.ProfilazioneFascicoli.getTemplateFascDettagli(idFascicolo); if (template != null) { int idDiagram = BusinessLogic.DiagrammiStato.DiagrammiStato.getDiagrammaAssociatoFasc(template.ID_TIPO_FASC); if (idDiagram != 0) { DocsPaVO.DiagrammaStato.DiagrammaStato stateDiagram = BusinessLogic.DiagrammiStato.DiagrammiStato.getDiagrammaById(idDiagram.ToString()); if (stateDiagram != null) { logger.DebugFormat("Trovato evento per cambio stato - stato={0} fascicolo={1} tipoevento={2}", idStato, idFascicolo, tipoEvento); BusinessLogic.DiagrammiStato.DiagrammiStato.salvaModificaStatoFasc(idFascicolo, idStato, stateDiagram, utente.idPeople, utente, string.Empty); // CABLATURA PER DEMO 21/11 if (tipoEvento.ToUpper() == "ACCETTAZIONE") { DocsPaVO.trasmissione.RagioneTrasmissione ragTrasm = BusinessLogic.Trasmissioni.RagioniManager.getRagione(idOggetto); if (ragTrasm != null) { if (template.ELENCO_OGGETTI != null && template.ELENCO_OGGETTI.Count > 0) { bool toUpdate = false; foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg in template.ELENCO_OGGETTI) { if (ogg.DESCRIZIONE.ToUpper() == "RUOLO ASSEGNATARIO") { logger.Debug("Ruolo assegnatario - ID=" + utente.idCorrGlobali); ogg.VALORE_DATABASE = utente.idCorrGlobali; toUpdate = true; } if (ogg.DESCRIZIONE.ToUpper() == "UTENTE ASSEGNATARIO") { DocsPaVO.utente.Corrispondente corr = BusinessLogic.Utenti.UserManager.getCorrispondenteByIdPeople(utente.idPeople, DocsPaVO.addressbook.TipoUtente.INTERNO, utente); if (corr != null) { logger.Debug("Utente assegnatario - idPeople=" + utente.idPeople + " - idCorrGlobali=" + corr.systemId); ogg.VALORE_DATABASE = corr.systemId; toUpdate = true; } } } if (toUpdate) { BusinessLogic.ProfilazioneDinamica.ProfilazioneFascicoli.salvaInserimentoUtenteProfDimFasc(template, idFascicolo); } } } } } } } } logger.Debug("END"); }
public static void compilaTipologiaDocumento(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.LiveCycle.ProcessFormInput processFormInput, XmlDocument xmlDoc, ref DocsPaVO.LiveCycle.ProcessFormOutput processFormOutput) { try { //Verifico che l'xml contiene un campo per la tipologia di documento XmlNode node = xmlDoc.SelectSingleNode("//TipologiaDocumento"); string tipologiaDocumento = string.Empty; DocsPaVO.ProfilazioneDinamica.Templates templateSelezionato = null; if (node != null) { tipologiaDocumento = node.InnerText; if (!string.IsNullOrEmpty(tipologiaDocumento)) { //Recupero il template del documento templateSelezionato = getTemplateDocumento(infoUtente, tipologiaDocumento); //In funzione del tipo di oggetto eseguo una compilazione specifica if (templateSelezionato != null && !string.IsNullOrEmpty(templateSelezionato.DESCRIZIONE)) { foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom oggettoCustom in templateSelezionato.ELENCO_OGGETTI) { switch (oggettoCustom.TIPO.DESCRIZIONE_TIPO) { case "CampoDiTesto": inserisciCampoDiTesto(oggettoCustom, xmlDoc); break; case "CasellaDiSelezione": inserisciCasellaDiSelezione(oggettoCustom, xmlDoc); break; case "MenuATendina": //inserisciMenuATendina(); break; case "SelezioneEsclusiva": inserisciSelezioneEsclusiva(oggettoCustom, xmlDoc); break; case "Contatore": //inserisciContatore(); break; case "Data": inserisciData(oggettoCustom, xmlDoc); break; case "Corrispondente": //inserisciCorrispondente(); break; } } //Imposto la tipologia di documento DocsPaVO.documento.TipologiaAtto tipologiaAtto = new DocsPaVO.documento.TipologiaAtto(); tipologiaAtto.systemId = templateSelezionato.SYSTEM_ID.ToString(); tipologiaAtto.descrizione = templateSelezionato.DESCRIZIONE; processFormInput.schedaDocumentoInput.tipologiaAtto = tipologiaAtto; processFormInput.schedaDocumentoInput.daAggiornareTipoAtto = true; processFormInput.schedaDocumentoInput.template = templateSelezionato; } processFormOutput.schedaDocumentoOutput = processFormInput.schedaDocumentoInput; } } } catch (Exception e) { logger.Debug("Errore in LiveCycle - DocumentiManager - metodo: compilaTipologiaDocumento()", e); } }
/// <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(); } }