Esempio n. 1
0
        /// <summary>
        /// Verifica se il protocollo è annullato o meno
        /// </summary>
        /// <returns></returns>
        private bool IsProtocolloAnnullato()
        {
            DocsPaWR.ProtocolloAnnullato protocolloAnnullato = this.GetSchedaDocumento().protocollo.protocolloAnnullato;

            return(protocolloAnnullato != null && protocolloAnnullato.dataAnnullamento != string.Empty);
        }
Esempio n. 2
0
        private void Page_PreRender(object sender, System.EventArgs e)
        {
            string Tema = GetCssAmministrazione();

            if (Tema != null && !Tema.Equals(""))
            {
                string[] realTema = Tema.Split('^');
                this.idLinkCss.Href = "../App_Themes/" + realTema[0] + "/" + realTema[0] + ".css";
            }
            else
            {
                this.idLinkCss.Href = "../App_Themes/TemaRosso/TemaRosso.css";
            }

            //abilitazione delle funzioni in base al ruolo
            UserManager.disabilitaFunzNonAutorizzate(this);

            verificaHMdiritti();

            // Ulteriori controlli di disabilitazione

            // controllo se il documento è annullato - in tal caso disabilito tutto
            if (schedaDocumento.protocollo != null)
            {
                DocsPaWR.ProtocolloAnnullato protAnnull = schedaDocumento.protocollo.protocolloAnnullato;

                if (protAnnull != null && protAnnull.dataAnnullamento != null && !protAnnull.Equals(""))
                {
                    this.DisableAllButtons();
                }
            }

            if (UserManager.isFiltroAooEnabled(this))
            {
                if (this.schedaDocumento != null && this.schedaDocumento.protocollo != null)
                {
                    DocsPaWR.Registro[] userRegistri = DocsPAWA.UserManager.getListaRegistri(this.Page);

                    if (btn_nuovaVersione.Enabled)
                    {
                        btn_nuovaVersione.Enabled = UserManager.verifyRegNoAOO(schedaDocumento, userRegistri);
                    }

                    if (btn_modiVersione.Enabled)
                    {
                        btn_modiVersione.Enabled = UserManager.verifyRegNoAOO(schedaDocumento, userRegistri);
                    }

                    if (btn_rimuoviVersione.Enabled)
                    {
                        btn_rimuoviVersione.Enabled = UserManager.verifyRegNoAOO(schedaDocumento, userRegistri);
                    }
                }
            }

            if (this.schedaDocumento != null && this.schedaDocumento.tipoProto.Equals("C"))
            {
                this.btn_modiVersione.Enabled = false;
            }

            // Controllo su stato documento consolidato
            if (schedaDocumento.ConsolidationState != null &&
                schedaDocumento.ConsolidationState.State >= DocsPaWR.DocumentConsolidationStateEnum.Step1)
            {
                this.DisableButtonsPerConsolidation();
            }
        }
