Example #1
0
        protected List <CasellaRegistro> GetEmailsRegister(string systemIdReg, out List <string> listFormatEmails)
        {
            List <CasellaRegistro> listEmails  = MultiBoxManager.GetComboRegisterConsult(systemIdReg);
            List <string>          listFormatE = new List <string>();

            foreach (CasellaRegistro c in listEmails)
            {
                if (!string.IsNullOrEmpty(c.EmailRegistro) && !c.EmailRegistro.Equals("&nbsp;"))
                {
                    System.Text.StringBuilder formatMail = new System.Text.StringBuilder();
                    if (c.Principale.Equals("1"))
                    {
                        formatMail.Append("* ");
                    }
                    formatMail.Append(c.EmailRegistro);
                    if (!string.IsNullOrEmpty(c.Note))
                    {
                        formatMail.Append(" - ");
                        formatMail.Append(c.Note);
                    }
                    listFormatE.Add(formatMail.ToString());
                }
            }
            listFormatEmails = listFormatE;
            return(listEmails);
        }
Example #2
0
        private void ButtonsManager()
        {
            this.RegistersBtnModify.Enabled       = true;
            this.RegistersBtnPrint.Enabled        = false;
            this.RegistersBtnChangesState.Enabled = false;
            this.RegistersBtnBox.Enabled          = true;

            if (!SelectedRegister.chaRF.Equals("1"))
            {
                if (SelectedRegister.stato.Equals("C"))
                {
                    this.RegistersBtnPrint.Enabled = true;
                }
                else
                {
                    this.RegistersBtnPrint.Enabled = false;
                }
                if (!SelectedRegister.flag_pregresso == true)
                {
                    this.RegistersBtnChangesState.Enabled = true;
                }
                this.RegistersBtnBox.Enabled = true;
            }
            if (MultiBoxManager.RoleIsAuthorizedConsult(SelectedRegister, UserManager.GetSelectedRole().systemId))
            {
                this.RegistersBtnBox.Enabled = true;
            }
            else
            {
                this.RegistersBtnBox.Enabled = false;
            }
            this.upPnlButtons.Update();
        }
Example #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void GrdRegisters_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             Registro               reg = (Registro)e.Row.DataItem;
             List <string>          listMultimailFormat;
             List <CasellaRegistro> listMultimail    = GetEmailsRegister(reg.systemId, out listMultimailFormat);
             DropDownList           DdlEmailRegister = (DropDownList)e.Row.FindControl("DdlEmailRegister");
             DdlEmailRegister.Attributes.Add("data-placeholder", Utils.Languages.GetLabelFromCode("GenericChosenSelectOne", UserManager.GetUserLanguage()));
             for (int i = 0; i < listMultimail.Count; i++)
             {
                 DdlEmailRegister.Items.Add(new ListItem()
                 {
                     Value    = listMultimail[i].EmailRegistro,
                     Text     = listMultimailFormat[i],
                     Selected = listMultimail[i].Principale.Equals("1")
                 });
             }
             //PEC 3 gestione visibilità(FLAG CONSULTA)
             if (MultiBoxManager.RoleIsAuthorizedConsult(reg, UserManager.GetSelectedRole().systemId) && DdlEmailRegister.Items.Count > 0)
             {
                 DdlEmailRegister.Enabled = true;
             }
             else
             {
                 DdlEmailRegister.Enabled = false;
             }
             for (int i = 0; i < e.Row.Cells.Count; i++)
             {
                 if (!GrdRegisters.Columns[i].HeaderText.Equals(Utils.Languages.GetLabelFromCode("RegistersGrdEmail", UIManager.UserManager.GetUserLanguage())))
                 {
                     e.Row.Cells[i].Attributes["onClick"] = "$('#grid_rowindex').val('" + e.Row.RowIndex.ToString() + "');__doPostBack('panelRegisters');return false;";
                 }
                 else
                 {
                     e.Row.Cells[i].Attributes["onClick"] = "$('#grid_rowindex').val('" + e.Row.RowIndex.ToString() + "');";
                 }
             }
             if (reg.chaRF == "1")
             {
                 Image img = (Image)e.Row.FindControl("btnImageRegister");
                 img.CssClass = "containerCodRegister";
                 e.Row.FindControl("rf").Visible = true;
             }
         }
     }
     catch (System.Exception ex)
     {
         UIManager.AdministrationManager.DiagnosticError(ex);
         return;
     }
 }
