Exemplo n.º 1
0
        /// <summary>
        /// Logica di business per determinare se è necessario avvisare
        /// l'utente prima della spedizione che non è stato acquisito alcun documento
        /// </summary>
        /// <param name="documento"></param>
        public static bool AvvisaSuSpedizioneDocumento(SchedaDocumento documento)
        {
            DocsPaWR.ConfigSpedizioneDocumento config = GetConfigSpedizioneDocumento();

            return(config.AvvisaSuSpedizioneDocumento &&
                   documento.documenti != null && documento.documenti[0].fileSize != "0");
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static bool SpedizioneAutomaticaDocumentoAttiva()
 {
     try
     {
         DocsPaWR.ConfigSpedizioneDocumento config = GetConfigSpedizioneDocumento();
         return(config.SpedizioneAutomaticaDocumento);
     }
     catch (System.Exception ex)
     {
         UIManager.AdministrationManager.DiagnosticError(ex);
         return(false);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Logica di business per determinare se è necessario avvisare
        /// l'utente prima della spedizione che non è stato acquisito alcun documento
        /// </summary>
        /// <param name="documento"></param>
        public static bool AvvisaSuSpedizioneDocumento(SchedaDocumento documento)
        {
            try
            {
                DocsPaWR.ConfigSpedizioneDocumento config = GetConfigSpedizioneDocumento();

                return(config.AvvisaSuSpedizioneDocumento &&
                       documento.documenti != null && documento.documenti[0].fileSize != "0");
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return(false);
            }
        }
Exemplo n.º 4
0
        protected void SenderBtnSend_Click(object sender, EventArgs e)
        {
            try {
                HttpContext.Current.Session.Remove("DestinatariNonRaggiunti");
                if (cboTipoRicevutaPec.Visible == true)
                {
                    SenderManager.getSetRicevutaPec(cboRegistriRF.SelectedValue, null, cboTipoRicevutaPec.SelectedValue, false, ddl_caselle.SelectedValue);
                }
                try
                {
                    DocsPaWR.ConfigSpedizioneDocumento config         = SenderManager.GetConfigSpedizioneDocumento();
                    DocsPaWR.SpedizioneDocumento       infoSpedizione = this.GetSpedizioneDocumento();

                    // Aggiornamento dati destinatari selezionati per la spedizione
                    this.listaDestinatariInterni.SaveData(infoSpedizione);
                    this.listaDestinatariInteroperanti.SaveData(infoSpedizione);
                    this.listaDestinatatiInteropSempl.SaveData(infoSpedizione);

                    bool almostOne = (this.listaDestinatariInterni.Items > 0 && this.listaDestinatariInterni.AlmostOneChecked);

                    if (!almostOne)
                    {
                        almostOne = (this.listaDestinatariInteroperanti.Items > 0 && this.listaDestinatariInteroperanti.AlmostOneChecked) || (this.listaDestinatatiInteropSempl.Items > 0 && this.listaDestinatatiInteropSempl.AlmostOneChecked);
                    }


                    if (!almostOne)
                    {
                        this.ShowErrorMessage("WarningSenderRecipients");
                    }

                    /*else if (!this.IsDocumentoAcquisito && config.AvvisaSuSpedizioneDocumento)
                     * {
                     *  this.msgSpedisci.Confirm("E' stata richiesta la spedizione senza aver associato alcun documento elettronico.\\nSi vuole eseguire le operazioni di trasmissione e spedizione automatiche?");
                     * }*///Gestito con nuovo messaggio
                    else
                    {
                        bool destInteropRGSSelected = (from d in infoSpedizione.DestinatariEsterni where d.InteroperanteRGS && d.IncludiInSpedizione select d).FirstOrDefault() != null;

                        DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getSelectedRecord();
                        if (destInteropRGSSelected && schedaDoc.template != null && !string.IsNullOrEmpty(schedaDoc.template.ID_CONTESTO_PROCEDURALE))
                        {
                            List <DocsPaWR.Messaggio> messaggiSuccessivi = SenderManager.GetMessaggiSuccessiviFlussoProcedurale(schedaDoc);

                            //se sono presenti più di uno messaggio lascio scegliere all'utente.
                            if (messaggiSuccessivi != null && messaggiSuccessivi.Count > 1)
                            {
                                this.NextMessages = messaggiSuccessivi;
                                this.InfoSpedizioneSelectMessage = infoSpedizione;
                                ScriptManager.RegisterStartupScript(this, this.GetType(), "SelectNextMessage", "ajaxModalPopupSelectNextMessage();", true);
                                return;
                            }
                            if (messaggiSuccessivi != null && messaggiSuccessivi.Count == 1)
                            {
                                infoSpedizione.tipoMessaggio = messaggiSuccessivi[0];
                            }
                        }
                        else
                        {
                            infoSpedizione.tipoMessaggio = null;
                        }
                        this.Spedisci(infoSpedizione);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                if (Session["MessError"] != null)
                {
                    messError = Session["MessError"].ToString();

                    string msgDesc  = "WarningDocumentCustom";
                    string errFormt = Server.UrlEncode(messError);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('" + utils.FormatJs(msgDesc) + "', 'warning', '', '" + utils.FormatJs(errFormt) + "');} else {parent.ajaxDialogModal('" + utils.FormatJs(msgDesc) + "', 'warning', '', '" + utils.FormatJs(errFormt) + "');}; ", true);

                    Session.Remove("MessError");
                    messError = string.Empty;
                }

                if (listaDestinatariInterni.Items > 0)
                {
                    UpdateDestinatariInterni.Update();
                }
                if (listaDestinatariInteroperanti.Items > 0)
                {
                    UpdateDestinatariInteroperanti.Update();
                }
                if (listaDestinatatiInteropSempl.Items > 0)
                {
                    UpdateDestinatatiInteropSempl.Update();
                }
                if (listaDestinatariNonInteroperanti.Items > 0)
                {
                    UpdateDestinatariNonInteroperanti.Update();
                }

                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "function", "<script>reallowOp();</script>", false);
                NttDataWA.DocsPaWR.SchedaDocumento documentTab = DocumentManager.getSelectedRecord();
                //aggiorno l'elenco allegati in sessione(per ricevute PITRE)
                if (documentTab != null && !string.IsNullOrEmpty(documentTab.docNumber))
                {
                    DocumentManager.setSelectedRecord(DocumentManager.getDocumentDetails(this.Page, documentTab.docNumber, documentTab.docNumber));
                }

                if (!string.IsNullOrEmpty(this.DestinatariNonRaggiunti))
                {
                    string msgDesc  = "WarningSendingRecipients";
                    string errFormt = this.DestinatariNonRaggiunti;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('" + utils.FormatJs(msgDesc) + "', 'warning', '', '" + utils.FormatJs(errFormt) + "');} else {parent.ajaxDialogModal('" + utils.FormatJs(msgDesc) + "', 'warning', '', '" + utils.FormatJs(errFormt) + "');}; ", true);
                    HttpContext.Current.Session.Remove("DestinatariNonRaggiunti");
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static bool SpedizioneAutomaticaDocumentoAttiva()
        {
            DocsPaWR.ConfigSpedizioneDocumento config = GetConfigSpedizioneDocumento();

            return(config.SpedizioneAutomaticaDocumento);
        }
Exemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSpedisci_Click(object sender, EventArgs e)
        {
            //ABBATANGELI GIANLUIGI AsyncPostBackTimeOut="3600" (1ora) spostato in <asp:ScriptManager /> della pagina aspx
            //setto il timeout della richiesta di aggiornamento asincrona a 5 minuti
            //scrManager.AsyncPostBackTimeout = 900;
            //Non cambio il default, imposto un temporaneo.
            if (cboTipoRicevutaPec.Visible == true)
            {
                SpedizioneManager.getSetRicevutaPec(cboRegistriRF.SelectedValue, null, cboTipoRicevutaPec.SelectedValue, false, ddl_caselle.SelectedValue);
            }
            try
            {
                DocsPaWR.ConfigSpedizioneDocumento config         = SpedizioneManager.GetConfigSpedizioneDocumento();
                DocsPaWR.SpedizioneDocumento       infoSpedizione = this.GetSpedizioneDocumento();

                // Aggiornamento dati destinatari selezionati per la spedizione
                this.listaDestinatariInterni.SaveData(infoSpedizione);
                this.listaDestinatariInteroperanti.SaveData(infoSpedizione);
                this.listaDestinatatiInteropSempl.SaveData(infoSpedizione);

                bool almostOne = (this.listaDestinatariInterni.Items > 0 && this.listaDestinatariInterni.AlmostOneChecked);

                if (!almostOne)
                {
                    almostOne = (this.listaDestinatariInteroperanti.Items > 0 && this.listaDestinatariInteroperanti.AlmostOneChecked) || (this.listaDestinatatiInteropSempl.Items > 0 && this.listaDestinatatiInteropSempl.AlmostOneChecked);
                }

                if (!almostOne)
                {
                    this.ShowErrorMessage("Nessun destinatario selezionato per la spedizione del documento");
                }

                /*else if (!this.IsDocumentoAcquisito && config.AvvisaSuSpedizioneDocumento)
                 * {
                 *  this.msgSpedisci.Confirm("E' stata richiesta la spedizione senza aver associato alcun documento elettronico.\\nSi vuole eseguire le operazioni di trasmissione e spedizione automatiche?");
                 * }*///Gestito con nuovo messaggio
                else
                {
                    this.Spedisci(infoSpedizione);
                }

                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "CloseErroreMsg",
                                                    "<script>CloseWaitPanel();</script>", false);
            }
            catch (Exception ex)
            {
                ErrorManager.OpenErrorPage(this, ex, "btnSpedisci_Click");
            }

            //Andrea
            if (Session["MessError"] != null)
            {
                messError = Session["MessError"].ToString();
                //messError.Replace("'", "\'");
                //Response.Write("<script language=\"javascript\">alert('Spedizioni con esito negativo: \\n" + messError + "');</script>");
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "messError",
                                                    "<script language=\"javascript\">alert('Spedizioni con esito negativo: \\n" + messError + "');</script>", false);
                Session.Remove("MessError");
                messError = string.Empty;
            }
            //End Andrea
        }