Esempio n. 3
0
        protected void SetTypeRecord()
        {
            if (!string.IsNullOrEmpty(this.TypeRecord))
            {
                SchedaDocumento doc = UIManager.DocumentManager.getSelectedRecord();
                DocsPaWR.ProtocolloAnnullato protAborted = null;
                bool consolidation = false;
                if (doc != null && doc.tipoProto != null && doc.protocollo != null && doc.protocollo.protocolloAnnullato != null)
                {
                    protAborted = doc.protocollo.protocolloAnnullato;
                }

                if (doc != null && doc.ConsolidationState != null && doc.ConsolidationState.State == DocumentConsolidationStateEnum.Step2)
                {
                    consolidation = true;
                }

                switch (this.TypeRecord.ToUpper())
                {
                case "A":
                    this.PProtocolType.InnerText = DocumentManager.GetCodeLabel("A");
                    if (protAborted == null)
                    {
                        if ((doc == null || doc.protocollo == null) || (doc != null && !string.IsNullOrEmpty(doc.systemId) && doc.protocollo != null && !string.IsNullOrEmpty(doc.protocollo.segnatura)) || (doc != null && string.IsNullOrEmpty(doc.systemId) && doc.protocollo != null))
                        {
                            if (consolidation)
                            {
                                this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxOrangeConsolidate");
                            }
                            else
                            {
                                this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxOrange");
                            }
                            this.LblReferenceCode.Attributes.Remove("class");
                            this.LblReferenceCode.Attributes.Add("class", "referenceCode");
                            this.DocumentImgPrintReceipt.Visible = true;
                            this.DocumentImgPrintReceipt.Enabled = true;
                            if (doc != null && doc.protocollo == null)
                            {
                                this.DocumentImgPrintReceipt.Enabled = false;
                            }
                        }
                        else
                        {
                            this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxOrangeWhite");
                        }

                        this.VisibiltyRoleFunctions();
                    }
                    else
                    {
                        this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxOrangeAbort");
                        this.LblReferenceCode.Attributes.Remove("class");
                        this.LblReferenceCode.Attributes.Add("class", "redStrike");
                    }
                    this.containerDocumentTopDx.Attributes.Add("class", "containerDocumentTopDxOrange");
                    this.containerDocumentTopCxOrange.Attributes.Add("class", "containerDocumentTopCxOrangeBg");
                    break;

                case "P":
                    this.PProtocolType.InnerText = DocumentManager.GetCodeLabel("P");
                    if (protAborted == null)
                    {
                        if ((doc == null || doc.protocollo == null) || (doc != null && !string.IsNullOrEmpty(doc.systemId) && doc.protocollo != null && !string.IsNullOrEmpty(doc.protocollo.segnatura)) || (doc != null && string.IsNullOrEmpty(doc.systemId) && doc.protocollo != null && !this.IsForwarded))
                        {
                            if (consolidation)
                            {
                                this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxGreenConsolidate");
                            }
                            else
                            {
                                this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxGreen");
                            }
                            this.LblReferenceCode.Attributes.Remove("class");
                            this.LblReferenceCode.Attributes.Add("class", "referenceCode");
                        }
                        else
                        {
                            this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxGreenWhite");
                        }
                    }
                    else
                    {
                        this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxGreenAbort");
                        this.LblReferenceCode.Attributes.Remove("class");
                        this.LblReferenceCode.Attributes.Add("class", "redStrike");
                    }
                    this.containerDocumentTopDx.Attributes.Add("class", "containerDocumentTopDxGreen");
                    this.containerDocumentTopCxOrange.Attributes.Add("class", "containerDocumentTopCxGreenBg");
                    break;

                case "I":
                    this.PProtocolType.InnerText = DocumentManager.GetCodeLabel("I");
                    if (protAborted == null)
                    {
                        if ((doc == null || doc.protocollo == null) || (doc != null && !string.IsNullOrEmpty(doc.systemId) && doc.protocollo != null && !string.IsNullOrEmpty(doc.protocollo.segnatura)) || (doc != null && string.IsNullOrEmpty(doc.systemId) && doc.protocollo != null))
                        {
                            if (consolidation)
                            {
                                this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxBlueConsolidate");
                            }
                            else
                            {
                                this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxBlue");
                            }
                            this.LblReferenceCode.Attributes.Remove("class");
                            this.LblReferenceCode.Attributes.Add("class", "referenceCode");
                        }
                        else
                        {
                            this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxBlueWhite");
                        }
                    }
                    else
                    {
                        this.PnlcontainerDocumentTopSx.Attributes.Add("class", "containerDocumentTopSxBlueAbort");
                        this.LblReferenceCode.Attributes.Remove("class");
                        this.LblReferenceCode.Attributes.Add("class", "redStrike");
                    }
                    this.containerDocumentTopDx.Attributes.Add("class", "containerDocumentTopDxBlue");
                    this.containerDocumentTopCxOrange.Attributes.Add("class", "containerDocumentTopCxBlueBg");
                    break;
                }
            }
        }