Example #4
0
        /// <summary>
        /// Aggiorna la drop down list delle caselle abilitate alla spedizione associate al registro selezionato
        /// </summary>
        private void SetCaselleRegistro(string selectMain)
        {
            //se è stato selezionato un registro/rf nella ddl dei registri mittente, allora setto la ddl delle caselle associate al registro
            if (!string.IsNullOrEmpty(cboRegistriRF.SelectedValue))
            {
                List <DocsPaWR.CasellaRegistro> listCaselle = new List <DocsPaWR.CasellaRegistro>();
                listCaselle = MultiBoxManager.GetComboRegisterSend(cboRegistriRF.SelectedValue);
                foreach (DocsPaWR.CasellaRegistro c in listCaselle)
                {
                    System.Text.StringBuilder formatMail = new System.Text.StringBuilder();
                    if (c.Principale.Equals("1"))
                    {
                        formatMail.Append("* ");
                    }
                    formatMail.Append(c.EmailRegistro);
                    if (!string.IsNullOrEmpty(c.Note))
                    {
                        formatMail.Append(" - ");
                        formatMail.Append(c.Note);
                    }
                    ddl_caselle.Items.Add(new ListItem(formatMail.ToString(), c.EmailRegistro));
                }

                if (listCaselle.Count == 0)
                {
                    ddl_caselle.Enabled = false;
                    ddl_caselle.Width   = new Unit(200);
                    return;
                }
                //se ho appena settato un nuovo registro/rf allora seleziono la casella principale
                if (selectMain.Equals("1"))
                {
                    //imposto la casella principale come selezionata
                    foreach (ListItem i in ddl_caselle.Items)
                    {
                        if (i.Text.Split(new string[] { "*" }, 2, System.StringSplitOptions.None).Length > 1)
                        {
                            ddl_caselle.SelectedValue = i.Value;
                            break;
                        }
                    }
                }
            }
        }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        protected bool IncludiDestinatarioInSpedizione(DocsPaWR.Destinatario item, NttDataWA.DocsPaWR.Registro[] rf, NttDataWA.DocsPaWR.Registro[] registri)
        {
            bool resultValue = true;

            try
            {
                resultValue = item.IncludiInSpedizione;

                DocsPaWR.DocsPaWebService ws = new DocsPaWR.DocsPaWebService();
                if (item is DocsPaWR.DestinatarioEsterno && !(item as DocsPaWR.DestinatarioEsterno).Interoperante)
                {
                    resultValue = false;
                }

                if (item is DocsPaWR.DestinatarioEsterno)
                {
                    DocsPaWR.DestinatarioEsterno destinatarioEsterno = item as DocsPaWR.DestinatarioEsterno;
                    if ((!MultiBoxManager.RoleIsAuthorizedSend("E", rf, registri) &&
                         destinatarioEsterno.DatiDestinatari[0].canalePref != null &&
                         (destinatarioEsterno.DatiDestinatari[0].canalePref.descrizione.Equals("MAIL") ||
                          destinatarioEsterno.DatiDestinatari[0].canalePref.descrizione.Equals("INTEROPERABILITA"))) ||
                        (destinatarioEsterno.DatiDestinatari[0].tipoIE != null && destinatarioEsterno.DatiDestinatari[0].tipoIE.Equals("I") && ws.IsEnabledInteropInterna() &&
                         !MultiBoxManager.RoleIsAuthorizedSend("I", rf, registri)))
                    {
                        resultValue = false;
                    }
                }
                if (item is DocsPaWR.DestinatarioInterno)
                {
                    DocsPaWR.DestinatarioInterno destinatarioInterno = item as DocsPaWR.DestinatarioInterno;
                    if (destinatarioInterno != null && destinatarioInterno.DisabledTrasm)
                    {
                        resultValue = false;
                    }
                }
            }
            catch (Exception ex)
            {
                resultValue = false;
            }

            return(resultValue);
        }
Example #6
0
        protected void FetchRegistri()
        {
            // Inserimento elemento vuoto
            if (RegistryManager.GetRegistryInSession() == null)
            {
                RegistryManager.SetRegistryInSession(RegistryManager.GetRegistriesByRole(UserManager.GetSelectedRole().systemId).FirstOrDefault());
            }

            this.cboRegistriRF.Items.Add(new ListItem(string.Empty, string.Empty));
            DocsPaWR.Registro[] registriRF = MultiBoxManager.GetRegisterEnabledSend().ToArray();
            this.cboRegistriRF.Items.AddRange(
                (from reg in registriRF
                 select new ListItem(
                     string.Format("{0} - {1}", reg.codRegistro, reg.descrizione), reg.systemId)).ToArray());
            int countRF = registriRF.Count(e => e.chaRF == "1");

            this.cboRegistriRF.SelectedValue = string.Empty;
            if (!string.IsNullOrEmpty(this.cboRegistriRF.SelectedValue))
            {
                SetCaselleRegistro("1");
                ddl_caselle.Enabled = true;
            }
        }
