コード例 #1
0
        /// <summary>
        /// Ritona la label del nodo di passo
        /// </summary>
        /// <param name="passo"></param>
        /// <returns></returns>
        public static string GetHolder(IstanzaPassoDiFirma passo)
        {
            string holder = passo.numeroSequenza.ToString() + " - ";
            string user   = string.Empty;

            switch (passo.Evento.TipoEvento)
            {
            case LibroFirmaManager.TypeStep.EVENT:
                user    = (passo.UtenteCoinvolto != null && !string.IsNullOrEmpty(passo.UtenteCoinvolto.idPeople)) ? passo.UtenteCoinvolto.descrizione : string.Empty;
                holder += passo.Evento.Descrizione + " - ";
                holder += string.IsNullOrEmpty(user) ? passo.RuoloCoinvolto.descrizione : user + " (" + passo.RuoloCoinvolto.descrizione + ")";
                break;

            case LibroFirmaManager.TypeStep.SIGN:
                user    = (passo.UtenteCoinvolto != null && !string.IsNullOrEmpty(passo.UtenteCoinvolto.idPeople)) ? passo.UtenteCoinvolto.descrizione : string.Empty;
                holder += string.IsNullOrEmpty(user) ? passo.RuoloCoinvolto.descrizione : user + "  (" + passo.RuoloCoinvolto.descrizione + ")";
                break;

            case LibroFirmaManager.TypeStep.WAIT:
                holder += Utils.Languages.GetLabelFromCode("SignatureProcessWait", UserManager.GetUserLanguage());
                break;
            }

            return(holder);
        }
コード例 #2
0
        /// <summary>
        /// Seleziona l'url dell'icona in base al tipo di evento
        /// </summary>
        /// <param name="passo"></param>
        /// <returns></returns>
        public static string GetIconEventType(IstanzaPassoDiFirma passo)
        {
            string url        = string.Empty;
            string tipoEvento = string.Empty;

            switch (passo.Evento.TipoEvento)
            {
            case LibroFirmaManager.TypeStep.EVENT:
                tipoEvento = passo.Evento.Gruppo.ToLower();
                if (!passo.IsAutomatico)
                {
                    url = "../Images/Icons/LibroFirma/" + tipoEvento + ".png";
                }
                else
                {
                    url = "../Images/Icons/LibroFirma/Event_Automatic.png";
                }
                break;

            case LibroFirmaManager.TypeStep.SIGN:
                tipoEvento = passo.Evento.CodiceAzione.ToLower();
                url        = passo.UtenteCoinvolto != null && !string.IsNullOrEmpty(passo.UtenteCoinvolto.idPeople) ? "../Images/Icons/LibroFirma/" + tipoEvento + "_user.png" : "../Images/Icons/LibroFirma/" + tipoEvento + "_role.png";
                break;

            case LibroFirmaManager.TypeStep.WAIT:
                tipoEvento = passo.Evento.CodiceAzione.ToLower();
                url        = "../Images/Icons/LibroFirma/" + tipoEvento + ".png";
                break;
            }
            return(url);
        }