Example #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="infoSpedizione"></param>
        protected void FetchRegistri(DocsPaWR.SpedizioneDocumento infoSpedizione)
        {
            // Se è presente almeno un destinatario interoperante,
            // vengono caricati i registri e gli RF visibili dall'utente corrente
            if (infoSpedizione.DestinatariEsterni.Where(e => e.Interoperante).Count() > 0)
            {
                // Inserimento elemento vuoto
                this.cboRegistriRF.Items.Add(new ListItem(string.Empty, string.Empty));

                DocsPaWR.Registro[] registriRF = MultiBoxManager.GetRegisterEnabledSend().ToArray();

                this.cboRegistriRF.Items.AddRange(
                    (from reg in registriRF
                     select new ListItem(
                         string.Format("{0} - {1}", reg.codRegistro, reg.descrizione), reg.systemId)).ToArray());

                int countRF = registriRF.Count(e => e.chaRF == "1");

                if (this.SelezionaRFPredefinito)
                {
                    if (countRF == 0)
                    {
                        // Nessun RF presente, selezione sul registro di protocollazione
                        //if (registriRF.Where(reg => reg.systemId == infoSpedizione.IdRegistroRfMittente) != null)
                        if (registriRF.Count(reg => reg.systemId == infoSpedizione.IdRegistroRfMittente) > 0) //Riallineamento codice da versione 3.22
                        {
                            this.cboRegistriRF.SelectedValue = registriRF.Where(reg => reg.systemId == infoSpedizione.IdRegistroRfMittente).First().systemId;
                        }
                        else
                        {
                            this.cboRegistriRF.SelectedValue = string.Empty;
                        }
                        //this.cboRegistriRF.SelectedValue = registriRF.Contains(UserManager.getRegistroBySistemId(this.Page, infoSpedizione.IdRegistroRfMittente)) ? infoSpedizione.IdRegistroRfMittente : string.Empty;
                    }
                    else if (countRF == 1)
                    {
                        // Se è presente un solo RF, viene selezionato per impostazione predefinita nella combo

                        DocsPaWR.Registro rf = registriRF.Where(e => e.chaRF == "1").First();
                        this.cboRegistriRF.SelectedValue = rf.systemId;
                    }
                    else if (countRF > 1)
                    {
                        // In presenza di più di un RF, la selezione viene effettuata sull'elemento vuoto
                        this.cboRegistriRF.SelectedValue = string.Empty;
                    }
                }
                else
                {
                    //this.cboRegistriRF.SelectedValue = registriRF.Contains(UserManager.getRegistroBySistemId(this.Page,infoSpedizione.IdRegistroRfMittente)) ? infoSpedizione.IdRegistroRfMittente : string.Empty;
                    if (countRF == 0)
                    {
                        //if (registriRF.Where(reg => reg.systemId == infoSpedizione.IdRegistroRfMittente) != null)
                        if (registriRF.Count(reg => reg.systemId == infoSpedizione.IdRegistroRfMittente) > 0) //Riallineamento codice da versione 3.22
                        {
                            this.cboRegistriRF.SelectedValue = registriRF.Where(reg => reg.systemId == infoSpedizione.IdRegistroRfMittente).First().systemId;
                        }
                        else
                        {
                            this.cboRegistriRF.SelectedValue = string.Empty;
                        }
                    }
                    else
                    {
                        // In presenza di più di un RF, seleziona elemento vuoto
                        this.cboRegistriRF.SelectedValue = string.Empty;
                    }
                }

                if (!string.IsNullOrEmpty(this.cboRegistriRF.SelectedValue))
                {
                    SetCaselleRegistro("1");
                    SetRicevutaPecCombo();
                    ddl_caselle.Enabled        = true;
                    cboTipoRicevutaPec.Enabled = true;
                    // Refresh id registro selezionato e mail address
                    infoSpedizione.IdRegistroRfMittente = this.cboRegistriRF.SelectedValue;
                    infoSpedizione.mailAddress          = this.ddl_caselle.SelectedValue;
                    this.SetSpedizioneDocumento(infoSpedizione);
                }
            }
        }