コード例 #3
0
        public static bool CheckAzioneAttesaPassoFirma(SchedaDocumento schedaDoc)
        {
            InfoUtente infoUtente = UserManager.GetInfoUser();
            bool       result     = true;

            try
            {
                //Attualmente le operazioni che vanno controllate sono passi attesi dal passo in esecuzione di un processo di firma sono REPERTORIAZIONE, FASCICOLAZIONE, SPEDIZIONE, PROTOCOLLAZIONE
                //FASCICOLAZIONE E PROTOCOLLAZIONE vengono gestite nel BE
                IstanzaPassoDiFirma istanza = docsPaWS.GetIstanzaPassoFirmaInAttesaByDocnumber(schedaDoc.docNumber);
                //Controllo l'azione del passo di firma
                #region REPERTORIO
                bool      daRepertoriare = false;
                Templates template       = schedaDoc.template;
                if (template != null && !string.IsNullOrEmpty(template.ID_TIPO_ATTO) && template.ELENCO_OGGETTI != null && template.ELENCO_OGGETTI.Count() > 0)
                {
                    OggettoCustom ogg = (from o in template.ELENCO_OGGETTI.Cast <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)
                    {
                        daRepertoriare = true;
                    }
                }
                if (daRepertoriare)
                {
                    if (!infoUtente.idGruppo.Equals(istanza.RuoloCoinvolto.idGruppo))
                    {
                        return(false);
                    }
                    if (!string.IsNullOrEmpty(istanza.UtenteCoinvolto.idPeople) && !infoUtente.idPeople.Equals(istanza.UtenteCoinvolto.idPeople))
                    {
                        return(false);
                    }
                    if (!string.IsNullOrEmpty(istanza.UtenteLocker) && !infoUtente.idPeople.Equals(istanza.UtenteCoinvolto.idPeople))
                    {
                        return(false);
                    }
                    if (!istanza.TipoFirma.Equals(Azione.DOCUMENTO_REPERTORIATO.ToString()))
                    {
                        return(false);
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return(false);
            }
            return(result);
        }
コード例 #4
0
        private IstanzaPassoDiFirma convertIstanzaPasso(LF_Services.IstanzaPassoFirma istanzaP)
        {
            IstanzaPassoDiFirma retVal = null;

            if (istanzaP != null)
            {
                retVal = new IstanzaPassoDiFirma();
                retVal.CodiceTipoEvento      = istanzaP.CodiceTipoEvento;
                retVal.dataEsecuzione        = istanzaP.dataEsecuzione;
                retVal.dataScadenza          = istanzaP.dataScadenza;
                retVal.descrizioneStatoPasso = istanzaP.descrizioneStatoPasso;
                retVal.idIstanzaPasso        = istanzaP.idIstanzaPasso;
                retVal.idIstanzaProcesso     = istanzaP.idIstanzaProcesso;
                retVal.idNotificaEffettuata  = istanzaP.idNotificaEffettuata;
                retVal.idPasso = istanzaP.idPasso;
                if (istanzaP.statoPasso == TipoStatoPasso.NEW.ToString())
                {
                    retVal.statoPasso = TipoStatoPasso.NEW;
                }
                if (istanzaP.statoPasso == TipoStatoPasso.STUCK.ToString())
                {
                    retVal.statoPasso = TipoStatoPasso.STUCK;
                }
                if (istanzaP.statoPasso == TipoStatoPasso.LOOK.ToString())
                {
                    retVal.statoPasso = TipoStatoPasso.LOOK;
                }
                if (istanzaP.statoPasso == TipoStatoPasso.CLOSE.ToString())
                {
                    retVal.statoPasso = TipoStatoPasso.CLOSE;
                }
                retVal.IdTipoEvento        = istanzaP.IdTipoEvento;
                retVal.motivoRespingimento = istanzaP.motivoRespingimento;
                retVal.numeroSequenza      = istanzaP.numeroSequenza;
                retVal.IdRuoloCoinvolto    = istanzaP.IdRuoloCoinvolto;
                retVal.TipoFirma           = istanzaP.TipoFirma;
                retVal.IdUtenteCoinvolto   = istanzaP.IdUtenteCoinvolto;
            }

            return(retVal);
        }
コード例 #5
0
        private TreeNode AddChildrenElements(IstanzaPassoDiFirma p, ref TreeNode root, bool isConcluted, bool isInterrupted, char interrottoDa)
        {
            TreeNode nodeChild = new TreeNode();
            string   text;

            nodeChild.ImageUrl = p.statoPasso.Equals(TipoStatoPasso.CUT) ? LibroFirmaManager.GetIconEventTypeDisabled(p) : LibroFirmaManager.GetIconEventType(p);
            nodeChild.Value    = p.idPasso;
            text                   = p.statoPasso.Equals(TipoStatoPasso.CUT) ? "<div class ='disabled'>" + LibroFirmaManager.GetHolder(p) + "</div>" : LibroFirmaManager.GetHolder(p);
            nodeChild.Text         = text;
            nodeChild.ToolTip      = LibroFirmaManager.GetHolder(p);
            nodeChild.SelectAction = TreeNodeSelectAction.None;

            if (!string.IsNullOrEmpty(p.Note))
            {
                TreeNode nodeChildNote = new TreeNode();
                text = p.statoPasso.Equals(TipoStatoPasso.CUT) ? "<div class ='disabled'>" + p.Note + "</div>" : p.Note;
                nodeChildNote.Text         = text;
                nodeChildNote.ToolTip      = p.Note;
                nodeChildNote.SelectAction = TreeNodeSelectAction.None;
                nodeChild.ChildNodes.Add(nodeChildNote);
            }

            if (!string.IsNullOrEmpty(p.dataEsecuzione))
            {
                TreeNode nodeChildDateExecution = new TreeNode();
                string   user   = Utils.Languages.GetLabelFromCode("DetailsLFAutomaticModeUserLocker", UserManager.GetUserLanguage()) + "  " + p.DescrizioneUtenteLocker;
                string   action = p.statoPasso.Equals(TipoStatoPasso.CLOSE) ? Utils.Languages.GetLabelFromCode("DetailsLFAutomaticModeEseguitoIl", UserManager.GetUserLanguage()) :
                                  Utils.Languages.GetLabelFromCode("DetailsLFAutomaticModeInterrottoIl", UserManager.GetUserLanguage());
                text = p.statoPasso.Equals(TipoStatoPasso.CUT) ? "<div class ='disabled'>" + action + " " + p.dataEsecuzione + " " + user + "</div>" : action + " " + p.dataEsecuzione + " " + user;
                nodeChildDateExecution.Text         = text;
                nodeChildDateExecution.SelectAction = TreeNodeSelectAction.None;
                nodeChild.ChildNodes.Add(nodeChildDateExecution);
            }
            if (!string.IsNullOrEmpty(p.Errore))
            {
                TreeNode nodeChildNote = new TreeNode();
                text = FormatError(p.Errore);
                nodeChildNote.Text         = text;
                nodeChildNote.ToolTip      = text;
                nodeChildNote.SelectAction = TreeNodeSelectAction.None;
                nodeChildNote.ImageUrl     = "../Images/Icons/task_in_corso.png";
                nodeChild.ChildNodes.Add(nodeChildNote);
            }
            root.ChildNodes.Add(nodeChild);
            if (p.statoPasso.Equals(TipoStatoPasso.LOOK) && !isConcluted)
            {
                nodeChild.Select();
            }
            if (p.statoPasso.Equals(TipoStatoPasso.LOOK) && isInterrupted && interrottoDa != '0')
            {
                TreeNode nodeChildDateExecution = new TreeNode();
                switch (interrottoDa)
                {
                case PROPONENTE:
                    nodeChildDateExecution.Text = Utils.Languages.GetLabelFromCode("DetailsLFAutomaticModeInterruptedByProponente", UserManager.GetUserLanguage());
                    break;

                case AMMINISTRATORE:
                    nodeChildDateExecution.Text = Utils.Languages.GetLabelFromCode("DetailsLFAutomaticModeInterruptedByAmministrazione", UserManager.GetUserLanguage());
                    break;

                default:
                    nodeChildDateExecution.Text = Utils.Languages.GetLabelFromCode("DetailsLFAutomaticModeInterrupted", UserManager.GetUserLanguage());
                    break;
                }
                nodeChildDateExecution.SelectAction = TreeNodeSelectAction.None;
                nodeChild.ChildNodes.Add(nodeChildDateExecution);
            }
            return(nodeChild);
        }
コード例 #6
0
        /// <summary>
        /// Creates the list of notifications associated with the event
        /// </summary>
        public void ElaborateListOfEvents(string eventWithoutActor)
        {
            DocsPaVO.utente.Utente utente        = null;
            List <string>          listElaborati = new List <string>();

            foreach (Evento eventInSession in _listEvents)
            {
                PassoFirma passo = _dataLayersEvents.GetPassoDiFirma(eventInSession, eventWithoutActor);

                if (!string.IsNullOrEmpty(passo.idPasso))
                {
                    LF_Services.ClosePassoAndGetNextRequest getRequest = new LF_Services.ClosePassoAndGetNextRequest();
                    LF_Services.AddElementoInLFRequest      addRequest = new LF_Services.AddElementoInLFRequest();

                    if (utente == null || utente.IdPeople != eventInSession.idUtente || utente.Idruolo != eventInSession.idRuolo)
                    {
                        utente = ServiceUser(eventInSession.idUtente, eventInSession.idRuolo, passo.isAutomatico);
                    }

                    getRequest.UserName            = utente.Userid;
                    getRequest.CodeAdm             = utente.CodAmm;
                    getRequest.CodeRoleLogin       = utente.CodRuolo;
                    getRequest.AuthenticationToken = utente.AuthenticationToken; // "SSO=TEST";
                    getRequest.Delegato            = eventInSession.Delegato;

                    getRequest.IdIstanzaPasso    = passo.idPasso;
                    getRequest.IdIstanzaProcesso = passo.idProcesso;
                    getRequest.IdVersione        = passo.VersionId;
                    getRequest.IdDocumento       = passo.idDocumeto;
                    getRequest.OrdinePasso       = passo.numeroSequenza;
                    getRequest.DataEsecuzione    = eventInSession.DataInserimento;
                    getRequest.DocAll            = passo.docAll;

                    LF_Services.LibroFirmaClient LF_Client = new LF_Services.LibroFirmaClient();

                    LF_Services.ClosePassoAndGetNextResponse getResponse = LF_Client.ClosePassoAndGetNext(getRequest);

                    IstanzaPassoDiFirma nextPasso = convertIstanzaPasso(getResponse.IstanzaPasso);
                    if (nextPasso != null)
                    {
                        addRequest.UserName            = utente.Userid;
                        addRequest.CodeAdm             = utente.CodAmm;
                        addRequest.CodeRoleLogin       = utente.CodRuolo;
                        addRequest.AuthenticationToken = utente.AuthenticationToken;
                        addRequest.Delegato            = eventInSession.Delegato;

                        addRequest.IdPassoPrecedente = passo.idPasso;
                        addRequest.IdPasso           = nextPasso.idIstanzaPasso;
                        addRequest.Modalita          = "A";

                        LF_Services.AddElementoInLFResponse addResponse = LF_Client.AddElementoInLF(addRequest);
                    }
                }
                else
                {
                    //Verifico se ci sono eventi di interruzione processo
                }

                listElaborati.Add(eventInSession.idEvento);
            }

            if (listElaborati.Count > 0) // && 1==2)
            {
                _dataLayersEvents.DeleteEvent(listElaborati);
            }
        }